Skip to content

Commit

Permalink
Update wearerequired/coding-standards requirement from ^5.0 to ^6.0 (#47
Browse files Browse the repository at this point in the history
)

* Update wearerequired/coding-standards requirement from ^5.0 to ^6.0

Updates the requirements on [wearerequired/coding-standards](https://github.com/wearerequired/coding-standards) to permit the latest version.
- [Release notes](https://github.com/wearerequired/coding-standards/releases)
- [Changelog](https://github.com/wearerequired/coding-standards/blob/master/CHANGELOG.md)
- [Commits](wearerequired/coding-standards@5.0.0...6.0.0)

---
updated-dependencies:
- dependency-name: wearerequired/coding-standards
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>

* Fix new PHPCS issues

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dominik Schilling <[email protected]>
  • Loading branch information
dependabot[bot] and ocean90 authored Apr 9, 2024
1 parent 9080aae commit 5e56ec5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"composer/semver": "^3.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0",
"deployer/deployer": "^7.3",
"wearerequired/coding-standards": "^5.0"
"wearerequired/coding-standards": "^6.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
12 changes: 11 additions & 1 deletion phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,18 @@

<rule ref="Required">
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols"/>
<exclude name="WordPress.Security.EscapeOutput.ExceptionNotEscaped"/>
</rule>

<!-- The minimum supported WordPress version for all sniffs which use it. -->
<config name="minimum_supported_wp_version" value="6.3"/>
<!-- The minimum PHP requirement. -->
<config name="testVersion" value="7.4-"/>

<rule ref="WordPress.Files.FileName.NotHyphenatedLowercase">
<exclude-pattern>/src/Plugin\.php</exclude-pattern>
<exclude-pattern>/res/deploy\.tpl\.php</exclude-pattern>
</rule>
<rule ref="WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase">
<exclude-pattern>/src/Plugin\.php</exclude-pattern>
</rule>
Expand All @@ -20,7 +30,7 @@
<rule ref="Squiz.Commenting.FunctionCommentThrowTag.Missing">
<exclude-pattern>/src/Plugin\.php</exclude-pattern>
</rule>
<rule ref="WordPress.WP.CapitalPDangit.Misspelled">
<rule ref="WordPress.WP.CapitalPDangit.MisspelledInText">
<exclude-pattern>/res/deploy\.tpl\.php</exclude-pattern>
</rule>
</ruleset>
6 changes: 3 additions & 3 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function activate( Composer $composer, IOInterface $io ): void {

$config = $this->composer->getConfig();

$this->rootDir = dirname( $config->getConfigSource()->getName() );
$this->rootDir = \dirname( $config->getConfigSource()->getName() );
}

/**
Expand Down Expand Up @@ -116,14 +116,14 @@ public function copyDeployerConfig( PackageEvent $event ): void {
} elseif ( $operation instanceof UpdateOperation ) {
$package = $operation->getTargetPackage();
} else {
throw new \Exception( 'Unknown operation: ' . \get_class( $operation ) );
throw new \Exception( 'Unknown operation: ' . \get_class( $operation ) ); // phpcs:ignore SlevomatCodingStandard.Classes.ModernClassNameReference.ClassNameReferencedViaFunctionCall -- Switch to $operation::class when PHP 8.0 is minimum.
}

if ( self::PLUGIN_PACKAGE_NAME !== $package->getName() ) {
return;
}

$source = dirname( __DIR__ ) . '/res/deploy.tpl.php';
$source = \dirname( __DIR__ ) . '/res/deploy.tpl.php';
$dest = $this->rootDir . '/deploy.php';

$copied = copy( $source, $dest );
Expand Down

0 comments on commit 5e56ec5

Please sign in to comment.