File tree 4 files changed +21
-7
lines changed
4 files changed +21
-7
lines changed Original file line number Diff line number Diff line change 92
92
>
93
93
<arg value =" analyse" />
94
94
<arg value =" -l" />
95
- <arg value =" 4 " />
95
+ <arg value =" 7 " />
96
96
<arg value =" -c" />
97
97
<arg path =" phpstan.neon" />
98
98
<arg path =" src" />
Original file line number Diff line number Diff line change 4
4
"license" : [" MIT" ],
5
5
"minimum-stability" : " dev" ,
6
6
"prefer-stable" : true ,
7
+ "extra" : {
8
+ "branch-alias" : {
9
+ "dev-master" : " 0.7-dev"
10
+ }
11
+ },
7
12
"require" : {
8
13
"php" : " ~7.0" ,
9
- "phpstan/phpstan" : " ^0.6.3 " ,
14
+ "phpstan/phpstan" : " ^0.7 " ,
10
15
"doctrine/common" : " ^2.7" ,
11
16
"doctrine/orm" : " ^2.5"
12
17
},
13
18
"require-dev" : {
14
- "consistence/coding-standard" : " ~0.12.0" ,
19
+ "consistence/coding-standard" : " ~0.13.0" ,
20
+ "jakub-onderka/php-parallel-lint" : " ^0.9.2" ,
15
21
"phing/phing" : " ^2.16.0" ,
16
22
"phpunit/phpunit" : " ^5.7" ,
17
- "slevomat/coding-standard" : " dev-php7#d4a1a9c "
23
+ "slevomat/coding-standard" : " ^2.0 "
18
24
},
19
25
"autoload" : {
20
26
"psr-4" : {
Original file line number Diff line number Diff line change 7
7
<exclude name =" SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces" />
8
8
<exclude name =" SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly" />
9
9
</rule >
10
- <rule ref =" SlevomatCodingStandard.Typehints .TypeHintDeclaration" >
10
+ <rule ref =" SlevomatCodingStandard.TypeHints .TypeHintDeclaration" >
11
11
<properties >
12
12
<property name =" usefulAnnotations" type =" array" value ="
13
13
@dataProvider
14
14
" />
15
+ <property name =" enableNullableTypeHints" type =" false" />
16
+ <property name =" enableVoidTypeHint" type =" false" />
15
17
</properties >
16
18
</rule >
17
19
</ruleset >
Original file line number Diff line number Diff line change 7
7
use PHPStan \Reflection \MethodReflection ;
8
8
use PHPStan \Type \ObjectType ;
9
9
use PHPStan \Type \Type ;
10
+ use PHPStan \Type \TypeCombinator ;
10
11
11
12
class EntityManagerFindDynamicReturnTypeExtension implements \PHPStan \Type \DynamicMethodReturnTypeExtension
12
13
{
@@ -51,10 +52,15 @@ public function getTypeFromMethodCall(
51
52
}
52
53
53
54
if ($ class === 'self ' ) {
54
- $ class = $ scope ->getClass ();
55
+ $ class = $ scope ->getClassReflection ()-> getName ();
55
56
}
56
57
57
- return new ObjectType ($ class , $ methodReflection ->getName () === 'find ' );
58
+ $ type = new ObjectType ($ class );
59
+ if ($ methodReflection ->getName () === 'find ' ) {
60
+ $ type = TypeCombinator::addNull ($ type );
61
+ }
62
+
63
+ return $ type ;
58
64
}
59
65
60
66
}
You can’t perform that action at this time.
0 commit comments