Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PHPCS and coding standards to the current version. #1894

Merged
merged 3 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions plugins/faustwp/.phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,8 @@
<property name="blank_line_check" value="true" />
</properties>
</rule>

<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter">
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter"/>
</rule>
</ruleset>
6 changes: 3 additions & 3 deletions plugins/faustwp/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"axepress/wp-graphql-stubs": "^1.16",
"szepeviktor/phpstan-wordpress": "^1.3",
"roave/security-advisories": "dev-master",
"squizlabs/php_codesniffer": "^3.5.8",
"wp-coding-standards/wpcs": "^2.2",
"squizlabs/php_codesniffer": "^3.10.1",
"wp-coding-standards/wpcs": "^3.1.0",
"yoast/phpunit-polyfills": "^1.0"
},
"scripts": {
Expand Down Expand Up @@ -66,4 +66,4 @@
"WPE\\FaustWP\\Tests\\Integration\\": "tests/integration/"
}
}
}
}
213 changes: 197 additions & 16 deletions plugins/faustwp/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/faustwp/faustwp.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}

define( 'FAUSTWP_FILE', __FILE__ );
define( 'FAUSTWP_DIR', dirname( __FILE__ ) );
define( 'FAUSTWP_DIR', __DIR__ );
define( 'FAUSTWP_URL', plugin_dir_url( __FILE__ ) );
define( 'FAUSTWP_PATH', plugin_basename( FAUSTWP_FILE ) );
define( 'FAUSTWP_SLUG', dirname( plugin_basename( FAUSTWP_FILE ) ) );
Expand Down
6 changes: 3 additions & 3 deletions plugins/faustwp/includes/replacement/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ function normalize_sitemap_entry( $sitemap_entry ) {
/**
* Check if a string has a file extension.
*
* @param string $string The string to check.
* @param string $file The string to check.
* @return boolean
*/
function has_file_extension( $string ) {
function has_file_extension( $file ) {
$file_extension_pattern = '/\.[a-zA-Z0-9]+$/';

if ( preg_match( $file_extension_pattern, $string ) ) {
if ( preg_match( $file_extension_pattern, $file ) ) {
return true;
} else {
return false; // String does not have a file extension.
Expand Down
12 changes: 6 additions & 6 deletions plugins/faustwp/includes/settings/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ function get_secret_key() {
/**
* Get a Faust setting by name.
*
* @param string $name The setting name.
* @param mixed $default Optional setting value. Default false.
* @param string $name The setting name.
* @param mixed $default_value Optional setting value. Default false.
*
* @return mixed The setting value.
*/
function faustwp_get_setting( $name, $default = false ) {
$value = $default;
function faustwp_get_setting( $name, $default_value = false ) {
$value = $default_value;
$settings = faustwp_get_settings();

if ( isset( $settings[ $name ] ) ) {
Expand All @@ -107,9 +107,9 @@ function faustwp_get_setting( $name, $default = false ) {
*
* @param mixed $value The setting value.
* @param string $name The setting name.
* @param mixed $default Optional setting value.
* @param mixed $default_value Optional setting value.
*/
return apply_filters( 'faustwp_get_setting', $value, $name, $default );
return apply_filters( 'faustwp_get_setting', $value, $name, $default_value );
}

/**
Expand Down
Loading