File tree Expand file tree Collapse file tree 4 files changed +21
-7
lines changed Expand file tree Collapse file tree 4 files changed +21
-7
lines changed Original file line number Diff line number Diff line change 9292 >
9393 <arg value =" analyse" />
9494 <arg value =" -l" />
95- <arg value =" 4 " />
95+ <arg value =" 7 " />
9696 <arg value =" -c" />
9797 <arg path =" phpstan.neon" />
9898 <arg path =" src" />
Original file line number Diff line number Diff line change 44 "license" : [" MIT" ],
55 "minimum-stability" : " dev" ,
66 "prefer-stable" : true ,
7+ "extra" : {
8+ "branch-alias" : {
9+ "dev-master" : " 0.7-dev"
10+ }
11+ },
712 "require" : {
813 "php" : " ~7.0" ,
9- "phpstan/phpstan" : " ^0.6.3 " ,
14+ "phpstan/phpstan" : " ^0.7 " ,
1015 "doctrine/common" : " ^2.7" ,
1116 "doctrine/orm" : " ^2.5"
1217 },
1318 "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" ,
1521 "phing/phing" : " ^2.16.0" ,
1622 "phpunit/phpunit" : " ^5.7" ,
17- "slevomat/coding-standard" : " dev-php7#d4a1a9c "
23+ "slevomat/coding-standard" : " ^2.0 "
1824 },
1925 "autoload" : {
2026 "psr-4" : {
Original file line number Diff line number Diff line change 77 <exclude name =" SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces" />
88 <exclude name =" SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly" />
99 </rule >
10- <rule ref =" SlevomatCodingStandard.Typehints .TypeHintDeclaration" >
10+ <rule ref =" SlevomatCodingStandard.TypeHints .TypeHintDeclaration" >
1111 <properties >
1212 <property name =" usefulAnnotations" type =" array" value ="
1313 @dataProvider
1414 " />
15+ <property name =" enableNullableTypeHints" type =" false" />
16+ <property name =" enableVoidTypeHint" type =" false" />
1517 </properties >
1618 </rule >
1719</ruleset >
Original file line number Diff line number Diff line change 77use PHPStan \Reflection \MethodReflection ;
88use PHPStan \Type \ObjectType ;
99use PHPStan \Type \Type ;
10+ use PHPStan \Type \TypeCombinator ;
1011
1112class EntityManagerFindDynamicReturnTypeExtension implements \PHPStan \Type \DynamicMethodReturnTypeExtension
1213{
@@ -51,10 +52,15 @@ public function getTypeFromMethodCall(
5152 }
5253
5354 if ($ class === 'self ' ) {
54- $ class = $ scope ->getClass ();
55+ $ class = $ scope ->getClassReflection ()-> getName ();
5556 }
5657
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 ;
5864 }
5965
6066}
You can’t perform that action at this time.
0 commit comments