Skip to content

Commit

Permalink
Compat Checker: Fix lint errors (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibndawood authored Mar 29, 2024
2 parents d01e050 + 891d94b commit 472647d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
6 changes: 5 additions & 1 deletion packages/php/compat-checker/src/Checker.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
*/
class Checker {

/** @var Checker The class instance. */
/**
* The Checker instance.
*
* @var Checker
*/
private static $instance;

/**
Expand Down
12 changes: 6 additions & 6 deletions packages/php/compat-checker/src/Checks/CompatCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ public static function instance( $plugin_basename ) {
/**
* Adds an admin notice to be displayed.
*
* @param string $slug The slug for the notice.
* @param string $class The CSS class for the notice.
* @param string $message The notice message.
* @param string $slug The slug for the notice.
* @param string $css_class The CSS class for the notice.
* @param string $message The notice message.
*/
protected function add_admin_notice( $slug, $class, $message ) {
protected function add_admin_notice( $slug, $css_class, $message ) {
$screen = get_current_screen();
$hidden = array( 'update', 'update-network', 'update-core', 'update-core-network', 'upgrade', 'upgrade-network', 'network' );
$show = isset( $screen->id ) && ! in_array( $screen->id, $hidden, true );
Expand All @@ -86,14 +86,14 @@ protected function add_admin_notice( $slug, $class, $message ) {
}

// If the notice is a warning and WooCommerce admin notice system is available. Then use it.
if ( str_contains( $class, 'warning' ) && class_exists( WC_Admin_Notices::class ) ) {
if ( str_contains( $css_class, 'warning' ) && class_exists( WC_Admin_Notices::class ) ) {
// Do not display the notice if it was dismissed.
if ( ! get_user_meta( get_current_user_id(), 'dismissed_' . $slug . '_notice', true ) ) {
WC_Admin_Notices::add_custom_notice( $slug, $message );
}
} else {
$this->notices[ $slug ] = array(
'class' => $class,
'class' => $css_class,
'message' => $message,
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Automattic\WooCommerce\Grow\Tools\CompatChecker\v0_0_1\Exception;

use \Exception;
use Exception;

defined( 'ABSPATH' ) || exit;

Expand Down

0 comments on commit 472647d

Please sign in to comment.