Skip to content

Commit 68134da

Browse files
authored
Merge pull request #3 from wearenolte/php8.2-composer-update
Update composer, PHP libraries and code for deprecated warnings
2 parents 90d48e0 + 1bc7ff5 commit 68134da

File tree

4 files changed

+384
-46
lines changed

4 files changed

+384
-46
lines changed

codesniffer.ruleset.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
<?xml version="1.0"?>
22
<ruleset name="WordPress Theme Coding Standards">
3+
<description>Use "WordPress" as the sniffer context, with some exclusions.</description>
34
<rule ref="WordPress">
45
<exclude name="Generic.WhiteSpace.ScopeIndent.IncorrectExact" />
56
<exclude name="Generic.WhiteSpace.ScopeIndent.Incorrect" />
6-
<exclude name="Squiz.Commenting.FileComment" />
7-
<exclude name="Squiz.Commenting.LongConditionClosingComment" />
7+
<exclude name="Generic.Files.LowercasedFilename" />
88
<exclude name="PEAR.Functions.FunctionCallSignature.Indent" />
9+
<exclude name="Squiz.Commenting.FileComment" />
10+
<exclude name="Squiz.Commenting.FunctionComment" />
911
<exclude name="WordPress.Files.FileName" />
10-
<exclude name="Generic.Files.LowercasedFilename" />
11-
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" />
1212
<exclude name="WordPress.NamingConventions.ValidHookName" />
13+
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" />
14+
<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found" />
1315
</rule>
16+
17+
<rule ref="Generic.Arrays.DisallowLongArraySyntax" />
1418
</ruleset>

composer.json

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,31 @@
2626
}
2727
},
2828
"require-dev": {
29-
"squizlabs/php_codesniffer": "3.*",
30-
"wp-coding-standards/wpcs": "2.*"
29+
"squizlabs/php_codesniffer": "^3.7.2",
30+
"wp-coding-standards/wpcs": "^3.0"
3131
},
3232
"scripts": {
3333
"installSniffer": [
34-
"./vendor/bin/phpcs --config-set installed_paths vendor/wp-coding-standards/wpcs/",
34+
"./vendor/bin/phpcs --config-set installed_paths vendor/wp-coding-standards/wpcs/,vendor/phpcsstandards/phpcsutils/,vendor/phpcsstandards/phpcsextra/",
3535
"./vendor/bin/phpcs --config-set default_standard ./codesniffer.ruleset.xml",
3636
"./vendor/bin/phpcs --config-set show_progress 0",
3737
"./vendor/bin/phpcs --config-set colors 1"
3838
],
39-
"post-install-cmd": [ "@installSniffer" ],
40-
"post-update-cmd": [ "@installSniffer" ],
41-
"ci": [
42-
"phpcs src/*.php src/**/*.php"
39+
"post-install-cmd": [
40+
"@installSniffer"
41+
],
42+
"post-update-cmd": [
43+
"@installSniffer"
44+
],
45+
"test": [
46+
"echo \"Running WordPressCS checks...\"",
47+
"./vendor/bin/phpcs -s src",
48+
"echo \"WordPressCS checks complete.\""
4349
]
50+
},
51+
"config": {
52+
"allow-plugins": {
53+
"dealerdirect/phpcodesniffer-composer-installer": true
54+
}
4455
}
4556
}

0 commit comments

Comments
 (0)