Skip to content

Commit 369d8f3

Browse files
Merge pull request #14 from MauricioFauth/phpcs-upgrade
Bump doctrine/coding-standard to version 14
2 parents b8d8b56 + fce9131 commit 369d8f3

3 files changed

Lines changed: 19 additions & 15 deletions

File tree

‎.github/workflows/tests.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
php-version: ['8.1', '8.2', '8.3', '8.4', '8.5']
17+
php-version: ['8.2', '8.3', '8.4', '8.5']
1818
steps:
1919
- name: Checkout code
2020
uses: actions/checkout@v7
@@ -38,5 +38,5 @@ jobs:
3838
- name: Lint the ruleset
3939
run: xmllint --noout --schema ./vendor/squizlabs/php_codesniffer/phpcs.xsd PhpMyAdmin/ruleset.xml
4040

41-
- name: Run PHP tests
42-
run: ./vendor/bin/phpcs --standard=PhpMyAdmin -vv | grep -oF "Processing ruleset $(pwd)/PhpMyAdmin/ruleset.xml"
41+
- name: Check installed coding standards
42+
run: vendor/bin/phpcs -i | grep -F "PhpMyAdmin, Doctrine and SlevomatCodingStandard"

‎PhpMyAdmin/ruleset.xml‎

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,28 @@
1212
<exclude name="SlevomatCodingStandard.Classes.SuperfluousExceptionNaming"/>
1313
<exclude name="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming"/>
1414
<exclude name="SlevomatCodingStandard.Classes.SuperfluousTraitNaming"/>
15-
16-
<!-- Do not replace /* @var type $foo */ and similar simple inline annotations with assert() -->
17-
<exclude name="SlevomatCodingStandard.PHP.RequireExplicitAssertion"/>
1815
</rule>
1916

20-
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">
17+
<!-- Enforces conditions to be on a single line when it fit on the line. -->
18+
<rule ref="SlevomatCodingStandard.ControlStructures.RequireSingleLineCondition">
2119
<properties>
22-
<property name="enableStandaloneNullTrueFalseTypeHints" value="false"/>
20+
<property name="alwaysForSimpleConditions" value="false"/>
2321
</properties>
2422
</rule>
25-
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint">
23+
24+
<!-- Enforces function call to be on a single line when it fits on the line. -->
25+
<rule ref="SlevomatCodingStandard.Functions.RequireSingleLineCall"/>
26+
27+
<!-- Checks duplicate spaces. -->
28+
<rule ref="SlevomatCodingStandard.Whitespaces.DuplicateSpaces">
2629
<properties>
27-
<property name="enableStandaloneNullTrueFalseTypeHints" value="false"/>
30+
<property name="ignoreSpacesInComment" value="true"/>
2831
</properties>
2932
</rule>
30-
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
33+
34+
<rule ref="SlevomatCodingStandard.TypeHints.ClassConstantTypeHint">
3135
<properties>
32-
<property name="enableStandaloneNullTrueFalseTypeHints" value="false"/>
36+
<property name="enableNativeTypeHint" value="false"/><!-- PHP 8.3+ -->
3337
</properties>
3438
</rule>
3539
</ruleset>

‎composer.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
"issues": "https://github.com/phpmyadmin/coding-standard/issues"
1717
},
1818
"require": {
19-
"php": "^8.1",
20-
"doctrine/coding-standard": "^13",
21-
"squizlabs/php_codesniffer": "^3.7"
19+
"php": "^8.2",
20+
"doctrine/coding-standard": "^14",
21+
"squizlabs/php_codesniffer": "^4"
2222
},
2323
"config": {
2424
"sort-packages": true,

0 commit comments

Comments
 (0)