Skip to content

Commit 1e85d9a

Browse files
Update dependencies
1 parent 7880c1e commit 1e85d9a

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

composer.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@
2929
],
3030
"minimum-stability": "stable",
3131
"require": {
32-
"php": ">=7",
32+
"php": ">=7.4",
3333
"squizlabs/php_codesniffer": "^3.6.0",
34-
"dealerdirect/phpcodesniffer-composer-installer": "~0.7.0",
35-
"wp-coding-standards/wpcs": "^2.3",
36-
"automattic/vipwpcs": "^2.2",
34+
"dealerdirect/phpcodesniffer-composer-installer": "~1.0.0",
35+
"automattic/vipwpcs": "dev-3.0/updates-for-wpcs-3.0",
3736
"phpcompatibility/php-compatibility": "^9.3.5",
3837
"automattic/phpcs-neutron-standard": "^1.6.0"
3938
},

phpcs.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@
6060
Curated list of WordPress specific rules.
6161
See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
6262
-->
63-
<rule ref="WordPress.Arrays.CommaAfterArrayItem"/>
64-
<rule ref="WordPress.CodeAnalysis.AssignmentInCondition"/>
65-
<rule ref="WordPress.CodeAnalysis.EmptyStatement"/>
63+
<rule ref="WordPress.CodeAnalysis.AssignmentInTernaryCondition"/>
6664
<rule ref="WordPress.CodeAnalysis.EscapedNotTranslated"/>
6765
<rule ref="WordPress.DB.PreparedSQLPlaceholders"/>
6866
<rule ref="WordPress.DB.PreparedSQL"/>
@@ -98,7 +96,6 @@
9896
<rule ref="WordPress.PHP.POSIXFunctions"/>
9997
<rule ref="WordPress.PHP.PregQuoteDelimiter"/>
10098
<rule ref="WordPress.PHP.RestrictedPHPFunctions"/>
101-
<rule ref="WordPress.PHP.StrictComparisons"/>
10299
<rule ref="WordPress.PHP.StrictInArray"/>
103100
<rule ref="WordPress.PHP.TypeCasts"/>
104101
<rule ref="WordPress.Security.EscapeOutput"/>
@@ -152,6 +149,8 @@
152149
Generic
153150
-->
154151
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
152+
<rule ref="Generic.CodeAnalysis.AssignmentInCondition"/>
153+
<rule ref="Generic.CodeAnalysis.EmptyPHPStatement"/>
155154
<rule ref="Generic.Metrics.CyclomaticComplexity">
156155
<properties>
157156
<property name="absoluteComplexity" value="50"/>
@@ -161,6 +160,7 @@
161160
<rule ref="Generic.PHP.CharacterBeforePHPOpeningTag"/>
162161
<rule ref="Generic.PHP.LowerCaseConstant"/>
163162
<rule ref="Generic.VersionControl.GitMergeConflict"/>
163+
<rule ref="NormalizedArrays.Arrays.CommaAfterLast"/>
164164
<rule ref="Squiz.Classes.LowercaseClassKeywords"/>
165165
<rule ref="Squiz.PHP.CommentedOutCode">
166166
<properties>
@@ -173,6 +173,8 @@
173173
<rule ref="Squiz.PHP.NonExecutableCode"/>
174174
<rule ref="Squiz.Scope.MemberVarScope"/>
175175
<rule ref="Squiz.Scope.StaticThisUsage"/>
176+
<rule ref="Universal.Operators.StrictComparisons" />
177+
<rule ref="Universal.WhiteSpace.CommaSpacing"/>
176178

177179
<!--
178180
PHPCompatibility

tests/cases/FixturesTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ private function createPhpcsForFixture(
198198
$sniffName = str_replace('.', DIRECTORY_SEPARATOR, $sniffName) . 'Sniff';
199199
$sniffFile = getenv('SNIFFS_PATH') . DIRECTORY_SEPARATOR . "{$sniffName}.php";
200200
if (!file_exists($sniffFile) || !is_readable($sniffFile)) {
201+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
201202
throw new Exception("Non-existent of unreadable sniff file '$sniffFile' found.");
202203
}
203204

tests/src/FixtureContentParser.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class FixtureContentParser
3535
public function parse(string $fixturePath): array
3636
{
3737
if (!file_exists($fixturePath) || !is_readable($fixturePath)) {
38+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
3839
throw new Exception("Fixture file {$fixturePath} is not readable.");
3940
}
4041

@@ -104,12 +105,14 @@ private function processResults(\stdClass $accumulator, string $fixturePath): ar
104105
|| !is_array($results[4] ?? null)
105106
) {
106107
throw new Exception(
108+
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
107109
sprintf(
108110
"Process callback for fixture '%s' (lines #%s:#%s) returned invalid output.",
109111
$fixturePath,
110112
$accumulator->process->start,
111113
$accumulator->process->end
112114
)
115+
// phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
113116
);
114117
}
115118

@@ -137,6 +140,7 @@ private function checkSniffName(string $sniff = null): string
137140
}
138141

139142
if (!preg_match('~^' . $regex . '$~', $sniff)) {
143+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
140144
throw new Exception("Invalid sniff name '{$sniff}'.");
141145
}
142146

0 commit comments

Comments
 (0)