Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioeatgoat committed Aug 25, 2023
1 parent 7880c1e commit 1e85d9a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@
],
"minimum-stability": "stable",
"require": {
"php": ">=7",
"php": ">=7.4",
"squizlabs/php_codesniffer": "^3.6.0",
"dealerdirect/phpcodesniffer-composer-installer": "~0.7.0",
"wp-coding-standards/wpcs": "^2.3",
"automattic/vipwpcs": "^2.2",
"dealerdirect/phpcodesniffer-composer-installer": "~1.0.0",
"automattic/vipwpcs": "dev-3.0/updates-for-wpcs-3.0",
"phpcompatibility/php-compatibility": "^9.3.5",
"automattic/phpcs-neutron-standard": "^1.6.0"
},
Expand Down
10 changes: 6 additions & 4 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@
Curated list of WordPress specific rules.
See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
-->
<rule ref="WordPress.Arrays.CommaAfterArrayItem"/>
<rule ref="WordPress.CodeAnalysis.AssignmentInCondition"/>
<rule ref="WordPress.CodeAnalysis.EmptyStatement"/>
<rule ref="WordPress.CodeAnalysis.AssignmentInTernaryCondition"/>
<rule ref="WordPress.CodeAnalysis.EscapedNotTranslated"/>
<rule ref="WordPress.DB.PreparedSQLPlaceholders"/>
<rule ref="WordPress.DB.PreparedSQL"/>
Expand Down Expand Up @@ -98,7 +96,6 @@
<rule ref="WordPress.PHP.POSIXFunctions"/>
<rule ref="WordPress.PHP.PregQuoteDelimiter"/>
<rule ref="WordPress.PHP.RestrictedPHPFunctions"/>
<rule ref="WordPress.PHP.StrictComparisons"/>
<rule ref="WordPress.PHP.StrictInArray"/>
<rule ref="WordPress.PHP.TypeCasts"/>
<rule ref="WordPress.Security.EscapeOutput"/>
Expand Down Expand Up @@ -152,6 +149,8 @@
Generic
-->
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<rule ref="Generic.CodeAnalysis.AssignmentInCondition"/>
<rule ref="Generic.CodeAnalysis.EmptyPHPStatement"/>
<rule ref="Generic.Metrics.CyclomaticComplexity">
<properties>
<property name="absoluteComplexity" value="50"/>
Expand All @@ -161,6 +160,7 @@
<rule ref="Generic.PHP.CharacterBeforePHPOpeningTag"/>
<rule ref="Generic.PHP.LowerCaseConstant"/>
<rule ref="Generic.VersionControl.GitMergeConflict"/>
<rule ref="NormalizedArrays.Arrays.CommaAfterLast"/>
<rule ref="Squiz.Classes.LowercaseClassKeywords"/>
<rule ref="Squiz.PHP.CommentedOutCode">
<properties>
Expand All @@ -173,6 +173,8 @@
<rule ref="Squiz.PHP.NonExecutableCode"/>
<rule ref="Squiz.Scope.MemberVarScope"/>
<rule ref="Squiz.Scope.StaticThisUsage"/>
<rule ref="Universal.Operators.StrictComparisons" />
<rule ref="Universal.WhiteSpace.CommaSpacing"/>

<!--
PHPCompatibility
Expand Down
1 change: 1 addition & 0 deletions tests/cases/FixturesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ private function createPhpcsForFixture(
$sniffName = str_replace('.', DIRECTORY_SEPARATOR, $sniffName) . 'Sniff';
$sniffFile = getenv('SNIFFS_PATH') . DIRECTORY_SEPARATOR . "{$sniffName}.php";
if (!file_exists($sniffFile) || !is_readable($sniffFile)) {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
throw new Exception("Non-existent of unreadable sniff file '$sniffFile' found.");
}

Expand Down
4 changes: 4 additions & 0 deletions tests/src/FixtureContentParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class FixtureContentParser
public function parse(string $fixturePath): array
{
if (!file_exists($fixturePath) || !is_readable($fixturePath)) {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
throw new Exception("Fixture file {$fixturePath} is not readable.");
}

Expand Down Expand Up @@ -104,12 +105,14 @@ private function processResults(\stdClass $accumulator, string $fixturePath): ar
|| !is_array($results[4] ?? null)
) {
throw new Exception(
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
sprintf(
"Process callback for fixture '%s' (lines #%s:#%s) returned invalid output.",
$fixturePath,
$accumulator->process->start,
$accumulator->process->end
)
// phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
);
}

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

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

Expand Down

0 comments on commit 1e85d9a

Please sign in to comment.