File tree 4 files changed +27
-4
lines changed
4 files changed +27
-4
lines changed Original file line number Diff line number Diff line change 497
497
<!-- Forbid useless semicolon `;` -->
498
498
<rule ref =" SlevomatCodingStandard.PHP.UselessSemicolon" />
499
499
<!-- Require /* @var type $foo */ and similar simple inline annotations to be replaced by assert() -->
500
- <rule ref =" SlevomatCodingStandard.PHP.RequireExplicitAssertion" />
500
+ <rule ref =" SlevomatCodingStandard.PHP.RequireExplicitAssertion" >
501
+ <properties >
502
+ <property name =" enableAdvancedStringTypes" value =" true" />
503
+ <property name =" enableIntegerRanges" value =" true" />
504
+ </properties >
505
+ </rule >
501
506
<!-- Require use of short versions of scalar types (i.e. int instead of integer) -->
502
507
<rule ref =" SlevomatCodingStandard.TypeHints.LongTypeHints" />
503
508
<!-- Require the `null` type hint to be in the last position of annotations -->
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ tests/input/ForbiddenClasses.php 7 0
25
25
tests/input/fully-qualified-and-fallbacks.php 2 0
26
26
tests/input/fully-qualified-without-namespace.php 4 0
27
27
tests/input/inheritdoc.php 12 1
28
- tests/input/inline_type_hint_assertions.php 7 0
28
+ tests/input/inline_type_hint_assertions.php 10 0
29
29
tests/input/LowCaseTypes.php 3 0
30
30
tests/input/merge-conflict.php 6 0
31
31
tests/input/namespaces-spacing.php 13 0
@@ -55,9 +55,9 @@ tests/input/use-ordering.php 9 0
55
55
tests/input/useless-semicolon.php 2 0
56
56
tests/input/UselessConditions.php 24 0
57
57
----------------------------------------------------------------------
58
- A TOTAL OF 518 ERRORS AND 9 WARNINGS WERE FOUND IN 51 FILES
58
+ A TOTAL OF 521 ERRORS AND 9 WARNINGS WERE FOUND IN 51 FILES
59
59
----------------------------------------------------------------------
60
- PHPCBF CAN FIX 415 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
60
+ PHPCBF CAN FIX 418 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
61
61
----------------------------------------------------------------------
62
62
63
63
Original file line number Diff line number Diff line change 24
24
assert (is_int ($ multipleScalarTypes ) || is_float ($ multipleScalarTypes ) || is_bool ($ multipleScalarTypes ) || is_string ($ multipleScalarTypes ) || is_array ($ multipleScalarTypes ) || $ multipleScalarTypes === null );
25
25
26
26
/** @var Potato $variableThatIsNowhereToBeFound */
27
+
28
+ $ a = 1 ;
29
+ assert (is_int ($ a ) && $ a > 0 );
30
+
31
+ $ aa = null ;
32
+ assert ((is_int ($ aa ) && $ aa > 0 ) || $ aa === null );
33
+
34
+ $ aaa = 'string ' ;
35
+ assert (is_string ($ aaa ) && $ aaa !== '' );
Original file line number Diff line number Diff line change 24
24
$ multipleScalarTypes = expression ();
25
25
26
26
/** @var Potato $variableThatIsNowhereToBeFound */
27
+
28
+ /** @var positive-int $a */
29
+ $ a = 1 ;
30
+
31
+ /** @var positive-int|null $aa */
32
+ $ aa = null ;
33
+
34
+ /** @var non-empty-string $aaa */
35
+ $ aaa = 'string ' ;
You can’t perform that action at this time.
0 commit comments