File tree Expand file tree Collapse file tree 8 files changed +49
-17
lines changed Expand file tree Collapse file tree 8 files changed +49
-17
lines changed Original file line number Diff line number Diff line change @@ -11,22 +11,24 @@ jobs:
1111 actions :
1212 -
1313 name : ' Validate'
14- # this is very slow, so it has to be in own workflow
1514 run : composer validate --strict
1615
16+ -
17+ name : ' Bare Run'
18+ run : bin/console
19+
1720 name : ${{ matrix.actions.name }}
1821 runs-on : ubuntu-latest
1922
2023 steps :
2124 - uses : actions/checkout@v2
2225
23- # see https://github.com/shivammathur/setup-php
2426 -
2527 uses : shivammathur/setup-php@v2
2628 with :
27- php-version : 7.3
29+ php-version : 8.0
2830 coverage : none
2931
3032 - uses : " ramsey/composer-install@v1"
3133
32- - run : ${{ matrix.actions.run }}
34+ - run : ${{ matrix.actions.run }}
Original file line number Diff line number Diff line change 44
55declare (strict_types=1 );
66
7- use Symfony \ Component \ Console \ Input \ ArgvInput ;
7+ use Rector \ PhpParserNodesDocs \ HttpKernel \ PhpParserNodesDocsKernel ;
88use Symplify \SymplifyKernel \ValueObject \KernelBootAndApplicationRun ;
99
1010require_once __DIR__ . '/../vendor/autoload.php ' ;
1111
12- $ kernelBootAndApplicationRun = new KernelBootAndApplicationRun (MonorepoBuilderKernel ::class);
13- $ kernelBootAndApplicationRun ->run ();
12+ $ kernelBootAndApplicationRun = new KernelBootAndApplicationRun (PhpParserNodesDocsKernel ::class);
13+ $ kernelBootAndApplicationRun ->run ();
Original file line number Diff line number Diff line change 88 "symfony/dependency-injection" : " ^5.2" ,
99 "symplify/symplify-kernel" : " ^9.1" ,
1010 "symplify/smart-file-system" : " ^9.1" ,
11- "symplify/package-builder" : " ^9.1"
11+ "symplify/package-builder" : " ^9.1" ,
12+ "symplify/console-package-builder" : " ^9.1" ,
13+ "nikic/php-parser" : " ^4.10"
1214 },
1315 "autoload" : {
1416 "psr-4" : {
Original file line number Diff line number Diff line change 22
33declare (strict_types=1 );
44
5+ use PhpParser \PrettyPrinter \Standard ;
56use Symfony \Component \DependencyInjection \Loader \Configurator \ContainerConfigurator ;
67use Symplify \SmartFileSystem \Finder \SmartFinder ;
78
1415 ->autoconfigure ();
1516
1617 $ services ->load ('Rector\PhpParserNodesDocs \\' , __DIR__ . '/../src ' )
17- ->exclude ([__DIR__ . '/../src/ValueObject ' ]);
18+ ->exclude ([__DIR__ . '/../src/ValueObject ' , __DIR__ . ' /../src/HttpKernel ' ]);
1819
1920 $ services ->set (SmartFinder::class);
21+ $ services ->set (Standard::class);
2022};
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ public function __construct(
5858
5959 protected function configure (): void
6060 {
61- $ this ->setDescription ('[DOCS] Dump overview of all Nodes ' );
61+ $ this ->setDescription ('Dump nodes overview ' );
6262
6363 $ this ->addOption (
6464 self ::OUTPUT_FILE ,
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Rector \PhpParserNodesDocs \Exception ;
6+
7+ use Exception ;
8+
9+ final class ShouldNotHappenException extends Exception
10+ {
11+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Rector \PhpParserNodesDocs \HttpKernel ;
6+
7+ use Symfony \Component \Config \Loader \LoaderInterface ;
8+ use Symplify \SymplifyKernel \HttpKernel \AbstractSymplifyKernel ;
9+
10+ final class PhpParserNodesDocsKernel extends AbstractSymplifyKernel
11+ {
12+ public function registerContainerConfiguration (LoaderInterface $ loader ): void
13+ {
14+ $ loader ->load (__DIR__ . '/../../config/config.php ' );
15+ }
16+ }
Original file line number Diff line number Diff line change 55namespace Rector \PhpParserNodesDocs ;
66
77use PhpParser \Node ;
8- use Rector \Core \Exception \ShouldNotHappenException ;
9- use Rector \Core \PhpParser \Printer \BetterStandardPrinter ;
8+ use PhpParser \PrettyPrinter \Standard ;
109use Rector \PhpParserNodesDocs \ValueObject \NodeCodeSample ;
1110use Symplify \SmartFileSystem \Finder \SmartFinder ;
1211use Symplify \SmartFileSystem \SmartFileInfo ;
@@ -19,14 +18,14 @@ final class NodeCodeSampleProvider
1918 private $ smartFinder ;
2019
2120 /**
22- * @var BetterStandardPrinter
21+ * @var Standard
2322 */
24- private $ betterStandardPrinter ;
23+ private $ standard ;
2524
26- public function __construct (SmartFinder $ smartFinder , BetterStandardPrinter $ betterStandardPrinter )
25+ public function __construct (SmartFinder $ smartFinder , Standard $ standard )
2726 {
2827 $ this ->smartFinder = $ smartFinder ;
29- $ this ->betterStandardPrinter = $ betterStandardPrinter ;
28+ $ this ->standard = $ standard ;
3029 }
3130
3231 /**
@@ -44,7 +43,7 @@ public function provide(): array
4443
4544 $ nodeClass = get_class ($ node );
4645
47- $ printedContent = $ this ->betterStandardPrinter -> print ($ node );
46+ $ printedContent = $ this ->standard -> prettyPrint ($ node );
4847 $ nodeCodeSamplesByNodeClass [$ nodeClass ][] = new NodeCodeSample (
4948 $ fileInfo ->getContents (),
5049 $ printedContent
You can’t perform that action at this time.
0 commit comments