Skip to content

Commit 99d4e4e

Browse files
authored
Merge pull request #2 from backdevs/update-deprecated-rules
Update deprecated rules
2 parents a4f153b + c54cb0c commit 99d4e4e

File tree

2 files changed

+27
-25
lines changed

2 files changed

+27
-25
lines changed

phpcs/rulesets/base.xml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,26 @@
2626
<!-- Forbid alias functions, i.e. `sizeof()`, `delete()` -->
2727
<rule ref="Generic.PHP.ForbiddenFunctions">
2828
<properties>
29-
<property name="forbiddenFunctions" type="array"
30-
value="
31-
chop => rtrim,
32-
close => closedir,
33-
delete => unset,
34-
doubleval => floatval,
35-
fputs => fwrite,
36-
ini_alter => ini_set,
37-
is_double => is_float,
38-
is_integer => is_int,
39-
is_long => is_int,
40-
is_null => null,
41-
is_real => is_float,
42-
is_writeable => is_writable,
43-
join => implode,
44-
key_exists => array_key_exists,
45-
pos => current,
46-
show_source => highlight_file,
47-
sizeof => count,
48-
strchr => strstr
49-
"/>
29+
<property name="forbiddenFunctions" type="array">
30+
<element key="chop" value="rtrim"/>
31+
<element key="close" value="closedir"/>
32+
<element key="delete" value="unset"/>
33+
<element key="doubleval" value="floatval"/>
34+
<element key="fputs" value="fwrite"/>
35+
<element key="ini_alter" value="ini_set"/>
36+
<element key="is_double" value="is_float"/>
37+
<element key="is_integer" value="is_int"/>
38+
<element key="is_long" value="is_int"/>
39+
<element key="is_null" value="null"/>
40+
<element key="is_real" value="is_float"/>
41+
<element key="is_writeable" value="is_writable"/>
42+
<element key="join" value="implode"/>
43+
<element key="key_exists" value="array_key_exists"/>
44+
<element key="pos" value="current"/>
45+
<element key="show_source" value="highlight_file"/>
46+
<element key="sizeof" value="count"/>
47+
<element key="strchr" value="strstr"/>
48+
</property>
5049
</properties>
5150
</rule>
5251
<!-- Forbid useless inline string concatenation -->
@@ -63,6 +62,9 @@
6362
<!-- Forbid `php_sapi_name()` function -->
6463
<rule ref="Generic.PHP.SAPIUsage"/>
6564

65+
<!-- Require space after language constructs -->
66+
<rule ref="Generic.WhiteSpace.LanguageConstructSpacing"/>
67+
6668
<!-- Forbid comments starting with # -->
6769
<rule ref="PEAR.Commenting.InlineComment"/>
6870

@@ -154,8 +156,6 @@
154156
<rule ref="Squiz.WhiteSpace.CastSpacing"/>
155157
<!-- Forbid blank line after function opening brace -->
156158
<rule ref="Squiz.WhiteSpace.FunctionOpeningBraceSpace"/>
157-
<!-- Require space after language constructs -->
158-
<rule ref="Squiz.WhiteSpace.LanguageConstructSpacing"/>
159159
<!-- Require space around logical operators -->
160160
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
161161
<!-- Forbid spaces around `->` operator -->

phpcs/rulesets/slevomat.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,12 @@
235235
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification" />
236236
</rule>
237237
<!-- Checks format of union type hints. -->
238-
<rule ref="SlevomatCodingStandard.TypeHints.UnionTypeHintFormat">
238+
<rule ref="SlevomatCodingStandard.TypeHints.DNFTypeHintFormat">
239239
<properties>
240240
<!-- Union type must be separated by | without spaces -->
241-
<property name="withSpaces" value="no"/>
241+
<property name="withSpacesAroundOperators" value="no"/>
242+
<!-- Requires nul to be first as in "null|SomeType" instead of "SomeType|null" -->
243+
<property name="nullPosition" value="first"/>
242244
</properties>
243245
</rule>
244246
<!-- Reports useless @var annotation (or whole documentation comment) for constants because the type of constant is always clear. -->

0 commit comments

Comments
 (0)