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

chore(deps): update wp/vip coding standards to v3 (major) #568

Merged
merged 2 commits into from
Sep 7, 2023
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: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
"wildwolf/singleton-trait": "^1.0"
},
"require-dev": {
"automattic/vipwpcs": "^2.3",
"automattic/vipwpcs": "^3.0",
"johnpbloch/wordpress-core": "^6.0",
"php-stubs/wordpress-stubs": "^6.0",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"phpunit/php-code-coverage": "^9.2",
"vimeo/psalm": "^5.0",
"wildwolf/wordpress-test-library-stubs": "^6.0",
"wp-cli/i18n-command": "^2.2",
"wp-coding-standards/wpcs": "^2.3",
"wp-coding-standards/wpcs": "^3.0",
"wp-phpunit/wp-phpunit": "^6.0"
},
"config": {
Expand Down
182 changes: 164 additions & 18 deletions composer.lock

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

4 changes: 2 additions & 2 deletions inc/class-datetimeutils.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
namespace WildWolf\WordPress\TwoFactorWebAuthn;

abstract class DateTimeUtils {
public static function format_date_time( int $dt ) : string {
public static function format_date_time( int $dt ): string {
$date_format = (string) get_option( 'date_format', 'Y-m-d' );
$time_format = (string) get_option( 'time_format', 'H:i:s' );
return date_i18n( $date_format . ' ' . $time_format, $dt, true );
}

public static function format_date_time_full( int $dt ) : string {
public static function format_date_time_full( int $dt ): string {
return gmdate( 'Y-m-d H:i:s', $dt );
}
}
2 changes: 1 addition & 1 deletion inc/class-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static function get_u2f_app_id(): string {
* @psalm-param array<string,mixed> $params
* @psalm-suppress PossiblyUnusedParam
*/
public static function render( string $view, array $params = [] ): void {
public static function render( string $view, array $params = [] ): void { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
/** @psalm-suppress UnresolvableInclude */
require __DIR__ . '/../views/' . $view . '.php'; // NOSONAR
}
Expand Down
1 change: 1 addition & 0 deletions inc/class-webauthn-user.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public function generate_and_save_handle(): UserHandle {
);

if ( false === $result ) {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- escape when printing
throw new UnexpectedValueException( __( 'Unable to save the user handle to the database.', 'two-factor-provider-webauthn' ) );
}

Expand Down
4 changes: 2 additions & 2 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket" />
<exclude name="PEAR.Functions.FunctionCallSignature.MultipleArguments" />
<exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine" />
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" />
<exclude name="WordPress.PHP.DisallowShortTernary.Found"/>
<exclude name="Universal.Operators.DisallowShortTernary.Found"/>
<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found" />
</rule>

<config name="testVersion" value="7.4-"/>
Expand Down
5 changes: 3 additions & 2 deletions views/user-profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

use WildWolf\WordPress\TwoFactorWebAuthn\Key_Table;

/** @psalm-var array{user: WP_User} $params */
defined( 'ABSPATH' ) || die();

defined( 'ABSPATH' ) || die(); ?>
/** @psalm-var array{user: WP_User} $params */
?>

<div id="webauthn-security-keys-section">
<h3><?php esc_html_e( 'Security Keys (WebAuthn)', 'two-factor-provider-webauthn' ); ?></h3>
Expand Down