diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 17d6a82..bf25ccc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,7 +39,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.0' + php-version: '8.2' tools: composer - name: Setup Node uses: actions/setup-node@v3 diff --git a/composer.json b/composer.json index b3f9e65..8dbe40c 100644 --- a/composer.json +++ b/composer.json @@ -21,14 +21,14 @@ "composer/installers": "~1.12" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^v0.7", + "dealerdirect/phpcodesniffer-composer-installer": "^v1.0", "matthiasmullie/minify": "^1.3", "phpcompatibility/phpcompatibility-wp": "^2.1", "phpunit/phpunit": "^5|^6|^7|^8|^9", "slowprog/composer-copy-file": "~0.3", "squizlabs/php_codesniffer": "^3.7", - "wp-coding-standards/wpcs": "^2.3", - "yoast/phpunit-polyfills": "^1.0" + "wp-coding-standards/wpcs": "^3.0", + "yoast/phpunit-polyfills": "^2.0" }, "scripts": { "post-install-cmd": [ diff --git a/includes/class-widget.php b/includes/class-widget.php index 1996ff0..11c51bb 100644 --- a/includes/class-widget.php +++ b/includes/class-widget.php @@ -95,15 +95,16 @@ class Widget extends WP_Widget { $wp_query = new WP_Query( $args ); $cnt = 0; - while ( $wp_query->have_posts() && ( $count <= 0 || ++ $cnt < $count ) ) { + while ( $wp_query->have_posts() && ( $count <= 0 || ++$cnt < $count ) ) { $wp_query->the_post(); - // @codingStandardsIgnoreLine + // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped echo SCLiveticker::tick_html_widget( esc_html( get_the_time( 'd.m.Y - H:i' ) ), get_the_title(), ( '1' === $highlight && get_the_time( 'U' ) > ( time() - $highlight_time ) ), get_the_ID() ); + // phpcs:enable } echo ''; diff --git a/stklcode-liveticker.php b/stklcode-liveticker.php index d4ac11b..353f55b 100644 --- a/stklcode-liveticker.php +++ b/stklcode-liveticker.php @@ -64,11 +64,11 @@ spl_autoload_register( 'scliveticker_autoload' ); /** * Autoloader for Liveticker classes. * - * @param string $class Name of the class to load. + * @param string $class_name Name of the class to load. * * @return void */ -function scliveticker_autoload( $class ) { +function scliveticker_autoload( $class_name ) { $plugin_classes = array( 'SCLiveticker\\SCLiveticker', 'SCLiveticker\\Admin', @@ -76,11 +76,11 @@ function scliveticker_autoload( $class ) { 'SCLiveticker\\System', 'SCLiveticker\\Widget', ); - if ( in_array( $class, $plugin_classes, true ) ) { + if ( in_array( $class_name, $plugin_classes, true ) ) { require_once sprintf( '%s/includes/class-%s.php', SCLIVETICKER_DIR, - strtolower( str_replace( '_', '-', substr( $class, 13 ) ) ) + strtolower( str_replace( '_', '-', substr( $class_name, 13 ) ) ) ); } } diff --git a/views/widget-form.php b/views/widget-form.php index 7e986ff..63ef13e 100644 --- a/views/widget-form.php +++ b/views/widget-form.php @@ -54,7 +54,7 @@ if ( ! defined( 'ABSPATH' ) ) { %d', $i,