File tree Expand file tree Collapse file tree 6 files changed +31
-9
lines changed Expand file tree Collapse file tree 6 files changed +31
-9
lines changed Original file line number Diff line number Diff line change 11
11
},
12
12
"require-dev" : {
13
13
"beberlei/assert" : " ^2.9.5" ,
14
- "consistence/coding-standard" : " ^3.0.1 " ,
14
+ "consistence/coding-standard" : " ^3.10 " ,
15
15
"dealerdirect/phpcodesniffer-composer-installer" : " ^0.7.0" ,
16
16
"ergebnis/composer-normalize" : " ^2.0.2" ,
17
17
"phing/phing" : " ^2.16.0" ,
18
18
"php-parallel-lint/php-parallel-lint" : " ^1.2" ,
19
19
"phpstan/phpstan-phpunit" : " ^0.12.3" ,
20
20
"phpstan/phpstan-strict-rules" : " ^0.12" ,
21
21
"phpunit/phpunit" : " ^7.5.18" ,
22
- "slevomat/coding-standard" : " ^4.5.2 "
22
+ "slevomat/coding-standard" : " ^6.4 "
23
23
},
24
24
"config" : {
25
25
"sort-packages" : true
Original file line number Diff line number Diff line change 17
17
<property name =" newlinesCountBetweenOpenTagAndDeclare" value =" 0" />
18
18
</properties >
19
19
</rule >
20
- <rule ref =" SlevomatCodingStandard.TypeHints.TypeHintDeclaration " >
20
+ <rule ref =" SlevomatCodingStandard.TypeHints.ParameterTypeHint " >
21
21
<properties >
22
22
<property name =" usefulAnnotations" type =" array" value ="
23
23
@dataProvider,
28
28
<exclude name =" SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableParameterTypeHintSpecification" />
29
29
<exclude name =" SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableReturnTypeHintSpecification" />
30
30
</rule >
31
+ <rule ref =" SlevomatCodingStandard.TypeHints.PropertyTypeHint" >
32
+ <properties >
33
+ <property name =" enableNativeTypeHint" value =" false" />
34
+ </properties >
35
+ <exclude name =" SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification" />
36
+ </rule >
37
+ <rule ref =" SlevomatCodingStandard.TypeHints.ReturnTypeHint" >
38
+ <properties >
39
+ <property name =" enableObjectTypeHint" value =" false" />
40
+ </properties >
41
+ <exclude name =" SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification" />
42
+ </rule >
31
43
<rule ref =" SlevomatCodingStandard.ControlStructures.AssignmentInCondition" />
32
- <rule ref =" SlevomatCodingStandard.ControlStructures .DisallowEqualOperators" />
44
+ <rule ref =" SlevomatCodingStandard.Operators .DisallowEqualOperators" />
33
45
<rule ref =" SlevomatCodingStandard.ControlStructures.EarlyExit" />
34
46
<rule ref =" SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming" />
35
47
<rule ref =" SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming" />
Original file line number Diff line number Diff line change @@ -129,7 +129,9 @@ function (Type $type): Type {
129
129
return TypeCombinator::removeNull ($ type );
130
130
}
131
131
);
132
- } elseif ($ assertName === 'notIsInstanceOf ' ) {
132
+ }
133
+
134
+ if ($ assertName === 'notIsInstanceOf ' ) {
133
135
$ classType = $ scope ->getType ($ args [1 ]->value );
134
136
if (!$ classType instanceof ConstantStringType) {
135
137
return new SpecifiedTypes ([], []);
@@ -144,7 +146,9 @@ function (Type $type) use ($objectType): Type {
144
146
return TypeCombinator::remove ($ type , $ objectType );
145
147
}
146
148
);
147
- } elseif ($ assertName === 'notSame ' ) {
149
+ }
150
+
151
+ if ($ assertName === 'notSame ' ) {
148
152
$ valueType = $ scope ->getType ($ args [1 ]->value );
149
153
return self ::arrayOrIterable (
150
154
$ typeSpecifier ,
Original file line number Diff line number Diff line change @@ -33,7 +33,9 @@ public function getTypeFromStaticMethodCall(\PHPStan\Reflection\MethodReflection
33
33
$ type = new AssertThatType ($ valueExpr , $ scope ->getType ($ valueExpr ));
34
34
if ($ methodReflection ->getName () === 'thatNullOr ' ) {
35
35
return $ type ->toNullOr ();
36
- } elseif ($ methodReflection ->getName () === 'thatAll ' ) {
36
+ }
37
+
38
+ if ($ methodReflection ->getName () === 'thatAll ' ) {
37
39
return $ type ->toAll ();
38
40
}
39
41
Original file line number Diff line number Diff line change @@ -36,7 +36,9 @@ public function getTypeFromFunctionCall(
36
36
$ type = new AssertThatType ($ valueExpr , $ scope ->getType ($ valueExpr ));
37
37
if ($ functionReflection ->getName () === 'Assert \\thatNullOr ' ) {
38
38
return $ type ->toNullOr ();
39
- } elseif ($ functionReflection ->getName () === 'Assert \\thatAll ' ) {
39
+ }
40
+
41
+ if ($ functionReflection ->getName () === 'Assert \\thatAll ' ) {
40
42
return $ type ->toAll ();
41
43
}
42
44
Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ public function getTypeFromMethodCall(
32
32
33
33
if ($ methodReflection ->getName () === 'all ' ) {
34
34
return $ type ->toAll ();
35
- } elseif ($ methodReflection ->getName () === 'nullOr ' ) {
35
+ }
36
+
37
+ if ($ methodReflection ->getName () === 'nullOr ' ) {
36
38
return $ type ->toNullOr ();
37
39
}
38
40
You can’t perform that action at this time.
0 commit comments