File tree Expand file tree Collapse file tree 4 files changed +39
-1
lines changed Expand file tree Collapse file tree 4 files changed +39
-1
lines changed Original file line number Diff line number Diff line change 1515 "require" : {
1616 "php" : " ^7.2 || ^8.0" ,
1717 "ext-simplexml" : " *" ,
18- "phpstan/phpstan" : " ^1.11"
18+ "phpstan/phpstan" : " ^1.11.7 "
1919 },
2020 "conflict" : {
2121 "symfony/framework-bundle" : " <3.0"
Original file line number Diff line number Diff line change @@ -322,6 +322,10 @@ services:
322322 class : PHPStan\Symfony\PasswordAuthenticatedUserStubFilesExtension
323323 tags :
324324 - phpstan.stubFilesExtension
325+ -
326+ class : PHPStan\Symfony\SymfonyDiagnoseExtension
327+ tags :
328+ - phpstan.diagnoseExtension
325329
326330 # FormInterface::getErrors() return type
327331 -
Original file line number Diff line number Diff line change @@ -27,6 +27,11 @@ public function __construct(Configuration $configuration)
2727 $ this ->consoleApplicationLoader = $ configuration ->getConsoleApplicationLoader ();
2828 }
2929
30+ public function hasConsoleApplicationLoader (): bool
31+ {
32+ return $ this ->consoleApplicationLoader !== null ;
33+ }
34+
3035 private function getConsoleApplication (): ?Application
3136 {
3237 if ($ this ->consoleApplicationLoader === null ) {
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types = 1 );
2+
3+ namespace PHPStan \Symfony ;
4+
5+ use PHPStan \Command \Output ;
6+ use PHPStan \Diagnose \DiagnoseExtension ;
7+ use function sprintf ;
8+
9+ class SymfonyDiagnoseExtension implements DiagnoseExtension
10+ {
11+
12+ /** @var ConsoleApplicationResolver */
13+ private $ consoleApplicationResolver ;
14+
15+ public function __construct (ConsoleApplicationResolver $ consoleApplicationResolver )
16+ {
17+ $ this ->consoleApplicationResolver = $ consoleApplicationResolver ;
18+ }
19+
20+ public function print (Output $ output ): void
21+ {
22+ $ output ->writeLineFormatted (sprintf (
23+ '<info>Symfony \'s consoleApplicationLoader:</info> %s ' ,
24+ $ this ->consoleApplicationResolver ->hasConsoleApplicationLoader () ? 'In use ' : 'No '
25+ ));
26+ $ output ->writeLineFormatted ('' );
27+ }
28+
29+ }
You can’t perform that action at this time.
0 commit comments