File tree 4 files changed +39
-1
lines changed
4 files changed +39
-1
lines changed Original file line number Diff line number Diff line change 15
15
"require" : {
16
16
"php" : " ^7.2 || ^8.0" ,
17
17
"ext-simplexml" : " *" ,
18
- "phpstan/phpstan" : " ^1.11"
18
+ "phpstan/phpstan" : " ^1.11.7 "
19
19
},
20
20
"conflict" : {
21
21
"symfony/framework-bundle" : " <3.0"
Original file line number Diff line number Diff line change @@ -322,6 +322,10 @@ services:
322
322
class : PHPStan\Symfony\PasswordAuthenticatedUserStubFilesExtension
323
323
tags :
324
324
- phpstan.stubFilesExtension
325
+ -
326
+ class : PHPStan\Symfony\SymfonyDiagnoseExtension
327
+ tags :
328
+ - phpstan.diagnoseExtension
325
329
326
330
# FormInterface::getErrors() return type
327
331
-
Original file line number Diff line number Diff line change @@ -27,6 +27,11 @@ public function __construct(Configuration $configuration)
27
27
$ this ->consoleApplicationLoader = $ configuration ->getConsoleApplicationLoader ();
28
28
}
29
29
30
+ public function hasConsoleApplicationLoader (): bool
31
+ {
32
+ return $ this ->consoleApplicationLoader !== null ;
33
+ }
34
+
30
35
private function getConsoleApplication (): ?Application
31
36
{
32
37
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