diff --git a/.github/workflows/browserslist-db.yml b/.github/workflows/browserslist-db.yml index bbb37339e8c..67e8d4dd7f2 100644 --- a/.github/workflows/browserslist-db.yml +++ b/.github/workflows/browserslist-db.yml @@ -21,7 +21,7 @@ jobs: git config --global user.name "${{ github.actor }}" - name: Checkout repository - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 persist-credentials: true diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index a0d21ebfd60..2a38009d757 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -26,15 +26,15 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10 + uses: github/codeql-action/init@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # v4.32.2 with: languages: ${{ matrix.language }} - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10 + uses: github/codeql-action/analyze@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # v4.32.2 diff --git a/.github/workflows/cs.yml b/.github/workflows/cs.yml index 63df1f0c457..c7fe3e14b73 100644 --- a/.github/workflows/cs.yml +++ b/.github/workflows/cs.yml @@ -40,7 +40,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: true diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9334681c0c9..51f810fdcb6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -56,7 +56,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false @@ -164,7 +164,7 @@ jobs: fi - name: Checkout Yoast Dist repo - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: repository: ${{ env.DIST_ORG }}/${{ github.event.repository.name }} ref: ${{ env.DIST_DEFAULT_BRANCH }} diff --git a/.github/workflows/deprecation-check.yml b/.github/workflows/deprecation-check.yml index 6c186ffe20e..c07c98546c1 100644 --- a/.github/workflows/deprecation-check.yml +++ b/.github/workflows/deprecation-check.yml @@ -23,7 +23,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false diff --git a/.github/workflows/finish-coveralls.yml b/.github/workflows/finish-coveralls.yml index 53127043f0a..663aad7ad40 100644 --- a/.github/workflows/finish-coveralls.yml +++ b/.github/workflows/finish-coveralls.yml @@ -84,7 +84,7 @@ jobs: # NOTE: The ref value should be different when triggered by pull_request event. # See: https://github.com/lewagon/wait-on-check-action/issues/25. - name: "Wait on tests (PR)" - uses: lewagon/wait-on-check-action@3603e826ee561ea102b58accb5ea55a1a7482343 # v1.4.1 + uses: lewagon/wait-on-check-action@74049309dfeff245fe8009a0137eacf28136cb3c # v1.5.0 if: github.event_name == 'pull_request' with: ref: ${{ github.event.pull_request.head.sha }} @@ -93,7 +93,7 @@ jobs: - name: "Wait on tests (push)" if: github.event_name != 'pull_request' - uses: lewagon/wait-on-check-action@3603e826ee561ea102b58accb5ea55a1a7482343 # v1.4.1 + uses: lewagon/wait-on-check-action@74049309dfeff245fe8009a0137eacf28136cb3c # v1.5.0 with: ref: ${{ github.sha }} repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/generate_csv.yml b/.github/workflows/generate_csv.yml index 4134b9b89b9..053a354a11c 100644 --- a/.github/workflows/generate_csv.yml +++ b/.github/workflows/generate_csv.yml @@ -11,7 +11,7 @@ jobs: steps: # Check out the repository - name: Check out repository - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false diff --git a/.github/workflows/jslint.yml b/.github/workflows/jslint.yml index fea9d465117..b02783e614c 100644 --- a/.github/workflows/jslint.yml +++ b/.github/workflows/jslint.yml @@ -57,7 +57,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false diff --git a/.github/workflows/jstest.yml b/.github/workflows/jstest.yml index 954fa155f72..68654e499e1 100644 --- a/.github/workflows/jstest.yml +++ b/.github/workflows/jstest.yml @@ -77,7 +77,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false @@ -148,7 +148,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false @@ -169,7 +169,7 @@ jobs: # Check out the premium config repo ahead of running the tests to prevent issues with permissions. - name: Checkout premium configuration if: ${{ steps.checks-run.outputs.should == 'true' && matrix.needs_premium_config == true }} - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: repository: Yoast/YoastSEO.js-premium-configuration path: packages/yoastseo/premium-configuration diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 90bb3dfb35e..22ec8ea2ca5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -43,7 +43,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index d56d09f4a27..4c7abb21e57 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 402de5dde47..cd6a9d56b26 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -61,7 +61,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false @@ -198,7 +198,7 @@ jobs: run: sudo apt-get install -y subversion - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false diff --git a/admin/ajax.php b/admin/ajax.php index 260ccda53f4..c9ac45d68e8 100644 --- a/admin/ajax.php +++ b/admin/ajax.php @@ -144,7 +144,7 @@ function wpseo_save_what( $what ) { */ function wpseo_upsert_meta( $post_id, $new_meta_value, $orig_meta_value, $meta_key, $return_key ) { - $post_id = intval( $post_id ); + $post_id = (int) $post_id; $sanitized_new_meta_value = wp_strip_all_tags( $new_meta_value ); $orig_meta_value = wp_strip_all_tags( $orig_meta_value ); @@ -171,7 +171,7 @@ function wpseo_upsert_meta( $post_id, $new_meta_value, $orig_meta_value, $meta_k $upsert_results['results'] = sprintf( /* translators: %s expands to post type. */ __( 'Post has an invalid Content Type: %s.', 'wordpress-seo' ), - $the_post->post_type + $the_post->post_type, ); return $upsert_results; @@ -183,7 +183,7 @@ function wpseo_upsert_meta( $post_id, $new_meta_value, $orig_meta_value, $meta_k $upsert_results['results'] = sprintf( /* translators: %s expands to post type name. */ __( 'You can\'t edit %s.', 'wordpress-seo' ), - $post_type_object->label + $post_type_object->label, ); return $upsert_results; @@ -195,7 +195,7 @@ function wpseo_upsert_meta( $post_id, $new_meta_value, $orig_meta_value, $meta_k $upsert_results['results'] = sprintf( /* translators: %s expands to the name of a post type (plural). */ __( 'You can\'t edit %s that aren\'t yours.', 'wordpress-seo' ), - $post_type_object->label + $post_type_object->label, ); return $upsert_results; @@ -310,7 +310,7 @@ function ajax_get_keyword_usage_and_post_types() { wp_die( // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: WPSEO_Utils::format_json_encode is safe. - WPSEO_Utils::format_json_encode( $return_object ) + WPSEO_Utils::format_json_encode( $return_object ), ); } @@ -355,7 +355,7 @@ function ajax_get_term_keyword_usage() { wp_die( // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: WPSEO_Utils::format_json_encode is safe. - WPSEO_Utils::format_json_encode( $usage ) + WPSEO_Utils::format_json_encode( $usage ), ); } @@ -406,6 +406,6 @@ function ajax_get_keyword_usage() { wp_die( // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: WPSEO_Utils::format_json_encode is safe. - WPSEO_Utils::format_json_encode( WPSEO_Meta::keyword_usage( $keyword, $post_id ) ) + WPSEO_Utils::format_json_encode( WPSEO_Meta::keyword_usage( $keyword, $post_id ) ), ); } diff --git a/admin/class-admin-asset-analysis-worker-location.php b/admin/class-admin-asset-analysis-worker-location.php index cb980ad1ca6..478f0a831e6 100644 --- a/admin/class-admin-asset-analysis-worker-location.php +++ b/admin/class-admin-asset-analysis-worker-location.php @@ -43,7 +43,7 @@ public function __construct( $flat_version = '', $name = 'analysis-worker' ) { [ 'name' => $name, 'src' => $analysis_worker, - ] + ], ); } diff --git a/admin/class-admin-asset-dev-server-location.php b/admin/class-admin-asset-dev-server-location.php index cf67ae74f78..ac3018ace1f 100644 --- a/admin/class-admin-asset-dev-server-location.php +++ b/admin/class-admin-asset-dev-server-location.php @@ -30,9 +30,7 @@ final class WPSEO_Admin_Asset_Dev_Server_Location implements WPSEO_Admin_Asset_L * @param string|null $url Where the dev server is located. */ public function __construct( $url = null ) { - if ( $url === null ) { - $url = self::DEFAULT_URL; - } + $url ??= self::DEFAULT_URL; $this->url = $url; } diff --git a/admin/class-admin-asset-manager.php b/admin/class-admin-asset-manager.php index 4fbe131698e..09485b39176 100644 --- a/admin/class-admin-asset-manager.php +++ b/admin/class-admin-asset-manager.php @@ -41,9 +41,7 @@ class WPSEO_Admin_Asset_Manager { * @param string $prefix The prefix for naming assets. */ public function __construct( ?WPSEO_Admin_Asset_Location $asset_location = null, $prefix = self::PREFIX ) { - if ( $asset_location === null ) { - $asset_location = self::create_default_location(); - } + $asset_location ??= self::create_default_location(); $this->asset_location = $asset_location; $this->prefix = $prefix; @@ -102,7 +100,7 @@ public function register_script( WPSEO_Admin_Asset $script ) { $url, $script->get_deps(), $script->get_version(), - $args + $args, ); if ( in_array( 'wp-i18n', $script->get_deps(), true ) ) { @@ -123,7 +121,7 @@ public function register_style( WPSEO_Admin_Asset $style ) { $this->get_url( $style, WPSEO_Admin_Asset::TYPE_CSS ), $style->get_deps(), $style->get_version(), - $style->get_media() + $style->get_media(), ); } @@ -348,7 +346,7 @@ protected function scripts_to_be_registered() { 'ext_length' => 3, 'additional_deps' => $additional_dependencies, 'header_scripts' => $header_scripts, - ] + ], ); $external_scripts = $this->load_generated_asset_file( [ @@ -358,7 +356,7 @@ protected function scripts_to_be_registered() { 'base_dir' => 'externals/', 'additional_deps' => $additional_dependencies, 'header_scripts' => $header_scripts, - ] + ], ); $language_scripts = $this->load_generated_asset_file( [ @@ -368,7 +366,7 @@ protected function scripts_to_be_registered() { 'base_dir' => 'languages/', 'additional_deps' => $additional_dependencies, 'header_scripts' => $header_scripts, - ] + ], ); $renamed_scripts = $this->load_renamed_scripts(); @@ -376,7 +374,7 @@ protected function scripts_to_be_registered() { $plugin_scripts, $external_scripts, $language_scripts, - $renamed_scripts + $renamed_scripts, ); $scripts['installation-success'] = [ @@ -404,7 +402,7 @@ static function ( $dep ) { } return $dep; }, - $scripts['post-edit']['deps'] + $scripts['post-edit']['deps'], ), 'in_footer' => ! in_array( 'post-edit-classic', $header_scripts, true ), 'version' => $scripts['post-edit']['version'], @@ -477,7 +475,7 @@ protected function load_generated_asset_file( $args ) { 'additional_deps' => [], 'base_dir' => '', 'header_scripts' => [], - ] + ], ); $scripts = []; $assets = require $args['asset_file']; diff --git a/admin/class-admin-editor-specific-replace-vars.php b/admin/class-admin-editor-specific-replace-vars.php index 781ce099929..ffbddfa42ef 100644 --- a/admin/class-admin-editor-specific-replace-vars.php +++ b/admin/class-admin-editor-specific-replace-vars.php @@ -41,12 +41,12 @@ class WPSEO_Admin_Editor_Specific_Replace_Vars { public function __construct() { $this->add_for_page_types( [ 'page', 'post', 'custom_post_type' ], - WPSEO_Custom_Fields::get_custom_fields() + WPSEO_Custom_Fields::get_custom_fields(), ); $this->add_for_page_types( [ 'post', 'term-in-custom-taxonomy' ], - WPSEO_Custom_Taxonomies::get_custom_taxonomies() + WPSEO_Custom_Taxonomies::get_custom_taxonomies(), ); } @@ -63,7 +63,7 @@ public function get() { */ $replacement_variables = apply_filters( 'wpseo_editor_specific_replace_vars', - $this->replacement_variables + $this->replacement_variables, ); if ( ! is_array( $replacement_variables ) ) { @@ -85,7 +85,7 @@ public function get() { public function get_generic( $replacement_variables ) { $shared_variables = array_diff( $this->extract_names( $replacement_variables ), - $this->get_unique_replacement_variables() + $this->get_unique_replacement_variables(), ); return array_values( $shared_variables ); diff --git a/admin/class-admin-gutenberg-compatibility-notification.php b/admin/class-admin-gutenberg-compatibility-notification.php index 8f521de3f4a..718569a1950 100644 --- a/admin/class-admin-gutenberg-compatibility-notification.php +++ b/admin/class-admin-gutenberg-compatibility-notification.php @@ -88,7 +88,7 @@ protected function add_notification() { __( '%1$s detected you are using version %2$s of %3$s, please update to the latest version to prevent compatibility issues.', 'wordpress-seo' ), 'Yoast SEO', $this->compatibility_checker->get_installed_version(), - 'Gutenberg' + 'Gutenberg', ); $notification = new Yoast_Notification( @@ -97,7 +97,7 @@ protected function add_notification() { 'id' => $this->notification_id, 'type' => $level, 'priority' => 1, - ] + ], ); $this->notification_center->add_notification( $notification ); diff --git a/admin/class-admin-help-panel.php b/admin/class-admin-help-panel.php index 6fdb6c2f0ca..5fbb4b05c00 100644 --- a/admin/class-admin-help-panel.php +++ b/admin/class-admin-help-panel.php @@ -70,7 +70,7 @@ public function get_button_html() { return sprintf( ' ', esc_attr( $this->id ), - $this->help_button_text + $this->help_button_text, ); } @@ -98,7 +98,7 @@ public function get_panel_html() { $wrapper_start, esc_attr( $this->id ), $this->help_content, - $wrapper_end + $wrapper_end, ); } } diff --git a/admin/class-admin-init.php b/admin/class-admin-init.php index dbd3a983bc2..0856250a5c7 100644 --- a/admin/class-admin-init.php +++ b/admin/class-admin-init.php @@ -306,7 +306,7 @@ public function show_hook_deprecation_warnings() { // Determine which filters have been registered. $deprecated_notices = array_intersect( array_keys( $deprecated_filters ), - array_keys( $wp_filter ) + array_keys( $wp_filter ), ); // Show notice for each deprecated filter or action that has been registered. @@ -316,7 +316,7 @@ public function show_hook_deprecation_warnings() { _deprecated_hook( $deprecated_filter, 'WPSEO ' . $deprecation_info['version'], - $deprecation_info['alternative'] + $deprecation_info['alternative'], ); // phpcs:enable } @@ -347,11 +347,11 @@ public function permalink_settings_notice() { /* translators: %1$s and %2$s expand to items to emphasize the word in the middle. */ esc_html__( 'Changing your permalinks settings can seriously impact your search engine visibility. It should almost %1$s never %2$s be done on a live website.', 'wordpress-seo' ), '', - '' + '', ), esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/why-permalinks/' ) ), // The link's content. - esc_html__( 'Learn about why permalinks are important for SEO.', 'wordpress-seo' ) + esc_html__( 'Learn about why permalinks are important for SEO.', 'wordpress-seo' ), ); } } diff --git a/admin/class-admin-utils.php b/admin/class-admin-utils.php index 4e3baa1aa95..53966320005 100644 --- a/admin/class-admin-utils.php +++ b/admin/class-admin-utils.php @@ -24,7 +24,7 @@ public static function get_install_url( $slug ) { return wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . dirname( $slug ) ), - 'install-plugin_' . dirname( $slug ) + 'install-plugin_' . dirname( $slug ), ); } @@ -42,7 +42,7 @@ public static function get_activation_url( $slug ) { return wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin_status=all&paged=1&s&plugin=' . $slug ), - 'activate-plugin_' . $slug + 'activate-plugin_' . $slug, ); } @@ -63,7 +63,7 @@ public static function get_install_link( $plugin ) { return sprintf( '%s', $install_url, - $plugin['title'] + $plugin['title'], ); } @@ -76,7 +76,7 @@ public static function get_new_tab_message() { return sprintf( '%s', /* translators: Hidden accessibility text. */ - esc_html__( '(Opens in a new browser tab)', 'wordpress-seo' ) + esc_html__( '(Opens in a new browser tab)', 'wordpress-seo' ), ); } } diff --git a/admin/class-admin.php b/admin/class-admin.php index 043ff2f3f31..825960ec56c 100644 --- a/admin/class-admin.php +++ b/admin/class-admin.php @@ -95,7 +95,7 @@ public function __construct() { $integrations = array_merge( $integrations, $this->get_admin_features(), - $this->initialize_cornerstone_content() + $this->initialize_cornerstone_content(), ); foreach ( $integrations as $integration ) { @@ -246,7 +246,7 @@ public function add_action_link( $links, $file ) { $no_deactivation_explanation = '' . sprintf( /* translators: %s expands to Yoast SEO Premium. */ __( 'Required by %s', 'wordpress-seo' ), - 'Yoast SEO Premium' + 'Yoast SEO Premium', ) . ''; array_unshift( $links, $no_deactivation_explanation ); @@ -348,14 +348,14 @@ private function localize_admin_global_script() { /* translators: %1$s: '%%term_title%%' variable used in titles and meta's template that's not compatible with the given template, %2$s: expands to 'HelpScout beacon' */ __( 'Warning: the variable %1$s cannot be used in this template. See the %2$s for more info.', 'wordpress-seo' ), '%s', - 'HelpScout beacon' + 'HelpScout beacon', ), /* translators: %s: expends to Yoast SEO */ 'help_video_iframe_title' => sprintf( __( '%s video tutorial', 'wordpress-seo' ), 'Yoast SEO' ), 'scrollable_table_hint' => __( 'Scroll to see the table content.', 'wordpress-seo' ), 'wincher_is_logged_in' => WPSEO_Options::get( 'wincher_integration_active', true ) ? YoastSEO()->helpers->wincher->login_status() : false, ], - YoastSEO()->helpers->wincher->get_admin_global_links() + YoastSEO()->helpers->wincher->get_admin_global_links(), ); } diff --git a/admin/class-bulk-description-editor-list-table.php b/admin/class-bulk-description-editor-list-table.php index 3b65304b030..0138415aa15 100644 --- a/admin/class-bulk-description-editor-list-table.php +++ b/admin/class-bulk-description-editor-list-table.php @@ -65,7 +65,7 @@ protected function parse_page_specific_column( $column_name, $record, $attribute return sprintf( '', esc_attr( 'wpseo-new-metadesc-' . $record->ID ), - esc_attr( $record->ID ) + esc_attr( $record->ID ), ); case 'col_existing_yoast_seo_metadesc': diff --git a/admin/class-bulk-editor-list-table.php b/admin/class-bulk-editor-list-table.php index 419885814d7..aa155c62db8 100644 --- a/admin/class-bulk-editor-list-table.php +++ b/admin/class-bulk-editor-list-table.php @@ -132,7 +132,7 @@ public function __construct( $args = [] ) { [ 'nonce' => '', 'input_fields' => [], - ] + ], ); $this->input_fields = $args['input_fields']; @@ -178,7 +178,7 @@ protected function populate_editable_post_types() { 'public' => true, 'exclude_from_search' => false, ], - 'object' + 'object', ); $this->all_posts = []; @@ -297,8 +297,8 @@ public function get_views() { WHERE post_status IN (" . implode( ', ', array_fill( 0, count( $states ), '%s' ) ) . ')', - $states - ) + $states, + ), ); $post_status = isset( $_GET['post_status'] ) && is_string( $_GET['post_status'] ) ? sanitize_text_field( wp_unslash( $_GET['post_status'] ) ) : ''; @@ -306,7 +306,7 @@ public function get_views() { $localized_text = sprintf( /* translators: %s expands to the number of posts in localized format. */ _nx( 'All (%s)', 'All (%s)', $total_posts, 'posts', 'wordpress-seo' ), - number_format_i18n( $total_posts ) + number_format_i18n( $total_posts ), ); $status_links['all'] = '' . $localized_text . ''; @@ -323,8 +323,8 @@ public function get_views() { SELECT COUNT(ID) FROM {$subquery} WHERE post_status = %s ", - $status_name - ) + $status_name, + ), ); if ( $total === 0 ) { @@ -344,7 +344,7 @@ public function get_views() { $trashed_posts = $wpdb->get_var( "SELECT COUNT(ID) FROM {$subquery} WHERE post_status IN ('trash') - " + ", ); $current_link_attributes = ''; @@ -355,7 +355,7 @@ public function get_views() { $localized_text = sprintf( /* translators: %s expands to the number of trashed posts in localized format. */ _nx( 'Trash (%s)', 'Trash (%s)', $trashed_posts, 'posts', 'wordpress-seo' ), - number_format_i18n( $trashed_posts ) + number_format_i18n( $trashed_posts ), ); $status_links['trash'] = '' . $localized_text . ''; @@ -377,7 +377,7 @@ public function extra_tablenav( $which ) { [ 'public' => true, 'exclude_from_search' => false, - ] + ], ); $instance_type = esc_attr( $this->page_type ); @@ -401,8 +401,8 @@ public function extra_tablenav( $which ) { WHERE post_status IN (" . implode( ', ', array_fill( 0, count( $states ), '%s' ) ) . ') ORDER BY post_type ASC', - $states - ) + $states, + ), ); $post_type_filter = isset( $_GET['post_type_filter'] ) && is_string( $_GET['post_type_filter'] ) ? sanitize_text_field( wp_unslash( $_GET['post_type_filter'] ) ) : ''; @@ -417,7 +417,7 @@ public function extra_tablenav( $which ) { '', esc_html( $obj->labels->name ), esc_attr( $post_type->post_type ), - selected( $selected, $post_type->post_type, false ) + selected( $selected, $post_type->post_type, false ), ); } } @@ -426,13 +426,13 @@ public function extra_tablenav( $which ) { '', esc_attr( 'post-type-filter-' . $instance_type ), /* translators: Hidden accessibility text. */ - esc_html__( 'Filter by content type', 'wordpress-seo' ) + esc_html__( 'Filter by content type', 'wordpress-seo' ), ); printf( '', // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: $options is properly escaped above. $options, - esc_attr( 'post-type-filter-' . $instance_type ) + esc_attr( 'post-type-filter-' . $instance_type ), ); submit_button( esc_html__( 'Filter', 'wordpress-seo' ), 'button', false, false, [ 'id' => 'post-query-submit' ] ); @@ -565,7 +565,7 @@ protected function count_items( $subquery, $all_states, $post_type_clause ) { "SELECT COUNT(ID) FROM {$subquery} WHERE post_status IN ({$all_states}) {$post_type_clause} - " + ", ); } @@ -617,7 +617,7 @@ protected function set_pagination( $total_items ) { 'total_items' => $total_items, 'total_pages' => ceil( $total_items / $per_page ), 'per_page' => $per_page, - ] + ], ); $this->pagination = [ @@ -714,8 +714,8 @@ protected function get_items( $query ) { $wpdb->prepare( $query, $this->pagination['offset'], - $this->pagination['per_page'] - ) + $this->pagination['per_page'], + ), ); } @@ -743,7 +743,7 @@ protected function get_all_states() { return $wpdb->prepare( implode( ', ', array_fill( 0, count( $states ), '%s' ) ), - $states + $states, ); } @@ -841,7 +841,7 @@ protected function parse_page_title_column( $rec ) { esc_url( get_edit_post_link( $rec->ID, true ) ), /* translators: Hidden accessibility text; %s: post title. */ esc_attr( sprintf( __( 'Edit “%s”', 'wordpress-seo' ), $title ) ), - __( 'Edit', 'wordpress-seo' ) + __( 'Edit', 'wordpress-seo' ), ); } @@ -853,7 +853,7 @@ protected function parse_page_title_column( $rec ) { esc_url( add_query_arg( 'preview', 'true', get_permalink( $rec->ID ) ) ), /* translators: Hidden accessibility text; %s: post title. */ esc_attr( sprintf( __( 'Preview “%s”', 'wordpress-seo' ), $title ) ), - __( 'Preview', 'wordpress-seo' ) + __( 'Preview', 'wordpress-seo' ), ); } } @@ -863,7 +863,7 @@ protected function parse_page_title_column( $rec ) { esc_url( get_permalink( $rec->ID ) ), /* translators: Hidden accessibility text; %s: post title. */ esc_attr( sprintf( __( 'View “%s”', 'wordpress-seo' ), $title ) ), - __( 'View', 'wordpress-seo' ) + __( 'View', 'wordpress-seo' ), ); } } @@ -919,7 +919,7 @@ protected function parse_column( $column_name, $rec ) { '%2$s %3$s', $rec->ID, esc_html__( 'Save', 'wordpress-seo' ), - esc_html__( 'Save all', 'wordpress-seo' ) + esc_html__( 'Save all', 'wordpress-seo' ), ); break; } @@ -1000,7 +1000,7 @@ protected function get_meta_data_result( array $post_ids ) { $where = $wpdb->prepare( 'post_id IN (' . implode( ', ', array_fill( 0, count( $post_ids ), '%d' ) ) . ')', - $post_ids + $post_ids, ); $where .= $wpdb->prepare( ' AND meta_key = %s', WPSEO_Meta::$meta_prefix . $this->target_db_field ); @@ -1039,7 +1039,7 @@ protected function merge_columns( $columns = [] ) { 'col_post_date' => __( 'Publication date', 'wordpress-seo' ), 'col_page_slug' => __( 'Page URL/Slug', 'wordpress-seo' ), ], - $columns + $columns, ); $columns['col_row_action'] = __( 'Action', 'wordpress-seo' ); diff --git a/admin/class-bulk-title-editor-list-table.php b/admin/class-bulk-title-editor-list-table.php index 5314fdb52d0..a523e26ba9d 100644 --- a/admin/class-bulk-title-editor-list-table.php +++ b/admin/class-bulk-title-editor-list-table.php @@ -80,7 +80,7 @@ protected function parse_page_specific_column( $column_name, $record, $attribute return sprintf( '', 'wpseo-new-title-' . $record->ID, - $record->ID + $record->ID, ); } diff --git a/admin/class-config.php b/admin/class-config.php index 609298e1a3a..bef7e30181b 100644 --- a/admin/class-config.php +++ b/admin/class-config.php @@ -63,7 +63,7 @@ public function init() { Plans_Page_Integration::PAGE, Redirects_Page_Integration::PAGE, ], - true + true, ); $new_dashboard_page = ( $page === General_Page_Integration::PAGE && ! is_network_admin() ); if ( $page_exceptions || $new_dashboard_page ) { diff --git a/admin/class-database-proxy.php b/admin/class-database-proxy.php index b9ddcbea873..063f58468c5 100644 --- a/admin/class-database-proxy.php +++ b/admin/class-database-proxy.php @@ -147,14 +147,14 @@ public function upsert( array $data, ?array $where = null, $format = null, $wher $this->get_table_name(), implode( ', ', $keys ), implode( ', ', array_fill( 0, count( $data ), '%s' ) ), - implode( ', ', $update ) + implode( ', ', $update ), ); $result = $this->database->query( $this->database->prepare( $query, - array_values( $data ) - ) + array_values( $data ), + ), ); $this->post_execution(); @@ -210,7 +210,7 @@ public function create_table( array $columns, array $indexes = [] ) { 'CREATE TABLE IF NOT EXISTS %1$s ( %2$s ) %3$s', $this->get_table_name(), implode( ',', array_merge( $columns, $indexes ) ), - $this->database->get_charset_collate() + $this->database->get_charset_collate(), ); $this->pre_execution(); diff --git a/admin/class-export.php b/admin/class-export.php index 6e769b046e0..a9fee859577 100644 --- a/admin/class-export.php +++ b/admin/class-export.php @@ -60,12 +60,12 @@ public function output() { /* translators: %1$s expands to Import settings */ esc_html__( 'Copy all these settings to another site\'s %1$s tab and click "%1$s" there.', - 'wordpress-seo' + 'wordpress-seo', ), esc_html__( 'Import settings', - 'wordpress-seo' - ) + 'wordpress-seo', + ), ); echo '

'; /* translators: %1$s expands to Yoast SEO */ @@ -96,7 +96,7 @@ private function export_header() { /* translators: %1$s expands to Yoast SEO, %2$s expands to Yoast.com */ esc_html__( 'These are settings for the %1$s plugin by %2$s', 'wordpress-seo' ), 'Yoast SEO', - 'Yoast.com' + 'Yoast.com', ); $this->write_line( '; ' . $header ); } diff --git a/admin/class-meta-columns.php b/admin/class-meta-columns.php index 43cf334a628..14ffecf8d72 100644 --- a/admin/class-meta-columns.php +++ b/admin/class-meta-columns.php @@ -418,14 +418,14 @@ protected function collect_filters() { if ( $this->is_valid_filter( $seo_filter ) ) { $active_filters = array_merge( $active_filters, - $this->determine_seo_filters( $seo_filter ) + $this->determine_seo_filters( $seo_filter ), ); } if ( $this->is_valid_filter( $readability_filter ) ) { $active_filters = array_merge( $active_filters, - $this->determine_readability_filters( $readability_filter ) + $this->determine_readability_filters( $readability_filter ), ); } @@ -441,13 +441,13 @@ protected function collect_filters() { $keyphrase_filter = apply_filters( 'wpseo_change_keyphrase_filter_in_request', $this->get_keyword_filter( $current_keyword_filter ), - $current_keyword_filter + $current_keyword_filter, ); if ( is_array( $keyphrase_filter ) ) { $active_filters = array_merge( $active_filters, - [ $keyphrase_filter ] + [ $keyphrase_filter ], ); } } diff --git a/admin/class-my-yoast-proxy.php b/admin/class-my-yoast-proxy.php index a30f5c85d4c..0b708dc7949 100644 --- a/admin/class-my-yoast-proxy.php +++ b/admin/class-my-yoast-proxy.php @@ -66,7 +66,7 @@ public function handle_proxy_page() { $this->render_proxy_page(); // Prevent the WordPress UI from loading. - exit; + exit(); } /** diff --git a/admin/class-option-tabs-formatter.php b/admin/class-option-tabs-formatter.php index 5a54266fc64..b59f6780d9f 100644 --- a/admin/class-option-tabs-formatter.php +++ b/admin/class-option-tabs-formatter.php @@ -50,7 +50,7 @@ public function run( WPSEO_Option_Tabs $option_tabs ) { esc_attr( $tab->get_name() . '-tab' ), esc_url( '#top#' . $tab->get_name() ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: we do this on purpose - $label + $label, ); } echo ''; diff --git a/admin/class-plugin-availability.php b/admin/class-plugin-availability.php index 8ed9491423c..9a553f4663b 100644 --- a/admin/class-plugin-availability.php +++ b/admin/class-plugin-availability.php @@ -43,7 +43,7 @@ protected function register_yoast_plugins() { 'description' => sprintf( /* translators: %1$s expands to Yoast SEO */ __( 'The premium version of %1$s with more features & support.', 'wordpress-seo' ), - 'Yoast SEO' + 'Yoast SEO', ), 'installed' => false, 'slug' => 'wordpress-seo-premium/wp-seo-premium.php', @@ -87,7 +87,7 @@ protected function register_yoast_plugins() { 'description' => sprintf( /* translators: %1$s expands to Yoast SEO */ __( 'Seamlessly integrate WooCommerce with %1$s and get extra features!', 'wordpress-seo' ), - 'Yoast SEO' + 'Yoast SEO', ), '_dependencies' => [ 'WooCommerce' => [ diff --git a/admin/class-premium-upsell-admin-block.php b/admin/class-premium-upsell-admin-block.php index 0eb90bca60b..af364e4bbcd 100644 --- a/admin/class-premium-upsell-admin-block.php +++ b/admin/class-premium-upsell-admin-block.php @@ -80,7 +80,7 @@ public function render() { '%3$s', esc_attr( 'wpseo-' . $this->identifier . '-popup-button' ), esc_url( $url ), - $button_text + $button_text, ); echo '
'; @@ -129,7 +129,7 @@ protected function get_argument_html( $argument ) { '
  • %3$s
  • ', esc_url( $assets_uri . 'packages/js/images/icon-check-circle-green.svg' ), esc_attr( $class . '--argument' ), - $argument + $argument, ); } @@ -179,7 +179,7 @@ private function get_header( bool $is_woocommerce_active ) { $header_text = sprintf( /* translators: %s expands to Yoast WooCommerce SEO */ esc_html__( 'Upgrade to %s', 'wordpress-seo' ), - 'Yoast WooCommerce SEO' + 'Yoast WooCommerce SEO', ); $header_icon = sprintf( '', @@ -190,12 +190,12 @@ private function get_header( bool $is_woocommerce_active ) { $header_text = sprintf( /* translators: %s expands to Yoast SEO Premium*/ esc_html__( 'Upgrade to %s', 'wordpress-seo' ), - 'Yoast SEO Premium' + 'Yoast SEO Premium', ); $header_icon = sprintf( '', - esc_url( $assets_uri . 'packages/js/images/icon-crown.svg' ) + esc_url( $assets_uri . 'packages/js/images/icon-crown.svg' ), ); } return [ $header_text, $header_icon ]; diff --git a/admin/class-primary-term-admin.php b/admin/class-primary-term-admin.php index 85c0c888e2c..a368551b533 100644 --- a/admin/class-primary-term-admin.php +++ b/admin/class-primary-term-admin.php @@ -68,7 +68,7 @@ protected function primary_term_field( $taxonomy_name ) { '', esc_attr( $this->generate_field_id( $taxonomy_name ) ), esc_attr( $this->generate_field_name( $taxonomy_name ) ), - esc_attr( $this->get_primary_term( $taxonomy_name ) ) + esc_attr( $this->get_primary_term( $taxonomy_name ) ), ); } @@ -159,9 +159,7 @@ protected function get_primary_term( $taxonomy_name ) { * @return array */ protected function get_primary_term_taxonomies( $post_id = null ) { - if ( $post_id === null ) { - $post_id = $this->get_current_id(); - } + $post_id ??= $this->get_current_id(); $taxonomies = wp_cache_get( 'primary_term_taxonomies_' . $post_id, 'wpseo' ); if ( $taxonomies !== false ) { @@ -239,7 +237,7 @@ private function map_taxonomies_for_js( $taxonomy ) { 'taxonomy' => $taxonomy->name, 'update_term_meta_cache' => false, 'fields' => 'id=>name', - ] + ], ); $mapped_terms_for_js = []; diff --git a/admin/class-product-upsell-notice.php b/admin/class-product-upsell-notice.php index e5149c179ab..bd16e6e09a3 100644 --- a/admin/class-product-upsell-notice.php +++ b/admin/class-product-upsell-notice.php @@ -84,7 +84,7 @@ public function dismiss_notice_listener() { $this->dismiss_notice(); if ( wp_safe_redirect( admin_url( 'admin.php?page=wpseo_dashboard' ) ) ) { - exit; + exit(); } } @@ -148,7 +148,7 @@ protected function get_premium_upsell_section() { /* translators: %1$s expands anchor to premium plugin page, %2$s expands to */ __( 'By the way, did you know we also have a %1$sPremium plugin%2$s? It offers advanced features, like a redirect manager and support for multiple keyphrases. It also comes with 24/7 personal support.', 'wordpress-seo' ), "", - '' + '', ); } @@ -166,14 +166,14 @@ protected function get_notification() { __( 'We\'ve noticed you\'ve been using %1$s for some time now; we hope you love it! We\'d be thrilled if you could %2$sgive us a 5 stars rating on WordPress.org%3$s!', 'wordpress-seo' ), 'Yoast SEO', '', - '' + '', ) . "\n\n"; $message .= sprintf( /* translators: %1$s is a link start tag to the bugreport guidelines on the Yoast help center, %2$s is the link closing tag. */ __( 'If you are experiencing issues, %1$splease file a bug report%2$s and we\'ll do our best to help you out.', 'wordpress-seo' ), '', - '' + '', ) . "\n\n"; $message .= $this->get_premium_upsell_section() . "\n\n"; @@ -187,7 +187,7 @@ protected function get_notification() { 'id' => 'wpseo-upsell-notice', 'capabilities' => 'wpseo_manage_options', 'priority' => 0.8, - ] + ], ); return $notification; diff --git a/admin/class-schema-person-upgrade-notification.php b/admin/class-schema-person-upgrade-notification.php index c2332c4e543..2bf01677af1 100644 --- a/admin/class-schema-person-upgrade-notification.php +++ b/admin/class-schema-person-upgrade-notification.php @@ -65,7 +65,7 @@ protected function get_notification() { /* translators: %1$s is a link start tag to the Search Appearance settings, %2$s is the link closing tag. */ __( 'You have previously set your site to represent a person. We’ve improved our functionality around Schema and the Knowledge Graph, so you should go in and %1$scomplete those settings%2$s.', 'wordpress-seo' ), '', - '' + '', ); $notification = new Yoast_Notification( @@ -75,7 +75,7 @@ protected function get_notification() { 'id' => 'wpseo-schema-person-upgrade', 'capabilities' => 'wpseo_manage_options', 'priority' => 0.8, - ] + ], ); return $notification; diff --git a/admin/class-suggested-plugins.php b/admin/class-suggested-plugins.php index 2d937be190e..708eac83af0 100644 --- a/admin/class-suggested-plugins.php +++ b/admin/class-suggested-plugins.php @@ -95,7 +95,7 @@ protected function get_yoast_seo_suggested_plugins_notification( $notification_i 'id' => $notification_id, 'type' => Yoast_Notification::WARNING, 'capabilities' => [ 'install_plugins' ], - ] + ], ); } @@ -117,7 +117,7 @@ protected function create_install_suggested_plugin_message( $suggested_plugin ) $install_link, '', $this->create_more_information_link( $suggested_plugin['url'], $suggested_plugin['title'] ), - '' + '', ); } @@ -134,7 +134,7 @@ protected function create_more_information_link( $url, $name ) { '', $url, /* translators: Hidden accessibility text; %1$s expands to the dependency name */ - sprintf( __( 'More information about %1$s', 'wordpress-seo' ), $name ) + sprintf( __( 'More information about %1$s', 'wordpress-seo' ), $name ), ); } } diff --git a/admin/class-wincher-dashboard-widget.php b/admin/class-wincher-dashboard-widget.php index 5f9c793be87..90faf1da8be 100644 --- a/admin/class-wincher-dashboard-widget.php +++ b/admin/class-wincher-dashboard-widget.php @@ -56,7 +56,7 @@ public function add_wincher_dashboard_widget() { 'wpseo-wincher-dashboard-overview', /* translators: %1$s expands to Yoast SEO, %2$s to Wincher */ sprintf( __( '%1$s / %2$s: Top Keyphrases', 'wordpress-seo' ), 'Yoast SEO', 'Wincher' ), - [ $this, 'display_wincher_dashboard_widget' ] + [ $this, 'display_wincher_dashboard_widget' ], ); } diff --git a/admin/class-yoast-columns.php b/admin/class-yoast-columns.php index 989f87b87cf..bf17dcc1d24 100644 --- a/admin/class-yoast-columns.php +++ b/admin/class-yoast-columns.php @@ -34,7 +34,7 @@ public function add_help_tab() { $help_tab_content = sprintf( /* translators: %1$s: Yoast SEO */ __( '%1$s adds several columns to this page.', 'wordpress-seo' ), - 'Yoast SEO' + 'Yoast SEO', ); if ( $meta_columns_present ) { @@ -42,7 +42,7 @@ public function add_help_tab() { /* translators: %1$s: Link to article about content analysis, %2$s: Anchor closing */ __( 'We\'ve written an article about %1$show to use the SEO score and Readability score%2$s.', 'wordpress-seo' ), '', - '' + '', ); } @@ -53,7 +53,7 @@ public function add_help_tab() { '', '', '', - '' + '', ); } @@ -65,7 +65,7 @@ public function add_help_tab() { 'id' => 'yst-columns', 'content' => '

    ' . $help_tab_content . '

    ', 'priority' => 15, - ] + ], ); } diff --git a/admin/class-yoast-dashboard-widget.php b/admin/class-yoast-dashboard-widget.php index 7b07fd99b78..dfbcb501371 100644 --- a/admin/class-yoast-dashboard-widget.php +++ b/admin/class-yoast-dashboard-widget.php @@ -37,9 +37,7 @@ class Yoast_Dashboard_Widget implements WPSEO_WordPress_Integration { * @param WPSEO_Statistics|null $statistics WPSEO_Statistics instance. */ public function __construct( ?WPSEO_Statistics $statistics = null ) { - if ( $statistics === null ) { - $statistics = new WPSEO_Statistics(); - } + $statistics ??= new WPSEO_Statistics(); $this->statistics = $statistics; $this->asset_manager = new WPSEO_Admin_Asset_Manager(); @@ -77,7 +75,7 @@ public function add_dashboard_widget() { 'wpseo-dashboard-overview', /* translators: %s is the plugin name */ sprintf( __( '%s Posts Overview', 'wordpress-seo' ), 'Yoast SEO' ), - [ $this, 'display_dashboard_widget' ] + [ $this, 'display_dashboard_widget' ], ); } @@ -128,7 +126,7 @@ public function localize_dashboard_script() { 'feed_header' => sprintf( /* translators: %1$s resolves to Yoast.com */ __( 'Latest blog posts on %1$s', 'wordpress-seo' ), - 'Yoast.com' + 'Yoast.com', ), 'feed_footer' => __( 'Read more like this on our SEO blog', 'wordpress-seo' ), 'wp_version' => substr( $GLOBALS['wp_version'], 0, 3 ) . '-' . ( is_plugin_active( 'classic-editor/classic-editor.php' ) ? '1' : '0' ), diff --git a/admin/class-yoast-form.php b/admin/class-yoast-form.php index 70788914112..1bf22c66708 100644 --- a/admin/class-yoast-form.php +++ b/admin/class-yoast-form.php @@ -328,13 +328,13 @@ public function checkbox_list( $variable, $labels, $attr = [] ) { esc_attr( $this->option_name . '[' . $variable . '][' . $name . ']' ), checked( ! empty( $values[ $name ] ), true, false ), esc_attr( $name ), - disabled( ( isset( $attr['disabled'] ) && $attr['disabled'] ), true, false ) + disabled( ( isset( $attr['disabled'] ) && $attr['disabled'] ), true, false ), ); printf( '', esc_attr( $variable . '-' . $name ), // #1 - esc_html( $label ) + esc_html( $label ), ); echo '
    '; } @@ -379,7 +379,7 @@ public function light_switch( $variable, $label, $buttons = [], $reverse = true, $reverse, $help, $strong, - $disabled_attribute + $disabled_attribute, ); // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: All output is properly escaped or hardcoded in the presenter. @@ -424,7 +424,7 @@ public function textinput( $variable, $label, $attr = [] ) { [ 'for' => $variable, 'class' => 'textinput', - ] + ], ); $aria_attributes = Yoast_Input_Validation::get_the_aria_invalid_attribute( $variable ); @@ -465,7 +465,7 @@ public function number( $variable, $label, $attr = [] ) { [ 'for' => $variable, 'class' => 'textinput ' . $attr['class'], - ] + ], ); $aria_attributes = Yoast_Input_Validation::get_the_aria_invalid_attribute( $variable ); @@ -510,7 +510,7 @@ public function textinput_extra_content( $variable, $label, $attr = [] ) { [ 'for' => $variable, 'class' => $attr['class'] . '--label', - ] + ], ); if ( isset( $attr['extra_content'] ) ) { @@ -533,7 +533,7 @@ public function textinput_extra_content( $variable, $label, $attr = [] ) { isset( $attr['autocomplete'] ) ? ' autocomplete="' . esc_attr( $attr['autocomplete'] ) . '"' : '', $aria_attributes, esc_attr( $val ), - $this->get_disabled_attribute( $variable, $attr ) + $this->get_disabled_attribute( $variable, $attr ), ); // phpcs:enable // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: output is properly escaped. @@ -572,7 +572,7 @@ public function textarea( $variable, $label, $attr = [] ) { [ 'for' => $variable, 'class' => 'textinput', - ] + ], ); $disabled_attribute = $this->get_disabled_attribute( $variable, $attr ); @@ -593,9 +593,7 @@ public function textarea( $variable, $label, $attr = [] ) { * @return void */ public function hidden( $variable, $id = '', $val = null ) { - if ( $val === null ) { - $val = $this->get_field_value( $variable, '' ); - } + $val ??= $this->get_field_value( $variable, '' ); if ( is_bool( $val ) ) { $val = ( $val === true ) ? 'true' : 'false'; @@ -639,7 +637,7 @@ public function select( $variable, $label, array $select_options, $styled = 'uns [ 'for' => $variable, 'class' => 'select', - ] + ], ); echo $help; // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: The help contains HTML. } @@ -702,7 +700,7 @@ public function file_upload( $variable, $label, $attr = [] ) { [ 'for' => $variable, 'class' => 'select', - ] + ], ); $disabled_attribute = $this->get_disabled_attribute( $variable, $attr ); @@ -751,7 +749,7 @@ public function media_input( $variable, $label, $attr = [] ) { [ 'for' => 'wpseo_' . $variable, 'class' => 'select', - ] + ], ); $id_field_id = 'wpseo_' . $var_esc . '_id'; @@ -838,7 +836,7 @@ public function radio( $variable, $values, $legend = '', $legend_attr = [], $att 'for' => $var_esc . '-' . $key_esc, 'class' => 'radio', 'aria_label' => $aria_label, - ] + ], ); } echo ''; @@ -969,10 +967,10 @@ public function index_switch( $variable, $label, $help = '', $attr = [] ) { sprintf( /* translators: %s expands to an indexable object's name, like a post type or taxonomy */ esc_html__( 'Show %s in search results?', 'wordpress-seo' ), - $label + $label, ), $help, - [ 'disabled' => $is_disabled ] + [ 'disabled' => $is_disabled ], ); } @@ -1008,7 +1006,7 @@ public function show_hide_switch( $variable, $label, $inverse_keys = false, $hel $show_hide_switch, $label, $help, - [ 'disabled' => $is_disabled ] + [ 'disabled' => $is_disabled ], ); } diff --git a/admin/class-yoast-input-validation.php b/admin/class-yoast-input-validation.php index 667ee78f1f9..ad1c261639b 100644 --- a/admin/class-yoast-input-validation.php +++ b/admin/class-yoast-input-validation.php @@ -64,7 +64,7 @@ public static function add_yoast_admin_document_title_errors( $admin_title ) { /* translators: %1$s: amount of errors, %2$s: the admin page title */ _n( 'The form contains %1$s error. %2$s', 'The form contains %1$s errors. %2$s', $error_count, 'wordpress-seo' ), number_format_i18n( $error_count ), - $admin_title + $admin_title, ); } diff --git a/admin/class-yoast-network-admin.php b/admin/class-yoast-network-admin.php index 01f8f2f30bd..cc4169878e7 100644 --- a/admin/class-yoast-network-admin.php +++ b/admin/class-yoast-network-admin.php @@ -210,7 +210,7 @@ public function enqueue_assets() { $asset_manager->localize_script( 'network-admin', 'wpseoNetworkAdminGlobalL10n', - $translations + $translations, ); } @@ -329,6 +329,6 @@ protected function redirect_back( $query_args = [] ) { } wp_safe_redirect( $sendback ); - exit; + exit(); } } diff --git a/admin/class-yoast-network-settings-api.php b/admin/class-yoast-network-settings-api.php index a573d141232..05c0d7e8f2f 100644 --- a/admin/class-yoast-network-settings-api.php +++ b/admin/class-yoast-network-settings-api.php @@ -155,9 +155,7 @@ public function meets_requirements() { */ public static function get() { - if ( self::$instance === null ) { - self::$instance = new self(); - } + self::$instance ??= new self(); return self::$instance; } diff --git a/admin/class-yoast-notification-center.php b/admin/class-yoast-notification-center.php index 3d6f422a679..974abcc1e45 100644 --- a/admin/class-yoast-notification-center.php +++ b/admin/class-yoast-notification-center.php @@ -90,9 +90,7 @@ private function __construct() { */ public static function get() { - if ( self::$instance === null ) { - self::$instance = new self(); - } + self::$instance ??= new self(); return self::$instance; } @@ -544,7 +542,7 @@ public function ajax_get_notifications() { $this->display_notifications( $echo ); // AJAX die. - exit; + exit(); } /** @@ -866,7 +864,7 @@ private function array_to_notification( $notification_data ) { return new Yoast_Notification( $notification_data['message'], - $notification_data['options'] + $notification_data['options'], ); } diff --git a/admin/class-yoast-notification.php b/admin/class-yoast-notification.php index 5c24b02fee7..f33adeaf6f8 100644 --- a/admin/class-yoast-notification.php +++ b/admin/class-yoast-notification.php @@ -359,9 +359,7 @@ public function render() { $message = $this->wrap_yoast_seo_icon( $this->message ); } - if ( $message === null ) { - $message = wpautop( $this->message ); - } + $message ??= wpautop( $this->message ); // Build the output DIV. return '
    ' . $message . '
    ' . PHP_EOL; @@ -388,7 +386,7 @@ private function wrap_yoast_seo_icon( $message ) { '', esc_url( plugin_dir_url( WPSEO_FILE ) . 'packages/js/images/Yoast_SEO_Icon.svg' ), 60, - 60 + 60, ); $out .= '
    '; $out .= $message; @@ -429,9 +427,7 @@ private function normalize_options( $options ) { } // Set to the id of the current user if not supplied. - if ( $options['user_id'] === null ) { - $options['user_id'] = get_current_user_id(); - } + $options['user_id'] ??= get_current_user_id(); return $options; } diff --git a/admin/class-yoast-notifications.php b/admin/class-yoast-notifications.php index c3847e01f43..87c41a8ec70 100644 --- a/admin/class-yoast-notifications.php +++ b/admin/class-yoast-notifications.php @@ -159,7 +159,7 @@ private function output_ajax_response( $type ) { [ 'html' => $html, 'total' => self::get_active_notification_count(), - ] + ], ); // phpcs:enable -- Reason: WPSEO_Utils::format_json_encode is safe. } diff --git a/admin/class-yoast-plugin-conflict.php b/admin/class-yoast-plugin-conflict.php index 838d8a70a73..48ab13f8b00 100644 --- a/admin/class-yoast-plugin-conflict.php +++ b/admin/class-yoast-plugin-conflict.php @@ -102,9 +102,7 @@ public function check_for_conflicts( $plugin_section ) { return false; } - if ( $sections_checked === null ) { - $sections_checked = []; - } + $sections_checked ??= []; if ( ! in_array( $plugin_section, $sections_checked, true ) ) { $sections_checked[] = $plugin_section; @@ -194,8 +192,8 @@ protected function set_error( $plugin_section, $readable_plugin_section ) { [ 'type' => Yoast_Notification::ERROR, 'id' => 'wpseo-conflict-' . $identifier, - ] - ) + ], + ), ); } } diff --git a/admin/exceptions/class-file-size-exception.php b/admin/exceptions/class-file-size-exception.php index 3deddbe215b..addbed6390d 100644 --- a/admin/exceptions/class-file-size-exception.php +++ b/admin/exceptions/class-file-size-exception.php @@ -21,7 +21,7 @@ public static function externally_hosted( $file_url ) { $message = sprintf( /* translators: %1$s expands to the requested url */ __( 'Cannot get the size of %1$s because it is hosted externally.', 'wordpress-seo' ), - $file_url + $file_url, ); return new self( $message ); @@ -38,7 +38,7 @@ public static function unknown_error( $file_url ) { $message = sprintf( /* translators: %1$s expands to the requested url */ __( 'Cannot get the size of %1$s because of unknown reasons.', 'wordpress-seo' ), - $file_url + $file_url, ); return new self( $message ); diff --git a/admin/filters/class-abstract-post-filter.php b/admin/filters/class-abstract-post-filter.php index 08232076870..6c772504ce2 100644 --- a/admin/filters/class-abstract-post-filter.php +++ b/admin/filters/class-abstract-post-filter.php @@ -95,7 +95,7 @@ public function enqueue_explanation_assets() { $asset_manager->localize_script( 'filter-explanation', 'yoastFilterExplanation', - [ 'text' => $explanation ] + [ 'text' => $explanation ], ); } @@ -112,7 +112,7 @@ public function add_filter_link( $views ) { esc_url( $this->get_filter_url() ), ( $this->is_filter_active() ) ? ' class="current" aria-current="page"' : '', $this->get_label(), - $this->get_post_total() + $this->get_post_total(), ); return $views; diff --git a/admin/filters/class-cornerstone-filter.php b/admin/filters/class-cornerstone-filter.php index 198312899d3..f57b6584c3c 100644 --- a/admin/filters/class-cornerstone-filter.php +++ b/admin/filters/class-cornerstone-filter.php @@ -51,7 +51,7 @@ public function filter_posts( $where ) { $where .= $wpdb->prepare( " AND {$wpdb->posts}.ID IN ( SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key = %s AND meta_value = '1' ) ", - WPSEO_Meta::$meta_prefix . self::META_NAME + WPSEO_Meta::$meta_prefix . self::META_NAME, ); } @@ -104,7 +104,7 @@ protected function get_explanation() { __( 'Mark the most important %1$s as \'cornerstone content\' to improve your site structure. %2$sLearn more about cornerstone content%3$s.', 'wordpress-seo' ), strtolower( $post_type_object->labels->name ), '', - '' + '', ); } @@ -124,8 +124,8 @@ protected function get_post_total() { meta_key = %s AND meta_value = '1' ", $this->get_current_post_type(), - WPSEO_Meta::$meta_prefix . self::META_NAME - ) + WPSEO_Meta::$meta_prefix . self::META_NAME, + ), ); } diff --git a/admin/google_search_console/views/gsc-display.php b/admin/google_search_console/views/gsc-display.php index 510831c2ed0..c11de080357 100644 --- a/admin/google_search_console/views/gsc-display.php +++ b/admin/google_search_console/views/gsc-display.php @@ -31,14 +31,14 @@ /* Translators: %1$s: expands to opening anchor tag, %2$s expands to closing anchor tag. */ __( 'Google has discontinued its Crawl Errors API. Therefore, any possible crawl errors you might have cannot be displayed here anymore. %1$sRead our statement on this for further information%2$s.', 'wordpress-seo' ), '', - WPSEO_Admin_Utils::get_new_tab_message() . '' + WPSEO_Admin_Utils::get_new_tab_message() . '', ); $gsc_notification .= '

    '; $gsc_notification .= sprintf( /* Translators: %1$s: expands to opening anchor tag, %2$s expands to closing anchor tag. */ __( 'To view your current crawl errors, %1$splease visit Google Search Console%2$s.', 'wordpress-seo' ), '', - WPSEO_Admin_Utils::get_new_tab_message() . '' + WPSEO_Admin_Utils::get_new_tab_message() . '', ); ?>
    diff --git a/admin/google_search_console/views/gsc-redirect-nopremium.php b/admin/google_search_console/views/gsc-redirect-nopremium.php index 2db6442beb2..39cd8ecbf05 100644 --- a/admin/google_search_console/views/gsc-redirect-nopremium.php +++ b/admin/google_search_console/views/gsc-redirect-nopremium.php @@ -13,7 +13,7 @@ printf( /* Translators: %s: expands to Yoast SEO Premium */ esc_html__( 'Creating redirects is a %s feature', 'wordpress-seo' ), - 'Yoast SEO Premium' + 'Yoast SEO Premium', ); echo ''; echo '

    '; @@ -21,7 +21,7 @@ /* Translators: %1$s: expands to 'Yoast SEO Premium', %2$s: links to Yoast SEO Premium plugin page. */ esc_html__( 'To be able to create a redirect and fix this issue, you need %1$s. You can buy the plugin, including one year of support and updates, on %2$s.', 'wordpress-seo' ), 'Yoast SEO Premium', - 'yoast.com' + 'yoast.com', ); echo '

    '; echo ''; diff --git a/admin/import/plugins/class-abstract-plugin-importer.php b/admin/import/plugins/class-abstract-plugin-importer.php index 6f5674f2f83..03b1b651b52 100644 --- a/admin/import/plugins/class-abstract-plugin-importer.php +++ b/admin/import/plugins/class-abstract-plugin-importer.php @@ -111,8 +111,8 @@ protected function cleanup() { $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->postmeta} WHERE meta_key LIKE %s", - $this->meta_key - ) + $this->meta_key, + ), ); $result = $wpdb->__get( 'result' ); if ( ! $result ) { @@ -161,8 +161,8 @@ protected function detect() { "SELECT COUNT(*) AS `count` FROM {$wpdb->postmeta} WHERE meta_key IN ( " . implode( ', ', array_fill( 0, count( $meta_keys ), '%s' ) ) . ' )', - $meta_keys - ) + $meta_keys, + ), ); if ( $result === '0' ) { @@ -189,8 +189,8 @@ protected function meta_key_clone( $old_key, $new_key, $replace_values = [] ) { $wpdb->prepare( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.SchemaChange -- This is intentional + temporary. "CREATE TEMPORARY TABLE tmp_meta_table SELECT * FROM {$wpdb->postmeta} WHERE meta_key = %s", - $old_key - ) + $old_key, + ), ); if ( $result === false ) { $this->set_missing_db_rights_status(); @@ -201,8 +201,8 @@ protected function meta_key_clone( $old_key, $new_key, $replace_values = [] ) { $wpdb->query( $wpdb->prepare( "DELETE FROM tmp_meta_table WHERE post_id IN ( SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key = %s )", - WPSEO_Meta::$meta_prefix . $new_key - ) + WPSEO_Meta::$meta_prefix . $new_key, + ), ); /* @@ -215,8 +215,8 @@ protected function meta_key_clone( $old_key, $new_key, $replace_values = [] ) { $wpdb->query( $wpdb->prepare( 'UPDATE tmp_meta_table SET meta_key = %s', - WPSEO_Meta::$meta_prefix . $new_key - ) + WPSEO_Meta::$meta_prefix . $new_key, + ), ); $this->meta_key_clone_replace( $replace_values ); @@ -320,8 +320,8 @@ protected function meta_key_clone_replace( $replace_values ) { $wpdb->prepare( 'UPDATE tmp_meta_table SET meta_value = %s WHERE meta_value = %s', $new_value, - $old_value - ) + $old_value, + ), ); } } diff --git a/admin/import/plugins/class-import-aioseo-v4.php b/admin/import/plugins/class-import-aioseo-v4.php index 9cd5dc61e2e..5aa76581a77 100644 --- a/admin/import/plugins/class-import-aioseo-v4.php +++ b/admin/import/plugins/class-import-aioseo-v4.php @@ -112,8 +112,8 @@ protected function meta_key_clone_replace( $replace_values ) { $wpdb->prepare( 'UPDATE tmp_meta_table SET meta_value = REPLACE( meta_value, %s, %s )', $aioseo_variable, - $yoast_variable - ) + $yoast_variable, + ), ); } @@ -149,7 +149,7 @@ protected function get_unique_custom_fields_or_taxonomies( $meta_values, $aioseo preg_match_all( "/#$aioseo_prefix-([\w-]+)/", $meta_value, - $matches + $matches, ); /* @@ -189,8 +189,8 @@ protected function replace_custom_field_or_taxonomy_replace_vars( $unique_custom $wpdb->prepare( 'UPDATE tmp_meta_table SET meta_value = REPLACE( meta_value, %s, %s )', $aioseo_variable, - $yoast_variable - ) + $yoast_variable, + ), ); } } @@ -211,8 +211,8 @@ protected function get_meta_values_with_custom_field_or_taxonomy( $wpdb, $aioseo return $wpdb->get_col( $wpdb->prepare( 'SELECT meta_value FROM tmp_meta_table WHERE meta_value LIKE %s', - "%#$aioseo_prefix-%" - ) + "%#$aioseo_prefix-%", + ), ); } diff --git a/admin/import/plugins/class-import-platinum-seo-pack.php b/admin/import/plugins/class-import-platinum-seo-pack.php index 16a5ce9e5c0..8240fe8c91e 100644 --- a/admin/import/plugins/class-import-platinum-seo-pack.php +++ b/admin/import/plugins/class-import-platinum-seo-pack.php @@ -128,7 +128,7 @@ protected function find_posts_by_robots_meta( $meta_value ) { 'order' => 'ASC', 'fields' => 'ids', 'nopaging' => true, - ] + ], ); if ( empty( $posts ) ) { return false; diff --git a/admin/import/plugins/class-import-squirrly.php b/admin/import/plugins/class-import-squirrly.php index e5ecc617a82..903eacc3135 100644 --- a/admin/import/plugins/class-import-squirrly.php +++ b/admin/import/plugins/class-import-squirrly.php @@ -89,8 +89,8 @@ protected function retrieve_posts() { return $wpdb->get_results( $wpdb->prepare( $this->retrieve_posts_query(), - get_current_blog_id() - ) + get_current_blog_id(), + ), ); } @@ -196,8 +196,8 @@ private function retrieve_post_data( $post_identifier ) { $data = $wpdb->get_var( $wpdb->prepare( "SELECT seo FROM {$this->table_name} WHERE blog_id = %d AND " . $query_where, - $replacements - ) + $replacements, + ), ); if ( ! $data || is_wp_error( $data ) ) { return false; diff --git a/admin/import/plugins/class-import-woothemes-seo.php b/admin/import/plugins/class-import-woothemes-seo.php index 5ee943c3f4a..8de37133853 100644 --- a/admin/import/plugins/class-import-woothemes-seo.php +++ b/admin/import/plugins/class-import-woothemes-seo.php @@ -130,8 +130,8 @@ private function cleanup_meta_key( $key ) { $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->postmeta} WHERE meta_key = %s", - $key - ) + $key, + ), ); return $wpdb->__get( 'result' ); } diff --git a/admin/import/plugins/class-import-wpseo.php b/admin/import/plugins/class-import-wpseo.php index 0d138f2bd9c..d34676b3cbf 100644 --- a/admin/import/plugins/class-import-wpseo.php +++ b/admin/import/plugins/class-import-wpseo.php @@ -197,7 +197,7 @@ private function import_taxonomy_metas() { [ 'taxonomy' => get_taxonomies(), 'hide_empty' => false, - ] + ], ); $tax_meta = get_option( 'wpseo_taxonomy_meta' ); @@ -300,7 +300,7 @@ private function cleanup_term_meta() { [ 'taxonomy' => get_taxonomies(), 'hide_empty' => false, - ] + ], ); foreach ( $terms as $term ) { diff --git a/admin/menu/class-admin-menu.php b/admin/menu/class-admin-menu.php index d6718aecd4d..05318a6ad82 100644 --- a/admin/menu/class-admin-menu.php +++ b/admin/menu/class-admin-menu.php @@ -59,7 +59,7 @@ public function register_settings_page() { $page_identifier, $admin_page_callback, $this->get_icon_svg(), - 99 + 99, ); // Wipe notification bits from hooks. @@ -91,7 +91,7 @@ public function get_submenu_pages() { $this->get_submenu_page( __( 'Search Console', 'wordpress-seo' ), 'wpseo_search_console', - $search_console_callback + $search_console_callback, ), $this->get_submenu_page( __( 'Tools', 'wordpress-seo' ), 'wpseo_tools' ), ]; diff --git a/admin/menu/class-base-menu.php b/admin/menu/class-base-menu.php index 216fc843704..524ce4b0f70 100644 --- a/admin/menu/class-base-menu.php +++ b/admin/menu/class-base-menu.php @@ -46,9 +46,7 @@ abstract public function get_submenu_pages(); * @return array Formatted submenu. */ protected function get_submenu_page( $page_title, $page_slug, $callback = null, $hook = null ) { - if ( $callback === null ) { - $callback = $this->get_admin_page_callback(); - } + $callback ??= $this->get_admin_page_callback(); return [ $this->get_page_identifier(), @@ -133,7 +131,7 @@ protected function register_menu_page( $submenu_page ) { $submenu_page[4], $submenu_page[5], $this->get_icon_svg(), - 99 + 99, ); // If necessary, add hooks for the submenu page. @@ -185,7 +183,7 @@ protected function register_submenu_page( $submenu_page ) { $submenu_page[2], $submenu_page[3], $submenu_page[4], - $submenu_page[5] + $submenu_page[5], ); // If necessary, add hooks for the submenu page. @@ -256,9 +254,7 @@ protected function get_license_page_title() { _deprecated_function( __METHOD__, 'Yoast SEO 25.5' ); - if ( $title === null ) { - $title = __( 'Upgrades', 'wordpress-seo' ); - } + $title ??= __( 'Upgrades', 'wordpress-seo' ); if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-promotion' ) && ! YoastSEO()->helpers->product->is_premium() ) { $title = __( 'Upgrades', 'wordpress-seo' ) . '' . __( '30% OFF', 'wordpress-seo' ) . ''; diff --git a/admin/menu/class-network-admin-menu.php b/admin/menu/class-network-admin-menu.php index ef5879efb31..71890d96102 100644 --- a/admin/menu/class-network-admin-menu.php +++ b/admin/menu/class-network-admin-menu.php @@ -36,7 +36,7 @@ public function register_settings_page() { $this->get_manage_capability(), $this->get_page_identifier(), [ $this, 'network_config_page' ], - $this->get_icon_svg() + $this->get_icon_svg(), ); $submenu_pages = $this->get_submenu_pages(); @@ -55,7 +55,7 @@ public function get_submenu_pages() { $this->get_submenu_page( __( 'General', 'wordpress-seo' ), $this->get_page_identifier(), - [ $this, 'network_config_page' ] + [ $this, 'network_config_page' ], ), ]; diff --git a/admin/menu/class-replacevar-editor.php b/admin/menu/class-replacevar-editor.php index be3a41254f0..fe69d28fb69 100644 --- a/admin/menu/class-replacevar-editor.php +++ b/admin/menu/class-replacevar-editor.php @@ -65,7 +65,7 @@ public function __construct( Yoast_Form $yform, $arguments ) { 'has_new_badge' => false, 'is_disabled' => false, 'has_premium_badge' => false, - ] + ], ); $this->validate_arguments( $arguments ); @@ -122,7 +122,7 @@ public function render() { esc_attr( $this->arguments['description_placeholder'] ), esc_attr( $this->arguments['has_new_badge'] ), esc_attr( $this->arguments['is_disabled'] ), - esc_attr( $this->arguments['has_premium_badge'] ) + esc_attr( $this->arguments['has_premium_badge'] ), ); } @@ -150,8 +150,8 @@ protected function validate_arguments( array $arguments ) { sprintf( /* translators: %1$s expands to the missing field name. */ __( 'Not all required fields are given. Missing field %1$s', 'wordpress-seo' ), - $field_name - ) + $field_name, + ), ); } } diff --git a/admin/menu/class-replacevar-field.php b/admin/menu/class-replacevar-field.php index e94d2c732fb..b201a0e340e 100644 --- a/admin/menu/class-replacevar-field.php +++ b/admin/menu/class-replacevar-field.php @@ -82,7 +82,7 @@ public function render() { esc_attr( $this->field_id ), esc_attr( $this->label ), esc_attr( $this->page_type_recommended ), - esc_attr( $this->page_type_specific ) + esc_attr( $this->page_type_specific ), ); } } diff --git a/admin/metabox/class-abstract-sectioned-metabox-tab.php b/admin/metabox/class-abstract-sectioned-metabox-tab.php index 29ec6e90a14..732486e468d 100644 --- a/admin/metabox/class-abstract-sectioned-metabox-tab.php +++ b/admin/metabox/class-abstract-sectioned-metabox-tab.php @@ -83,7 +83,7 @@ public function display_link() { esc_attr( $this->link_class ), ( $this->link_title !== '' ) ? ' title="' . esc_attr( $this->link_title ) . '"' : '', ( $this->link_aria_label !== '' ) ? ' aria-label="' . esc_attr( $this->link_aria_label ) . '"' : '', - $this->link_content + $this->link_content, ); } } diff --git a/admin/metabox/class-metabox-collapsible.php b/admin/metabox/class-metabox-collapsible.php index c5d378cd600..2e7502b029e 100644 --- a/admin/metabox/class-metabox-collapsible.php +++ b/admin/metabox/class-metabox-collapsible.php @@ -67,7 +67,7 @@ public function content() { 'collapsible' => true, 'class' => 'metabox wpseo-form wpseo-collapsible-container', 'paper_id' => 'collapsible-' . $this->name, - ] + ], ); return $collapsible_paper->get_output(); diff --git a/admin/metabox/class-metabox-form-tab.php b/admin/metabox/class-metabox-form-tab.php index df39f8b0fbf..395dbc4ca5e 100644 --- a/admin/metabox/class-metabox-form-tab.php +++ b/admin/metabox/class-metabox-form-tab.php @@ -115,7 +115,7 @@ public function link() { ( $this->link_class !== '' ) ? ' ' . esc_attr( $this->link_class ) : '', ( $this->link_title !== '' ) ? ' title="' . esc_attr( $this->link_title ) . '"' : '', ( $this->link_aria_label !== '' ) ? ' aria-label="' . esc_attr( $this->link_aria_label ) . '"' : '', - $this->link_content + $this->link_content, ); } @@ -129,7 +129,7 @@ public function content() { '
    %3$s
    ', esc_attr( 'wpseo_' . $this->name ), esc_attr( $this->name ), - $this->content + $this->content, ); } } diff --git a/admin/metabox/class-metabox-section-additional.php b/admin/metabox/class-metabox-section-additional.php index 7ec559dd772..15e919feb34 100644 --- a/admin/metabox/class-metabox-section-additional.php +++ b/admin/metabox/class-metabox-section-additional.php @@ -87,7 +87,7 @@ public function display_link() { esc_attr( $this->name ), esc_attr( $this->link_class ), ( $this->link_aria_label !== '' ) ? ' aria-label="' . esc_attr( $this->link_aria_label ) . '"' : '', - $this->link_content + $this->link_content, ); } @@ -100,7 +100,7 @@ public function display_content() { $html = sprintf( '
    ', esc_attr( $this->name ), - esc_attr( $this->content_class ) + esc_attr( $this->content_class ), ); $html .= $this->content; $html .= '
    '; diff --git a/admin/metabox/class-metabox-section-inclusive-language.php b/admin/metabox/class-metabox-section-inclusive-language.php index 1fddff4a093..291cd46300b 100644 --- a/admin/metabox/class-metabox-section-inclusive-language.php +++ b/admin/metabox/class-metabox-section-inclusive-language.php @@ -27,7 +27,7 @@ public function display_link() { '
  • %2$s
  • ', esc_attr( $this->name ), - esc_html__( 'Inclusive language', 'wordpress-seo' ) + esc_html__( 'Inclusive language', 'wordpress-seo' ), ); } @@ -39,7 +39,7 @@ public function display_link() { public function display_content() { printf( '
    ', - esc_attr( $this->name ) + esc_attr( $this->name ), ); echo '
    ', '
    '; } diff --git a/admin/metabox/class-metabox-section-react.php b/admin/metabox/class-metabox-section-react.php index 70906599753..9e83a8d4f3a 100644 --- a/admin/metabox/class-metabox-section-react.php +++ b/admin/metabox/class-metabox-section-react.php @@ -90,7 +90,7 @@ public function display_link() { esc_attr( $this->name ), esc_attr( $this->link_class ), ( $this->link_aria_label !== '' ) ? ' aria-label="' . esc_attr( $this->link_aria_label ) . '"' : '', - wp_kses_post( $this->link_content ) + wp_kses_post( $this->link_content ), ); } @@ -105,7 +105,7 @@ public function display_content() { printf( '
    ', - esc_attr( $this->name ) + esc_attr( $this->name ), ); echo wp_kses_post( $this->content ); echo '
    '; diff --git a/admin/metabox/class-metabox-section-readability.php b/admin/metabox/class-metabox-section-readability.php index cbfea90747f..0d1b6729dbf 100644 --- a/admin/metabox/class-metabox-section-readability.php +++ b/admin/metabox/class-metabox-section-readability.php @@ -27,7 +27,7 @@ public function display_link() { '
  • %2$s
  • ', esc_attr( $this->name ), - esc_html__( 'Readability', 'wordpress-seo' ) + esc_html__( 'Readability', 'wordpress-seo' ), ); } @@ -39,7 +39,7 @@ public function display_link() { public function display_content() { printf( '
    ', - esc_attr( $this->name ) + esc_attr( $this->name ), ); echo '
    ', '
    '; } diff --git a/admin/metabox/class-metabox.php b/admin/metabox/class-metabox.php index 19922ebc5a2..a671adce05a 100644 --- a/admin/metabox/class-metabox.php +++ b/admin/metabox/class-metabox.php @@ -131,7 +131,7 @@ public function internet_explorer_metabox() { $post_type, 'normal', apply_filters( 'wpseo_metabox_prio', 'high' ), - [ '__block_editor_compatible_meta_box' => true ] + [ '__block_editor_compatible_meta_box' => true ], ); } } @@ -148,7 +148,7 @@ public function render_internet_explorer_notice() { '', '', '', - '' + '', ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output escaped above. @@ -202,7 +202,7 @@ public static function translate_meta_boxes() { /* translators: 1: link open tag; 2: link close tag. */ __( 'The canonical URL that this page should point to. Leave empty to default to permalink. %1$sCross domain canonical%2$s supported too.', 'wordpress-seo' ), '', - WPSEO_Admin_Utils::get_new_tab_message() . '' + WPSEO_Admin_Utils::get_new_tab_message() . '', ); WPSEO_Meta::$meta_fields['advanced']['redirect']['title'] = __( '301 Redirect', 'wordpress-seo' ); @@ -251,7 +251,7 @@ public function add_meta_box() { $post_type, 'normal', apply_filters( 'wpseo_metabox_prio', 'high' ), - [ '__block_editor_compatible_meta_box' => true ] + [ '__block_editor_compatible_meta_box' => true ], ); } } @@ -278,7 +278,7 @@ public function get_metabox_script_data() { $permalink = $this->get_permalink(); $post_formatter = new WPSEO_Metabox_Formatter( - new WPSEO_Post_Metabox_Formatter( $this->get_metabox_post(), [], $permalink ) + new WPSEO_Post_Metabox_Formatter( $this->get_metabox_post(), [], $permalink ), ); $values = $post_formatter->get_values(); @@ -422,7 +422,7 @@ private function get_tabs() { $tabs[] = new WPSEO_Metabox_Section_React( 'schema', '' . __( 'Schema', 'wordpress-seo' ), - '' + '', ); } @@ -433,7 +433,7 @@ private function get_tabs() { '', [ 'html_after' => '
    ', - ] + ], ); } @@ -484,7 +484,7 @@ protected function get_additional_tabs() { $tab['name'], $tab['link_content'], $tab['content'], - $options + $options, ); } } @@ -726,7 +726,7 @@ public function save_postdata( $post_id ) { WPSEO_Meta::get_meta_field_defs( 'general', $post->post_type ), WPSEO_Meta::get_meta_field_defs( 'advanced' ), $social_fields, - WPSEO_Meta::get_meta_field_defs( 'schema', $post->post_type ) + WPSEO_Meta::get_meta_field_defs( 'schema', $post->post_type ), ); foreach ( $meta_boxes as $key => $meta_box ) { @@ -1101,7 +1101,7 @@ private function get_custom_fields_replace_vars( $post ) { [ $meta->presentation->title, $meta->presentation->meta_description, - ] + ], ); preg_match_all( '/%%cf_([A-Za-z0-9_]+)%%/', $replace_vars_fields, $matches ); diff --git a/admin/notifiers/dismissible-notification.php b/admin/notifiers/dismissible-notification.php index 84a608babd9..c0e89f2d10f 100644 --- a/admin/notifiers/dismissible-notification.php +++ b/admin/notifiers/dismissible-notification.php @@ -121,6 +121,6 @@ protected function set_dismissal_state() { */ protected function redirect_to_dashboard() { wp_safe_redirect( admin_url( 'admin.php?page=wpseo_dashboard' ) ); - exit; + exit(); } } diff --git a/admin/pages/network.php b/admin/pages/network.php index 829282725ac..0b182df9af0 100644 --- a/admin/pages/network.php +++ b/admin/pages/network.php @@ -25,8 +25,8 @@ __( 'Crawl settings', 'wordpress-seo' ), [ 'save_button' => true, - ] - ) + ], + ), ); $network_tabs->add_tab( new WPSEO_Option_Tab( 'restore-site', __( 'Restore Site', 'wordpress-seo' ), [ 'save_button' => false ] ) ); $network_tabs->display( $yform ); diff --git a/admin/pages/tools.php b/admin/pages/tools.php index e4b5d31b241..47a23d82a79 100644 --- a/admin/pages/tools.php +++ b/admin/pages/tools.php @@ -47,7 +47,7 @@ printf( /* translators: %1$s expands to Yoast SEO */ esc_html__( '%1$s comes with some very powerful built-in tools:', 'wordpress-seo' ), - 'Yoast SEO' + 'Yoast SEO', ); echo '

    '; diff --git a/admin/roles/class-role-manager-factory.php b/admin/roles/class-role-manager-factory.php index d22753a24be..bbe8cff126e 100644 --- a/admin/roles/class-role-manager-factory.php +++ b/admin/roles/class-role-manager-factory.php @@ -18,9 +18,7 @@ class WPSEO_Role_Manager_Factory { public static function get() { static $manager = null; - if ( $manager === null ) { - $manager = new WPSEO_Role_Manager_WP(); - } + $manager ??= new WPSEO_Role_Manager_WP(); return $manager; } diff --git a/admin/services/class-file-size.php b/admin/services/class-file-size.php index 5b093e4820a..8f648e4fc25 100644 --- a/admin/services/class-file-size.php +++ b/admin/services/class-file-size.php @@ -26,7 +26,7 @@ public function get( WP_REST_Request $request ) { 'type' => 'success', 'size_in_bytes' => $this->get_file_size( $file_url ), ], - 200 + 200, ); } catch ( WPSEO_File_Size_Exception $exception ) { return new WP_REST_Response( @@ -34,7 +34,7 @@ public function get( WP_REST_Request $request ) { 'type' => 'failure', 'response' => $exception->getMessage(), ], - 404 + 404, ); } } @@ -99,7 +99,7 @@ protected function calculate_file_size( $file_url ) { return WPSEO_Image_Utils::get_file_size( [ 'path' => $file_url, - ] + ], ); } } diff --git a/admin/statistics/class-statistics-service.php b/admin/statistics/class-statistics-service.php index 352e29e02ea..161b3d67407 100644 --- a/admin/statistics/class-statistics-service.php +++ b/admin/statistics/class-statistics-service.php @@ -209,22 +209,22 @@ private function labels() { /* translators: %1$s expands to an opening strong tag, %2$s expands to a closing strong tag */ __( 'Posts %1$swithout%2$s a focus keyphrase', 'wordpress-seo' ), '', - '' + '', ), WPSEO_Rank::BAD => sprintf( /* translators: %s expands to the score */ __( 'Posts with the SEO score: %s', 'wordpress-seo' ), - '' . __( 'Needs improvement', 'wordpress-seo' ) . '' + '' . __( 'Needs improvement', 'wordpress-seo' ) . '', ), WPSEO_Rank::OK => sprintf( /* translators: %s expands to the score */ __( 'Posts with the SEO score: %s', 'wordpress-seo' ), - '' . __( 'OK', 'wordpress-seo' ) . '' + '' . __( 'OK', 'wordpress-seo' ) . '', ), WPSEO_Rank::GOOD => sprintf( /* translators: %s expands to the score */ __( 'Posts with the SEO score: %s', 'wordpress-seo' ), - '' . __( 'Good', 'wordpress-seo' ) . '' + '' . __( 'Good', 'wordpress-seo' ) . '', ), WPSEO_Rank::NO_INDEX => __( 'Posts that should not show up in search results', 'wordpress-seo' ), ]; diff --git a/admin/taxonomy/class-taxonomy-fields.php b/admin/taxonomy/class-taxonomy-fields.php index 9da698ef4a3..d4801f2e5a8 100644 --- a/admin/taxonomy/class-taxonomy-fields.php +++ b/admin/taxonomy/class-taxonomy-fields.php @@ -209,7 +209,7 @@ protected function get_social_fields() { 'options' => '', 'hide' => false, ], - ] + ], ); } diff --git a/admin/taxonomy/class-taxonomy-metabox.php b/admin/taxonomy/class-taxonomy-metabox.php index 67890f391f7..4a615515275 100644 --- a/admin/taxonomy/class-taxonomy-metabox.php +++ b/admin/taxonomy/class-taxonomy-metabox.php @@ -160,7 +160,7 @@ private function get_tabs() { '', [ 'html_after' => '
    ', - ] + ], ); } @@ -209,7 +209,7 @@ protected function get_additional_tabs() { $tab['name'], $tab['link_content'], $tab['content'], - $options + $options, ); } } diff --git a/admin/taxonomy/class-taxonomy.php b/admin/taxonomy/class-taxonomy.php index a63d3778d05..75794430232 100644 --- a/admin/taxonomy/class-taxonomy.php +++ b/admin/taxonomy/class-taxonomy.php @@ -114,7 +114,7 @@ private function show_internet_explorer_notice() { '', '', '', - '' + '', ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output escaped above. echo new Alert_Presenter( $content ); @@ -299,7 +299,7 @@ public function localize_term_scraper_script( $term_id ) { $taxonomy = get_taxonomy( $term->taxonomy ); $term_formatter = new WPSEO_Metabox_Formatter( - new WPSEO_Term_Metabox_Formatter( $taxonomy, $term ) + new WPSEO_Term_Metabox_Formatter( $taxonomy, $term ), ); return $term_formatter->get_values(); diff --git a/admin/views/class-yoast-feature-toggles.php b/admin/views/class-yoast-feature-toggles.php index 14aca6b9e6c..7785510f5d9 100644 --- a/admin/views/class-yoast-feature-toggles.php +++ b/admin/views/class-yoast-feature-toggles.php @@ -36,9 +36,7 @@ class Yoast_Feature_Toggles { * @return self Main instance. */ public static function instance() { - if ( self::$instance === null ) { - self::$instance = new self(); - } + self::$instance ??= new self(); return self::$instance; } @@ -49,9 +47,7 @@ public static function instance() { * @return array List of sorted Yoast_Feature_Toggle instances. */ public function get_all() { - if ( $this->toggles === null ) { - $this->toggles = $this->load_toggles(); - } + $this->toggles ??= $this->load_toggles(); return $this->toggles; } @@ -157,7 +153,7 @@ protected function load_toggles() { /* translators: 1: Yoast SEO, 2: translated version of "Off" */ __( 'The advanced section of the %1$s meta box allows a user to remove posts from the search results or change the canonical. The settings in the schema tab allows a user to change schema meta data for a post. These are things you might not want any author to do. That\'s why, by default, only editors and administrators can do this. Setting to "%2$s" allows all users to change these settings.', 'wordpress-seo' ), 'Yoast SEO', - __( 'Off', 'wordpress-seo' ) + __( 'Off', 'wordpress-seo' ), ), 'order' => 90, ], @@ -168,7 +164,7 @@ protected function load_toggles() { 'read_more_label' => sprintf( /* translators: 1: Yoast SEO */ __( 'Allow us to track some data about your site to improve our plugin.', 'wordpress-seo' ), - 'Yoast SEO' + 'Yoast SEO', ), 'read_more_url' => 'https://yoa.st/usage-tracking-2', 'order' => 95, @@ -179,7 +175,7 @@ protected function load_toggles() { 'label' => sprintf( /* translators: 1: Yoast SEO */ __( 'This %1$s REST API endpoint gives you all the metadata you need for a specific URL. This will make it very easy for headless WordPress sites to use %1$s for all their SEO meta output.', 'wordpress-seo' ), - 'Yoast SEO' + 'Yoast SEO', ), 'order' => 100, ], @@ -239,7 +235,7 @@ protected function sitemaps_toggle_after() { $alert = new Alert_Presenter( /* translators: %1$s: expands to an opening anchor tag, %2$s: expands to a closing anchor tag */ sprintf( esc_html__( 'Disabling Yoast SEO\'s XML sitemaps will not disable WordPress\' core sitemaps. In some cases, this %1$s may result in SEO errors on your site%2$s. These may be reported in Google Search Console and other tools.', 'wordpress-seo' ), '', '' ), - 'warning' + 'warning', ); $out .= $alert->present(); $out .= '
    '; diff --git a/admin/views/class-yoast-integration-toggles.php b/admin/views/class-yoast-integration-toggles.php index ac66ee0f016..20bdb2216b7 100644 --- a/admin/views/class-yoast-integration-toggles.php +++ b/admin/views/class-yoast-integration-toggles.php @@ -33,9 +33,7 @@ class Yoast_Integration_Toggles { * @return self Main instance. */ public static function instance() { - if ( self::$instance === null ) { - self::$instance = new self(); - } + self::$instance ??= new self(); return self::$instance; } @@ -46,9 +44,7 @@ public static function instance() { * @return array List of sorted Yoast_Feature_Toggle instances. */ public function get_all() { - if ( $this->toggles === null ) { - $this->toggles = $this->load_toggles(); - } + $this->toggles ??= $this->load_toggles(); return $this->toggles; } @@ -69,7 +65,7 @@ protected function load_toggles() { 'label' => sprintf( /* translators: %s: 'Semrush' */ __( 'The %s integration offers suggestions and insights for keywords related to the entered focus keyphrase.', 'wordpress-seo' ), - 'Semrush' + 'Semrush', ), 'order' => 10, ], diff --git a/admin/views/js-templates-primary-term.php b/admin/views/js-templates-primary-term.php index 684ef87d52b..8947faec111 100644 --- a/admin/views/js-templates-primary-term.php +++ b/admin/views/js-templates-primary-term.php @@ -19,13 +19,13 @@ $yoast_free_js_button_label = sprintf( $yoast_free_js_button_label, '{{data.term}}', - '{{data.taxonomy.title}}' + '{{data.taxonomy.title}}', ); printf( '', esc_attr( $yoast_free_js_button_label ), - esc_html__( 'Make primary', 'wordpress-seo' ) + esc_html__( 'Make primary', 'wordpress-seo' ), ); ?> @@ -38,7 +38,7 @@ $yoast_free_js_taxonomy_title = __( 'Primary %s', 'wordpress-seo' ); $yoast_free_js_taxonomy_title = sprintf( '(' . $yoast_free_js_taxonomy_title . ')', - '{{data.taxonomy.title}}' + '{{data.taxonomy.title}}', ); ?> diff --git a/admin/views/paper-collapsible.php b/admin/views/paper-collapsible.php index e8e3fea4f17..ae2e4ece6a4 100644 --- a/admin/views/paper-collapsible.php +++ b/admin/views/paper-collapsible.php @@ -44,7 +44,7 @@ class=""get_button_html(), esc_html( $title ) . wp_kses_post( $title_after ), - wp_kses_post( $collapsible_config['toggle_icon'] ) + wp_kses_post( $collapsible_config['toggle_icon'] ), ); } else { @@ -72,7 +72,7 @@ class="" diff --git a/admin/views/partial-notifications-errors.php b/admin/views/partial-notifications-errors.php index 8ec3c30faf4..ee9c92d1a58 100644 --- a/admin/views/partial-notifications-errors.php +++ b/admin/views/partial-notifications-errors.php @@ -23,7 +23,7 @@ $yoast_seo_i18n_muted_issues_title = sprintf( /* translators: %d expands the amount of hidden notifications. */ _n( 'You have %d hidden notification:', 'You have %d hidden notifications:', $yoast_seo_dismissed_total, 'wordpress-seo' ), - $yoast_seo_dismissed_total + $yoast_seo_dismissed_total, ); require WPSEO_PATH . 'admin/views/partial-notifications-template.php'; diff --git a/admin/views/partial-notifications-template.php b/admin/views/partial-notifications-template.php index c09dca5b291..7277f61d618 100644 --- a/admin/views/partial-notifications-template.php +++ b/admin/views/partial-notifications-template.php @@ -36,7 +36,7 @@ function _yoast_display_notifications( $notifications_list, $status ) { $button = sprintf( '', /* translators: Hidden accessibility text. */ - esc_html__( 'Hide this item.', 'wordpress-seo' ) + esc_html__( 'Hide this item.', 'wordpress-seo' ), ); break; @@ -44,7 +44,7 @@ function _yoast_display_notifications( $notifications_list, $status ) { $button = sprintf( '', /* translators: Hidden accessibility text. */ - esc_html__( 'Show this item.', 'wordpress-seo' ) + esc_html__( 'Show this item.', 'wordpress-seo' ), ); break; } @@ -57,7 +57,7 @@ function _yoast_display_notifications( $notifications_list, $status ) { // This needs to be fixed in https://github.com/Yoast/wordpress-seo-premium/issues/2548. $notification, // Note: $button is properly escaped above. - $button + $button, ); } @@ -101,7 +101,7 @@ function _yoast_display_notifications( $notifications_list, $status ) { 'content' => _yoast_display_notifications( $yoast_seo_dismissed, 'dismissed' ), 'collapsible' => true, 'collapsible_header_class' => 'yoast-notification', - ] + ], ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: get_output() output is properly escaped. echo $dismissed_paper->get_output(); diff --git a/admin/views/partial-notifications-warnings.php b/admin/views/partial-notifications-warnings.php index e960d6ae61d..f5dfc284510 100644 --- a/admin/views/partial-notifications-warnings.php +++ b/admin/views/partial-notifications-warnings.php @@ -23,7 +23,7 @@ $yoast_seo_i18n_muted_issues_title = sprintf( /* translators: %d expands the amount of hidden notifications. */ _n( 'You have %d hidden notification:', 'You have %d hidden notifications:', $yoast_seo_dismissed_total, 'wordpress-seo' ), - $yoast_seo_dismissed_total + $yoast_seo_dismissed_total, ); require WPSEO_PATH . 'admin/views/partial-notifications-template.php'; diff --git a/admin/views/tabs/dashboard/dashboard.php b/admin/views/tabs/dashboard/dashboard.php index 2c8c96a54da..b419e787f80 100644 --- a/admin/views/tabs/dashboard/dashboard.php +++ b/admin/views/tabs/dashboard/dashboard.php @@ -17,7 +17,7 @@ $wpseo_contributors_phrase = sprintf( /* translators: %1$s expands to Yoast SEO */ __( 'See who contributed to %1$s.', 'wordpress-seo' ), - 'Yoast SEO' + 'Yoast SEO', ); ?> diff --git a/admin/views/tabs/network/crawl-settings.php b/admin/views/tabs/network/crawl-settings.php index 81ff2d9b71b..ed2f49cb483 100644 --- a/admin/views/tabs/network/crawl-settings.php +++ b/admin/views/tabs/network/crawl-settings.php @@ -22,7 +22,7 @@ printf( /* translators: %s expands to Yoast SEO */ esc_html__( 'This tab allows you to selectively disable %s features for all sites in the network. By default all features are enabled, which allows site admins to choose for themselves if they want to toggle a feature on or off for their site. When you disable a feature here, site admins will not be able to use that feature at all.', 'wordpress-seo' ), - 'Yoast SEO' + 'Yoast SEO', ); echo '

    '; @@ -30,7 +30,7 @@ /* translators: %1$s opens the link to the Yoast.com article about Crawl settings, %2$s closes the link, */ esc_html__( '%1$sLearn more about crawl settings.%2$s', 'wordpress-seo' ), '', - '' + '', ); echo '

    '; diff --git a/admin/views/tabs/network/features.php b/admin/views/tabs/network/features.php index 05ac5bbf454..5c0cec56d80 100644 --- a/admin/views/tabs/network/features.php +++ b/admin/views/tabs/network/features.php @@ -25,7 +25,7 @@ printf( /* translators: %s expands to Yoast SEO */ esc_html__( 'This tab allows you to selectively disable %s features for all sites in the network. By default all features are enabled, which allows site admins to choose for themselves if they want to toggle a feature on or off for their site. When you disable a feature here, site admins will not be able to use that feature at all.', 'wordpress-seo' ), - 'Yoast SEO' + 'Yoast SEO', ); foreach ( $feature_toggles as $feature ) { @@ -52,7 +52,7 @@ $help_text .= sprintf( '%2$s', esc_url( WPSEO_Shortlinker::get( $url ) ), - esc_html( $feature->read_more_label ) + esc_html( $feature->read_more_label ), ); } @@ -60,7 +60,7 @@ WPSEO_Option::ALLOW_KEY_PREFIX . $feature->setting, /* translators: Hidden accessibility text; %s expands to a feature's name. */ sprintf( esc_html__( 'Help on: %s', 'wordpress-seo' ), esc_html( $feature->name ) ), - $help_text + $help_text, ); $name = $feature->name; @@ -102,7 +102,7 @@ 'show_premium_upsell' => $show_premium_upsell, 'premium_upsell_url' => $premium_upsell_url, 'note_when_disabled' => $note_when_disabled, - ] + ], ); } ?> diff --git a/admin/views/tabs/network/general.php b/admin/views/tabs/network/general.php index a73c722b928..f212f9a44e9 100644 --- a/admin/views/tabs/network/general.php +++ b/admin/views/tabs/network/general.php @@ -26,7 +26,7 @@ [ 'admin' => __( 'Site Admins (default)', 'wordpress-seo' ), 'superadmin' => __( 'Super Admins only', 'wordpress-seo' ), - ] + ], ); if ( get_blog_count() <= 100 ) { @@ -35,7 +35,7 @@ $yform->select( 'defaultblog', __( 'New sites in the network inherit their SEO settings from this site', 'wordpress-seo' ), - $network_admin->get_site_choices( true, true ) + $network_admin->get_site_choices( true, true ), ); echo '

    ' . esc_html__( 'Choose the site whose settings you want to use as default for all sites that are added to your network. If you choose \'None\', the normal plugin defaults will be used.', 'wordpress-seo' ) . '

    '; } @@ -46,7 +46,7 @@ /* translators: 1: link open tag; 2: link close tag. */ esc_html__( 'Enter the %1$sSite ID%2$s for the site whose settings you want to use as default for all sites that are added to your network. Leave empty for none (i.e. the normal plugin defaults will be used).', 'wordpress-seo' ), '', - '' + '', ); echo '

    '; } diff --git a/admin/views/tabs/network/integrations.php b/admin/views/tabs/network/integrations.php index be635eeccba..e1000559730 100644 --- a/admin/views/tabs/network/integrations.php +++ b/admin/views/tabs/network/integrations.php @@ -25,7 +25,7 @@ printf( /* translators: %1$s expands to Yoast SEO */ esc_html__( 'This tab allows you to selectively disable %1$s integrations with third-party products for all sites in the network. By default all integrations are enabled, which allows site admins to choose for themselves if they want to toggle an integration on or off for their site. When you disable an integration here, site admins will not be able to use that integration at all.', 'wordpress-seo' ), - 'Yoast SEO' + 'Yoast SEO', ); foreach ( $integration_toggles as $integration ) { @@ -40,7 +40,7 @@ $help_text .= sprintf( '%2$s', esc_url( WPSEO_Shortlinker::get( $integration->read_more_url ) ), - esc_html( $integration->read_more_label ) + esc_html( $integration->read_more_label ), ); } @@ -48,7 +48,7 @@ WPSEO_Option::ALLOW_KEY_PREFIX . $integration->setting, /* translators: Hidden accessibility text; %s expands to an integration's name. */ sprintf( esc_html__( 'Help on: %s', 'wordpress-seo' ), esc_html( $integration->name ) ), - $help_text + $help_text, ); $name = $integration->name; @@ -88,7 +88,7 @@ 'preserve_disabled_value' => $preserve_disabled_value, 'show_premium_upsell' => $show_premium_upsell, 'premium_upsell_url' => $premium_upsell_url, - ] + ], ); do_action( 'Yoast\WP\SEO\admin_network_integration_after', $integration ); diff --git a/admin/views/tabs/network/restore-site.php b/admin/views/tabs/network/restore-site.php index ce6701a9851..4484f4f8fc7 100644 --- a/admin/views/tabs/network/restore-site.php +++ b/admin/views/tabs/network/restore-site.php @@ -21,7 +21,7 @@ $yform->select( 'site_id', __( 'Site ID', 'wordpress-seo' ), - $network_admin->get_site_choices( false, true ) + $network_admin->get_site_choices( false, true ), ); } else { diff --git a/admin/views/tabs/tool/import-seo.php b/admin/views/tabs/tool/import-seo.php index a5f666e4b1a..69abf0da650 100644 --- a/admin/views/tabs/tool/import-seo.php +++ b/admin/views/tabs/tool/import-seo.php @@ -20,7 +20,7 @@ printf( /* translators: %s expands to Yoast SEO */ esc_html__( '%s did not detect any plugin data from plugins it can import from.', 'wordpress-seo' ), - 'Yoast SEO' + 'Yoast SEO', ); echo '

    '; @@ -65,7 +65,7 @@ function wpseo_import_external_select( $name, $plugins ) { printf( /* translators: 1: expands to Yoast SEO */ esc_html__( 'This will import the post metadata like SEO titles and descriptions into your %1$s metadata. It will only do this when there is no existing %1$s metadata yet. The original data will remain in place.', 'wordpress-seo' ), - 'Yoast SEO' + 'Yoast SEO', ); ?>

    @@ -105,7 +105,7 @@ function wpseo_import_external_select( $name, $plugins ) { /* translators: 1: Link start tag to the First time configuration tab in the General page, 2: Link closing tag. */ esc_html__( 'You should finish the %1$sfirst time configuration%2$s to make sure your SEO data has been optimized and you’ve set the essential Yoast SEO settings for your site.', 'wordpress-seo' ), '', - '' + '', ); ?>

    diff --git a/admin/views/tabs/tool/wpseo-export.php b/admin/views/tabs/tool/wpseo-export.php index d0a4196145e..3946ddaa4ad 100644 --- a/admin/views/tabs/tool/wpseo-export.php +++ b/admin/views/tabs/tool/wpseo-export.php @@ -24,7 +24,7 @@ $wpseo_export_phrase = sprintf( /* translators: %1$s expands to Yoast SEO */ __( 'Export your %1$s settings here, to copy them on another site.', 'wordpress-seo' ), - 'Yoast SEO' + 'Yoast SEO', ); ?> diff --git a/admin/views/tabs/tool/wpseo-import.php b/admin/views/tabs/tool/wpseo-import.php index 18a5bfe9fb6..35fafc8c00a 100644 --- a/admin/views/tabs/tool/wpseo-import.php +++ b/admin/views/tabs/tool/wpseo-import.php @@ -22,7 +22,7 @@ /* translators: 1: expands to Yoast SEO, 2: expands to Import settings. */ esc_html__( 'Import settings from another %1$s installation by pasting them here and clicking "%2$s".', 'wordpress-seo' ), 'Yoast SEO', - esc_html__( 'Import settings', 'wordpress-seo' ) + esc_html__( 'Import settings', 'wordpress-seo' ), ); ?>

    @@ -37,7 +37,7 @@ printf( /* translators: %s expands to Yoast SEO */ esc_html__( '%s settings to import:', 'wordpress-seo' ), - 'Yoast SEO' + 'Yoast SEO', ); ?>
    diff --git a/admin/views/tool-bulk-editor.php b/admin/views/tool-bulk-editor.php index 354ba376092..dab5a8334a7 100644 --- a/admin/views/tool-bulk-editor.php +++ b/admin/views/tool-bulk-editor.php @@ -70,10 +70,10 @@ function yoast_free_bulk_sanitize_input_fields() { wp_redirect( remove_query_arg( [ '_wp_http_referer', '_wpnonce' ], - $request_uri - ) + $request_uri, + ), ); - exit; + exit(); } /** diff --git a/admin/views/tool-file-editor.php b/admin/views/tool-file-editor.php index b0db6a4310d..dcfaf9ce7ab 100644 --- a/admin/views/tool-file-editor.php +++ b/admin/views/tool-file-editor.php @@ -26,7 +26,7 @@ $die_msg = sprintf( /* translators: %s expands to robots.txt. */ __( 'You cannot create a %s file.', 'wordpress-seo' ), - 'robots.txt' + 'robots.txt', ); exit( esc_html( $die_msg ) ); } @@ -47,7 +47,7 @@ $die_msg = sprintf( /* translators: %s expands to robots.txt. */ __( 'You cannot edit the %s file.', 'wordpress-seo' ), - 'robots.txt' + 'robots.txt', ); exit( esc_html( $die_msg ) ); } @@ -63,7 +63,7 @@ $msg = sprintf( /* translators: %s expands to robots.txt. */ __( 'Updated %s', 'wordpress-seo' ), - 'robots.txt' + 'robots.txt', ); } } @@ -74,7 +74,7 @@ $die_msg = sprintf( /* translators: %s expands to ".htaccess". */ __( 'You cannot edit the %s file.', 'wordpress-seo' ), - '.htaccess' + '.htaccess', ); exit( esc_html( $die_msg ) ); } @@ -114,7 +114,7 @@ printf( /* translators: %s expands to robots.txt. */ esc_html__( 'You don\'t have a %s file, create one here:', 'wordpress-seo' ), - 'robots.txt' + 'robots.txt', ); echo '

    '; @@ -123,8 +123,8 @@ sprintf( /* translators: %s expands to robots.txt. */ esc_attr__( 'Create %s file', 'wordpress-seo' ), - 'robots.txt' - ) + 'robots.txt', + ), ); echo ''; } @@ -133,7 +133,7 @@ printf( /* translators: %s expands to robots.txt. */ esc_html__( 'If you had a %s file and it was editable, you could edit it from here.', 'wordpress-seo' ), - 'robots.txt' + 'robots.txt', ); echo '

    '; } @@ -151,7 +151,7 @@ printf( /* translators: %s expands to robots.txt. */ esc_html__( 'If your %s were writable, you could edit it from here.', 'wordpress-seo' ), - 'robots.txt' + 'robots.txt', ); echo '

    '; echo '
    '; @@ -163,7 +163,7 @@ printf( /* translators: %s expands to robots.txt. */ esc_html__( 'Edit the content of your %s:', 'wordpress-seo' ), - 'robots.txt' + 'robots.txt', ); echo ''; echo '
    '; @@ -172,8 +172,8 @@ sprintf( /* translators: %s expands to robots.txt. */ esc_attr__( 'Save changes to %s', 'wordpress-seo' ), - 'robots.txt' - ) + 'robots.txt', + ), ); echo ''; } @@ -184,7 +184,7 @@ printf( /* translators: %s expands to ".htaccess". */ esc_html__( '%s file', 'wordpress-seo' ), - '.htaccess' + '.htaccess', ); echo ''; @@ -201,7 +201,7 @@ printf( /* translators: %s expands to ".htaccess". */ esc_html__( 'If your %s were writable, you could edit it from here.', 'wordpress-seo' ), - '.htaccess' + '.htaccess', ); echo '

    '; echo '
    '; @@ -213,7 +213,7 @@ printf( /* translators: %s expands to ".htaccess". */ esc_html__( 'Edit the content of your %s:', 'wordpress-seo' ), - '.htaccess' + '.htaccess', ); echo ''; echo '
    '; @@ -222,8 +222,8 @@ sprintf( /* translators: %s expands to ".htaccess". */ esc_attr__( 'Save changes to %s', 'wordpress-seo' ), - '.htaccess' - ) + '.htaccess', + ), ); echo ''; } @@ -233,7 +233,7 @@ printf( /* translators: %s expands to ".htaccess". */ esc_html__( 'If you had a %s file and it was editable, you could edit it from here.', 'wordpress-seo' ), - '.htaccess' + '.htaccess', ); echo '

    '; } diff --git a/admin/watchers/class-slug-change-watcher.php b/admin/watchers/class-slug-change-watcher.php index 68d186168d2..1c4718eed6e 100644 --- a/admin/watchers/class-slug-change-watcher.php +++ b/admin/watchers/class-slug-change-watcher.php @@ -184,9 +184,7 @@ protected function get_post_type_label( $post_type ) { $post_type_object = get_post_type_object( $post_type ); // If the post type of this post wasn't registered default back to post. - if ( $post_type_object === null ) { - $post_type_object = get_post_type_object( 'post' ); - } + $post_type_object ??= get_post_type_object( 'post' ); return $post_type_object->labels->singular_name; } @@ -247,7 +245,7 @@ protected function add_notification( $message ) { [ 'type' => 'notice-warning is-dismissible', 'yoast_branding' => true, - ] + ], ); $notification_center = Yoast_Notification_Center::get(); diff --git a/composer.json b/composer.json index 0a0994414d8..9604a60591f 100644 --- a/composer.json +++ b/composer.json @@ -38,8 +38,8 @@ "wpackagist-plugin/easy-digital-downloads": "dev-trunk", "wpackagist-plugin/google-site-kit": "dev-trunk", "wpackagist-plugin/woocommerce": "dev-trunk", - "yoast/wp-test-utils": "^1.2", - "yoast/yoastcs": "^3.2.0" + "yoast/wp-test-utils": "^1.2.1", + "yoast/yoastcs": "^3.3.0" }, "suggest": { "ext-bcmath": "For more accurate calculations", @@ -111,8 +111,8 @@ "Yoast\\WP\\SEO\\Composer\\Actions::check_coding_standards" ], "check-cs-thresholds": [ - "@putenv YOASTCS_THRESHOLD_ERRORS=2379", - "@putenv YOASTCS_THRESHOLD_WARNINGS=251", + "@putenv YOASTCS_THRESHOLD_ERRORS=2384", + "@putenv YOASTCS_THRESHOLD_WARNINGS=256", "Yoast\\WP\\SEO\\Composer\\Actions::check_cs_thresholds" ], "check-cs": [ diff --git a/composer.lock b/composer.lock index 2f5599b3ca1..c19445d7929 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9a54667eb432cd5eb3bd9e7d7760d0c5", + "content-hash": "39a23b5c2ed5051c90d7939162f27c90", "packages": [ { "name": "composer/installers", @@ -258,27 +258,27 @@ }, { "name": "brain/monkey", - "version": "2.6.2", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/Brain-WP/BrainMonkey.git", - "reference": "d95a9d895352c30f47604ad1b825ab8fa9d1a373" + "reference": "ea3aeb3d559ba3c0930b3f4d210b665a4c044d83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/d95a9d895352c30f47604ad1b825ab8fa9d1a373", - "reference": "d95a9d895352c30f47604ad1b825ab8fa9d1a373", + "url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/ea3aeb3d559ba3c0930b3f4d210b665a4c044d83", + "reference": "ea3aeb3d559ba3c0930b3f4d210b665a4c044d83", "shasum": "" }, "require": { "antecedent/patchwork": "^2.1.17", - "mockery/mockery": "^1.3.5 || ^1.4.4", + "mockery/mockery": "~1.3.6 || ~1.4.4 || ~1.5.1 || ^1.6.10", "php": ">=5.6.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", "phpcompatibility/php-compatibility": "^9.3.0", - "phpunit/phpunit": "^5.7.26 || ^6.0 || ^7.0 || >=8.0 <8.5.12 || ^8.5.14 || ^9.0" + "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.49 || ^9.6.30" }, "type": "library", "extra": { @@ -324,7 +324,7 @@ "issues": "https://github.com/Brain-WP/BrainMonkey/issues", "source": "https://github.com/Brain-WP/BrainMonkey" }, - "time": "2024-08-29T20:15:04+00:00" + "time": "2026-02-05T09:22:14+00:00" }, { "name": "composer/package-versions-deprecated", @@ -401,29 +401,29 @@ }, { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v1.0.0", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/composer-installer.git", - "reference": "4be43904336affa5c2f70744a348312336afd0da" + "reference": "845eb62303d2ca9b289ef216356568ccc075ffd1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", - "reference": "4be43904336affa5c2f70744a348312336afd0da", + "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/845eb62303d2ca9b289ef216356568ccc075ffd1", + "reference": "845eb62303d2ca9b289ef216356568ccc075ffd1", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0 || ^2.0", + "composer-plugin-api": "^2.2", "php": ">=5.4", - "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" + "squizlabs/php_codesniffer": "^3.1.0 || ^4.0" }, "require-dev": { - "composer/composer": "*", + "composer/composer": "^2.2", "ext-json": "*", "ext-zip": "*", - "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpcompatibility/php-compatibility": "^9.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcompatibility/php-compatibility": "^9.0 || ^10.0.0@dev", "yoast/phpunit-polyfills": "^1.0" }, "type": "composer-plugin", @@ -442,9 +442,9 @@ "authors": [ { "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" + "email": "opensource@frenck.dev", + "homepage": "https://frenck.dev", + "role": "Open source developer" }, { "name": "Contributors", @@ -452,7 +452,6 @@ } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", "keywords": [ "PHPCodeSniffer", "PHP_CodeSniffer", @@ -473,9 +472,28 @@ ], "support": { "issues": "https://github.com/PHPCSStandards/composer-installer/issues", + "security": "https://github.com/PHPCSStandards/composer-installer/security/policy", "source": "https://github.com/PHPCSStandards/composer-installer" }, - "time": "2023-01-05T11:28:13+00:00" + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" + } + ], + "time": "2025-11-11T04:32:07+00:00" }, { "name": "doctrine/instantiator", @@ -1654,16 +1672,16 @@ }, { "name": "phpcompatibility/phpcompatibility-paragonie", - "version": "1.3.3", + "version": "1.3.4", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", - "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac" + "reference": "244d7b04fc4bc2117c15f5abe23eb933b5f02bbf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/293975b465e0e709b571cbf0c957c6c0a7b9a2ac", - "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/244d7b04fc4bc2117c15f5abe23eb933b5f02bbf", + "reference": "244d7b04fc4bc2117c15f5abe23eb933b5f02bbf", "shasum": "" }, "require": { @@ -1720,27 +1738,32 @@ { "url": "https://opencollective.com/php_codesniffer", "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcompatibility", + "type": "thanks_dev" } ], - "time": "2024-04-24T21:30:46+00:00" + "time": "2025-09-19T17:43:28+00:00" }, { "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.6", + "version": "2.1.8", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "80ccb1a7640995edf1b87a4409fa584cd5869469" + "reference": "7c8d18b4d90dac9e86b0869a608fa09158e168fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/80ccb1a7640995edf1b87a4409fa584cd5869469", - "reference": "80ccb1a7640995edf1b87a4409fa584cd5869469", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/7c8d18b4d90dac9e86b0869a608fa09158e168fa", + "reference": "7c8d18b4d90dac9e86b0869a608fa09158e168fa", "shasum": "" }, "require": { "phpcompatibility/php-compatibility": "^9.0", - "phpcompatibility/phpcompatibility-paragonie": "^1.0" + "phpcompatibility/phpcompatibility-paragonie": "^1.0", + "squizlabs/php_codesniffer": "^3.3" }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^1.0" @@ -1790,35 +1813,39 @@ { "url": "https://opencollective.com/php_codesniffer", "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcompatibility", + "type": "thanks_dev" } ], - "time": "2025-01-16T22:34:19+00:00" + "time": "2025-10-18T00:05:59+00:00" }, { "name": "phpcsstandards/phpcsextra", - "version": "1.2.1", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", - "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489" + "reference": "b598aa890815b8df16363271b659d73280129101" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/11d387c6642b6e4acaf0bd9bf5203b8cca1ec489", - "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/b598aa890815b8df16363271b659d73280129101", + "reference": "b598aa890815b8df16363271b659d73280129101", "shasum": "" }, "require": { "php": ">=5.4", - "phpcsstandards/phpcsutils": "^1.0.9", - "squizlabs/php_codesniffer": "^3.8.0" + "phpcsstandards/phpcsutils": "^1.2.0", + "squizlabs/php_codesniffer": "^3.13.5 || ^4.0.1" }, "require-dev": { "php-parallel-lint/php-console-highlighter": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.3.2", - "phpcsstandards/phpcsdevcs": "^1.1.6", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcsstandards/phpcsdevcs": "^1.2.0", "phpcsstandards/phpcsdevtools": "^1.2.1", - "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "type": "phpcodesniffer-standard", "extra": { @@ -1868,35 +1895,39 @@ { "url": "https://opencollective.com/php_codesniffer", "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" } ], - "time": "2023-12-08T16:49:07+00:00" + "time": "2025-11-12T23:06:57+00:00" }, { "name": "phpcsstandards/phpcsutils", - "version": "1.0.12", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", - "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c" + "reference": "c216317e96c8b3f5932808f9b0f1f7a14e3bbf55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/87b233b00daf83fb70f40c9a28692be017ea7c6c", - "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/c216317e96c8b3f5932808f9b0f1f7a14e3bbf55", + "reference": "c216317e96c8b3f5932808f9b0f1f7a14e3bbf55", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", "php": ">=5.4", - "squizlabs/php_codesniffer": "^3.10.0 || 4.0.x-dev@dev" + "squizlabs/php_codesniffer": "^3.13.5 || ^4.0.1" }, "require-dev": { "ext-filter": "*", "php-parallel-lint/php-console-highlighter": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.3.2", - "phpcsstandards/phpcsdevcs": "^1.1.6", - "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0" + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcsstandards/phpcsdevcs": "^1.2.0", + "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0 || ^3.0.0" }, "type": "phpcodesniffer-standard", "extra": { @@ -1933,6 +1964,7 @@ "phpcodesniffer-standard", "phpcs", "phpcs3", + "phpcs4", "standards", "static analysis", "tokens", @@ -1956,36 +1988,40 @@ { "url": "https://opencollective.com/php_codesniffer", "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" } ], - "time": "2024-05-20T13:34:27+00:00" + "time": "2025-12-08T14:27:58+00:00" }, { "name": "phpstan/phpdoc-parser", - "version": "1.33.0", + "version": "2.3.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140" + "reference": "a004701b11273a26cd7955a61d67a7f1e525a45a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/82a311fd3690fb2bf7b64d5c98f912b3dd746140", - "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/a004701b11273a26cd7955a61d67a7f1e525a45a", + "reference": "a004701b11273a26cd7955a61d67a7f1e525a45a", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "doctrine/annotations": "^2.0", - "nikic/php-parser": "^4.15", + "nikic/php-parser": "^5.3.0", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6", "symfony/process": "^5.2" }, "type": "library", @@ -2003,9 +2039,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.33.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.2" }, - "time": "2024-10-13T11:25:22+00:00" + "time": "2026-01-25T14:56:51+00:00" }, { "name": "phpunit/php-code-coverage", @@ -3752,28 +3788,27 @@ }, { "name": "sirbrillig/phpcs-variable-analysis", - "version": "v2.12.0", + "version": "v2.13.0", "source": { "type": "git", "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", - "reference": "4debf5383d9ade705e0a25121f16c3fecaf433a7" + "reference": "a15e970b8a0bf64cfa5e86d941f5e6b08855f369" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/4debf5383d9ade705e0a25121f16c3fecaf433a7", - "reference": "4debf5383d9ade705e0a25121f16c3fecaf433a7", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/a15e970b8a0bf64cfa5e86d941f5e6b08855f369", + "reference": "a15e970b8a0bf64cfa5e86d941f5e6b08855f369", "shasum": "" }, "require": { "php": ">=5.4.0", - "squizlabs/php_codesniffer": "^3.5.6" + "squizlabs/php_codesniffer": "^3.5.7 || ^4.0.0" }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0", - "phpcsstandards/phpcsdevcs": "^1.1", - "phpstan/phpstan": "^1.7", + "phpstan/phpstan": "^1.7 || ^2.0", "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0 || ^10.5.32 || ^11.3.3", - "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0" + "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0 || ^6.0 || ^7.0" }, "type": "phpcodesniffer-standard", "autoload": { @@ -3805,36 +3840,36 @@ "source": "https://github.com/sirbrillig/phpcs-variable-analysis", "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki" }, - "time": "2025-03-17T16:17:38+00:00" + "time": "2025-09-30T22:22:48+00:00" }, { "name": "slevomat/coding-standard", - "version": "8.15.0", + "version": "8.22.1", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "7d1d957421618a3803b593ec31ace470177d7817" + "reference": "1dd80bf3b93692bedb21a6623c496887fad05fec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/7d1d957421618a3803b593ec31ace470177d7817", - "reference": "7d1d957421618a3803b593ec31ace470177d7817", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/1dd80bf3b93692bedb21a6623c496887fad05fec", + "reference": "1dd80bf3b93692bedb21a6623c496887fad05fec", "shasum": "" }, "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", - "php": "^7.2 || ^8.0", - "phpstan/phpdoc-parser": "^1.23.1", - "squizlabs/php_codesniffer": "^3.9.0" + "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.1.2", + "php": "^7.4 || ^8.0", + "phpstan/phpdoc-parser": "^2.3.0", + "squizlabs/php_codesniffer": "^3.13.4" }, "require-dev": { - "phing/phing": "2.17.4", - "php-parallel-lint/php-parallel-lint": "1.3.2", - "phpstan/phpstan": "1.10.60", - "phpstan/phpstan-deprecation-rules": "1.1.4", - "phpstan/phpstan-phpunit": "1.3.16", - "phpstan/phpstan-strict-rules": "1.5.2", - "phpunit/phpunit": "8.5.21|9.6.8|10.5.11" + "phing/phing": "3.0.1|3.1.0", + "php-parallel-lint/php-parallel-lint": "1.4.0", + "phpstan/phpstan": "2.1.24", + "phpstan/phpstan-deprecation-rules": "2.0.3", + "phpstan/phpstan-phpunit": "2.0.7", + "phpstan/phpstan-strict-rules": "2.0.6", + "phpunit/phpunit": "9.6.8|10.5.48|11.4.4|11.5.36|12.3.10" }, "type": "phpcodesniffer-standard", "extra": { @@ -3858,7 +3893,7 @@ ], "support": { "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/8.15.0" + "source": "https://github.com/slevomat/coding-standard/tree/8.22.1" }, "funding": [ { @@ -3870,20 +3905,20 @@ "type": "tidelift" } ], - "time": "2024-03-09T15:20:58+00:00" + "time": "2025-09-13T08:53:30+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.12.0", + "version": "3.13.5", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "2d1b63db139c3c6ea0c927698e5160f8b3b8d630" + "reference": "0ca86845ce43291e8f5692c7356fccf3bcf02bf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/2d1b63db139c3c6ea0c927698e5160f8b3b8d630", - "reference": "2d1b63db139c3c6ea0c927698e5160f8b3b8d630", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/0ca86845ce43291e8f5692c7356fccf3bcf02bf4", + "reference": "0ca86845ce43291e8f5692c7356fccf3bcf02bf4", "shasum": "" }, "require": { @@ -3900,11 +3935,6 @@ "bin/phpcs" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" @@ -3954,7 +3984,7 @@ "type": "thanks_dev" } ], - "time": "2025-03-18T05:04:51+00:00" + "time": "2025-11-04T16:30:35+00:00" }, { "name": "symfony/config", @@ -4950,16 +4980,16 @@ }, { "name": "wp-coding-standards/wpcs", - "version": "3.1.0", + "version": "3.3.0", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7" + "reference": "7795ec6fa05663d716a549d0b44e47ffc8b0d4a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/9333efcbff231f10dfd9c56bb7b65818b4733ca7", - "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7795ec6fa05663d716a549d0b44e47ffc8b0d4a6", + "reference": "7795ec6fa05663d716a549d0b44e47ffc8b0d4a6", "shasum": "" }, "require": { @@ -4967,17 +4997,17 @@ "ext-libxml": "*", "ext-tokenizer": "*", "ext-xmlreader": "*", - "php": ">=5.4", - "phpcsstandards/phpcsextra": "^1.2.1", - "phpcsstandards/phpcsutils": "^1.0.10", - "squizlabs/php_codesniffer": "^3.9.0" + "php": ">=7.2", + "phpcsstandards/phpcsextra": "^1.5.0", + "phpcsstandards/phpcsutils": "^1.1.0", + "squizlabs/php_codesniffer": "^3.13.4" }, "require-dev": { "php-parallel-lint/php-console-highlighter": "^1.0.0", - "php-parallel-lint/php-parallel-lint": "^1.3.2", - "phpcompatibility/php-compatibility": "^9.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcompatibility/php-compatibility": "^10.0.0@dev", "phpcsstandards/phpcsdevtools": "^1.2.0", - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^8.0 || ^9.0" }, "suggest": { "ext-iconv": "For improved results", @@ -5012,7 +5042,7 @@ "type": "custom" } ], - "time": "2024-03-25T16:39:00+00:00" + "time": "2025-11-25T12:08:04+00:00" }, { "name": "wpackagist-plugin/easy-digital-downloads", @@ -5136,25 +5166,27 @@ }, { "name": "yoast/wp-test-utils", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/Yoast/wp-test-utils.git", - "reference": "2e0f62e0281e4859707c5f13b7da1422aa1c8f7b" + "reference": "e1c316f10ff892fff36116349b59ee5a00174ca3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Yoast/wp-test-utils/zipball/2e0f62e0281e4859707c5f13b7da1422aa1c8f7b", - "reference": "2e0f62e0281e4859707c5f13b7da1422aa1c8f7b", + "url": "https://api.github.com/repos/Yoast/wp-test-utils/zipball/e1c316f10ff892fff36116349b59ee5a00174ca3", + "reference": "e1c316f10ff892fff36116349b59ee5a00174ca3", "shasum": "" }, "require": { - "brain/monkey": "^2.6.1", + "brain/monkey": "^2.7.0", "php": ">=5.6", - "yoast/phpunit-polyfills": "^1.1.0" + "yoast/phpunit-polyfills": "^1.1.5" }, "require-dev": { - "yoast/yoastcs": "^2.3.1" + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "yoast/yoastcs": "^3.3.0" }, "type": "library", "extra": { @@ -5199,22 +5231,23 @@ ], "support": { "issues": "https://github.com/Yoast/wp-test-utils/issues", + "security": "https://github.com/Yoast/wp-test-utils/security/policy", "source": "https://github.com/Yoast/wp-test-utils" }, - "time": "2023-09-27T10:25:08+00:00" + "time": "2026-02-05T18:06:16+00:00" }, { "name": "yoast/yoastcs", - "version": "3.2.0", + "version": "3.3.0", "source": { "type": "git", "url": "https://github.com/Yoast/yoastcs.git", - "reference": "2594255b7d1503bae9584eb89708b0b23fac5391" + "reference": "54fdadbd4145dc5f08110c0f9b38fd2fc28a1394" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Yoast/yoastcs/zipball/2594255b7d1503bae9584eb89708b0b23fac5391", - "reference": "2594255b7d1503bae9584eb89708b0b23fac5391", + "url": "https://api.github.com/repos/Yoast/yoastcs/zipball/54fdadbd4145dc5f08110c0f9b38fd2fc28a1394", + "reference": "54fdadbd4145dc5f08110c0f9b38fd2fc28a1394", "shasum": "" }, "require": { @@ -5224,18 +5257,17 @@ "php-parallel-lint/php-console-highlighter": "^1.0.0", "php-parallel-lint/php-parallel-lint": "^1.4.0", "phpcompatibility/phpcompatibility-wp": "^2.1.6", - "phpcsstandards/phpcsextra": "^1.2.1", + "phpcsstandards/phpcsextra": "^1.5.0", "phpcsstandards/phpcsutils": "^1.0.12", - "sirbrillig/phpcs-variable-analysis": "^2.12.0", + "sirbrillig/phpcs-variable-analysis": "^2.13.0", "slevomat/coding-standard": "^8.15.0", "squizlabs/php_codesniffer": "^3.12.0", - "wp-coding-standards/wpcs": "^3.1.0" + "wp-coding-standards/wpcs": "^3.3.0" }, "require-dev": { "phpcompatibility/php-compatibility": "^9.3.5", - "phpcsstandards/phpcsdevtools": "^1.2.2", - "phpunit/phpunit": "^8.0 || ^9.0", - "roave/security-advisories": "dev-master" + "phpcsstandards/phpcsdevtools": "^1.2.3", + "phpunit/phpunit": "^8.5.50 || ^9.6.31" }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", @@ -5263,7 +5295,7 @@ "security": "https://github.com/Yoast/yoastcs/security/policy", "source": "https://github.com/Yoast/yoastcs" }, - "time": "2025-03-19T11:49:48+00:00" + "time": "2026-02-04T12:33:54+00:00" } ], "aliases": [], diff --git a/config/composer/actions.php b/config/composer/actions.php index e111da26dc1..4c0f50e4516 100644 --- a/config/composer/actions.php +++ b/config/composer/actions.php @@ -131,7 +131,7 @@ public static function compile_dependency_injection_container( Event $event ) { __DIR__ . '/../../src/generated/container.php', __DIR__ . '/../dependency-injection/services.php', __DIR__ . '/../../vendor/composer/autoload_classmap.php', - 'Yoast\WP\SEO\Generated' + 'Yoast\WP\SEO\Generated', ); $io->write( 'The dependency injection container has been compiled.' ); @@ -150,7 +150,7 @@ public static function lint_branch( Event $event ) { $branch = 'trunk'; $args = $event->getArguments(); - if ( ! empty( $args ) ) { + if ( ! empty( $args[0] ) ) { $branch = $args[0]; } @@ -240,7 +240,7 @@ private static function check_cs_for_changed_files( $compare ) { $command = \sprintf( 'composer check-cs-warnings -- %s %s', \implode( ' ', \array_map( 'escapeshellarg', $php_files ) ), - $extra_args + $extra_args, ); \system( $command, $exit_code ); @@ -260,7 +260,7 @@ private static function filter_files( array $files, string $extension ): array { $files, static function ( $file ) use ( $extension ) { return \substr( $file, ( 0 - \strlen( $extension ) ) ) === $extension; - } + }, ); } @@ -420,7 +420,7 @@ public static function generate_unit_test( Event $event ) { if ( empty( $args[0] ) ) { throw new RuntimeException( 'You must provide an argument with the fully qualified class name' - . 'for which you want a unit test to be generated.' + . 'for which you want a unit test to be generated.', ); } diff --git a/config/composer/unit-test-generator.php b/config/composer/unit-test-generator.php index c8dc849337a..f3728c96bfb 100644 --- a/config/composer/unit-test-generator.php +++ b/config/composer/unit-test-generator.php @@ -79,7 +79,7 @@ public function generate( $fully_qualified_class_name ) { $groups, $property_statements, $create_mock_statements, - $instance_argument_statements + $instance_argument_statements, ); \file_put_contents( __DIR__ . '/../../' . $unit_test_path, $filled_in_template ); @@ -148,7 +148,7 @@ protected function generate_groups( $path ) { static function ( $group ) { return ' * @group ' . $group; }, - $groups + $groups, ); return \implode( \PHP_EOL, $groups ); @@ -244,7 +244,7 @@ static function ( $argument ) { return 'use ' . $argument->getClass()->getShortName() . ';'; } }, - $constructor_arguments + $constructor_arguments, ); return \implode( \PHP_EOL, $statements ); @@ -262,7 +262,7 @@ protected function generate_property_statements( array $constructor_arguments ) static function ( $argument ) { return self::generate_mocked_property_statement( $argument->getClass()->getShortName(), $argument->getName() ); }, - $constructor_arguments + $constructor_arguments, ); return \implode( \PHP_EOL . \PHP_EOL, $statements ); @@ -300,7 +300,7 @@ protected function generate_create_mock_statements( array $constructor_arguments static function ( $argument ) { return '$this->' . $argument->getName() . ' = Mockery::mock( ' . $argument->getClass()->getShortName() . '::class );'; }, - $constructor_arguments + $constructor_arguments, ); return \implode( \PHP_EOL . "\t\t", $statements ); @@ -318,7 +318,7 @@ protected function generate_instance_argument_statements( array $constructor_arg static function ( $argument ) { return '$this->' . $argument->getName(); }, - $constructor_arguments + $constructor_arguments, ); return \implode( ',' . \PHP_EOL . "\t\t\t", $statements ); diff --git a/config/dependency-injection/container-compiler.php b/config/dependency-injection/container-compiler.php index a7572ffd03f..4cb79b5121e 100644 --- a/config/dependency-injection/container-compiler.php +++ b/config/dependency-injection/container-compiler.php @@ -55,7 +55,7 @@ public static function compile( [ 'class' => 'Cached_Container', 'namespace' => $target_namespace, - ] + ], ); $code = \str_replace( 'Symfony\\Component\\DependencyInjection', 'YoastSEO_Vendor\\Symfony\\Component\\DependencyInjection', $code ); $code = \str_replace( 'Symfony\\\\Component\\\\DependencyInjection', 'YoastSEO_Vendor\\\\Symfony\\\\Component\\\\DependencyInjection', $code ); diff --git a/config/dependency-injection/custom-loader.php b/config/dependency-injection/custom-loader.php index e995857c6f0..0fedb5024dc 100644 --- a/config/dependency-injection/custom-loader.php +++ b/config/dependency-injection/custom-loader.php @@ -135,9 +135,7 @@ private function findClasses( $namespace, $pattern, $excludePattern ) { if ( $excludePattern ) { $excludePattern = $parameter_bag->unescapeValue( $parameter_bag->resolveValue( $excludePattern ) ); foreach ( $this->glob( $excludePattern, true, $resource ) as $path => $info ) { - if ( $exclude_prefix === null ) { - $exclude_prefix = $resource->getPrefix(); - } + $exclude_prefix ??= $resource->getPrefix(); // Normalize Windows slashes. $path = $this->normalize_slashes( $path ); @@ -181,7 +179,7 @@ private function findClasses( $namespace, $pattern, $excludePattern ) { 'While discovering services from namespace "%s", an error was thrown when processing the class "%s": "%s".', $namespace, $class, - $e->getMessage() + $e->getMessage(), ); continue; } diff --git a/config/dependency-injection/interface-injection-pass.php b/config/dependency-injection/interface-injection-pass.php index 801e9ca3123..d13f75620aa 100644 --- a/config/dependency-injection/interface-injection-pass.php +++ b/config/dependency-injection/interface-injection-pass.php @@ -149,7 +149,7 @@ static function ( $other_definition ) use ( $definition_class ) { } return \is_subclass_of( $other_class, $definition_class->splat_argument_type ); - } + }, ); } } diff --git a/inc/class-addon-manager.php b/inc/class-addon-manager.php index f6e1bc9954c..a9c687e5efc 100644 --- a/inc/class-addon-manager.php +++ b/inc/class-addon-manager.php @@ -276,9 +276,7 @@ public function get_plugin_information( $data, $action, $args ) { * @return stdClass The list of addons activated for this site. */ public function get_myyoast_site_information() { - if ( $this->site_information === null ) { - $this->site_information = $this->get_site_information_transient(); - } + $this->site_information ??= $this->get_site_information_transient(); if ( $this->site_information ) { return $this->site_information; @@ -412,7 +410,7 @@ public function expired_subscription_warning( $plugin_data ) { /* translators: %1$s and %2$s are a opening and closing tag. */ esc_html__( '%1$s30%% OFF - Black Friday %2$s', 'wordpress-seo' ), '', - '' + '', ); } echo '

    '; @@ -422,7 +420,7 @@ public function expired_subscription_warning( $plugin_data ) { esc_html__( 'Your %1$s plugin cannot be updated as your subscription has expired. %2$sRenew your product subscription%3$s to restore updates and full feature access.', 'wordpress-seo' ), esc_html( $plugin_data['name'] ), '', - '' + '', ) // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output is escaped above. . $sale_copy @@ -538,9 +536,9 @@ protected function create_notification( $product_name, $short_link ) { '', 'MyYoast', '', - $product_name + $product_name, ), - $notification_options + $notification_options, ); } diff --git a/inc/class-my-yoast-api-request.php b/inc/class-my-yoast-api-request.php index 752c22be57b..17a993fbe34 100644 --- a/inc/class-my-yoast-api-request.php +++ b/inc/class-my-yoast-api-request.php @@ -137,7 +137,7 @@ protected function decode_response( $response ) { if ( ! is_object( $response ) ) { throw new WPSEO_MyYoast_Invalid_JSON_Exception( - esc_html__( 'No JSON object was returned.', 'wordpress-seo' ) + esc_html__( 'No JSON object was returned.', 'wordpress-seo' ), ); } @@ -158,7 +158,7 @@ private function validate_response( $response ) { } throw new WPSEO_MyYoast_Invalid_JSON_Exception( - esc_html__( 'Not all needed fields are present.', 'wordpress-seo' ) + esc_html__( 'Not all needed fields are present.', 'wordpress-seo' ), ); } diff --git a/inc/class-rewrite.php b/inc/class-rewrite.php index 9622ada0aad..89827ceb38b 100644 --- a/inc/class-rewrite.php +++ b/inc/class-rewrite.php @@ -251,6 +251,6 @@ protected function redirect( $category_redirect ) { $catlink = trailingslashit( get_option( 'home' ) ) . user_trailingslashit( $category_redirect, 'category' ); wp_safe_redirect( $catlink, 301, 'Yoast SEO' ); - exit; + exit(); } } diff --git a/inc/class-upgrade-history.php b/inc/class-upgrade-history.php index 227cb672b19..da4b1e0a6d7 100644 --- a/inc/class-upgrade-history.php +++ b/inc/class-upgrade-history.php @@ -89,9 +89,9 @@ protected function get_options_data( array $option_names ) { SELECT %i, %i FROM ' . $wpdb->options . ' WHERE %i IN ( ' . implode( ',', array_fill( 0, count( $option_names ), '%s' ) ) . ' ) ', - array_merge( [ 'option_value', 'option_name', 'option_name' ], $option_names ) + array_merge( [ 'option_value', 'option_name', 'option_name' ], $option_names ), ), - ARRAY_A + ARRAY_A, ); $data = []; diff --git a/inc/class-upgrade.php b/inc/class-upgrade.php index 3ea7da39622..45f1ee2fffc 100644 --- a/inc/class-upgrade.php +++ b/inc/class-upgrade.php @@ -314,8 +314,8 @@ protected function upgrade_36() { $wpdb->query( $wpdb->prepare( 'DELETE FROM %i WHERE %i LIKE %s AND autoload IN ("on", "yes")', - [ $wpdb->options, 'option_name', 'wpseo_sitemap_%' ] - ) + [ $wpdb->options, 'option_name', 'wpseo_sitemap_%' ], + ), ); } @@ -358,8 +358,8 @@ private function upgrade_47() { $wpdb->query( $wpdb->prepare( 'UPDATE ' . $wpdb->postmeta . ' SET meta_key = %s WHERE meta_key = "yst_is_cornerstone"', - WPSEO_Cornerstone_Filter::META_NAME - ) + WPSEO_Cornerstone_Filter::META_NAME, + ), ); } @@ -398,9 +398,9 @@ protected function upgrade_49() { $meta_key, 'meta_value', '%wpseo-dismiss-about%', - ] + ], ), - ARRAY_A + ARRAY_A, ); if ( empty( $usermetas ) ) { @@ -452,8 +452,8 @@ protected function upgrade_50() { $wpdb->prepare( "DELETE FROM %i WHERE %i = '_yst_content_links_processed'", - [ $wpdb->postmeta, 'meta_key' ] - ) + [ $wpdb->postmeta, 'meta_key' ], + ), ); } @@ -658,8 +658,8 @@ protected function upgrade_90() { $wpdb->prepare( 'DELETE FROM %i WHERE %i LIKE %s', - [ $wpdb->options, 'option_name', 'wpseo_sitemap_%' ] - ) + [ $wpdb->options, 'option_name', 'wpseo_sitemap_%' ], + ), ); } @@ -743,8 +743,8 @@ public function upgrade_125() { $wpdb->prepare( 'DELETE FROM %i WHERE %i = %s', - [ $wpdb->usermeta, 'meta_key', 'wp_yoast_promo_hide_premium_upsell_admin_block' ] - ) + [ $wpdb->usermeta, 'meta_key', 'wp_yoast_promo_hide_premium_upsell_admin_block' ], + ), ); // Removes the WordPress update notification, because it is no longer necessary when WordPress 5.3 is released. @@ -1012,7 +1012,7 @@ private function upgrade_189() { WPSEO_Options::set( 'should_redirect_after_install_free', false ); // We're adding a hardcoded time here, so that in the future we can be able to identify whether the user did see the Installation Success page or not. // If they did, they wouldn't have this hardcoded value in that option, but rather (roughly) the timestamp of the moment they saw it. - WPSEO_Options::set( 'activation_redirect_timestamp_free', 1652258756 ); + WPSEO_Options::set( 'activation_redirect_timestamp_free', 1_652_258_756 ); // Transfer the Social URLs. $other = []; @@ -1218,7 +1218,7 @@ public function clean_up_private_taxonomies_for_141() { 'object_type', 'object_sub_type', ], - $private_taxonomies + $private_taxonomies, ); // phpcs:disable WordPress.DB.DirectDatabaseQuery.NoCaching -- Reason: No relevant caches. @@ -1230,8 +1230,8 @@ public function clean_up_private_taxonomies_for_141() { AND %i IN (" . implode( ', ', array_fill( 0, count( $private_taxonomies ), '%s' ) ) . ')', - $replacements - ) + $replacements, + ), ); $wpdb->show_errors = $show_errors; @@ -1255,8 +1255,8 @@ private function reset_permalinks_of_attachments_for_141() { $wpdb->query( $wpdb->prepare( "UPDATE %i SET %i = NULL WHERE %i = 'post' AND %i = 'attachment'", - [ Model::get_table_name( 'Indexable' ), 'permalink', 'object_type', 'object_sub_type' ] - ) + [ Model::get_table_name( 'Indexable' ), 'permalink', 'object_type', 'object_sub_type' ], + ), ); $wpdb->show_errors = $show_errors; @@ -1335,8 +1335,8 @@ private function remove_sitemap_validators() { $wpdb->query( $wpdb->prepare( 'DELETE FROM %i WHERE %i LIKE %s', - [ $wpdb->options, 'option_name', 'wpseo_sitemap%validator%' ] - ) + [ $wpdb->options, 'option_name', 'wpseo_sitemap%validator%' ], + ), ); } @@ -1357,9 +1357,9 @@ protected function get_option_from_database( $option_name ) { $results = $wpdb->get_results( $wpdb->prepare( 'SELECT %i FROM %i WHERE %i = %s', - [ 'option_value', $wpdb->options, 'option_name', $option_name ] + [ 'option_value', $wpdb->options, 'option_name', $option_name ], ), - ARRAY_A + ARRAY_A, ); if ( ! empty( $results ) ) { @@ -1402,9 +1402,7 @@ protected function cleanup_option_data( $option_name ) { * @return void */ protected function save_option_setting( $source_data, $source_setting, $target_setting = null ) { - if ( $target_setting === null ) { - $target_setting = $source_setting; - } + $target_setting ??= $source_setting; if ( isset( $source_data[ $source_setting ] ) ) { WPSEO_Options::set( $target_setting, $source_data[ $source_setting ] ); @@ -1433,7 +1431,7 @@ private function migrate_woocommerce_archive_setting_to_shop_page() { WPSEO_Meta::set_value( 'title', $option_title, - $shop_page_id + $shop_page_id, ); WPSEO_Options::set( 'title-ptarchive-product', '' ); @@ -1447,7 +1445,7 @@ private function migrate_woocommerce_archive_setting_to_shop_page() { WPSEO_Meta::set_value( 'metadesc', $option_metadesc, - $shop_page_id + $shop_page_id, ); WPSEO_Options::set( 'metadesc-ptarchive-product', '' ); @@ -1461,7 +1459,7 @@ private function migrate_woocommerce_archive_setting_to_shop_page() { WPSEO_Meta::set_value( 'bctitle', $option_bctitle, - $shop_page_id + $shop_page_id, ); WPSEO_Options::set( 'bctitle-ptarchive-product', '' ); @@ -1475,7 +1473,7 @@ private function migrate_woocommerce_archive_setting_to_shop_page() { WPSEO_Meta::set_value( 'meta-robots-noindex', $option_noindex, - $shop_page_id + $shop_page_id, ); WPSEO_Options::set( 'noindex-ptarchive-product', false ); @@ -1614,8 +1612,8 @@ public function remove_indexable_rows_for_non_public_post_types() { "DELETE FROM %i WHERE %i = 'post' AND %i IS NOT NULL", - [ $indexable_table, 'object_type', 'object_sub_type' ] - ) + [ $indexable_table, 'object_type', 'object_sub_type' ], + ), ); } else { @@ -1634,9 +1632,9 @@ public function remove_indexable_rows_for_non_public_post_types() { 'object_sub_type', 'object_sub_type', ], - $included_post_types - ) - ) + $included_post_types, + ), + ), ); } @@ -1668,8 +1666,8 @@ public function remove_indexable_rows_for_non_public_taxonomies() { "DELETE FROM %i WHERE %i = 'term' AND %i IS NOT NULL", - [ $indexable_table, 'object_type', 'object_sub_type' ] - ) + [ $indexable_table, 'object_type', 'object_sub_type' ], + ), ); } else { @@ -1688,9 +1686,9 @@ public function remove_indexable_rows_for_non_public_taxonomies() { 'object_sub_type', 'object_sub_type', ], - $included_taxonomies - ) - ) + $included_taxonomies, + ), + ), ); } @@ -1729,9 +1727,9 @@ protected function deduplicate_unindexed_indexable_rows() { object_type HAVING count(*) > 1", - [ Model::get_table_name( 'Indexable' ) ] + [ Model::get_table_name( 'Indexable' ) ], ), - ARRAY_A + ARRAY_A, ); if ( empty( $duplicates ) ) { @@ -1780,8 +1778,8 @@ protected function clean_unindexed_indexable_rows_with_no_object_id() { WHERE %i = 'unindexed' AND %i NOT IN ( 'home-page', 'date-archive', 'post-type-archive', 'system-page' ) AND %i IS NULL", - [ Model::get_table_name( 'Indexable' ), 'post_status', 'object_type', 'object_id' ] - ) + [ Model::get_table_name( 'Indexable' ), 'post_status', 'object_type', 'object_id' ], + ), ); $wpdb->show_errors = $show_errors; @@ -1808,8 +1806,8 @@ protected function remove_indexable_rows_for_disabled_authors_archive() { $wpdb->query( $wpdb->prepare( "DELETE FROM %i WHERE %i = 'user'", - [ Model::get_table_name( 'Indexable' ), 'object_type' ] - ) + [ Model::get_table_name( 'Indexable' ), 'object_type' ], + ), ); $wpdb->show_errors = $show_errors; @@ -1829,7 +1827,7 @@ protected function get_indexable_deduplication_query_for_type( $object_type, $du $duplicates, static function ( $duplicate ) use ( $object_type ) { return $duplicate['object_type'] === $object_type; - } + }, ); if ( empty( $filtered_duplicates ) ) { @@ -1845,7 +1843,7 @@ static function ( $duplicate ) use ( $object_type ) { 'object_id', ], array_values( $object_ids ), - array_values( $newest_indexable_ids ) + array_values( $newest_indexable_ids ), ); $replacements[] = $object_type; @@ -1858,7 +1856,7 @@ static function ( $duplicate ) use ( $object_type ) { %i IN ( ' . implode( ', ', array_fill( 0, count( $filtered_duplicates ), '%d' ) ) . ' ) AND id NOT IN ( ' . implode( ', ', array_fill( 0, count( $filtered_duplicates ), '%d' ) ) . ' ) AND object_type = %s', - $replacements + $replacements, ); } diff --git a/inc/class-wpseo-admin-bar-menu.php b/inc/class-wpseo-admin-bar-menu.php index 8d3dc24a8ae..c96068d9d90 100644 --- a/inc/class-wpseo-admin-bar-menu.php +++ b/inc/class-wpseo-admin-bar-menu.php @@ -156,9 +156,7 @@ public function __construct( * @return bool True if SEO score is enabled, false otherwise. */ protected function get_is_seo_enabled() { - if ( $this->is_seo_enabled === null ) { - $this->is_seo_enabled = ( new WPSEO_Metabox_Analysis_SEO() )->is_enabled(); - } + $this->is_seo_enabled ??= ( new WPSEO_Metabox_Analysis_SEO() )->is_enabled(); return $this->is_seo_enabled; } @@ -169,9 +167,7 @@ protected function get_is_seo_enabled() { * @return bool True if readability is enabled, false otherwise. */ protected function get_is_readability_enabled() { - if ( $this->is_readability_enabled === null ) { - $this->is_readability_enabled = ( new WPSEO_Metabox_Analysis_Readability() )->is_enabled(); - } + $this->is_readability_enabled ??= ( new WPSEO_Metabox_Analysis_Readability() )->is_enabled(); return $this->is_readability_enabled; } @@ -182,9 +178,7 @@ protected function get_is_readability_enabled() { * @return bool|Indexable The indexable, false if none could be found. */ protected function get_current_indexable() { - if ( $this->current_indexable === null ) { - $this->current_indexable = $this->indexable_repository->for_current_page(); - } + $this->current_indexable ??= $this->indexable_repository->for_current_page(); return $this->current_indexable; } @@ -237,7 +231,7 @@ public function add_menu( WP_Admin_Bar $wp_admin_bar ) { 'id' => 'wpseo-seo-focus-keyword', 'title' => __( 'Focus keyphrase: ', 'wordpress-seo' ) . '' . $focus_keyword . '', 'meta' => [ 'tabindex' => '0' ], - ] + ], ); $wp_admin_bar->add_menu( [ @@ -246,7 +240,7 @@ public function add_menu( WP_Admin_Bar $wp_admin_bar ) { 'title' => __( 'SEO score', 'wordpress-seo' ) . ': ' . $this->score_icon_helper->for_seo( $indexable, 'adminbar-sub-menu-score' ) ->present(), 'meta' => [ 'tabindex' => '0' ], - ] + ], ); } @@ -258,7 +252,7 @@ public function add_menu( WP_Admin_Bar $wp_admin_bar ) { 'title' => __( 'Readability', 'wordpress-seo' ) . ': ' . $this->score_icon_helper->for_readability( $indexable->readability_score, 'adminbar-sub-menu-score' ) ->present(), 'meta' => [ 'tabindex' => '0' ], - ] + ], ); } @@ -273,7 +267,7 @@ public function add_menu( WP_Admin_Bar $wp_admin_bar ) { 'tabindex' => '0', 'target' => '_blank', ], - ] + ], ); } } @@ -623,12 +617,12 @@ protected function add_premium_link( WP_Admin_Bar $wp_admin_bar ) { 'title' => sprintf( '%2$s', esc_url( $link ), - $button_label + $button_label, ), 'meta' => [ 'tabindex' => '0', ], - ] + ], ); } @@ -660,7 +654,7 @@ protected function add_brand_insights_link( WP_Admin_Bar $wp_admin_bar ) { 'tabindex' => '0', 'target' => '_blank', ], - ] + ], ); } @@ -919,7 +913,7 @@ protected function get_notification_counter( $notification_count ) { '
    %s
    ', ( $notification_count ) ? '' : ' wpseo-no-adminbar-notifications', $notification_count, - $counter_screen_reader_text + $counter_screen_reader_text, ); } @@ -942,9 +936,9 @@ protected function get_notification_popup() { 'There is a new notification.', 'There are new notifications.', $new_notifications_count, - 'wordpress-seo' + 'wordpress-seo', ), - $new_notifications_count + $new_notifications_count, ); return '
    ' . $notification . '
    '; diff --git a/inc/class-wpseo-content-images.php b/inc/class-wpseo-content-images.php index bae91bc6360..9e23a91f625 100644 --- a/inc/class-wpseo-content-images.php +++ b/inc/class-wpseo-content-images.php @@ -87,9 +87,7 @@ private function get_img_tag_source( $image ) { * @return string The content of the supplied post. */ private function get_post_content( $post_id, $post ) { - if ( $post === null ) { - $post = get_post( $post_id ); - } + $post ??= get_post( $post_id ); if ( $post === null ) { return ''; diff --git a/inc/class-wpseo-custom-taxonomies.php b/inc/class-wpseo-custom-taxonomies.php index e1fb1816b2a..3d2f1bae719 100644 --- a/inc/class-wpseo-custom-taxonomies.php +++ b/inc/class-wpseo-custom-taxonomies.php @@ -40,7 +40,7 @@ public static function get_custom_taxonomies() { array_push( self::$custom_taxonomies, self::add_custom_taxonomies_prefix( $custom_taxonomy ), - self::add_custom_taxonomies_description_prefix( $custom_taxonomy ) + self::add_custom_taxonomies_description_prefix( $custom_taxonomy ), ); } } diff --git a/inc/class-wpseo-image-utils.php b/inc/class-wpseo-image-utils.php index 6875aab7a08..dbb0b7d0bf2 100644 --- a/inc/class-wpseo-image-utils.php +++ b/inc/class-wpseo-image-utils.php @@ -26,9 +26,7 @@ public static function get_attachment_by_url( $url ) { static $uploads; - if ( $uploads === null ) { - $uploads = wp_get_upload_dir(); - } + $uploads ??= wp_get_upload_dir(); // Don't try to do this for external URLs. if ( strpos( $url, $uploads['baseurl'] ) !== 0 ) { @@ -188,7 +186,7 @@ public static function has_usable_file_size( $image ) { * * @param int $max_bytes The maximum weight (in bytes) of an image. */ - $max_size = apply_filters( 'wpseo_image_image_weight_limit', 2097152 ); + $max_size = apply_filters( 'wpseo_image_image_weight_limit', 2_097_152 ); // We cannot check without a path, so assume it's fine. if ( ! isset( $image['path'] ) ) { @@ -268,9 +266,7 @@ protected static function get_full_size_image_data( $attachment_id ) { public static function get_absolute_path( $path ) { static $uploads; - if ( $uploads === null ) { - $uploads = wp_get_upload_dir(); - } + $uploads ??= wp_get_upload_dir(); // Add the uploads basedir if the path does not start with it. if ( empty( $uploads['error'] ) && strpos( $path, $uploads['basedir'] ) !== 0 ) { diff --git a/inc/class-wpseo-meta.php b/inc/class-wpseo-meta.php index 5a4a136cbbd..61691cd4e87 100644 --- a/inc/class-wpseo-meta.php +++ b/inc/class-wpseo-meta.php @@ -267,7 +267,7 @@ public static function init() { register_meta( 'post', self::$meta_prefix . $key, - [ 'sanitize_callback' => [ self::class, 'sanitize_post_meta' ] ] + [ 'sanitize_callback' => [ self::class, 'sanitize_post_meta' ] ], ); // Set the $fields_index property for efficiency. @@ -398,7 +398,7 @@ public static function sanitize_post_meta( $meta_value, $meta_key ) { case ( $meta_key === self::$meta_prefix . 'linkdex' ): $int = WPSEO_Utils::validate_int( $meta_value ); if ( $int !== false && $int >= 0 ) { - $clean = strval( $int ); // Convert to string to make sure default check works. + $clean = (string) $int; // Convert to string to make sure default check works. } break; @@ -721,7 +721,7 @@ public static function replace_meta( $old_metakey, $new_metakey, $delete_old = f ;", $old_metakey, $wpdb->esc_like( self::$meta_prefix . '%' ), - self::$meta_prefix . 'linkdex' + self::$meta_prefix . 'linkdex', ); $oldies = $wpdb->get_results( $query ); @@ -773,7 +773,7 @@ public static function clean_up() { ;", self::$meta_prefix . 'meta-robots', self::$meta_prefix . 'meta-robots-noindex', - self::$meta_prefix . 'meta-robots-nofollow' + self::$meta_prefix . 'meta-robots-nofollow', ); $oldies = $wpdb->get_results( $query ); @@ -825,7 +825,7 @@ public static function clean_up() { $query[] = $wpdb->prepare( "( meta_key = %s AND meta_value NOT IN ( '" . implode( "','", esc_sql( $valid ) ) . "' ) )", - self::$meta_prefix . $key + self::$meta_prefix . $key, ); unset( $valid ); } @@ -833,13 +833,13 @@ public static function clean_up() { $query[] = $wpdb->prepare( '( meta_key = %s AND meta_value = %s )', self::$meta_prefix . $key, - $field_def['default_value'] + $field_def['default_value'], ); } else { $query[] = $wpdb->prepare( "( meta_key = %s AND meta_value = '' )", - self::$meta_prefix . $key + self::$meta_prefix . $key, ); } } @@ -877,7 +877,7 @@ public static function clean_up() { */ $query = $wpdb->prepare( "SELECT meta_id, meta_value FROM {$wpdb->postmeta} WHERE meta_key = %s", - self::$meta_prefix . 'meta-robots-adv' + self::$meta_prefix . 'meta-robots-adv', ); $oldies = $wpdb->get_results( $query ); diff --git a/inc/class-wpseo-rank.php b/inc/class-wpseo-rank.php index a8b9c101519..8f0e514045f 100644 --- a/inc/class-wpseo-rank.php +++ b/inc/class-wpseo-rank.php @@ -168,27 +168,27 @@ public function get_drop_down_label() { self::NO_FOCUS => sprintf( /* translators: %s expands to the SEO score */ __( 'SEO: %s', 'wordpress-seo' ), - __( 'No Focus Keyphrase', 'wordpress-seo' ) + __( 'No Focus Keyphrase', 'wordpress-seo' ), ), self::BAD => sprintf( /* translators: %s expands to the SEO score */ __( 'SEO: %s', 'wordpress-seo' ), - __( 'Needs improvement', 'wordpress-seo' ) + __( 'Needs improvement', 'wordpress-seo' ), ), self::OK => sprintf( /* translators: %s expands to the SEO score */ __( 'SEO: %s', 'wordpress-seo' ), - __( 'OK', 'wordpress-seo' ) + __( 'OK', 'wordpress-seo' ), ), self::GOOD => sprintf( /* translators: %s expands to the SEO score */ __( 'SEO: %s', 'wordpress-seo' ), - __( 'Good', 'wordpress-seo' ) + __( 'Good', 'wordpress-seo' ), ), self::NO_INDEX => sprintf( /* translators: %s expands to the SEO score */ __( 'SEO: %s', 'wordpress-seo' ), - __( 'Post Noindexed', 'wordpress-seo' ) + __( 'Post Noindexed', 'wordpress-seo' ), ), ]; @@ -205,22 +205,22 @@ public function get_drop_down_readability_labels() { self::BAD => sprintf( /* translators: %s expands to the readability score */ __( 'Readability: %s', 'wordpress-seo' ), - __( 'Needs improvement', 'wordpress-seo' ) + __( 'Needs improvement', 'wordpress-seo' ), ), self::OK => sprintf( /* translators: %s expands to the readability score */ __( 'Readability: %s', 'wordpress-seo' ), - __( 'OK', 'wordpress-seo' ) + __( 'OK', 'wordpress-seo' ), ), self::GOOD => sprintf( /* translators: %s expands to the readability score */ __( 'Readability: %s', 'wordpress-seo' ), - __( 'Good', 'wordpress-seo' ) + __( 'Good', 'wordpress-seo' ), ), self::NO_FOCUS => sprintf( /* translators: %s expands to the readability score */ __( 'Readability: %s', 'wordpress-seo' ), - __( 'Not analyzed', 'wordpress-seo' ) + __( 'Not analyzed', 'wordpress-seo' ), ), ]; @@ -237,17 +237,17 @@ public function get_drop_down_inclusive_language_labels() { self::BAD => sprintf( /* translators: %s expands to the inclusive language score */ __( 'Inclusive language: %s', 'wordpress-seo' ), - __( 'Needs improvement', 'wordpress-seo' ) + __( 'Needs improvement', 'wordpress-seo' ), ), self::OK => sprintf( /* translators: %s expands to the inclusive language score */ __( 'Inclusive language: %s', 'wordpress-seo' ), - __( 'Potentially non-inclusive', 'wordpress-seo' ) + __( 'Potentially non-inclusive', 'wordpress-seo' ), ), self::GOOD => sprintf( /* translators: %s expands to the inclusive language score */ __( 'Inclusive language: %s', 'wordpress-seo' ), - __( 'Good', 'wordpress-seo' ) + __( 'Good', 'wordpress-seo' ), ), ]; diff --git a/inc/class-wpseo-replace-vars.php b/inc/class-wpseo-replace-vars.php index b4ebbd76306..8f0f679b488 100644 --- a/inc/class-wpseo-replace-vars.php +++ b/inc/class-wpseo-replace-vars.php @@ -181,7 +181,7 @@ public function replace( $text, $args, $omit = [] ) { array_keys( $replacements ), // Make sure to exclude replacement values that are arrays e.g. coming from a custom field serialized value. array_filter( array_values( $replacements ), 'is_scalar' ), - $text + $text, ); } @@ -1306,7 +1306,7 @@ public function get_replacement_variables_with_labels() { $replacement_variables = array_filter( array_merge( self::$help_texts['basic'], self::$help_texts['advanced'] ), [ $this, 'is_not_prefixed' ], - ARRAY_FILTER_USE_KEY + ARRAY_FILTER_USE_KEY, ); $hidden = $this->get_hidden_replace_vars(); @@ -1323,8 +1323,8 @@ static function ( WPSEO_Replacement_Variable $replacement_variable ) use ( $hidd 'hidden' => in_array( $name, $hidden, true ), ]; }, - array_merge( $replacement_variables, $custom_variables ) - ) + array_merge( $replacement_variables, $custom_variables ), + ), ); } @@ -1339,7 +1339,7 @@ public function get_replacement_variables_list() { $replacement_variables = array_merge( $this->get_replacement_variables(), WPSEO_Custom_Fields::get_custom_fields(), - WPSEO_Custom_Taxonomies::get_custom_taxonomies() + WPSEO_Custom_Taxonomies::get_custom_taxonomies(), ); return array_map( [ $this, 'format_replacement_variable' ], $replacement_variables ); @@ -1463,7 +1463,7 @@ private static function set_basic_help_texts() { $separator_description = sprintf( $separator_description, // 'wp_title()' - 'wp_title()' + 'wp_title()', ); $replacement_variables = [ @@ -1621,7 +1621,7 @@ private function get_term_hierarchy() { return rtrim( get_term_parents_list( $this->args->term_id, $this->args->taxonomy, $args ), - $separator + $separator, ); } diff --git a/inc/class-wpseo-utils.php b/inc/class-wpseo-utils.php index 17541e60e17..914320d702d 100644 --- a/inc/class-wpseo-utils.php +++ b/inc/class-wpseo-utils.php @@ -198,10 +198,10 @@ public static function sanitize_url( $value, $allowed_protocols = [ 'http', 'htt $parts['host'] = preg_replace( '`[^a-z0-9-.:\[\]\\x80-\\xff]`', '', - strtolower( $parts['host'] ) + strtolower( $parts['host'] ), ); - $url .= $parts['host'] . ( isset( $parts['port'] ) ? ':' . intval( $parts['port'] ) : '' ); + $url .= $parts['host'] . ( isset( $parts['port'] ) ? ':' . (int) $parts['port'] : '' ); } if ( isset( $parts['path'] ) && strpos( $parts['path'], '/' ) === 0 ) { @@ -219,7 +219,7 @@ public static function sanitize_url( $value, $allowed_protocols = [ 'http', 'htt $parsed_query = array_combine( self::sanitize_encoded_text_field( array_keys( $parsed_query ) ), - self::sanitize_encoded_text_field( array_values( $parsed_query ) ) + self::sanitize_encoded_text_field( array_values( $parsed_query ) ), ); $url = add_query_arg( $parsed_query, $url ); @@ -235,7 +235,7 @@ public static function sanitize_url( $value, $allowed_protocols = [ 'http', 'htt static function ( $octects ) { return strtolower( $octects[0] ); }, - $url + $url, ); } @@ -551,14 +551,14 @@ public static function calc( $number1, $action, $number2, $round = false, $decim if ( isset( $result ) ) { if ( $compare === false ) { if ( $round === true ) { - $result = round( floatval( $result ), $decimals ); + $result = round( (float) $result, $decimals ); if ( $decimals === 0 ) { $result = (int) $result; } } else { // phpcs:ignore Universal.Operators.StrictComparisons -- Purposeful loose comparison. - $result = ( intval( $result ) == $result ) ? intval( $result ) : floatval( $result ); + $result = ( intval( $result ) == $result ) ? (int) $result : (float) $result; } } diff --git a/inc/options/class-wpseo-option-ms.php b/inc/options/class-wpseo-option-ms.php index c47b179d017..b0b38e15f22 100644 --- a/inc/options/class-wpseo-option-ms.php +++ b/inc/options/class-wpseo-option-ms.php @@ -206,7 +206,7 @@ protected function validate_option( $dirty, $clean, $old ) { $key, // Suffix-ID for the error message box. /* translators: %1$s expands to the option name and %2$sexpands to Yoast SEO */ sprintf( __( '%1$s is not a valid choice for who should be allowed access to the %2$s settings. Value reset to the default.', 'wordpress-seo' ), esc_html( sanitize_text_field( $dirty[ $key ] ) ), 'Yoast SEO' ), // The error message. - 'error' // Message type. + 'error', // Message type. ); } break; @@ -229,9 +229,9 @@ protected function validate_option( $dirty, $clean, $old ) { . sprintf( /* translators: %s is the ID number of a blog. */ esc_html__( 'This must be an existing blog. Blog %s does not exist or has been marked as deleted.', 'wordpress-seo' ), - '' . esc_html( sanitize_text_field( $dirty[ $key ] ) ) . '' + '' . esc_html( sanitize_text_field( $dirty[ $key ] ) ) . '', ), // The error message. - 'error' // Message type. + 'error', // Message type. ); } unset( $exists ); @@ -241,7 +241,7 @@ protected function validate_option( $dirty, $clean, $old ) { $this->group_name, // Slug title of the setting. $key, // Suffix-ID for the error message box. esc_html__( 'The default blog setting must be the numeric blog id of the blog you want to use as default.', 'wordpress-seo' ) . '
    ' . esc_html__( 'No numeric value was received.', 'wordpress-seo' ), // The error message. - 'error' // Message type. + 'error', // Message type. ); } unset( $int ); diff --git a/inc/options/class-wpseo-option-titles.php b/inc/options/class-wpseo-option-titles.php index e3a9bb5fab4..4b127c97c8b 100644 --- a/inc/options/class-wpseo-option-titles.php +++ b/inc/options/class-wpseo-option-titles.php @@ -543,7 +543,7 @@ protected function validate_option( $dirty, $clean, $old ) { $key, // Suffix-id for the error message box. /* translators: %s expands to a post type. */ sprintf( __( 'Please select a valid taxonomy for post type "%s"', 'wordpress-seo' ), $post_type ), // The error message. - 'error' // Message type. + 'error', // Message type. ); } } @@ -581,7 +581,7 @@ protected function validate_option( $dirty, $clean, $old ) { '_' . $tax, // Suffix-ID for the error message box. /* translators: %s expands to a taxonomy slug. */ sprintf( __( 'Please select a valid post type for taxonomy "%s"', 'wordpress-seo' ), $tax ), // The error message. - 'error' // Message type. + 'error', // Message type. ); unset( $tax ); } diff --git a/inc/options/class-wpseo-options.php b/inc/options/class-wpseo-options.php index 225d3601051..790a4261ab9 100644 --- a/inc/options/class-wpseo-options.php +++ b/inc/options/class-wpseo-options.php @@ -561,9 +561,7 @@ protected static function add_ms_option( $option ) { protected static function is_multisite() { static $is_multisite; - if ( $is_multisite === null ) { - $is_multisite = is_multisite(); - } + $is_multisite ??= is_multisite(); return $is_multisite; } diff --git a/inc/sitemaps/class-post-type-sitemap-provider.php b/inc/sitemaps/class-post-type-sitemap-provider.php index d018ad0b3ce..a621464e18d 100644 --- a/inc/sitemaps/class-post-type-sitemap-provider.php +++ b/inc/sitemaps/class-post-type-sitemap-provider.php @@ -365,7 +365,7 @@ protected function get_first_links( $post_type ) { $page_on_front_id = (int) get_option( 'page_on_front' ); if ( $page_on_front_id > 0 ) { $front_page = $this->get_url( - get_post( $page_on_front_id ) + get_post( $page_on_front_id ), ); } @@ -404,7 +404,7 @@ protected function get_first_links( $post_type ) { $archive_url = apply_filters( 'wpseo_sitemap_post_type_archive_link', $this->get_post_type_archive_link( $post_type ), - $post_type + $post_type, ); } @@ -626,7 +626,7 @@ protected function get_url( $post ) { $url['loc'] = apply_filters( 'wpseo_xml_sitemap_post_url', get_permalink( $post ), $post ); $link_type = YoastSEO()->helpers->url->get_link_type( wp_parse_url( $url['loc'] ), - $this->get_parsed_home_url() + $this->get_parsed_home_url(), ); /* @@ -696,7 +696,7 @@ private function get_all_dates_using_with_clause( $post_type, $max_entries ) { 'post_modified_gmt', 'ordering', $max_entries, - ] + ], ); //phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- We need to use a direct query here. @@ -714,8 +714,8 @@ private function get_all_dates_using_with_clause( $post_type, $max_entries ) { FROM %i WHERE MOD(n, %d) = 0; ', - $replacements - ) + $replacements, + ), ); } @@ -744,7 +744,7 @@ private function get_all_dates( $post_type, $max_entries ) { $post_type, $max_entries, 'post_modified_gmt', - ] + ], ); return $wpdb->get_col( @@ -759,8 +759,8 @@ private function get_all_dates( $post_type, $max_entries ) { AND ( @rownum:=@rownum+1 ) %% %d = 0 ORDER BY %i ASC ', - $replacements - ) + $replacements, + ), ); } } diff --git a/inc/sitemaps/class-sitemap-image-parser.php b/inc/sitemaps/class-sitemap-image-parser.php index 58d8ec5a952..1a883999708 100644 --- a/inc/sitemaps/class-sitemap-image-parser.php +++ b/inc/sitemaps/class-sitemap-image-parser.php @@ -257,7 +257,7 @@ protected function parse_galleries( $content, $post_id = 0 ) { $id = $post_id; if ( ! empty( $gallery['id'] ) ) { - $id = intval( $gallery['id'] ); + $id = (int) $gallery['id']; } // Forked from core gallery_shortcode() to have exact same logic. R. @@ -467,7 +467,7 @@ protected function get_gallery_attachments_for_included( $included_ids ) { [ 'posts_per_page' => count( $ids_to_include ), 'post__in' => $ids_to_include, - ] + ], ); $gallery_attachments = []; diff --git a/inc/sitemaps/class-sitemaps-cache-validator.php b/inc/sitemaps/class-sitemaps-cache-validator.php index 166d181fc3f..49c2463e330 100644 --- a/inc/sitemaps/class-sitemaps-cache-validator.php +++ b/inc/sitemaps/class-sitemaps-cache-validator.php @@ -110,8 +110,8 @@ public static function truncate_type( $type, $prefix = '', $postfix = '' ) { throw new OutOfRangeException( __( 'Trying to build the sitemap cache key, but the postfix and prefix combination leaves too little room to do this. You are probably requesting a page that is way out of the expected range.', - 'wordpress-seo' - ) + 'wordpress-seo', + ), ); } @@ -195,8 +195,8 @@ public static function cleanup_database( $type = null, $validator = null ) { $wpdb->prepare( //phpcs:disable WordPress.DB.PreparedSQLPlaceholders -- %i placeholder is still not recognized. 'DELETE FROM %i WHERE ' . implode( ' OR ', array_fill( 0, count( $where ), '%s' ) ), - array_merge( [ $wpdb->options ], $where ) - ) + array_merge( [ $wpdb->options ], $where ), + ), ); wp_cache_delete( 'alloptions', 'options' ); diff --git a/inc/sitemaps/class-sitemaps.php b/inc/sitemaps/class-sitemaps.php index dd8f350343a..c7653259387 100644 --- a/inc/sitemaps/class-sitemaps.php +++ b/inc/sitemaps/class-sitemaps.php @@ -194,8 +194,8 @@ public function register_xsl( $name, $building_function, $rewrite = '' ) { * @return void */ public function set_n( $current_page ) { - if ( is_scalar( $current_page ) && intval( $current_page ) > 0 ) { - $this->current_page = intval( $current_page ); + if ( is_scalar( $current_page ) && (int) $current_page > 0 ) { + $this->current_page = (int) $current_page; } } @@ -270,7 +270,7 @@ public function redirect( $query ) { if ( get_query_var( 'sitemap_n' ) === '1' || get_query_var( 'sitemap_n' ) === '0' ) { wp_safe_redirect( home_url( "/$type-sitemap.xml" ), 301, 'Yoast SEO' ); - exit; + exit(); } $this->set_n( get_query_var( 'sitemap_n' ) ); @@ -539,7 +539,7 @@ public static function get_last_modified_gmt( $post_types, $return_all = false ) [ 'post_type', 'date', - ] + ], ); //phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- We need to use a direct query here. @@ -555,8 +555,8 @@ public static function get_last_modified_gmt( $post_types, $return_all = false ) GROUP BY %i ORDER BY %i DESC ', - $replacements - ) + $replacements, + ), ); foreach ( $dates as $obj ) { diff --git a/inc/sitemaps/class-taxonomy-sitemap-provider.php b/inc/sitemaps/class-taxonomy-sitemap-provider.php index e69f0e79182..064c808572e 100644 --- a/inc/sitemaps/class-taxonomy-sitemap-provider.php +++ b/inc/sitemaps/class-taxonomy-sitemap-provider.php @@ -202,7 +202,7 @@ public function get_sitemap_links( $type, $max_entries, $current_page ) { 'update_term_meta_cache' => false, 'offset' => $offset, 'number' => $steps, - ] + ], ); // If there are no terms fetched for this range, we are on an invalid page. @@ -227,7 +227,7 @@ public function get_sitemap_links( $type, $max_entries, $current_page ) { 'post_status', ], $post_statuses, - [ 'post_password' ] + [ 'post_password' ], ); /** @@ -279,8 +279,8 @@ public function get_sitemap_links( $type, $max_entries, $current_page ) { WHERE p.%i IN (' . implode( ', ', array_fill( 0, count( $post_statuses ), '%s' ) ) . ") AND p.%i = '' ", - $current_replacements - ) + $current_replacements, + ), ); if ( $this->include_images ) { diff --git a/lib/migrations/adapter.php b/lib/migrations/adapter.php index 561f5e53ad2..ff70d587e46 100644 --- a/lib/migrations/adapter.php +++ b/lib/migrations/adapter.php @@ -604,7 +604,7 @@ public function add_index( $table_name, $column_name, $options = [] ) { ( $unique === true ) ? 'UNIQUE ' : '', $this->identifier( $index_name ), $this->identifier( $table_name ), - \implode( ', ', $cols ) + \implode( ', ', $cols ), ); return $this->execute_ddl( $sql ); @@ -658,7 +658,7 @@ public function add_timestamps( $table_name, $created_column_name, $updated_colu 'null' => false, 'default' => 'CURRENT_TIMESTAMP', 'extra' => 'ON UPDATE CURRENT_TIMESTAMP', - ] + ], ); return $created_at && $updated_at; @@ -813,7 +813,7 @@ public function type_to_sql( $type, $options = [] ) { else { $column_type_sql .= \sprintf( "('%s')", - \implode( "','", \array_map( [ $this, 'quote_string' ], $values ) ) + \implode( "','", \array_map( [ $this, 'quote_string' ], $values ) ), ); } } diff --git a/lib/migrations/table.php b/lib/migrations/table.php index 8ad2228cb42..5ca7adf27aa 100644 --- a/lib/migrations/table.php +++ b/lib/migrations/table.php @@ -150,7 +150,7 @@ public function timestamps( $created_column_name = 'created_at', $updated_column 'null' => false, 'default' => 'CURRENT_TIMESTAMP', 'extra' => 'ON UPDATE CURRENT_TIMESTAMP', - ] + ], ); } @@ -208,7 +208,7 @@ public function finish( $wants_sql = false ) { 'unsigned' => true, 'null' => false, 'auto_increment' => true, - ] + ], ); $create_table_sql .= $primary_id->to_sql() . ",\n"; } diff --git a/lib/model.php b/lib/model.php index eb767b1d1d5..2b8b6c693ee 100644 --- a/lib/model.php +++ b/lib/model.php @@ -484,7 +484,7 @@ protected function has_many_through( $associated_class_name, $join_class_name = "{$associated_table_name}.{$associated_table_id_column}", '=', "{$join_table_name}.{$key_to_associated_table}", - ] + ], ) ->where( "{$join_table_name}.{$key_to_base_table}", $this->{$base_table_id_column} ); } diff --git a/lib/orm.php b/lib/orm.php index 8681f22dc20..afaff54c56a 100644 --- a/lib/orm.php +++ b/lib/orm.php @@ -281,7 +281,7 @@ protected static function execute( $query, $parameters = [] ) { $parameters, static function ( $parameter ) { return $parameter !== null; - } + }, ); if ( ! empty( $parameters ) ) { $query = $wpdb->prepare( $query, $parameters ); @@ -1080,7 +1080,7 @@ protected function add_condition( $type, $fragment, $values = [] ) { [ self::CONDITION_FRAGMENT => $fragment, self::CONDITION_VALUES => $values, - ] + ], ); return $this; @@ -1742,7 +1742,7 @@ protected function build_select() { $this->build_order_by(), $this->build_limit(), $this->build_offset(), - ] + ], ); } @@ -2439,7 +2439,7 @@ public function delete_many() { 'DELETE FROM', $this->quote_identifier( $this->table_name ), $this->build_where(), - ] + ], ); return self::execute( $query, $this->values ); diff --git a/readme.txt b/readme.txt index ba48f80a4a1..4254ed6cd4e 100644 --- a/readme.txt +++ b/readme.txt @@ -309,17 +309,17 @@ Release date: 2026-02-17 #### Enhancements -* Adds `html-react-parser` dependency for improved HTML string handling in React components. -* Adds `images` array to FAQ and How-to blocks attributes for explicit image handling. -* Migrates FAQ block's question/answer fields from array-based formats to HTML strings for better compatibility with WordPress components. -* Migrates How-to block's step name/text fields from array-based formats to HTML strings for better compatibility with WordPress components. -* Updates the design for the search appearance mode switcher. +* Introduces an `images` array attribute to FAQ and How-to blocks to allow for explicit image handling. +* Integrates `html-react-parser` to improve HTML string handling within React components. +* Migrates FAQ block question and answer fields from arrays to HTML strings to improve compatibility with WordPress components. +* Migrates How-to block step name and text fields from arrays to HTML strings to improve compatibility with WordPress components. +* Refines the design of the search appearance mode switcher. #### Bugfixes -* Fixes a bug where inline link icon was missing when editing a sync pattern in the block editor with WordPress 6.9. +* Fixes a bug where the inline link icon was missing when editing a synced pattern in the Block Editor on WordPress 6.9. * Fixes a bug where the AI Optimize buttons remained active even when another button had been pressed. -* Fixes a bug where the _subheading distribution assessment_ threw an error when there was some text with no subheadings plus a block containing a subheading (like the Yoast Table of contents block). +* Fixes a bug where the subheading distribution assessment threw an error when the content contained text without subheadings followed by a block that included a subheading (such as a Table of Contents block). #### Other diff --git a/src/actions/configuration/first-time-configuration-action.php b/src/actions/configuration/first-time-configuration-action.php index 6b518540d68..6fb3595b47f 100644 --- a/src/actions/configuration/first-time-configuration-action.php +++ b/src/actions/configuration/first-time-configuration-action.php @@ -151,7 +151,7 @@ public function set_person_social_profiles( $params ) { static function ( $key ) { return $key !== 'user_id'; }, - \ARRAY_FILTER_USE_KEY + \ARRAY_FILTER_USE_KEY, ); $failures = $this->social_profiles_helper->set_person_social_profiles( $params['user_id'], $social_profiles ); diff --git a/src/actions/importing/aioseo/aioseo-cleanup-action.php b/src/actions/importing/aioseo/aioseo-cleanup-action.php index 13195bfba72..c2f90288223 100644 --- a/src/actions/importing/aioseo/aioseo-cleanup-action.php +++ b/src/actions/importing/aioseo/aioseo-cleanup-action.php @@ -130,7 +130,7 @@ public function cleanup_postmeta_query() { // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Reason: There is no unescaped user input. return $this->wpdb->prepare( "DELETE FROM {$table} WHERE meta_key IN (" . \implode( ', ', \array_fill( 0, \count( $meta_keys_to_delete ), '%s' ) ) . ')', - $meta_keys_to_delete + $meta_keys_to_delete, ); // phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared } diff --git a/src/actions/importing/aioseo/aioseo-posts-importing-action.php b/src/actions/importing/aioseo/aioseo-posts-importing-action.php index 71bdbdbc1ec..eff92311c25 100644 --- a/src/actions/importing/aioseo/aioseo-posts-importing-action.php +++ b/src/actions/importing/aioseo/aioseo-posts-importing-action.php @@ -461,7 +461,7 @@ public function query( $limit = false, $just_detect = false ) { // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Reason: There is no unescaped user input. return $this->wpdb->prepare( "SELECT {$select_statement} FROM {$table} WHERE id > %d ORDER BY id{$limit_statement}", - $replacements + $replacements, ); // phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared } diff --git a/src/actions/importing/aioseo/aioseo-validate-data-action.php b/src/actions/importing/aioseo/aioseo-validate-data-action.php index 17817f1d1f2..72a3f03aa2e 100644 --- a/src/actions/importing/aioseo/aioseo-validate-data-action.php +++ b/src/actions/importing/aioseo/aioseo-validate-data-action.php @@ -142,7 +142,7 @@ public function validate_aioseo_table() { $aioseo_columns = $this->wpdb->get_col( "SHOW COLUMNS FROM {$table}", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Reason: There is no unescaped user input. - 0 + 0, ); return $needed_data === \array_intersect( $needed_data, $aioseo_columns ); diff --git a/src/actions/indexing/indexable-post-indexation-action.php b/src/actions/indexing/indexable-post-indexation-action.php index d549a2b9842..88854226147 100644 --- a/src/actions/indexing/indexable-post-indexation-action.php +++ b/src/actions/indexing/indexable-post-indexation-action.php @@ -143,7 +143,7 @@ protected function get_count_query() { $excluded_post_statuses = $this->post_helper->get_excluded_post_statuses(); $replacements = \array_merge( $post_types, - $excluded_post_statuses + $excluded_post_statuses, ); $replacements[] = $this->version; @@ -160,7 +160,7 @@ protected function get_count_query() { SELECT I.object_id from $indexable_table as I WHERE I.object_type = 'post' AND I.version = %d )", - $replacements + $replacements, ); } @@ -178,7 +178,7 @@ protected function get_select_query( $limit = false ) { $excluded_post_statuses = $this->post_helper->get_excluded_post_statuses(); $replacements = \array_merge( $post_types, - $excluded_post_statuses + $excluded_post_statuses, ); $replacements[] = $this->version; @@ -201,7 +201,7 @@ protected function get_select_query( $limit = false ) { WHERE I.object_type = 'post' AND I.version = %d ) $limit_query", - $replacements + $replacements, ); } } diff --git a/src/actions/indexing/indexable-term-indexation-action.php b/src/actions/indexing/indexable-term-indexation-action.php index b1dbfd356a8..0d0b54d24ea 100644 --- a/src/actions/indexing/indexable-term-indexation-action.php +++ b/src/actions/indexing/indexable-term-indexation-action.php @@ -148,7 +148,7 @@ protected function get_count_query() { AND I.version = %d WHERE I.object_id IS NULL AND taxonomy IN ($taxonomies_placeholders)", - $replacements + $replacements, ); } @@ -191,7 +191,7 @@ protected function get_select_query( $limit = false ) { WHERE I.object_id IS NULL AND taxonomy IN ($placeholders) $limit_query", - $replacements + $replacements, ); } } diff --git a/src/actions/indexing/post-link-indexing-action.php b/src/actions/indexing/post-link-indexing-action.php index 3f96a5ec9a8..0d13a0741be 100644 --- a/src/actions/indexing/post-link-indexing-action.php +++ b/src/actions/indexing/post-link-indexing-action.php @@ -63,7 +63,7 @@ static function ( $post ) { 'content' => $post->post_content, ]; }, - $posts + $posts, ); } @@ -94,7 +94,7 @@ protected function get_count_query() { WHERE ( I.object_id IS NULL OR L.post_id IS NOT NULL ) AND P.post_status = 'publish' AND P.post_type IN (" . \implode( ', ', \array_fill( 0, \count( $public_post_types ), '%s' ) ) . ')', - $public_post_types + $public_post_types, ); } @@ -136,7 +136,7 @@ protected function get_select_query( $limit = false ) { AND P.post_status = 'publish' AND P.post_type IN (" . \implode( ', ', \array_fill( 0, \count( $public_post_types ), '%s' ) ) . ") $limit_query", - $replacements + $replacements, ); } } diff --git a/src/actions/indexing/term-link-indexing-action.php b/src/actions/indexing/term-link-indexing-action.php index 3e6a4bc3a31..68a3432f5aa 100644 --- a/src/actions/indexing/term-link-indexing-action.php +++ b/src/actions/indexing/term-link-indexing-action.php @@ -67,7 +67,7 @@ static function ( $term ) { 'content' => $term->description, ]; }, - $terms + $terms, ); } @@ -97,7 +97,7 @@ protected function get_count_query() { AND I.link_count IS NOT NULL WHERE I.object_id IS NULL AND T.taxonomy IN ($placeholders)", - $public_taxonomies + $public_taxonomies, ); } @@ -136,7 +136,7 @@ protected function get_select_query( $limit = false ) { WHERE I.object_id IS NULL AND T.taxonomy IN (" . \implode( ', ', \array_fill( 0, \count( $public_taxonomies ), '%s' ) ) . ") $limit_query", - $replacements + $replacements, ); } } diff --git a/src/actions/wincher/wincher-keyphrases-action.php b/src/actions/wincher/wincher-keyphrases-action.php index dd51f5b6658..5b469682ba2 100644 --- a/src/actions/wincher/wincher-keyphrases-action.php +++ b/src/actions/wincher/wincher-keyphrases-action.php @@ -85,7 +85,7 @@ public function track_keyphrases( $keyphrases, $limits ) { try { $endpoint = \sprintf( self::KEYPHRASES_ADD_URL, - $this->options_helper->get( 'wincher_website_id' ) + $this->options_helper->get( 'wincher_website_id' ), ); // Enforce arrrays to ensure a consistent way of preparing the request. @@ -113,8 +113,8 @@ static function ( $keyphrase ) { 'groups' => [], ]; }, - $keyphrases - ) + $keyphrases, + ), ); $results = $this->client->post( $endpoint, WPSEO_Utils::format_json_encode( $formatted_keyphrases ) ); @@ -131,12 +131,12 @@ static function ( $keyphrase ) { 'keyword' => $keyphrase['keyword'], ]; }, - $results['data'] + $results['data'], ); $results['data'] = \array_combine( \array_column( $results['data'], 'keyword' ), - \array_values( $results['data'] ) + \array_values( $results['data'] ), ); return $this->to_result_object( $results ); @@ -160,7 +160,7 @@ public function untrack_keyphrase( $keyphrase_id ) { $endpoint = \sprintf( self::KEYPHRASE_DELETE_URL, $this->options_helper->get( 'wincher_website_id' ), - $keyphrase_id + $keyphrase_id, ); $this->client->delete( $endpoint ); @@ -188,9 +188,7 @@ public function untrack_keyphrase( $keyphrase_id ) { */ public function get_tracked_keyphrases( $used_keyphrases = null, $permalink = null, $start_at = null ) { try { - if ( $used_keyphrases === null ) { - $used_keyphrases = $this->collect_all_keyphrases(); - } + $used_keyphrases ??= $this->collect_all_keyphrases(); // If we still have no keyphrases the API will return an error, so // don't even bother sending a request. @@ -199,13 +197,13 @@ public function get_tracked_keyphrases( $used_keyphrases = null, $permalink = nu [ 'data' => [], 'status' => 200, - ] + ], ); } $endpoint = \sprintf( self::KEYPHRASES_URL, - $this->options_helper->get( 'wincher_website_id' ) + $this->options_helper->get( 'wincher_website_id' ), ); $results = $this->client->post( @@ -215,11 +213,11 @@ public function get_tracked_keyphrases( $used_keyphrases = null, $permalink = nu 'keywords' => $used_keyphrases, 'url' => $permalink, 'start_at' => $start_at, - ] + ], ), [ 'timeout' => 60, - ] + ], ); if ( ! \array_key_exists( 'data', $results ) ) { @@ -231,7 +229,7 @@ public function get_tracked_keyphrases( $used_keyphrases = null, $permalink = nu // Extract the positional data and assign it to the keyphrase. $results['data'] = \array_combine( \array_column( $results['data'], 'keyword' ), - \array_values( $results['data'] ) + \array_values( $results['data'] ), ); return $this->to_result_object( $results ); @@ -287,7 +285,7 @@ protected function collect_all_keyphrases() { ->where_not_equal( 'post_status', 'trash' ) ->distinct() ->find_array(), - 'primary_focus_keyword' + 'primary_focus_keyword', ); /** @@ -314,7 +312,7 @@ protected function filter_results_by_used_keyphrases( $results, $used_keyphrases $results, static function ( $result ) use ( $used_keyphrases ) { return \in_array( $result['keyword'], \array_map( 'strtolower', $used_keyphrases ), true ); - } + }, ); } diff --git a/src/ai-authorization/application/token-manager.php b/src/ai-authorization/application/token-manager.php index 42b6eadddc9..8b62c724360 100644 --- a/src/ai-authorization/application/token-manager.php +++ b/src/ai-authorization/application/token-manager.php @@ -156,8 +156,8 @@ public function token_invalidate( string $user_id ): void { new Request( '/token/invalidate', $request_body, - $request_headers - ) + $request_headers, + ), ); } catch ( Unauthorized_Exception | Forbidden_Exception $e ) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedCatch -- Reason: Ignored on purpose. // If the credentials in our request were already invalid, our job is done and we continue to remove the tokens client-side. diff --git a/src/ai-authorization/infrastructure/access-token-user-meta-repository.php b/src/ai-authorization/infrastructure/access-token-user-meta-repository.php index 2dc0a3f02b5..41315edc16a 100644 --- a/src/ai-authorization/infrastructure/access-token-user-meta-repository.php +++ b/src/ai-authorization/infrastructure/access-token-user-meta-repository.php @@ -57,7 +57,7 @@ public function store_token( int $user_id, string $value ): void { $this->user_helper->update_meta( $user_id, self::META_KEY, - $value + $value, ); } /** diff --git a/src/ai-authorization/infrastructure/code-verifier-user-meta-repository.php b/src/ai-authorization/infrastructure/code-verifier-user-meta-repository.php index f281da8381d..be5a1dad6d5 100644 --- a/src/ai-authorization/infrastructure/code-verifier-user-meta-repository.php +++ b/src/ai-authorization/infrastructure/code-verifier-user-meta-repository.php @@ -55,7 +55,7 @@ public function store_code_verifier( int $user_id, string $code, int $created_at [ 'code' => $code, 'created_at' => $created_at, - ] + ], ); } diff --git a/src/ai-authorization/infrastructure/refresh-token-user-meta-repository.php b/src/ai-authorization/infrastructure/refresh-token-user-meta-repository.php index ae7da309465..948940c1931 100644 --- a/src/ai-authorization/infrastructure/refresh-token-user-meta-repository.php +++ b/src/ai-authorization/infrastructure/refresh-token-user-meta-repository.php @@ -57,7 +57,7 @@ public function store_token( int $user_id, string $value ): void { $this->user_helper->update_meta( $user_id, self::META_KEY, - $value + $value, ); } /** diff --git a/src/ai-authorization/user-interface/abstract-callback-route.php b/src/ai-authorization/user-interface/abstract-callback-route.php index 5129b19db2e..e104c1b17cd 100644 --- a/src/ai-authorization/user-interface/abstract-callback-route.php +++ b/src/ai-authorization/user-interface/abstract-callback-route.php @@ -101,7 +101,7 @@ public function callback( WP_REST_Request $request ): WP_REST_Response { [ 'message' => 'Tokens successfully stored.', 'code_verifier' => $code_verifier->get_code(), - ] + ], ); } diff --git a/src/ai-authorization/user-interface/callback-route.php b/src/ai-authorization/user-interface/callback-route.php index ac22f0005b4..a653b93ef1a 100644 --- a/src/ai-authorization/user-interface/callback-route.php +++ b/src/ai-authorization/user-interface/callback-route.php @@ -54,7 +54,7 @@ public function register_routes() { ], 'callback' => [ $this, 'callback' ], 'permission_callback' => '__return_true', - ] + ], ); } } diff --git a/src/ai-authorization/user-interface/refresh-callback-route.php b/src/ai-authorization/user-interface/refresh-callback-route.php index b9d81cee557..ccb58b55843 100644 --- a/src/ai-authorization/user-interface/refresh-callback-route.php +++ b/src/ai-authorization/user-interface/refresh-callback-route.php @@ -54,7 +54,7 @@ public function register_routes() { ], 'callback' => [ $this, 'callback' ], 'permission_callback' => '__return_true', - ] + ], ); } } diff --git a/src/ai-consent/user-interface/consent-route.php b/src/ai-consent/user-interface/consent-route.php index e5dca97430f..922896a6d2b 100644 --- a/src/ai-consent/user-interface/consent-route.php +++ b/src/ai-consent/user-interface/consent-route.php @@ -97,7 +97,7 @@ public function register_routes() { ], 'callback' => [ $this, 'consent' ], 'permission_callback' => [ $this, 'check_permissions' ], - ] + ], ); } @@ -110,7 +110,7 @@ public function register_routes() { */ public function consent( WP_REST_Request $request ): WP_REST_Response { $user_id = \get_current_user_id(); - $consent = \boolval( $request->get_param( 'consent' ) ); + $consent = (bool) $request->get_param( 'consent' ); try { if ( $consent ) { diff --git a/src/ai-free-sparks/user-interface/free-sparks-route.php b/src/ai-free-sparks/user-interface/free-sparks-route.php index 8e2c6a27320..664d6922d97 100644 --- a/src/ai-free-sparks/user-interface/free-sparks-route.php +++ b/src/ai-free-sparks/user-interface/free-sparks-route.php @@ -66,7 +66,7 @@ public function register_routes() { 'methods' => 'POST', 'callback' => [ $this, 'start' ], 'permission_callback' => [ $this, 'can_edit_posts' ], - ] + ], ); } diff --git a/src/ai-generator/domain/suggestions-bucket.php b/src/ai-generator/domain/suggestions-bucket.php index 71399b567ed..478c07e2d9c 100644 --- a/src/ai-generator/domain/suggestions-bucket.php +++ b/src/ai-generator/domain/suggestions-bucket.php @@ -43,7 +43,7 @@ public function to_array() { static function ( $item ) { return $item->get_value(); }, - $this->suggestions + $this->suggestions, ); } } diff --git a/src/ai-generator/user-interface/bust-subscription-cache-route.php b/src/ai-generator/user-interface/bust-subscription-cache-route.php index 2a9a87ce7a2..33f830a286e 100644 --- a/src/ai-generator/user-interface/bust-subscription-cache-route.php +++ b/src/ai-generator/user-interface/bust-subscription-cache-route.php @@ -73,7 +73,7 @@ public function register_routes() { 'args' => [], 'callback' => [ $this, 'bust_subscription_cache' ], 'permission_callback' => [ $this, 'check_permissions' ], - ] + ], ); } diff --git a/src/ai-generator/user-interface/get-suggestions-route.php b/src/ai-generator/user-interface/get-suggestions-route.php index 5135ddcb85e..03e4b657dad 100644 --- a/src/ai-generator/user-interface/get-suggestions-route.php +++ b/src/ai-generator/user-interface/get-suggestions-route.php @@ -131,7 +131,7 @@ public function register_routes() { ], 'callback' => [ $this, 'get_suggestions' ], 'permission_callback' => [ $this, 'check_permissions' ], - ] + ], ); } @@ -152,7 +152,7 @@ public function get_suggestions( WP_REST_Request $request ): WP_REST_Response { $request->get_param( 'focus_keyphrase' ), $request->get_param( 'language' ), $request->get_param( 'platform' ), - $request->get_param( 'editor' ) + $request->get_param( 'editor' ), ); } catch ( Remote_Request_Exception $e ) { $message = [ @@ -164,7 +164,7 @@ public function get_suggestions( WP_REST_Request $request ): WP_REST_Response { } return new WP_REST_Response( $message, - $e->getCode() + $e->getCode(), ); } catch ( RuntimeException $e ) { return new WP_REST_Response( 'Failed to get suggestions.', 500 ); diff --git a/src/ai-generator/user-interface/get-usage-route.php b/src/ai-generator/user-interface/get-usage-route.php index 32f5acfa27a..adf1e640a29 100644 --- a/src/ai-generator/user-interface/get-usage-route.php +++ b/src/ai-generator/user-interface/get-usage-route.php @@ -102,7 +102,7 @@ public function register_routes() { ], 'callback' => [ $this, 'get_usage' ], 'permission_callback' => [ $this, 'check_permissions' ], - ] + ], ); } @@ -135,7 +135,7 @@ public function get_usage( $request ): WP_REST_Response { } return new WP_REST_Response( $message, - $e->getCode() + $e->getCode(), ); } diff --git a/src/ai-http-request/application/request-handler.php b/src/ai-http-request/application/request-handler.php index efd51bfc23a..757298d1a12 100644 --- a/src/ai-http-request/application/request-handler.php +++ b/src/ai-http-request/application/request-handler.php @@ -76,7 +76,7 @@ public function handle( Request $request ): Response { $request->get_action_path(), $request->get_body(), $request->get_headers(), - $request->is_post() + $request->is_post(), ); $response = $this->response_parser->parse( $api_response ); diff --git a/src/alerts/application/default-seo-data/default-seo-data-alert.php b/src/alerts/application/default-seo-data/default-seo-data-alert.php index 60af7692a26..915e7eaf7cd 100644 --- a/src/alerts/application/default-seo-data/default-seo-data-alert.php +++ b/src/alerts/application/default-seo-data/default-seo-data-alert.php @@ -160,7 +160,7 @@ private function get_default_seo_data_notification( $has_enough_posts_with_defau 'id' => self::NOTIFICATION_ID, 'type' => Yoast_Notification::WARNING, 'capabilities' => [ 'wpseo_manage_options' ], - ] + ], ); } @@ -197,7 +197,7 @@ private function get_default_seo_data_message( $has_enough_posts_with_default_ti '', '', '', - '' + '', ); } } diff --git a/src/alerts/application/ping-other-admins/ping-other-admins-alert.php b/src/alerts/application/ping-other-admins/ping-other-admins-alert.php index 25b0866fd08..b2cab981aee 100644 --- a/src/alerts/application/ping-other-admins/ping-other-admins-alert.php +++ b/src/alerts/application/ping-other-admins/ping-other-admins-alert.php @@ -160,7 +160,7 @@ private function get_ping_other_admins_notification(): Yoast_Notification { 'capabilities' => [ 'wpseo_manage_options' ], 'priority' => 20, 'resolve_nonce' => \wp_create_nonce( 'wpseo-resolve-alert-nonce' ), - ] + ], ); } @@ -173,7 +173,7 @@ private function get_message() { $message = \sprintf( /* translators: %1$s expands to "Yoast SEO". */ \esc_html__( 'Looks like you’re new here. %1$s makes it easy to optimize your website for search engines. Want to keep your site healthy and easier to find? Sign up below to receive practical emails to get you started!', 'wordpress-seo' ), - 'Yoast SEO' + 'Yoast SEO', ); $notification_text = '

    ' . $message . '

    '; diff --git a/src/alerts/user-interface/default-seo-data/default-seo-data-cron-callback-integration.php b/src/alerts/user-interface/default-seo-data/default-seo-data-cron-callback-integration.php index d30dd12bac0..1117fbcc3f3 100644 --- a/src/alerts/user-interface/default-seo-data/default-seo-data-cron-callback-integration.php +++ b/src/alerts/user-interface/default-seo-data/default-seo-data-cron-callback-integration.php @@ -67,7 +67,7 @@ public function register_hooks() { [ $this, 'detect_default_seo_data_in_recent', - ] + ], ); } diff --git a/src/alerts/user-interface/resolve-alert-route.php b/src/alerts/user-interface/resolve-alert-route.php index 5b2a49cdd2a..0e24582890b 100644 --- a/src/alerts/user-interface/resolve-alert-route.php +++ b/src/alerts/user-interface/resolve-alert-route.php @@ -64,7 +64,7 @@ public function resolve_alert() { \wp_send_json_error( [ 'message' => 'Security check failed.', - ] + ], ); return; } @@ -73,7 +73,7 @@ public function resolve_alert() { \wp_send_json_error( [ 'message' => 'Alert ID is missing.', - ] + ], ); return; } @@ -86,7 +86,7 @@ public function resolve_alert() { \wp_send_json_success( [ 'message' => 'Alert resolved successfully.', - ] + ], ); } } diff --git a/src/analytics/application/missing-indexables-collector.php b/src/analytics/application/missing-indexables-collector.php index 957d4127367..28d71b53093 100644 --- a/src/analytics/application/missing-indexables-collector.php +++ b/src/analytics/application/missing-indexables-collector.php @@ -66,7 +66,7 @@ private function add_additional_indexing_actions() { $indexing_actions, static function ( $indexing_action ) { return \is_a( $indexing_action, Indexation_Action_Interface::class ); - } + }, ); } } diff --git a/src/analytics/domain/missing-indexable-bucket.php b/src/analytics/domain/missing-indexable-bucket.php index f384c5a1c65..391da0059d7 100644 --- a/src/analytics/domain/missing-indexable-bucket.php +++ b/src/analytics/domain/missing-indexable-bucket.php @@ -42,7 +42,7 @@ public function to_array() { static function ( $item ) { return $item->to_array(); }, - $this->missing_indexable_counts + $this->missing_indexable_counts, ); } } diff --git a/src/analytics/domain/to-be-cleaned-indexable-bucket.php b/src/analytics/domain/to-be-cleaned-indexable-bucket.php index abaf1f886c9..5aa5cf3cafb 100644 --- a/src/analytics/domain/to-be-cleaned-indexable-bucket.php +++ b/src/analytics/domain/to-be-cleaned-indexable-bucket.php @@ -42,7 +42,7 @@ public function to_array() { static function ( $item ) { return $item->to_array(); }, - $this->to_be_cleaned_indexable_counts + $this->to_be_cleaned_indexable_counts, ); } } diff --git a/src/analytics/user-interface/last-completed-indexation-integration.php b/src/analytics/user-interface/last-completed-indexation-integration.php index 6360b70f86c..ec7eef1b395 100644 --- a/src/analytics/user-interface/last-completed-indexation-integration.php +++ b/src/analytics/user-interface/last-completed-indexation-integration.php @@ -42,7 +42,7 @@ public function register_hooks(): void { 'maybe_set_indexables_unindexed_calculated', ], 10, - 2 + 2, ); } diff --git a/src/builders/indexable-author-builder.php b/src/builders/indexable-author-builder.php index 6977ed9e6f0..ba1d3ed6289 100644 --- a/src/builders/indexable-author-builder.php +++ b/src/builders/indexable-author-builder.php @@ -163,7 +163,7 @@ protected function find_alternative_image( Indexable $indexable ) { [ 'size' => 500, 'scheme' => 'https', - ] + ], ); if ( $gravatar_image ) { return [ @@ -208,8 +208,8 @@ protected function get_object_timestamps( $author_id ) { AND p.%i = '' AND p.%i = %d ", - $replacements - ) + $replacements, + ), ); //phpcs:enable } diff --git a/src/builders/indexable-builder.php b/src/builders/indexable-builder.php index ac556a05f5a..719b90a2f9b 100644 --- a/src/builders/indexable-builder.php +++ b/src/builders/indexable-builder.php @@ -278,7 +278,7 @@ protected function maybe_build_author_indexable( $author_id ) { $author_indexable = $this->indexable_repository->find_by_id_and_type( $author_id, 'user', - false + false, ); if ( ! $author_indexable || $this->version_manager->indexable_needs_upgrade( $author_indexable ) ) { // Try to build the author. @@ -398,7 +398,7 @@ public function build( $indexable, $defaults = null ) { 'object_type' => $indexable->object_type, 'post_status' => 'unindexed', 'version' => 0, - ] + ], ); // If we already had an existing indexable, mark it as unindexed. We cannot rely on its validity anymore. $indexable->post_status = 'unindexed'; diff --git a/src/builders/indexable-home-page-builder.php b/src/builders/indexable-home-page-builder.php index bb803fa3e05..86bf4edf0d1 100644 --- a/src/builders/indexable-home-page-builder.php +++ b/src/builders/indexable-home-page-builder.php @@ -140,8 +140,8 @@ protected function get_object_timestamps() { AND p.%i = '' AND p.%i = 'post' ", - $replacements - ) + $replacements, + ), ); //phpcs:enable } diff --git a/src/builders/indexable-link-builder.php b/src/builders/indexable-link-builder.php index 48520c7485d..3e04055b91a 100644 --- a/src/builders/indexable-link-builder.php +++ b/src/builders/indexable-link-builder.php @@ -254,14 +254,14 @@ protected function create_links( $indexable, $links, $images ) { function ( $link ) use ( $home_url, $indexable ) { return $this->create_internal_link( $link, $home_url, $indexable ); }, - $links + $links, ); // Filter out links to the same page with a fragment or query. $links = \array_filter( $links, function ( $link ) use ( $current_url ) { return $this->filter_link( $link, $current_url ); - } + }, ); $image_links = []; @@ -314,7 +314,7 @@ protected function create_internal_link( $url, $home_url, $indexable, $is_image 'type' => $link_type, 'indexable_id' => $indexable->id, 'post_id' => $indexable->object_id, - ] + ], ); $model->parsed_url = $parsed_url; @@ -503,7 +503,7 @@ protected function links_diff( $links_a, $links_b ) { $links_b, static function ( SEO_Links $link_a, SEO_Links $link_b ) { return \strcmp( $link_a->url, $link_b->url ); - } + }, ); } diff --git a/src/builders/indexable-post-builder.php b/src/builders/indexable-post-builder.php index e5d9c3efab5..2784f552169 100644 --- a/src/builders/indexable-post-builder.php +++ b/src/builders/indexable-post-builder.php @@ -133,7 +133,7 @@ public function build( $post_id, $indexable ) { $indexable->primary_focus_keyword_score = $this->get_keyword_score( $this->meta->get_value( 'focuskw', $post_id ), - (int) $this->meta->get_value( 'linkdex', $post_id ) + (int) $this->meta->get_value( 'linkdex', $post_id ), ); $indexable->readability_score = (int) $this->meta->get_value( 'content_score', $post_id ); @@ -142,7 +142,7 @@ public function build( $post_id, $indexable ) { $indexable->is_cornerstone = ( $this->meta->get_value( 'is_cornerstone', $post_id ) === '1' ); $indexable->is_robots_noindex = $this->get_robots_noindex( - (int) $this->meta->get_value( 'meta-robots-noindex', $post_id ) + (int) $this->meta->get_value( 'meta-robots-noindex', $post_id ), ); // Set additional meta-robots values. diff --git a/src/builders/indexable-post-type-archive-builder.php b/src/builders/indexable-post-type-archive-builder.php index 3d04aa5d5cc..1b4de3fde97 100644 --- a/src/builders/indexable-post-type-archive-builder.php +++ b/src/builders/indexable-post-type-archive-builder.php @@ -160,8 +160,8 @@ protected function get_object_timestamps( $post_type ) { AND p.%i = '' AND p.%i = %s ", - $replacements - ) + $replacements, + ), ); //phpcs:enable } diff --git a/src/builders/indexable-term-builder.php b/src/builders/indexable-term-builder.php index 3484a37dda5..78eb342161c 100644 --- a/src/builders/indexable-term-builder.php +++ b/src/builders/indexable-term-builder.php @@ -101,7 +101,7 @@ public function build( $term_id, $indexable ) { $indexable->primary_focus_keyword_score = $this->get_keyword_score( $this->get_meta_value( 'wpseo_focuskw', $term_meta ), - $this->get_meta_value( 'wpseo_linkdex', $term_meta ) + $this->get_meta_value( 'wpseo_linkdex', $term_meta ), ); $indexable->is_robots_noindex = $this->get_noindex_value( $this->get_meta_value( 'wpseo_noindex', $term_meta ) ); @@ -283,8 +283,8 @@ protected function get_object_timestamps( $term_id, $taxonomy ) { WHERE p.%i IN (' . \implode( ', ', \array_fill( 0, \count( $post_statuses ), '%s' ) ) . ") AND p.%i = '' ", - $replacements - ) + $replacements, + ), ); //phpcs:enable } diff --git a/src/commands/cleanup-command.php b/src/commands/cleanup-command.php index 7bbba3dedfa..dbc565c2bf0 100644 --- a/src/commands/cleanup-command.php +++ b/src/commands/cleanup-command.php @@ -98,10 +98,10 @@ public function cleanup( $args = null, $assoc_args = null ) { 'Cleaned up %1$d record.', 'Cleaned up %1$d records.', $total_removed, - 'wordpress-seo' + 'wordpress-seo', ), - $total_removed - ) + $total_removed, + ), ); } @@ -184,11 +184,11 @@ private function cleanup_current_site( $assoc_args ) { 'Cleaned up %1$d record from %2$s.', 'Cleaned up %1$d records from %2$s.', $total_removed, - 'wordpress-seo' + 'wordpress-seo', ), $total_removed, - $site_url - ) + $site_url, + ), ); return $total_removed; diff --git a/src/commands/index-command.php b/src/commands/index-command.php index ac612cd101f..4b860e16154 100644 --- a/src/commands/index-command.php +++ b/src/commands/index-command.php @@ -171,7 +171,7 @@ public static function get_namespace() { public function index( $args = null, $assoc_args = null ) { if ( ! $this->indexable_helper->should_index_indexables() ) { WP_CLI::log( - \__( 'Your WordPress environment is running on a non-production site. Indexables can only be created on production environments. Please check your `WP_ENVIRONMENT_TYPE` settings.', 'wordpress-seo' ) + \__( 'Your WordPress environment is running on a non-production site. Indexables can only be created on production environments. Please check your `WP_ENVIRONMENT_TYPE` settings.', 'wordpress-seo' ), ); return; @@ -282,14 +282,14 @@ protected function clear() { $wpdb->query( $wpdb->prepare( 'TRUNCATE TABLE %1$s', - Model::get_table_name( 'Indexable' ) - ) + Model::get_table_name( 'Indexable' ), + ), ); $wpdb->query( $wpdb->prepare( 'TRUNCATE TABLE %1$s', - Model::get_table_name( 'Indexable_Hierarchy' ) - ) + Model::get_table_name( 'Indexable_Hierarchy' ), + ), ); // phpcs:enable } diff --git a/src/config/badge-group-names.php b/src/config/badge-group-names.php index 59ae793cf76..e8ba39e87f6 100644 --- a/src/config/badge-group-names.php +++ b/src/config/badge-group-names.php @@ -53,9 +53,7 @@ public function is_still_eligible_for_new_badge( $group, $current_version = null $group_version = $this::GROUP_NAMES[ $group ]; - if ( $current_version === null ) { - $current_version = $this->version; - } + $current_version ??= $this->version; return (bool) \version_compare( $group_version, $current_version, '>' ); } diff --git a/src/config/conflicting-plugins.php b/src/config/conflicting-plugins.php index b6e2b67c6cd..769df5d65a0 100644 --- a/src/config/conflicting-plugins.php +++ b/src/config/conflicting-plugins.php @@ -105,7 +105,7 @@ public static function all_plugins() { self::OPEN_GRAPH_PLUGINS, self::XML_SITEMAPS_PLUGINS, self::CLOAKING_PLUGINS, - self::SEO_PLUGINS + self::SEO_PLUGINS, ); } } diff --git a/src/config/migrations/20171228151840_WpYoastIndexable.php b/src/config/migrations/20171228151840_WpYoastIndexable.php index 5ed29a66554..0b8d2020259 100644 --- a/src/config/migrations/20171228151840_WpYoastIndexable.php +++ b/src/config/migrations/20171228151840_WpYoastIndexable.php @@ -53,7 +53,7 @@ private function add_table() { [ 'null' => true, 'limit' => 191, - ] + ], ); // Object information. @@ -64,7 +64,7 @@ private function add_table() { 'unsigned' => true, 'null' => true, 'limit' => 11, - ] + ], ); $indexable_table->column( 'object_type', @@ -72,7 +72,7 @@ private function add_table() { [ 'null' => false, 'limit' => 32, - ] + ], ); $indexable_table->column( 'object_sub_type', @@ -80,7 +80,7 @@ private function add_table() { [ 'null' => true, 'limit' => 32, - ] + ], ); // Ownership. @@ -91,7 +91,7 @@ private function add_table() { 'unsigned' => true, 'null' => true, 'limit' => 11, - ] + ], ); $indexable_table->column( 'post_parent', @@ -100,7 +100,7 @@ private function add_table() { 'unsigned' => true, 'null' => true, 'limit' => 11, - ] + ], ); // Title and description. @@ -110,7 +110,7 @@ private function add_table() { [ 'null' => true, 'limit' => 191, - ] + ], ); $indexable_table->column( 'description', 'text', [ 'null' => true ] ); $indexable_table->column( @@ -119,7 +119,7 @@ private function add_table() { [ 'null' => true, 'limit' => 191, - ] + ], ); // Post metadata: status, public, protected. @@ -129,7 +129,7 @@ private function add_table() { [ 'null' => true, 'limit' => 191, - ] + ], ); $indexable_table->column( 'is_public', @@ -137,7 +137,7 @@ private function add_table() { [ 'null' => true, 'default' => null, - ] + ], ); $indexable_table->column( 'is_protected', 'boolean', [ 'default' => false ] ); $indexable_table->column( @@ -146,7 +146,7 @@ private function add_table() { [ 'null' => true, 'default' => null, - ] + ], ); $indexable_table->column( @@ -157,7 +157,7 @@ private function add_table() { 'null' => true, 'default' => null, 'limit' => 11, - ] + ], ); $indexable_table->column( 'canonical', 'mediumtext', [ 'null' => true ] ); @@ -169,7 +169,7 @@ private function add_table() { [ 'null' => true, 'limit' => 191, - ] + ], ); $indexable_table->column( 'primary_focus_keyword_score', @@ -177,7 +177,7 @@ private function add_table() { [ 'null' => true, 'limit' => 3, - ] + ], ); $indexable_table->column( 'readability_score', @@ -185,7 +185,7 @@ private function add_table() { [ 'null' => true, 'limit' => 3, - ] + ], ); $indexable_table->column( 'is_cornerstone', 'boolean', [ 'default' => false ] ); @@ -196,7 +196,7 @@ private function add_table() { [ 'null' => true, 'default' => false, - ] + ], ); $indexable_table->column( 'is_robots_nofollow', @@ -204,7 +204,7 @@ private function add_table() { [ 'null' => true, 'default' => false, - ] + ], ); $indexable_table->column( 'is_robots_noarchive', @@ -212,7 +212,7 @@ private function add_table() { [ 'null' => true, 'default' => false, - ] + ], ); $indexable_table->column( 'is_robots_noimageindex', @@ -220,7 +220,7 @@ private function add_table() { [ 'null' => true, 'default' => false, - ] + ], ); $indexable_table->column( 'is_robots_nosnippet', @@ -228,7 +228,7 @@ private function add_table() { [ 'null' => true, 'default' => false, - ] + ], ); // Twitter. @@ -238,7 +238,7 @@ private function add_table() { [ 'null' => true, 'limit' => 191, - ] + ], ); $indexable_table->column( 'twitter_image', 'mediumtext', [ 'null' => true ] ); $indexable_table->column( 'twitter_description', 'mediumtext', [ 'null' => true ] ); @@ -248,7 +248,7 @@ private function add_table() { [ 'null' => true, 'limit' => 191, - ] + ], ); $indexable_table->column( 'twitter_image_source', @@ -256,7 +256,7 @@ private function add_table() { [ 'null' => true, 'limit' => 191, - ] + ], ); // Open-Graph. @@ -266,7 +266,7 @@ private function add_table() { [ 'null' => true, 'limit' => 191, - ] + ], ); $indexable_table->column( 'open_graph_description', 'mediumtext', [ 'null' => true ] ); $indexable_table->column( 'open_graph_image', 'mediumtext', [ 'null' => true ] ); @@ -276,7 +276,7 @@ private function add_table() { [ 'null' => true, 'limit' => 191, - ] + ], ); $indexable_table->column( 'open_graph_image_source', @@ -284,7 +284,7 @@ private function add_table() { [ 'null' => true, 'limit' => 191, - ] + ], ); $indexable_table->column( 'open_graph_image_meta', 'text', [ 'null' => true ] ); @@ -295,7 +295,7 @@ private function add_table() { [ 'null' => true, 'limit' => 11, - ] + ], ); $indexable_table->column( 'incoming_link_count', @@ -303,7 +303,7 @@ private function add_table() { [ 'null' => true, 'limit' => 11, - ] + ], ); // Prominent words. @@ -315,7 +315,7 @@ private function add_table() { 'limit' => 11, 'unsigned' => true, 'default' => null, - ] + ], ); $indexable_table->finish(); @@ -341,7 +341,7 @@ private function add_indexes( $indexable_table_name ) { ], [ 'name' => 'object_type_and_sub_type', - ] + ], ); $this->add_index( @@ -349,7 +349,7 @@ private function add_indexes( $indexable_table_name ) { 'permalink_hash', [ 'name' => 'permalink_hash', - ] + ], ); } diff --git a/src/config/migrations/20171228151841_WpYoastPrimaryTerm.php b/src/config/migrations/20171228151841_WpYoastPrimaryTerm.php index e68f316b5a6..c65f83c7936 100644 --- a/src/config/migrations/20171228151841_WpYoastPrimaryTerm.php +++ b/src/config/migrations/20171228151841_WpYoastPrimaryTerm.php @@ -34,7 +34,7 @@ public function up() { 'unsigned' => true, 'null' => false, 'limit' => 11, - ] + ], ); $indexable_table->column( 'term_id', @@ -43,7 +43,7 @@ public function up() { 'unsigned' => true, 'null' => false, 'limit' => 11, - ] + ], ); $indexable_table->column( 'taxonomy', @@ -51,7 +51,7 @@ public function up() { [ 'null' => false, 'limit' => 32, - ] + ], ); // Executes the SQL to create the table. @@ -65,7 +65,7 @@ public function up() { ], [ 'name' => 'post_taxonomy', - ] + ], ); $this->add_index( @@ -76,7 +76,7 @@ public function up() { ], [ 'name' => 'post_term', - ] + ], ); $this->add_timestamps( $table_name ); diff --git a/src/config/migrations/20191011111109_WpYoastIndexableHierarchy.php b/src/config/migrations/20191011111109_WpYoastIndexableHierarchy.php index 6d36d1a56af..cd5478a6cf3 100644 --- a/src/config/migrations/20191011111109_WpYoastIndexableHierarchy.php +++ b/src/config/migrations/20191011111109_WpYoastIndexableHierarchy.php @@ -35,7 +35,7 @@ public function up() { 'unsigned' => true, 'null' => true, 'limit' => 11, - ] + ], ); $indexable_table->column( 'ancestor_id', @@ -45,7 +45,7 @@ public function up() { 'unsigned' => true, 'null' => true, 'limit' => 11, - ] + ], ); $indexable_table->column( 'depth', @@ -54,7 +54,7 @@ public function up() { 'unsigned' => true, 'null' => true, 'limit' => 11, - ] + ], ); $indexable_table->finish(); diff --git a/src/config/migrations/20200420073606_AddColumnsToIndexables.php b/src/config/migrations/20200420073606_AddColumnsToIndexables.php index 6b77bc10780..d39ac705b2c 100644 --- a/src/config/migrations/20200420073606_AddColumnsToIndexables.php +++ b/src/config/migrations/20200420073606_AddColumnsToIndexables.php @@ -34,7 +34,7 @@ public function up() { 'null' => false, 'limit' => 20, 'default' => $blog_id, - ] + ], ); } diff --git a/src/config/migrations/20200428123747_BreadcrumbTitleAndHierarchyReset.php b/src/config/migrations/20200428123747_BreadcrumbTitleAndHierarchyReset.php index 83fcb74c6b3..21a96dac33a 100644 --- a/src/config/migrations/20200428123747_BreadcrumbTitleAndHierarchyReset.php +++ b/src/config/migrations/20200428123747_BreadcrumbTitleAndHierarchyReset.php @@ -40,7 +40,7 @@ public function down() { [ 'null' => true, 'limit' => 191, - ] + ], ); } diff --git a/src/config/migrations/20200428194858_ExpandIndexableColumnLengths.php b/src/config/migrations/20200428194858_ExpandIndexableColumnLengths.php index 2633ae61549..aaac655fa81 100644 --- a/src/config/migrations/20200428194858_ExpandIndexableColumnLengths.php +++ b/src/config/migrations/20200428194858_ExpandIndexableColumnLengths.php @@ -45,31 +45,31 @@ public function down() { $this->get_table_name(), 'title', 'string', - $attr_limit_191 + $attr_limit_191, ); $this->change_column( $this->get_table_name(), 'opengraph_title', 'string', - $attr_limit_191 + $attr_limit_191, ); $this->change_column( $this->get_table_name(), 'twitter_title', 'string', - $attr_limit_191 + $attr_limit_191, ); $this->change_column( $this->get_table_name(), 'open_graph_image_source', 'string', - $attr_limit_191 + $attr_limit_191, ); $this->change_column( $this->get_table_name(), 'twitter_image_source', 'string', - $attr_limit_191 + $attr_limit_191, ); } diff --git a/src/config/migrations/20200430075614_AddIndexableObjectIdAndTypeIndex.php b/src/config/migrations/20200430075614_AddIndexableObjectIdAndTypeIndex.php index f4a702705f7..5884496c833 100644 --- a/src/config/migrations/20200430075614_AddIndexableObjectIdAndTypeIndex.php +++ b/src/config/migrations/20200430075614_AddIndexableObjectIdAndTypeIndex.php @@ -31,7 +31,7 @@ public function up() { ], [ 'name' => 'object_id_and_type', - ] + ], ); } @@ -49,7 +49,7 @@ public function down() { ], [ 'name' => 'object_id_and_type', - ] + ], ); } diff --git a/src/config/migrations/20200609154515_AddHasAncestorsColumn.php b/src/config/migrations/20200609154515_AddHasAncestorsColumn.php index 34adf8b2604..f2c1e55ba43 100644 --- a/src/config/migrations/20200609154515_AddHasAncestorsColumn.php +++ b/src/config/migrations/20200609154515_AddHasAncestorsColumn.php @@ -30,7 +30,7 @@ public function up() { 'boolean', [ 'default' => false, - ] + ], ); Wrapper::get_wpdb()->query( @@ -38,7 +38,7 @@ public function up() { UPDATE ' . Model::get_table_name( 'Indexable' ) . ' SET has_ancestors = 1 WHERE id IN ( SELECT indexable_id FROM ' . Model::get_table_name( 'Indexable_Hierarchy' ) . ' ) - ' + ', ); } diff --git a/src/config/migrations/20200616130143_ReplacePermalinkHashIndex.php b/src/config/migrations/20200616130143_ReplacePermalinkHashIndex.php index bfb4c359e25..4961fc22a90 100644 --- a/src/config/migrations/20200616130143_ReplacePermalinkHashIndex.php +++ b/src/config/migrations/20200616130143_ReplacePermalinkHashIndex.php @@ -37,7 +37,7 @@ public function up() { [ 'null' => true, 'limit' => 40, - ] + ], ); if ( $adapter->has_index( $table_name, [ 'permalink_hash' ], [ 'name' => 'permalink_hash' ] ) ) { @@ -48,7 +48,7 @@ public function up() { ], [ 'name' => 'permalink_hash', - ] + ], ); } @@ -61,7 +61,7 @@ public function up() { ], [ 'name' => 'permalink_hash_and_object_type', - ] + ], ); } } @@ -88,7 +88,7 @@ public function down() { ], [ 'name' => 'permalink_hash_and_object_type', - ] + ], ); } @@ -99,7 +99,7 @@ public function down() { [ 'null' => true, 'limit' => 191, - ] + ], ); if ( ! $adapter->has_index( $table_name, [ 'permalink_hash' ], [ 'name' => 'permalink_hash' ] ) ) { @@ -110,7 +110,7 @@ public function down() { ], [ 'name' => 'permalink_hash', - ] + ], ); } } diff --git a/src/config/migrations/20200617122511_CreateSEOLinksTable.php b/src/config/migrations/20200617122511_CreateSEOLinksTable.php index c9b2fb6bcb4..067b42641b9 100644 --- a/src/config/migrations/20200617122511_CreateSEOLinksTable.php +++ b/src/config/migrations/20200617122511_CreateSEOLinksTable.php @@ -38,7 +38,7 @@ public function up() { 'limit' => 20, 'unsigned' => true, 'auto_increment' => true, - ] + ], ); $table->column( 'url', 'string', [ 'limit' => 255 ] ); $table->column( @@ -47,7 +47,7 @@ public function up() { [ 'limit' => 20, 'unsigned' => true, - ] + ], ); $table->column( 'target_post_id', @@ -55,7 +55,7 @@ public function up() { [ 'limit' => 20, 'unsigned' => true, - ] + ], ); $table->column( 'type', 'string', [ 'limit' => 8 ] ); $table->finish(); diff --git a/src/config/migrations/20200702141921_CreateIndexableSubpagesIndex.php b/src/config/migrations/20200702141921_CreateIndexableSubpagesIndex.php index ba1d13c8361..0c4084f63ba 100644 --- a/src/config/migrations/20200702141921_CreateIndexableSubpagesIndex.php +++ b/src/config/migrations/20200702141921_CreateIndexableSubpagesIndex.php @@ -30,12 +30,12 @@ public function up() { [ 'null' => true, 'limit' => 20, - ] + ], ); $this->add_index( $this->get_table_name(), [ 'post_parent', 'object_type', 'post_status', 'object_id' ], - [ 'name' => 'subpages' ] + [ 'name' => 'subpages' ], ); } @@ -52,12 +52,12 @@ public function down() { [ 'null' => true, 'limit' => 191, - ] + ], ); $this->remove_index( $this->get_table_name(), [ 'post_parent', 'object_type', 'post_status', 'object_id' ], - [ 'name' => 'subpages' ] + [ 'name' => 'subpages' ], ); } diff --git a/src/config/migrations/20200728095334_AddIndexesForProminentWordsOnIndexables.php b/src/config/migrations/20200728095334_AddIndexesForProminentWordsOnIndexables.php index 51566ca5a3b..093259d9841 100644 --- a/src/config/migrations/20200728095334_AddIndexesForProminentWordsOnIndexables.php +++ b/src/config/migrations/20200728095334_AddIndexesForProminentWordsOnIndexables.php @@ -44,7 +44,7 @@ public function up() { $this->columns_with_index, [ 'name' => 'prominent_words', - ] + ], ); } } diff --git a/src/config/migrations/20201202144329_AddEstimatedReadingTime.php b/src/config/migrations/20201202144329_AddEstimatedReadingTime.php index f0d94cf3b78..8cdea8e0c05 100644 --- a/src/config/migrations/20201202144329_AddEstimatedReadingTime.php +++ b/src/config/migrations/20201202144329_AddEstimatedReadingTime.php @@ -32,7 +32,7 @@ public function up() { [ 'null' => true, 'default' => null, - ] + ], ); } diff --git a/src/config/migrations/20201216124002_ExpandIndexableIDColumnLengths.php b/src/config/migrations/20201216124002_ExpandIndexableIDColumnLengths.php index 5d46c997c4c..361ea495543 100644 --- a/src/config/migrations/20201216124002_ExpandIndexableIDColumnLengths.php +++ b/src/config/migrations/20201216124002_ExpandIndexableIDColumnLengths.php @@ -39,7 +39,7 @@ public function up() { $this->get_table_name(), $column, 'biginteger', - [ 'limit' => 20 ] + [ 'limit' => 20 ], ); } } diff --git a/src/config/migrations/20201216141134_ExpandPrimaryTermIDColumnLengths.php b/src/config/migrations/20201216141134_ExpandPrimaryTermIDColumnLengths.php index 9105bae72f0..f3a6137928a 100644 --- a/src/config/migrations/20201216141134_ExpandPrimaryTermIDColumnLengths.php +++ b/src/config/migrations/20201216141134_ExpandPrimaryTermIDColumnLengths.php @@ -38,7 +38,7 @@ public function up() { $this->get_table_name(), $column, 'biginteger', - [ 'limit' => 20 ] + [ 'limit' => 20 ], ); } } diff --git a/src/config/migrations/20210817092415_AddVersionColumnToIndexables.php b/src/config/migrations/20210817092415_AddVersionColumnToIndexables.php index 2d179abcd12..ddd6562e846 100644 --- a/src/config/migrations/20210817092415_AddVersionColumnToIndexables.php +++ b/src/config/migrations/20210817092415_AddVersionColumnToIndexables.php @@ -29,7 +29,7 @@ public function up() { 'integer', [ 'default' => 1, - ] + ], ); } @@ -41,7 +41,7 @@ public function up() { public function down() { $this->remove_column( $this->get_table_name(), - 'version' + 'version', ); } diff --git a/src/config/migrations/20211020091404_AddObjectTimestamps.php b/src/config/migrations/20211020091404_AddObjectTimestamps.php index eece2639781..271d53c9118 100644 --- a/src/config/migrations/20211020091404_AddObjectTimestamps.php +++ b/src/config/migrations/20211020091404_AddObjectTimestamps.php @@ -30,7 +30,7 @@ public function up() { [ 'null' => true, 'default' => null, - ] + ], ); $this->add_column( $this->get_table_name(), @@ -39,7 +39,7 @@ public function up() { [ 'null' => true, 'default' => null, - ] + ], ); $this->add_index( $this->get_table_name(), @@ -51,7 +51,7 @@ public function up() { ], [ 'name' => 'published_sitemap_index', - ] + ], ); } @@ -73,7 +73,7 @@ public function down() { ], [ 'name' => 'published_sitemap_index', - ] + ], ); } diff --git a/src/config/migrations/20230417083836_AddInclusiveLanguageScore.php b/src/config/migrations/20230417083836_AddInclusiveLanguageScore.php index ab2fdc7c30e..6792220eb43 100644 --- a/src/config/migrations/20230417083836_AddInclusiveLanguageScore.php +++ b/src/config/migrations/20230417083836_AddInclusiveLanguageScore.php @@ -32,7 +32,7 @@ public function up() { [ 'null' => true, 'limit' => 3, - ] + ], ); } diff --git a/src/config/migrations/20260105111111_AddSeoLinksIndex.php b/src/config/migrations/20260105111111_AddSeoLinksIndex.php index 3a4d7ea8209..94ac2b69b56 100644 --- a/src/config/migrations/20260105111111_AddSeoLinksIndex.php +++ b/src/config/migrations/20260105111111_AddSeoLinksIndex.php @@ -30,7 +30,7 @@ public function up() { 'url', [ 'name' => 'url_index', - ] + ], ); $this->add_index( @@ -38,7 +38,7 @@ public function up() { 'target_indexable_id', [ 'name' => 'target_indexable_id_index', - ] + ], ); } @@ -55,14 +55,14 @@ public function down() { 'url', [ 'name' => 'url_index', - ] + ], ); $this->remove_index( $table_name, 'target_indexable_id', [ 'name' => 'target_indexable_id_index', - ] + ], ); } diff --git a/src/config/oauth-client.php b/src/config/oauth-client.php index 5ba1ec22d87..09a653306f8 100644 --- a/src/config/oauth-client.php +++ b/src/config/oauth-client.php @@ -72,7 +72,7 @@ public function __construct( $tokens['expires'], $tokens['has_expired'], $tokens['created_at'], - ( $tokens['error_count'] ?? 0 ) + ( $tokens['error_count'] ?? 0 ), ); } } @@ -93,7 +93,7 @@ public function request_tokens( $code ) { 'authorization_code', [ 'code' => $code, - ] + ], ); $token = OAuth_Token::from_response( $response ); @@ -274,7 +274,7 @@ protected function refresh_tokens( OAuth_Token $tokens ) { 'refresh_token', [ 'refresh_token' => $tokens->refresh_token, - ] + ], ); $token_obj = OAuth_Token::from_response( $new_tokens ); diff --git a/src/config/schema-types.php b/src/config/schema-types.php index e0f76202631..25d5dcf3871 100644 --- a/src/config/schema-types.php +++ b/src/config/schema-types.php @@ -163,7 +163,7 @@ public function get_article_type_options() { 'name' => \__( 'None', 'wordpress-seo' ), 'value' => 'None', ], - ] + ], ); } } diff --git a/src/config/semrush-client.php b/src/config/semrush-client.php index da45140bf17..41f2a1cd895 100644 --- a/src/config/semrush-client.php +++ b/src/config/semrush-client.php @@ -41,13 +41,13 @@ public function __construct( Options_Helper $options_helper, WP_Remote_Handler $ ], [ 'httpClient' => new Client( [ 'handler' => $wp_remote_handler ] ), - ] + ], ); parent::__construct( self::TOKEN_OPTION, $provider, - $options_helper + $options_helper, ); } @@ -75,7 +75,7 @@ public function do_request( $method, $url, array $options ) { 'params' => [ 'access_token' => $this->get_tokens()->access_token, ], - ] + ], ); return parent::do_request( $method, $url, $options ); diff --git a/src/config/wincher-client.php b/src/config/wincher-client.php index 7f9b58302f2..4c4ade7b5d3 100644 --- a/src/config/wincher-client.php +++ b/src/config/wincher-client.php @@ -56,13 +56,13 @@ public function __construct( Options_Helper $options_helper, WP_Remote_Handler $ ], [ 'httpClient' => new Client( [ 'handler' => $wp_remote_handler ] ), - ] + ], ); parent::__construct( self::TOKEN_OPTION, $provider, - $options_helper + $options_helper, ); } @@ -77,7 +77,7 @@ public function get_authorization_url() { $url = $this->provider->getAuthorizationUrl( [ 'state' => WPSEO_Utils::format_json_encode( [ 'domain' => $parsed_site_url['host'] ] ), - ] + ], ); $pkce_code = $this->provider->getPkceCode(); diff --git a/src/config/wincher-pkce-provider.php b/src/config/wincher-pkce-provider.php index 58c67bed32c..ce59c755306 100644 --- a/src/config/wincher-pkce-provider.php +++ b/src/config/wincher-pkce-provider.php @@ -80,10 +80,10 @@ protected function getRandomPkceCode( $length = 64 ) { // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode \base64_encode( \random_bytes( $length ) ), '+/', - '-_' + '-_', ), 0, - $length + $length, ); } @@ -136,9 +136,9 @@ protected function getAuthorizationParameters( array $options ) { // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode \base64_encode( \hash( 'sha256', $this->pkceCode, true ) ), '+/', - '-_' + '-_', ), - '=' + '=', ); } elseif ( $pkce_method === 'plain' ) { @@ -190,7 +190,7 @@ public function getAccessToken( $grant, array $options = [] ) { if ( \is_array( $response ) === false ) { throw new UnexpectedValueException( - 'Invalid response received from Authorization Server. Expected JSON.' + 'Invalid response received from Authorization Server. Expected JSON.', ); } @@ -217,7 +217,7 @@ protected function getConfigurableOptions() { 'responseResourceOwnerId', 'scopes', 'pkceMethod', - ] + ], ); } diff --git a/src/content-type-visibility/application/content-type-visibility-watcher-actions.php b/src/content-type-visibility/application/content-type-visibility-watcher-actions.php index e9b60b2b7d0..06103973d4a 100644 --- a/src/content-type-visibility/application/content-type-visibility-watcher-actions.php +++ b/src/content-type-visibility/application/content-type-visibility-watcher-actions.php @@ -156,7 +156,7 @@ private function add_notification() { /* translators: 1: Opening tag of the link to the Search appearance settings page, 2: Link closing tag. */ \esc_html__( 'You\'ve added a new type of content. We recommend that you review the corresponding %1$sSearch appearance settings%2$s.', 'wordpress-seo' ), '', - '' + '', ); $notification = new Yoast_Notification( @@ -166,7 +166,7 @@ private function add_notification() { 'id' => 'content-types-made-public', 'capabilities' => 'wpseo_manage_options', 'priority' => 0.8, - ] + ], ); $this->notification_center->add_notification( $notification ); diff --git a/src/content-type-visibility/user-interface/content-type-visibility-dismiss-new-route.php b/src/content-type-visibility/user-interface/content-type-visibility-dismiss-new-route.php index df999e16528..292742196b9 100644 --- a/src/content-type-visibility/user-interface/content-type-visibility-dismiss-new-route.php +++ b/src/content-type-visibility/user-interface/content-type-visibility-dismiss-new-route.php @@ -120,7 +120,7 @@ public function post_type_dismiss_callback( $request ) { return new WP_REST_Response( (object) $response, - $response['status'] + $response['status'], ); } @@ -149,7 +149,7 @@ public function taxonomy_dismiss_callback( WP_REST_Request $request ) { return new WP_REST_Response( (object) $response, - $response['status'] + $response['status'], ); } } diff --git a/src/context/meta-tags-context.php b/src/context/meta-tags-context.php index 55452c72ab8..0676ac7a2a0 100644 --- a/src/context/meta-tags-context.php +++ b/src/context/meta-tags-context.php @@ -522,10 +522,8 @@ public function generate_schema_page_type() { $type = 'CollectionPage'; break; default: - $additional_type = $this->indexable->schema_page_type; - if ( $additional_type === null ) { - $additional_type = $this->options->get( 'schema-page-type-' . $this->indexable->object_sub_type ); - } + $additional_type = $this->indexable->schema_page_type; + $additional_type ??= $this->options->get( 'schema-page-type-' . $this->indexable->object_sub_type ); $type = [ 'WebPage', $additional_type ]; @@ -552,10 +550,8 @@ public function generate_schema_page_type() { * @return string|array The schema article type. */ public function generate_schema_article_type() { - $additional_type = $this->indexable->schema_article_type; - if ( $additional_type === null ) { - $additional_type = $this->options->get( 'schema-article-type-' . $this->indexable->object_sub_type ); - } + $additional_type = $this->indexable->schema_article_type; + $additional_type ??= $this->options->get( 'schema-article-type-' . $this->indexable->object_sub_type ); /** This filter is documented in inc/options/class-wpseo-option-titles.php */ $allowed_article_types = \apply_filters( 'wpseo_schema_article_types', Schema_Types::ARTICLE_TYPES ); diff --git a/src/dashboard/application/configuration/dashboard-configuration.php b/src/dashboard/application/configuration/dashboard-configuration.php index 60c0e00397b..1baa57295d4 100644 --- a/src/dashboard/application/configuration/dashboard-configuration.php +++ b/src/dashboard/application/configuration/dashboard-configuration.php @@ -134,7 +134,7 @@ public function get_configuration(): array { [ Readability_Analysis::NAME, Keyphrase_Analysis::NAME, - ] + ], )->to_array(), 'endpoints' => $this->endpoints_repository->get_all_endpoints()->to_array(), 'nonce' => $this->nonce_repository->get_rest_nonce(), diff --git a/src/dashboard/infrastructure/browser-cache/browser-cache-configuration.php b/src/dashboard/infrastructure/browser-cache/browser-cache-configuration.php index ed9261201aa..d55dc19bf1b 100644 --- a/src/dashboard/infrastructure/browser-cache/browser-cache-configuration.php +++ b/src/dashboard/infrastructure/browser-cache/browser-cache-configuration.php @@ -42,7 +42,7 @@ private function get_storage_prefix() { $current_user = \wp_get_current_user(); $auth_cookie = \wp_parse_auth_cookie(); $blog_id = \get_current_blog_id(); - $session_token = isset( $auth_cookie['token'] ) ? $auth_cookie['token'] : ''; + $session_token = ( $auth_cookie['token'] ?? '' ); return \wp_hash( $current_user->user_login . '|' . $session_token . '|' . $blog_id ); } diff --git a/src/dashboard/infrastructure/integrations/site-kit.php b/src/dashboard/infrastructure/integrations/site-kit.php index 56ef67bc9c4..fe06032308f 100644 --- a/src/dashboard/infrastructure/integrations/site-kit.php +++ b/src/dashboard/infrastructure/integrations/site-kit.php @@ -154,7 +154,7 @@ public function is_onboarded(): bool { * @return bool If the user can read the data. */ private function can_read_data( array $module ): bool { - return ( ! \is_null( $module['can_view'] ) ? $module['can_view'] : false ); + return ( $module['can_view'] ?? false ); } /** @@ -269,7 +269,7 @@ public function get_preloaded_data( array $paths ): array { return \array_reduce( \array_unique( $actual_paths ), 'rest_preload_api_request', - [] + [], ); } @@ -282,8 +282,8 @@ public function get_activate_url(): string { return \html_entity_decode( \wp_nonce_url( \self_admin_url( 'plugins.php?action=activate&plugin=' . self::SITE_KIT_FILE ), - 'activate-plugin_' . self::SITE_KIT_FILE - ) + 'activate-plugin_' . self::SITE_KIT_FILE, + ), ); } @@ -296,8 +296,8 @@ public function get_install_url(): string { return \html_entity_decode( \wp_nonce_url( \self_admin_url( 'update.php?action=install-plugin&plugin=google-site-kit' ), - 'install-plugin_google-site-kit' - ) + 'install-plugin_google-site-kit', + ), ); } @@ -310,8 +310,8 @@ public function get_update_url(): string { return \html_entity_decode( \wp_nonce_url( \self_admin_url( 'update.php?action=upgrade-plugin&plugin=' . self::SITE_KIT_FILE ), - 'upgrade-plugin_' . self::SITE_KIT_FILE - ) + 'upgrade-plugin_' . self::SITE_KIT_FILE, + ), ); } diff --git a/src/dashboard/infrastructure/score-results/readability-score-results/readability-score-results-collector.php b/src/dashboard/infrastructure/score-results/readability-score-results/readability-score-results-collector.php index f41a55f924e..5abf6f8cb1d 100644 --- a/src/dashboard/infrastructure/score-results/readability-score-results/readability-score-results-collector.php +++ b/src/dashboard/infrastructure/score-results/readability-score-results/readability-score-results-collector.php @@ -39,7 +39,7 @@ public function get_score_results( array $readability_score_groups, Content_Type [ Model::get_table_name( 'Indexable' ), $content_type_name, - ] + ], ); if ( $term_id === null ) { @@ -52,7 +52,7 @@ public function get_score_results( array $readability_score_groups, Content_Type WHERE ( I.post_status = 'publish' OR I.post_status IS NULL ) AND I.object_type = 'post' AND I.object_sub_type = %s", - $replacements + $replacements, ); //phpcs:enable } @@ -74,7 +74,7 @@ public function get_score_results( array $readability_score_groups, Content_Type FROM %i WHERE term_taxonomy_id = %d )", - $replacements + $replacements, ); //phpcs:enable } diff --git a/src/dashboard/infrastructure/score-results/seo-score-results/seo-score-results-collector.php b/src/dashboard/infrastructure/score-results/seo-score-results/seo-score-results-collector.php index d5e7043e57e..75efe486d7c 100644 --- a/src/dashboard/infrastructure/score-results/seo-score-results/seo-score-results-collector.php +++ b/src/dashboard/infrastructure/score-results/seo-score-results/seo-score-results-collector.php @@ -39,7 +39,7 @@ public function get_score_results( array $seo_score_groups, Content_Type $conten [ Model::get_table_name( 'Indexable' ), $content_type_name, - ] + ], ); if ( $term_id === null ) { @@ -53,7 +53,7 @@ public function get_score_results( array $seo_score_groups, Content_Type $conten AND I.object_type = 'post' AND I.object_sub_type = %s AND ( I.is_robots_noindex IS NULL OR I.is_robots_noindex <> 1 )", - $replacements + $replacements, ); //phpcs:enable } @@ -76,7 +76,7 @@ public function get_score_results( array $seo_score_groups, Content_Type $conten FROM %i WHERE term_taxonomy_id = %d )", - $replacements + $replacements, ); //phpcs:enable } diff --git a/src/dashboard/infrastructure/search-console/site-kit-search-console-adapter.php b/src/dashboard/infrastructure/search-console/site-kit-search-console-adapter.php index 5a802704840..f7b7c6de59d 100644 --- a/src/dashboard/infrastructure/search-console/site-kit-search-console-adapter.php +++ b/src/dashboard/infrastructure/search-console/site-kit-search-console-adapter.php @@ -179,9 +179,9 @@ private function validate_response( WP_REST_Response $response ): void { throw new Failed_Request_Exception( \wp_kses_post( $response->as_error() - ->get_error_message() + ->get_error_message(), ), - (int) $error_status_code + (int) $error_status_code, ); } diff --git a/src/dashboard/infrastructure/taxonomies/taxonomies-collector.php b/src/dashboard/infrastructure/taxonomies/taxonomies-collector.php index a0714f5ad67..00c05593674 100644 --- a/src/dashboard/infrastructure/taxonomies/taxonomies-collector.php +++ b/src/dashboard/infrastructure/taxonomies/taxonomies-collector.php @@ -53,7 +53,7 @@ public function get_custom_filtering_taxonomy( string $content_type ) { \_doing_it_wrong( 'Filter: \'wpseo_{$content_type}_filtering_taxonomy\'', 'The `wpseo_{$content_type}_filtering_taxonomy` filter should return a public taxonomy, available in REST API, that is associated with that content type.', - 'YoastSEO v24.1' + 'YoastSEO v24.1', ); } diff --git a/src/dashboard/user-interface/configuration/site-kit-configuration-dismissal-route.php b/src/dashboard/user-interface/configuration/site-kit-configuration-dismissal-route.php index ef922af786b..13c7041355d 100644 --- a/src/dashboard/user-interface/configuration/site-kit-configuration-dismissal-route.php +++ b/src/dashboard/user-interface/configuration/site-kit-configuration-dismissal-route.php @@ -88,7 +88,7 @@ public function register_routes() { ], ], ], - ] + ], ); } @@ -108,7 +108,7 @@ public function set_site_kit_configuration_permanent_dismissal( WP_REST_Request return new WP_Error( 'wpseo_set_site_kit_configuration_permanent_dismissal_error', $exception->getMessage(), - (object) [] + (object) [], ); } @@ -116,7 +116,7 @@ public function set_site_kit_configuration_permanent_dismissal( WP_REST_Request [ 'success' => $result, ], - ( $result ) ? 200 : 400 + ( $result ) ? 200 : 400, ); } diff --git a/src/dashboard/user-interface/configuration/site-kit-consent-management-route.php b/src/dashboard/user-interface/configuration/site-kit-consent-management-route.php index 3063981a586..096d4866cb4 100644 --- a/src/dashboard/user-interface/configuration/site-kit-consent-management-route.php +++ b/src/dashboard/user-interface/configuration/site-kit-consent-management-route.php @@ -96,7 +96,7 @@ public function register_routes() { ], ], ], - ] + ], ); } @@ -116,7 +116,7 @@ public function set_site_kit_consent( WP_REST_Request $request ) { return new WP_Error( 'wpseo_set_site_kit_consent_error', $exception->getMessage(), - (object) [] + (object) [], ); } @@ -124,7 +124,7 @@ public function set_site_kit_consent( WP_REST_Request $request ) { [ 'success' => $result, ], - ( $result ) ? 200 : 400 + ( $result ) ? 200 : 400, ); } diff --git a/src/dashboard/user-interface/scores/abstract-scores-route.php b/src/dashboard/user-interface/scores/abstract-scores-route.php index 11fa2e4d239..5da16f4eaae 100644 --- a/src/dashboard/user-interface/scores/abstract-scores-route.php +++ b/src/dashboard/user-interface/scores/abstract-scores-route.php @@ -146,7 +146,7 @@ public function register_routes() { 'type' => 'integer', 'default' => null, 'sanitize_callback' => static function ( $param ) { - return \intval( $param ); + return (int) $param; }, ], 'troubleshooting' => [ @@ -157,7 +157,7 @@ public function register_routes() { ], ], ], - ] + ], ); } @@ -180,13 +180,13 @@ public function get_scores( WP_REST_Request $request ) { [ 'error' => $exception->getMessage(), ], - $exception->getCode() + $exception->getCode(), ); } return new WP_REST_Response( $results, - 200 + 200, ); } diff --git a/src/dashboard/user-interface/setup/setup-url-interceptor.php b/src/dashboard/user-interface/setup/setup-url-interceptor.php index bb488bf2d7d..b0ca0b8a270 100644 --- a/src/dashboard/user-interface/setup/setup-url-interceptor.php +++ b/src/dashboard/user-interface/setup/setup-url-interceptor.php @@ -93,7 +93,7 @@ public function add_redirect_page( $pages ) { '', '', 'wpseo_manage_options', - self::PAGE + self::PAGE, ); return $pages; diff --git a/src/dashboard/user-interface/time-based-seo-metrics/time-based-seo-metrics-route.php b/src/dashboard/user-interface/time-based-seo-metrics/time-based-seo-metrics-route.php index c30fbf8032a..7684d711bb1 100644 --- a/src/dashboard/user-interface/time-based-seo-metrics/time-based-seo-metrics-route.php +++ b/src/dashboard/user-interface/time-based-seo-metrics/time-based-seo-metrics-route.php @@ -151,7 +151,7 @@ public function register_routes() { ], ], ], - ] + ], ); } @@ -225,13 +225,13 @@ public function get_time_based_seo_metrics( WP_REST_Request $request ): WP_REST_ [ 'error' => $exception->getMessage(), ], - $exception->getCode() + $exception->getCode(), ); } return new WP_REST_Response( $time_based_seo_metrics_container->to_array(), - 200 + 200, ); } diff --git a/src/dashboard/user-interface/tracking/setup-steps-tracking-route.php b/src/dashboard/user-interface/tracking/setup-steps-tracking-route.php index aa30f8bd306..a0a2445a158 100644 --- a/src/dashboard/user-interface/tracking/setup-steps-tracking-route.php +++ b/src/dashboard/user-interface/tracking/setup-steps-tracking-route.php @@ -108,7 +108,7 @@ public function register_routes() { ], ], ], - ] + ], ); } @@ -133,7 +133,7 @@ public function track_setup_steps( WP_REST_Request $request ) { $data, static function ( $value ) { return $value !== null; - } + }, ); // Check if all values are null then return an error that no valid params were passed. @@ -141,7 +141,7 @@ static function ( $value ) { return new WP_Error( 'wpseo_set_site_kit_usage_tracking', \__( 'No valid parameters were passed.', 'wordpress-seo' ), - [ 'status' => 400 ] + [ 'status' => 400 ], ); } @@ -153,7 +153,7 @@ static function ( $value ) { return new WP_Error( 'wpseo_set_site_kit_usage_tracking', $exception->getMessage(), - (object) [] + (object) [], ); } if ( ! $result ) { @@ -165,7 +165,7 @@ static function ( $value ) { [ 'success' => $result, ], - ( $result ) ? 200 : 400 + ( $result ) ? 200 : 400, ); } diff --git a/src/deprecated/frontend/breadcrumbs.php b/src/deprecated/frontend/breadcrumbs.php index 5c9337eed2e..5b450fc378a 100644 --- a/src/deprecated/frontend/breadcrumbs.php +++ b/src/deprecated/frontend/breadcrumbs.php @@ -106,9 +106,7 @@ public function __toString() { * @return static The instance. */ public static function get_instance() { - if ( self::$instance === null ) { - self::$instance = new self(); - } + self::$instance ??= new self(); return self::$instance; } diff --git a/src/deprecated/frontend/frontend.php b/src/deprecated/frontend/frontend.php index c301ca03d0f..afb9a962827 100644 --- a/src/deprecated/frontend/frontend.php +++ b/src/deprecated/frontend/frontend.php @@ -92,9 +92,7 @@ public function __call( $method, $arguments ) { * @return static The instance. */ public static function get_instance() { - if ( self::$instance === null ) { - self::$instance = new self(); - } + self::$instance ??= new self(); return self::$instance; } diff --git a/src/deprecated/src/promotions/domain/black-friday-checklist-promotion.php b/src/deprecated/src/promotions/domain/black-friday-checklist-promotion.php index e5d2cc8fdb9..0e96e232cdb 100644 --- a/src/deprecated/src/promotions/domain/black-friday-checklist-promotion.php +++ b/src/deprecated/src/promotions/domain/black-friday-checklist-promotion.php @@ -22,8 +22,8 @@ public function __construct() { 'black-friday-2023-checklist', new Time_Interval( \gmmktime( 11, 00, 00, 9, 19, 2023 ), - \gmmktime( 11, 00, 00, 10, 31, 2023 ) - ) + \gmmktime( 11, 00, 00, 10, 31, 2023 ), + ), ); } } diff --git a/src/exceptions/indexable/author-not-built-exception.php b/src/exceptions/indexable/author-not-built-exception.php index 9363d0e187d..c09537b5854 100644 --- a/src/exceptions/indexable/author-not-built-exception.php +++ b/src/exceptions/indexable/author-not-built-exception.php @@ -17,7 +17,7 @@ class Author_Not_Built_Exception extends Not_Built_Exception { */ public static function author_archives_are_not_indexed_for_users_without_posts( $user_id ) { return new self( - 'Indexable for author with id ' . $user_id . ' is not being built, since author archives are not indexed for users without posts.' + 'Indexable for author with id ' . $user_id . ' is not being built, since author archives are not indexed for users without posts.', ); } @@ -31,7 +31,7 @@ public static function author_archives_are_not_indexed_for_users_without_posts( */ public static function author_archives_are_disabled( $user_id ) { return new self( - 'Indexable for author with id ' . $user_id . ' is not being built, since author archives are disabled.' + 'Indexable for author with id ' . $user_id . ' is not being built, since author archives are disabled.', ); } @@ -45,7 +45,7 @@ public static function author_archives_are_disabled( $user_id ) { */ public static function author_not_built_because_of_filter( $user_id ) { return new self( - 'Indexable for author with id ' . $user_id . ' is not being built, since it is excluded because of the \'wpseo_should_build_and_save_user_indexable\' filter.' + 'Indexable for author with id ' . $user_id . ' is not being built, since it is excluded because of the \'wpseo_should_build_and_save_user_indexable\' filter.', ); } } diff --git a/src/exceptions/indexable/invalid-term-exception.php b/src/exceptions/indexable/invalid-term-exception.php index 1c6a3178e58..bd0f733a1d8 100644 --- a/src/exceptions/indexable/invalid-term-exception.php +++ b/src/exceptions/indexable/invalid-term-exception.php @@ -19,8 +19,8 @@ public function __construct( $reason ) { \sprintf( /* translators: %s is the reason given by WordPress. */ \esc_html__( 'The term is considered invalid. The following reason was given by WordPress: %s', 'wordpress-seo' ), - $reason - ) + $reason, + ), ); } } diff --git a/src/exceptions/indexable/not-built-exception.php b/src/exceptions/indexable/not-built-exception.php index decc356f0ee..fe70e839564 100644 --- a/src/exceptions/indexable/not-built-exception.php +++ b/src/exceptions/indexable/not-built-exception.php @@ -17,7 +17,7 @@ class Not_Built_Exception extends Indexable_Exception { */ public static function invalid_object_id( $object_id ) { return new self( - "Indexable was not built because it had an invalid object id of $object_id." + "Indexable was not built because it had an invalid object id of $object_id.", ); } } diff --git a/src/exceptions/missing-method.php b/src/exceptions/missing-method.php index 780cb6bc392..3dab2987ad9 100644 --- a/src/exceptions/missing-method.php +++ b/src/exceptions/missing-method.php @@ -23,8 +23,8 @@ public static function for_class( $method, $class_name ) { /* translators: %1$s expands to the method name. %2$s expands to the class name */ \__( 'Method %1$s() does not exist in class %2$s', 'wordpress-seo' ), $method, - $class_name - ) + $class_name, + ), ); } } diff --git a/src/general/user-interface/general-page-integration.php b/src/general/user-interface/general-page-integration.php index 96857018b59..d7893ba41fd 100644 --- a/src/general/user-interface/general-page-integration.php +++ b/src/general/user-interface/general-page-integration.php @@ -215,7 +215,7 @@ public function add_page( $pages ) { self::PAGE, [ $this, 'display_page' ], ], - ] + ], ); return $pages; diff --git a/src/general/user-interface/opt-in-route.php b/src/general/user-interface/opt-in-route.php index dc66860c8ed..a43e924de92 100644 --- a/src/general/user-interface/opt-in-route.php +++ b/src/general/user-interface/opt-in-route.php @@ -108,7 +108,7 @@ public function set_opt_in_seen( $request ) { 'success' => $success, 'status' => $status, ], - $status + $status, ); } diff --git a/src/generators/breadcrumbs-generator.php b/src/generators/breadcrumbs-generator.php index a38691bf594..6cb882f795e 100644 --- a/src/generators/breadcrumbs-generator.php +++ b/src/generators/breadcrumbs-generator.php @@ -153,7 +153,7 @@ public function generate( Meta_Tags_Context $context ) { $indexables, static function ( $indexable ) { return \is_a( $indexable, Indexable::class ); - } + }, ); $crumbs = \array_map( [ $this, 'get_post_type_crumb' ], $indexables ); @@ -176,7 +176,7 @@ static function ( $indexable ) { \_doing_it_wrong( 'Filter: \'wpseo_breadcrumb_links\'', 'The `wpseo_breadcrumb_links` filter should return a multi-dimensional array.', - 'YoastSEO v20.0' + 'YoastSEO v20.0', ); } else { @@ -422,7 +422,7 @@ protected function add_paged_crumb( array $crumbs, $current_indexable ) { 'text' => \sprintf( /* translators: %s expands to the current page number */ \__( 'Page %s', 'wordpress-seo' ), - $current_page_number + $current_page_number, ), ]; diff --git a/src/generators/open-graph-image-generator.php b/src/generators/open-graph-image-generator.php index aaf8ee7230a..de8f2cedd7b 100644 --- a/src/generators/open-graph-image-generator.php +++ b/src/generators/open-graph-image-generator.php @@ -162,8 +162,8 @@ protected function add_from_indexable( Indexable $indexable, Images $image_conta (array) $meta_data, [ 'url' => $indexable->open_graph_image, - ] - ) + ], + ), ); } } diff --git a/src/generators/schema-generator.php b/src/generators/schema-generator.php index 86e6bedab57..d640ffe53c8 100644 --- a/src/generators/schema-generator.php +++ b/src/generators/schema-generator.php @@ -272,7 +272,7 @@ public function protected_webpage_schema( $graph_piece ) { 'datePublished', 'dateModified', 'breadcrumb', - ] + ], ); $graph_piece = \array_intersect_key( $graph_piece, $properties_to_show ); diff --git a/src/helpers/crawl-cleanup-helper.php b/src/helpers/crawl-cleanup-helper.php index 73d0d96626d..65c168d36d3 100644 --- a/src/helpers/crawl-cleanup-helper.php +++ b/src/helpers/crawl-cleanup-helper.php @@ -270,7 +270,7 @@ public function do_clean_redirect( $proper_url ) { /* translators: %1$s: Yoast SEO */ \__( '%1$s: unregistered URL parameter removed. See %2$s', 'wordpress-seo' ), 'Yoast SEO', - 'https://yoa.st/advanced-crawl-settings' + 'https://yoa.st/advanced-crawl-settings', ); $this->redirect_helper->do_safe_redirect( $proper_url, 301, $message ); diff --git a/src/helpers/current-page-helper.php b/src/helpers/current-page-helper.php index 09aae3e4aa8..39e632fee47 100644 --- a/src/helpers/current-page-helper.php +++ b/src/helpers/current-page-helper.php @@ -441,7 +441,7 @@ public function current_post_is_privacy_policy() { return false; } - return \intval( $post->ID ) === \intval( \get_option( 'wp_page_for_privacy_policy', false ) ); + return (int) $post->ID === (int) \get_option( 'wp_page_for_privacy_policy', false ); } /** diff --git a/src/helpers/home-url-helper.php b/src/helpers/home-url-helper.php index 17197a7818c..6103fb0251c 100644 --- a/src/helpers/home-url-helper.php +++ b/src/helpers/home-url-helper.php @@ -27,9 +27,7 @@ class Home_Url_Helper { * @return string The home url. */ public function get() { - if ( static::$home_url === null ) { - static::$home_url = \home_url(); - } + static::$home_url ??= \home_url(); return static::$home_url; } @@ -40,9 +38,7 @@ public function get() { * @return array The parsed url. */ public function get_parsed() { - if ( static::$parsed_home_url === null ) { - static::$parsed_home_url = \wp_parse_url( $this->get() ); - } + static::$parsed_home_url ??= \wp_parse_url( $this->get() ); return static::$parsed_home_url; } diff --git a/src/helpers/indexing-helper.php b/src/helpers/indexing-helper.php index a6c8a4b68e0..ddf852d5959 100644 --- a/src/helpers/indexing-helper.php +++ b/src/helpers/indexing-helper.php @@ -178,7 +178,7 @@ public function set_reason( $reason ) { */ protected function remove_indexing_notification() { $this->notification_center->remove_notification_by_id( - Indexing_Notification_Integration::NOTIFICATION_ID + Indexing_Notification_Integration::NOTIFICATION_ID, ); } diff --git a/src/helpers/notification-helper.php b/src/helpers/notification-helper.php index 3989e14f1ec..cb127c4d3ee 100644 --- a/src/helpers/notification-helper.php +++ b/src/helpers/notification-helper.php @@ -69,7 +69,7 @@ function ( $notification ) { 'resolveNonce' => $notification->get_resolve_nonce(), ]; }, - $all_notifications + $all_notifications, ); } } diff --git a/src/helpers/post-type-helper.php b/src/helpers/post-type-helper.php index 92ee2cfcf42..7f45c006edc 100644 --- a/src/helpers/post-type-helper.php +++ b/src/helpers/post-type-helper.php @@ -225,7 +225,7 @@ public function is_post_type_archive_indexable( $post_type ) { static function ( $post_type_object ) { return $post_type_object->name; }, - $public_type_objects + $public_type_objects, ); return \in_array( $post_type, $public_types, true ); diff --git a/src/helpers/redirect-helper.php b/src/helpers/redirect-helper.php index b2fba707677..2c0f8802831 100644 --- a/src/helpers/redirect-helper.php +++ b/src/helpers/redirect-helper.php @@ -21,7 +21,7 @@ class Redirect_Helper { public function do_unsafe_redirect( $location, $status = 302, $reason = 'Yoast SEO' ) { // phpcs:ignore WordPress.Security.SafeRedirect -- intentional, function has been renamed to make unsafe more clear. \wp_redirect( $location, $status, $reason ); - exit; + exit(); } /** @@ -37,7 +37,7 @@ public function do_unsafe_redirect( $location, $status = 302, $reason = 'Yoast S */ public function do_safe_redirect( $location, $status = 302, $reason = 'Yoast SEO' ) { \wp_safe_redirect( $location, $status, $reason ); - exit; + exit(); } /** diff --git a/src/helpers/schema/article-helper.php b/src/helpers/schema/article-helper.php index d4661c25143..b31af3a5e2a 100644 --- a/src/helpers/schema/article-helper.php +++ b/src/helpers/schema/article-helper.php @@ -15,9 +15,7 @@ class Article_Helper { * @return bool True if it has Article schema, false if not. */ public function is_article_post_type( $post_type = null ) { - if ( $post_type === null ) { - $post_type = \get_post_type(); - } + $post_type ??= \get_post_type(); return $this->is_author_supported( $post_type ); } diff --git a/src/helpers/schema/replace-vars-helper.php b/src/helpers/schema/replace-vars-helper.php index 6d09410befb..4b205d6a01b 100644 --- a/src/helpers/schema/replace-vars-helper.php +++ b/src/helpers/schema/replace-vars-helper.php @@ -116,7 +116,7 @@ public function register_replace_vars( $context ) { protected function register_replacement( $variable, $value ) { $this->replace_vars->safe_register_replacement( $variable, - $this->get_identity_function( $value ) + $this->get_identity_function( $value ), ); } diff --git a/src/helpers/social-profiles-helper.php b/src/helpers/social-profiles-helper.php index 4c2098f5b1a..a82f801efac 100644 --- a/src/helpers/social-profiles-helper.php +++ b/src/helpers/social-profiles-helper.php @@ -226,7 +226,7 @@ public function set_organization_social_profiles( $social_profiles ) { $social_profiles[ $field_name ], static function ( $other_social_url ) { return $other_social_url !== ''; - } + }, ); $social_profiles[ $field_name ] = \array_values( $other_social_urls ); diff --git a/src/helpers/url-helper.php b/src/helpers/url-helper.php index e5f5d2b7b26..e638ed81f4a 100644 --- a/src/helpers/url-helper.php +++ b/src/helpers/url-helper.php @@ -213,9 +213,7 @@ public function get_link_type( $url, $home_url = null, $is_image = false ) { return ( $is_image ) ? SEO_Links::TYPE_EXTERNAL_IMAGE : SEO_Links::TYPE_EXTERNAL; } - if ( $home_url === null ) { - $home_url = \wp_parse_url( \home_url() ); - } + $home_url ??= \wp_parse_url( \home_url() ); // When the base host is equal to the host. if ( isset( $url['host'] ) && $url['host'] !== $home_url['host'] ) { diff --git a/src/helpers/woocommerce-helper.php b/src/helpers/woocommerce-helper.php index 05423808c47..edfe49a80e5 100644 --- a/src/helpers/woocommerce-helper.php +++ b/src/helpers/woocommerce-helper.php @@ -66,6 +66,6 @@ public function current_post_is_terms_and_conditions_page() { return false; } - return \intval( $post->ID ) === \intval( \wc_terms_and_conditions_page_id() ); + return (int) $post->ID === (int) \wc_terms_and_conditions_page_id(); } } diff --git a/src/initializers/crawl-cleanup-permalinks.php b/src/initializers/crawl-cleanup-permalinks.php index c76dcd10559..a30e12badd3 100644 --- a/src/initializers/crawl-cleanup-permalinks.php +++ b/src/initializers/crawl-cleanup-permalinks.php @@ -142,7 +142,7 @@ public function utm_redirect() { $message = \sprintf( /* translators: %1$s: Yoast SEO */ \__( '%1$s: redirect utm variables to #', 'wordpress-seo' ), - 'Yoast SEO' + 'Yoast SEO', ); $this->redirect_helper->do_safe_redirect( \trailingslashit( $this->url_helper->recreate_current_url( false ) ) . \ltrim( $new_path, '/' ), 301, $message ); diff --git a/src/integrations/academy-integration.php b/src/integrations/academy-integration.php index 4c8cd9be91e..b49a1f457e8 100644 --- a/src/integrations/academy-integration.php +++ b/src/integrations/academy-integration.php @@ -113,7 +113,7 @@ public function add_page( $pages ) { self::PAGE, [ $this, 'display_page' ], ], - ] + ], ); return $pages; diff --git a/src/integrations/admin/addon-installation/dialog-integration.php b/src/integrations/admin/addon-installation/dialog-integration.php index 6b0821492ae..fe360971bf7 100644 --- a/src/integrations/admin/addon-installation/dialog-integration.php +++ b/src/integrations/admin/addon-installation/dialog-integration.php @@ -93,9 +93,9 @@ public function throw_no_owned_addons_warning() { /* translators: %1$s expands to Yoast SEO */ \esc_html__( 'No %1$s plugins have been installed. You don\'t seem to own any active subscriptions.', - 'wordpress-seo' + 'wordpress-seo', ), - 'Yoast SEO' + 'Yoast SEO', ) . '

    '; } @@ -112,7 +112,7 @@ public function show_modal() { [ 'addons' => $this->owned_addons, 'nonce' => \wp_create_nonce( 'wpseo_addon_installation' ), - ] + ], ); $asset_manager = new WPSEO_Admin_Asset_Manager(); diff --git a/src/integrations/admin/addon-installation/installation-integration.php b/src/integrations/admin/addon-installation/installation-integration.php index 1a0b8ea83b1..bc7369c5e29 100644 --- a/src/integrations/admin/addon-installation/installation-integration.php +++ b/src/integrations/admin/addon-installation/installation-integration.php @@ -103,7 +103,7 @@ public function install_and_activate_addons() { \printf( '

    %s

    ', - \esc_html__( 'Installing and activating addons', 'wordpress-seo' ) + \esc_html__( 'Installing and activating addons', 'wordpress-seo' ), ); $licensed_addons = $this->addon_manager->get_myyoast_site_information()->subscriptions; @@ -129,12 +129,12 @@ public function install_and_activate_addons() { \esc_html__( '%1$s Continue to %2$s%3$s', 'wordpress-seo' ), '', 'Yoast SEO Premium', - '' + '', ); echo '
    '; - exit; + exit(); } /** @@ -158,7 +158,7 @@ public function activate_addon( $addon_slug ) { $output[] = \sprintf( /* Translators:%s expands to the error message. */ \__( 'Addon activation failed because of an error: %s.', 'wordpress-seo' ), - $exception->getMessage() + $exception->getMessage(), ); } @@ -190,7 +190,7 @@ public function install_addon( $addon_slug, $addon_download ) { $output[] = \sprintf( /* Translators: %s expands to the error message. */ \__( 'Addon installation failed because of an error: %s.', 'wordpress-seo' ), - $exception->getMessage() + $exception->getMessage(), ); } diff --git a/src/integrations/admin/check-required-version.php b/src/integrations/admin/check-required-version.php index a82e0d7d991..125593b24af 100644 --- a/src/integrations/admin/check-required-version.php +++ b/src/integrations/admin/check-required-version.php @@ -83,13 +83,13 @@ public function check_required_version( $source, $remote_source = null, $upgrade /* translators: 1: Current Yoast SEO version, 2: Version required by the uploaded plugin. */ \__( 'The Yoast SEO version on your site is %1$s, however the uploaded plugin requires %2$s.', 'wordpress-seo' ), \WPSEO_VERSION, - \esc_html( $requires_yoast_seo ) + \esc_html( $requires_yoast_seo ), ); return new WP_Error( 'incompatible_yoast_seo_required_version', \__( 'The package could not be installed because it\'s not supported by the currently installed Yoast SEO version.', 'wordpress-seo' ), - $error + $error, ); } @@ -114,7 +114,7 @@ public function update_comparison_table( $table, $current_plugin_data, $new_plug '%1$s%2$s%3$s', \__( 'Required Yoast SEO version', 'wordpress-seo' ), ( $requires_yoast_seo_current !== false ) ? \esc_html( $requires_yoast_seo_current ) : '-', - ( $requires_yoast_seo_new !== false ) ? \esc_html( $requires_yoast_seo_new ) : '-' + ( $requires_yoast_seo_new !== false ) ? \esc_html( $requires_yoast_seo_new ) : '-', ); $table = \str_replace( '', $new_row . '', $table ); diff --git a/src/integrations/admin/crawl-settings-integration.php b/src/integrations/admin/crawl-settings-integration.php index 57a8dc0ae0b..8a31040ec97 100644 --- a/src/integrations/admin/crawl-settings-integration.php +++ b/src/integrations/admin/crawl-settings-integration.php @@ -203,10 +203,10 @@ private function add_crawl_settings( $yform ) { /* Translators: %1$s expands to an opening anchor tag for a link leading to the Yoast SEO page of the Permalink Cleanup features, %2$s expands to a closing anchor tag. */ \esc_html__( 'These are expert features, so make sure you know what you\'re doing before removing the parameters. %1$sRead more about how your site can be affected%2$s.', - 'wordpress-seo' + 'wordpress-seo', ), '', - '' + '', ); $this->print_toggles( $this->permalink_cleanup_settings, $yform, \__( 'Permalink cleanup settings', 'wordpress-seo' ), [], $permalink_warning ); @@ -276,7 +276,7 @@ private function print_toggles( array $settings, Yoast_Form $yform, $title = '', $toggles, $label, '', - $attr + $attr, ); if ( $this->should_feature_be_disabled_permalink( $setting ) ) { echo '

    '; @@ -285,7 +285,7 @@ private function print_toggles( array $settings, Yoast_Form $yform, $title = '', /* translators: 1: Link start tag to the Permalinks settings page, 2: Link closing tag. */ \esc_html__( 'This feature is disabled when your site is not using %1$spretty permalinks%2$s.', 'wordpress-seo' ), '', - '' + '', ); } else { diff --git a/src/integrations/admin/cron-integration.php b/src/integrations/admin/cron-integration.php index 14c4699ac1f..c3f85a0dcf9 100644 --- a/src/integrations/admin/cron-integration.php +++ b/src/integrations/admin/cron-integration.php @@ -42,7 +42,7 @@ public function register_hooks() { \wp_schedule_event( $this->date_helper->current_time(), 'daily', - Indexing_Notification_Integration::NOTIFICATION_ID + Indexing_Notification_Integration::NOTIFICATION_ID, ); } } diff --git a/src/integrations/admin/deactivated-premium-integration.php b/src/integrations/admin/deactivated-premium-integration.php index 40516b137c6..faa7445274a 100644 --- a/src/integrations/admin/deactivated-premium-integration.php +++ b/src/integrations/admin/deactivated-premium-integration.php @@ -88,10 +88,10 @@ public function premium_deactivated_notice() { '', - '' + '', ); // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped -- Output escaped above. echo new Notice_Presenter( @@ -101,7 +101,7 @@ public function premium_deactivated_notice() { 'support-team.svg', null, true, - 'yoast-premium-deactivated-notice' + 'yoast-premium-deactivated-notice', ); // phpcs:enable diff --git a/src/integrations/admin/first-time-configuration-integration.php b/src/integrations/admin/first-time-configuration-integration.php index 3b5b3804922..9845cecb778 100644 --- a/src/integrations/admin/first-time-configuration-integration.php +++ b/src/integrations/admin/first-time-configuration-integration.php @@ -137,8 +137,8 @@ public function add_first_time_configuration_tab( $dashboard_tabs ) { new WPSEO_Option_Tab( 'first-time-configuration', \__( 'First-time configuration', 'wordpress-seo' ), - [ 'save_button' => false ] - ) + [ 'save_button' => false ], + ), ); } @@ -192,7 +192,7 @@ public function enqueue_assets() { $options, function ( $item ) { return $item['value'] === $this->is_company_or_person(); - } + }, ); $selected_option = \reset( $filtered_options ); if ( \is_array( $selected_option ) ) { diff --git a/src/integrations/admin/first-time-configuration-notice-integration.php b/src/integrations/admin/first-time-configuration-notice-integration.php index d47d05935d3..837ab3f0200 100644 --- a/src/integrations/admin/first-time-configuration-notice-integration.php +++ b/src/integrations/admin/first-time-configuration-notice-integration.php @@ -110,7 +110,7 @@ public function first_time_configuration_notice() { \__( 'Get started quickly with the %1$s%2$s First-time configuration%3$s and configure Yoast SEO with the optimal SEO settings for your site!', 'wordpress-seo' ), '', 'Yoast SEO', - '' + '', ); } else { @@ -118,7 +118,7 @@ public function first_time_configuration_notice() { /* translators: 1: Link start tag to the first-time configuration, 2: Link closing tag. */ \__( 'We noticed that you haven\'t fully configured Yoast SEO yet. Optimize your SEO settings even further by using our improved %1$s First-time configuration%2$s.', 'wordpress-seo' ), '', - '' + '', ); } @@ -128,7 +128,7 @@ public function first_time_configuration_notice() { 'mirrored_fit_bubble_woman_1_optim.svg', null, true, - 'yoast-first-time-configuration-notice' + 'yoast-first-time-configuration-notice', ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output from present() is considered safe. diff --git a/src/integrations/admin/helpscout-beacon.php b/src/integrations/admin/helpscout-beacon.php index 3a6c2d0b4eb..4a9098cf0f4 100644 --- a/src/integrations/admin/helpscout-beacon.php +++ b/src/integrations/admin/helpscout-beacon.php @@ -190,7 +190,7 @@ public function output_beacon_js() { ( $this->ask_consent ) ? 'wpseoHelpScoutBeaconConsent' : 'wpseoHelpScoutBeacon', \esc_html( $this->pages_ids[ $this->page ] ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- escaping done in format_json_encode. - WPSEO_Utils::format_json_encode( (array) $this->get_session_data() ) + WPSEO_Utils::format_json_encode( (array) $this->get_session_data() ), ); } @@ -242,7 +242,7 @@ protected function get_session_data() { 'Active plugins' => $this->get_active_plugins(), 'Must-use and dropins' => $this->get_mustuse_and_dropins(), 'Indexables status' => $this->get_indexables_status(), - ] + ], ); if ( ! empty( $this->products ) ) { @@ -319,7 +319,7 @@ private function get_product_info( $plugin ) { $product_info = \sprintf( 'Expiration date %1$s', - $plugin->expiry_date + $plugin->expiry_date, ); return $product_info; @@ -356,7 +356,7 @@ private function get_theme_info() { '%1$s (Version %2$s, %3$s)', \esc_html( $theme->display( 'Name' ) ), \esc_html( $theme->display( 'Version' ) ), - \esc_attr( $theme->display( 'ThemeURI' ) ) + \esc_attr( $theme->display( 'ThemeURI' ) ), ); if ( \is_child_theme() ) { @@ -389,7 +389,7 @@ private function get_active_plugins() { \esc_html( $plugin_data['Name'] ), \esc_html( $plugin_data['Version'] ), $plugin_update_available, - \esc_attr( $plugin_data['PluginURI'] ) + \esc_attr( $plugin_data['PluginURI'] ), ); } @@ -452,7 +452,7 @@ private function get_language_settings() { $language_settings = \sprintf( 'Site locale: %1$s, user locale: %2$s', ( \is_string( $site_locale ) ) ? \esc_html( $site_locale ) : 'unknown', - ( \is_string( $user_locale ) ) ? \esc_html( $user_locale ) : 'unknown' + ( \is_string( $user_locale ) ) ? \esc_html( $user_locale ) : 'unknown', ); return $language_settings; diff --git a/src/integrations/admin/indexing-notification-integration.php b/src/integrations/admin/indexing-notification-integration.php index 3ae6cbdfbd6..fd03721530f 100644 --- a/src/integrations/admin/indexing-notification-integration.php +++ b/src/integrations/admin/indexing-notification-integration.php @@ -227,7 +227,7 @@ protected function notification() { 'id' => self::NOTIFICATION_ID, 'capabilities' => 'wpseo_manage_options', 'priority' => 0.8, - ] + ], ); } diff --git a/src/integrations/admin/indexing-tool-integration.php b/src/integrations/admin/indexing-tool-integration.php index fa2e15e34e2..d4cd3d3e723 100644 --- a/src/integrations/admin/indexing-tool-integration.php +++ b/src/integrations/admin/indexing-tool-integration.php @@ -178,7 +178,7 @@ protected function render_indexing_error() { $presenter = new Indexing_Error_Presenter( $this->short_link_helper, $this->product_helper, - $this->addon_manager + $this->addon_manager, ); return $presenter->present(); diff --git a/src/integrations/admin/installation-success-integration.php b/src/integrations/admin/installation-success-integration.php index be7ad79be7b..d66bc77efaf 100644 --- a/src/integrations/admin/installation-success-integration.php +++ b/src/integrations/admin/installation-success-integration.php @@ -115,7 +115,7 @@ public function add_submenu_page( $submenu_pages ) { '', 'manage_options', 'wpseo_installation_successful_free', - [ $this, 'render_page' ] + [ $this, 'render_page' ], ); return $submenu_pages; @@ -147,7 +147,7 @@ public function enqueue_assets() { 'firstTimeConfigurationUrl' => $ftc_url, 'dashboardUrl' => \esc_url( \admin_url( 'admin.php?page=wpseo_dashboard' ) ), 'explorePremiumUrl' => $this->shortlinker->build( 'https://yoa.st/ftc-premium-link' ), - ] + ], ); } @@ -166,6 +166,6 @@ public function render_page() { * @return void */ public function terminate_execution() { - exit; + exit(); } } diff --git a/src/integrations/admin/integrations-page.php b/src/integrations/admin/integrations-page.php index c9f03a62a6e..34f073b236b 100644 --- a/src/integrations/admin/integrations-page.php +++ b/src/integrations/admin/integrations-page.php @@ -179,19 +179,19 @@ public function enqueue_assets() { if ( $acf_seo_installed ) { $acf_seo_activate_url = \wp_nonce_url( \self_admin_url( 'plugins.php?action=activate&plugin=' . $acf_seo_file ), - 'activate-plugin_' . $acf_seo_file + 'activate-plugin_' . $acf_seo_file, ); } else { $acf_seo_activate_url = \wp_nonce_url( \self_admin_url( 'plugins.php?action=activate&plugin=' . $acf_seo_file_github ), - 'activate-plugin_' . $acf_seo_file_github + 'activate-plugin_' . $acf_seo_file_github, ); } $acf_seo_install_url = \wp_nonce_url( \self_admin_url( 'update.php?action=install-plugin&plugin=acf-content-analysis-for-yoast-seo' ), - 'install-plugin_acf-content-analysis-for-yoast-seo' + 'install-plugin_acf-content-analysis-for-yoast-seo', ); $this->admin_asset_manager->localize_script( @@ -226,7 +226,7 @@ public function enqueue_assets() { 'site_kit_configuration' => $this->site_kit_integration_data->to_array(), 'site_kit_consent_management_url' => $this->site_kit_consent_management_endpoint->get_url(), 'schema_framework_enabled' => $this->options_helper->get( 'enable_schema', true ) === true && ! $this->schema_configuration->is_schema_disabled_programmatically(), - ] + ], ); } diff --git a/src/integrations/admin/link-count-columns-integration.php b/src/integrations/admin/link-count-columns-integration.php index c9f72bc7ab9..e87befbc22d 100644 --- a/src/integrations/admin/link-count-columns-integration.php +++ b/src/integrations/admin/link-count-columns-integration.php @@ -138,7 +138,7 @@ public function add_post_columns( $columns ) { '%2$s', \esc_attr__( 'Number of outgoing internal links in this post.', 'wordpress-seo' ), /* translators: Hidden accessibility text. */ - \esc_html__( 'Outgoing internal links', 'wordpress-seo' ) + \esc_html__( 'Outgoing internal links', 'wordpress-seo' ), ); if ( $this->post_link_indexing_action->get_total_unindexed() === 0 ) { @@ -146,7 +146,7 @@ public function add_post_columns( $columns ) { '%2$s', \esc_attr__( 'Number of internal links linking to this post.', 'wordpress-seo' ), /* translators: Hidden accessibility text. */ - \esc_html__( 'Received internal links', 'wordpress-seo' ) + \esc_html__( 'Received internal links', 'wordpress-seo' ), ); } diff --git a/src/integrations/admin/old-configuration-integration.php b/src/integrations/admin/old-configuration-integration.php index e3d3a50a277..406b5eef635 100644 --- a/src/integrations/admin/old-configuration-integration.php +++ b/src/integrations/admin/old-configuration-integration.php @@ -39,7 +39,7 @@ public function add_submenu_page( $submenu_pages ) { '', 'manage_options', 'wpseo_configurator', - [ $this, 'render_page' ] + [ $this, 'render_page' ], ); return $submenu_pages; @@ -66,6 +66,6 @@ public function redirect_to_new_configuration() { } $redirect_url = 'admin.php?page=wpseo_dashboard#/first-time-configuration'; \wp_safe_redirect( \admin_url( $redirect_url ), 302, 'Yoast SEO' ); - exit; + exit(); } } diff --git a/src/integrations/admin/redirections-tools-page.php b/src/integrations/admin/redirections-tools-page.php index da4bb5432ea..ccbad977e7d 100644 --- a/src/integrations/admin/redirections-tools-page.php +++ b/src/integrations/admin/redirections-tools-page.php @@ -58,7 +58,7 @@ public function register_admin_menu() { $page_title = \sprintf( /* translators: %s: expands to Yoast */ \esc_html__( '%s Redirects', 'wordpress-seo' ), - 'Yoast' + 'Yoast', ); \add_management_page( @@ -66,7 +66,7 @@ public function register_admin_menu() { $page_title, 'edit_others_posts', 'wpseo_redirects_tools', - [ $this, 'show_redirects_page' ] + [ $this, 'show_redirects_page' ], ); } diff --git a/src/integrations/admin/redirects-page-integration.php b/src/integrations/admin/redirects-page-integration.php index 528e937672a..cfdc61d3a96 100644 --- a/src/integrations/admin/redirects-page-integration.php +++ b/src/integrations/admin/redirects-page-integration.php @@ -127,7 +127,7 @@ public function enqueue_assets() { 'linkParams' => \YoastSEO()->helpers->short_link->get_query_params(), 'pluginUrl' => \plugins_url( '', \WPSEO_FILE ), 'wistiaEmbedPermission' => $this->wistia_embed_permission_repository->get_value_for_user( $user_id ), - ] + ], ); } diff --git a/src/integrations/admin/workouts-integration.php b/src/integrations/admin/workouts-integration.php index 5e8867bc244..25d9285b79d 100644 --- a/src/integrations/admin/workouts-integration.php +++ b/src/integrations/admin/workouts-integration.php @@ -160,7 +160,7 @@ public function enqueue_assets() { 'isPremium' => $this->product_helper->is_premium(), 'upsellText' => $this->get_upsell_text(), 'upsellLink' => $this->get_upsell_link(), - ] + ], ); } @@ -205,9 +205,9 @@ private function get_update_premium_notice() { /* translators: %s: expands to 'Yoast SEO Premium'. */ \esc_html__( 'Accessing the latest workouts requires an updated version of %s (at least 17.7), but it looks like your subscription has expired. Please renew your subscription to update and gain access to all the latest features.', - 'wordpress-seo' + 'wordpress-seo', ), - 'Yoast SEO Premium' + 'Yoast SEO Premium', ); $button = '' . \esc_html__( 'Renew your subscription', 'wordpress-seo' ) @@ -224,7 +224,7 @@ private function get_update_premium_notice() { \esc_html__( 'It looks like you\'re running an outdated version of %1$s, please %2$supdate to the latest version (at least 17.7)%3$s to gain access to our updated workouts section.', 'wordpress-seo' ), 'Yoast SEO Premium', '', - '' + '', ); $button = null; } @@ -237,7 +237,7 @@ private function get_update_premium_notice() { \esc_html__( 'It looks like you’re running an outdated and unactivated version of %1$s, please activate your subscription in %2$sMyYoast%3$s and update to the latest version (at least 17.7) to gain access to our updated workouts section.', 'wordpress-seo' ), 'Yoast SEO Premium', '', - '' + '', ); $button = '' . \esc_html__( 'Get help activating your subscription', 'wordpress-seo' ) @@ -250,7 +250,7 @@ private function get_update_premium_notice() { $title, $copy, null, - $button + $button, ); return $notice->present(); @@ -300,20 +300,20 @@ private function get_upsell_text() { return \sprintf( /* translators: %s: expands to 'Yoast SEO Premium'. */ \__( 'Renew %s', 'wordpress-seo' ), - 'Yoast SEO Premium' + 'Yoast SEO Premium', ); } if ( $this->has_premium_subscription_activated() ) { return \sprintf( /* translators: %s: expands to 'Yoast SEO Premium'. */ \__( 'Update %s', 'wordpress-seo' ), - 'Yoast SEO Premium' + 'Yoast SEO Premium', ); } return \sprintf( /* translators: %s: expands to 'Yoast SEO Premium'. */ \__( 'Activate %s', 'wordpress-seo' ), - 'Yoast SEO Premium' + 'Yoast SEO Premium', ); } diff --git a/src/integrations/blocks/abstract-dynamic-block-v3.php b/src/integrations/blocks/abstract-dynamic-block-v3.php index c905a44e96f..4715c935214 100644 --- a/src/integrations/blocks/abstract-dynamic-block-v3.php +++ b/src/integrations/blocks/abstract-dynamic-block-v3.php @@ -62,7 +62,7 @@ public function register_block() { [ 'editor_script' => $this->script, 'render_callback' => [ $this, 'present' ], - ] + ], ); } diff --git a/src/integrations/blocks/abstract-dynamic-block.php b/src/integrations/blocks/abstract-dynamic-block.php index 4352fb1f043..bed943c9262 100644 --- a/src/integrations/blocks/abstract-dynamic-block.php +++ b/src/integrations/blocks/abstract-dynamic-block.php @@ -54,7 +54,7 @@ public function register_block() { 'type' => 'string', ], ], - ] + ], ); } diff --git a/src/integrations/blocks/block-categories.php b/src/integrations/blocks/block-categories.php index 09fa960a075..3e31312fdf3 100644 --- a/src/integrations/blocks/block-categories.php +++ b/src/integrations/blocks/block-categories.php @@ -35,7 +35,7 @@ public function add_block_categories( $categories ) { 'title' => \sprintf( /* translators: %1$s expands to Yoast. */ \__( '%1$s Structured Data Blocks', 'wordpress-seo' ), - 'Yoast' + 'Yoast', ), ]; $categories[] = [ @@ -43,7 +43,7 @@ public function add_block_categories( $categories ) { 'title' => \sprintf( /* translators: %1$s expands to Yoast. */ \__( '%1$s Internal Linking Blocks', 'wordpress-seo' ), - 'Yoast' + 'Yoast', ), ]; diff --git a/src/integrations/blocks/breadcrumbs-block.php b/src/integrations/blocks/breadcrumbs-block.php index 867729209e1..9f248cf72c4 100644 --- a/src/integrations/blocks/breadcrumbs-block.php +++ b/src/integrations/blocks/breadcrumbs-block.php @@ -100,7 +100,7 @@ public function present( $attributes ) { 'object_id' => $post_id, 'object_type' => 'post', 'object_sub_type' => $post->post_type, - ] + ], ); } diff --git a/src/integrations/blocks/structured-data-blocks.php b/src/integrations/blocks/structured-data-blocks.php index 59a5cad17c3..2adfadb92a4 100644 --- a/src/integrations/blocks/structured-data-blocks.php +++ b/src/integrations/blocks/structured-data-blocks.php @@ -88,13 +88,13 @@ public function register_blocks() { \WPSEO_PATH . 'blocks/structured-data-blocks/faq/block.json', [ 'render_callback' => [ $this, 'optimize_faq_images' ], - ] + ], ); \register_block_type( \WPSEO_PATH . 'blocks/structured-data-blocks/how-to/block.json', [ 'render_callback' => [ $this, 'optimize_how_to_images' ], - ] + ], ); } @@ -130,21 +130,21 @@ private function transform_duration_to_string( $days, $hours, $minutes ) { $strings[] = \sprintf( /* translators: %d expands to the number of day/days. */ \_n( '%d day', '%d days', $days, 'wordpress-seo' ), - $days + $days, ); } if ( $hours ) { $strings[] = \sprintf( /* translators: %d expands to the number of hour/hours. */ \_n( '%d hour', '%d hours', $hours, 'wordpress-seo' ), - $hours + $hours, ); } if ( $minutes ) { $strings[] = \sprintf( /* translators: %d expands to the number of minute/minutes. */ \_n( '%d minute', '%d minutes', $minutes, 'wordpress-seo' ), - $minutes + $minutes, ); } return $strings; @@ -170,13 +170,13 @@ private function build_duration_string( $attributes ) { return \sprintf( /* translators: %s expands to a unit of time (e.g. 1 day). */ \__( '%1$s and %2$s', 'wordpress-seo' ), - ...$elements + ...$elements, ); case 3: return \sprintf( /* translators: %s expands to a unit of time (e.g. 1 day). */ \__( '%1$s, %2$s and %3$s', 'wordpress-seo' ), - ...$elements + ...$elements, ); default: return ''; @@ -204,7 +204,7 @@ public function present_duration_text( $attributes, $content ) { '/(

    )(.*<\/span>)(.[^\/p>]*)(<\/p>)/', '

    ' . $duration_text . ' ' . $duration . '

    ', $content, - 1 + 1, ); } @@ -282,13 +282,13 @@ function ( $matches ) { 'wpseo_structured_data_blocks_image_size', $image_size, $attachment_id, - $src_matches[1] + $src_matches[1], ); $image_html = \wp_get_attachment_image( $attachment_id, $image_size, false, - $image_style + $image_style, ); if ( empty( $image_html ) ) { @@ -297,7 +297,7 @@ function ( $matches ) { return $image_html; }, - $content + $content, ); if ( ! $this->registered_shutdown_function ) { diff --git a/src/integrations/cleanup-integration.php b/src/integrations/cleanup-integration.php index 892bc1124c5..48f262dc23f 100644 --- a/src/integrations/cleanup-integration.php +++ b/src/integrations/cleanup-integration.php @@ -165,7 +165,7 @@ public function get_cleanup_tasks() { return $this->cleanup_repository->cleanup_orphaned_from_table( 'SEO_Links', 'target_indexable_id', $limit ); }, ], - $this->get_additional_misc_cleanups() + $this->get_additional_misc_cleanups(), ); } @@ -270,7 +270,7 @@ public function start_cron_job( $task_name, $schedule_time = 3600 ) { \wp_schedule_event( ( \time() + $schedule_time ), 'hourly', - self::CRON_HOOK + self::CRON_HOOK, ); } diff --git a/src/integrations/front-end-integration.php b/src/integrations/front-end-integration.php index 7e1ecd8c521..0b26ac78ba8 100644 --- a/src/integrations/front-end-integration.php +++ b/src/integrations/front-end-integration.php @@ -262,7 +262,7 @@ public function register_hooks() { \add_filter( 'wpseo_frontend_presenter_classes', [ $this, 'filter_robots_presenter' ] ); \add_action( 'wpseo_head', [ $this, 'present_head' ], -9999 ); - \add_action( 'wpseo_head', [ $this, 'update_outdated_permalink' ], -10000 ); + \add_action( 'wpseo_head', [ $this, 'update_outdated_permalink' ], -10_000 ); \remove_action( 'wp_head', 'rel_canonical' ); \remove_action( 'wp_head', 'index_rel_link' ); @@ -329,7 +329,7 @@ public function update_outdated_permalink() { $this->indexable_repository->reset_permalink( $context->indexable->object_type, $context->indexable->object_sub_type, - $context->indexable->object_id + $context->indexable->object_id, ); // Clear the memoizer caches so present_head() sees the updated indexable. @@ -501,9 +501,7 @@ public function present_head() { * @return Abstract_Indexable_Presenter[] The presenters. */ public function get_presenters( $page_type, $context = null ) { - if ( $context === null ) { - $context = $this->context_memoizer->for_current_page(); - } + $context ??= $this->context_memoizer->for_current_page(); $needed_presenters = $this->get_needed_presenters( $page_type ); @@ -535,7 +533,7 @@ public function get_presenters( $page_type, $context = null ) { return \array_merge( [ new Marker_Open_Presenter() ], $presenter_instances, - [ new Marker_Close_Presenter() ] + [ new Marker_Close_Presenter() ], ); } diff --git a/src/integrations/front-end/crawl-cleanup-rss.php b/src/integrations/front-end/crawl-cleanup-rss.php index 6f26706c58a..b2dbaf06397 100644 --- a/src/integrations/front-end/crawl-cleanup-rss.php +++ b/src/integrations/front-end/crawl-cleanup-rss.php @@ -51,7 +51,7 @@ public function register_hooks() { } \add_action( 'wp', [ $this, 'maybe_disable_feeds' ] ); - \add_action( 'wp', [ $this, 'maybe_redirect_feeds' ], -10000 ); + \add_action( 'wp', [ $this, 'maybe_redirect_feeds' ], -10_000 ); } /** @@ -183,7 +183,7 @@ private function redirect_feed( $url, $reason ) { $this->cache_control_header( 7 * \DAY_IN_SECONDS ); \wp_safe_redirect( $url, 301, 'Yoast SEO: ' . $reason ); - exit; + exit(); } /** diff --git a/src/integrations/front-end/crawl-cleanup-searches.php b/src/integrations/front-end/crawl-cleanup-searches.php index 48acf627923..d66f9e9311a 100644 --- a/src/integrations/front-end/crawl-cleanup-searches.php +++ b/src/integrations/front-end/crawl-cleanup-searches.php @@ -118,7 +118,7 @@ public function maybe_redirect_searches() { $proper_url = \home_url( '/' ); - if ( \intval( \get_query_var( 'paged' ) ) > 1 ) { + if ( (int) \get_query_var( 'paged' ) > 1 ) { $proper_url .= \sprintf( 'page/%s/', \get_query_var( 'paged' ) ); unset( $args['paged'] ); } diff --git a/src/integrations/front-end/force-rewrite-title.php b/src/integrations/front-end/force-rewrite-title.php index 357e9b90f06..ec142556fb7 100644 --- a/src/integrations/front-end/force-rewrite-title.php +++ b/src/integrations/front-end/force-rewrite-title.php @@ -75,7 +75,7 @@ public function register_hooks() { return; } - \add_action( 'template_redirect', [ $this, 'force_rewrite_output_buffer' ], 99999 ); + \add_action( 'template_redirect', [ $this, 'force_rewrite_output_buffer' ], 99_999 ); \add_action( 'wp_footer', [ $this, 'flush_cache' ], -1 ); } diff --git a/src/integrations/front-end/redirects.php b/src/integrations/front-end/redirects.php index 9f61e54b0c1..7ffcb1c542e 100644 --- a/src/integrations/front-end/redirects.php +++ b/src/integrations/front-end/redirects.php @@ -224,7 +224,7 @@ protected function get_attachment_url() { return \apply_filters( 'wpseo_attachment_redirect_url', \wp_get_attachment_url( \get_queried_object_id() ), - \get_queried_object() + \get_queried_object(), ); } diff --git a/src/integrations/front-end/robots-txt-integration.php b/src/integrations/front-end/robots-txt-integration.php index adbda35281d..9e2b6462d22 100644 --- a/src/integrations/front-end/robots-txt-integration.php +++ b/src/integrations/front-end/robots-txt-integration.php @@ -65,7 +65,7 @@ public static function get_conditionals() { * @return void */ public function register_hooks() { - \add_filter( 'robots_txt', [ $this, 'filter_robots' ], 99999 ); + \add_filter( 'robots_txt', [ $this, 'filter_robots' ], 99_999 ); if ( $this->options_helper->get( 'deny_search_crawling' ) && ! \is_multisite() ) { \add_action( 'Yoast\WP\SEO\register_robots_rules', [ $this, 'add_disallow_search_to_robots' ], 10, 1 ); @@ -157,7 +157,7 @@ protected function remove_default_robots( $robots_txt ) { return \preg_replace( '`User-agent: \*[\r\n]+Disallow: /wp-admin/[\r\n]+Allow: /wp-admin/admin-ajax\.php[\r\n]+`', '', - $robots_txt + $robots_txt, ); } diff --git a/src/integrations/front-end/wp-robots-integration.php b/src/integrations/front-end/wp-robots-integration.php index 657083a62c4..f07ca0eaa49 100644 --- a/src/integrations/front-end/wp-robots-integration.php +++ b/src/integrations/front-end/wp-robots-integration.php @@ -195,7 +195,7 @@ static function ( $a, $b ) { $bi = ( $order[ $b ] ?? 4 ); return ( $ai - $bi ); - } + }, ); return $robots; diff --git a/src/integrations/settings-integration.php b/src/integrations/settings-integration.php index 9207bea3ed7..13fb4bdd6dd 100644 --- a/src/integrations/settings-integration.php +++ b/src/integrations/settings-integration.php @@ -382,7 +382,7 @@ public function add_page( $pages ) { self::PAGE, [ $this, 'display_page' ], ], - ] + ], ); return $pages; @@ -415,7 +415,7 @@ static function () use ( $runner ) { $failure_reason = $runner->get_generation_failure_reason(); echo \esc_html( "{{ yoast-llms-txt-generation-failure: $failure_reason }}" ); } - } + }, ); return $pages; @@ -862,7 +862,7 @@ protected function transform_settings( $settings ) { $settings['wpseo_titles']['breadcrumbs-sep'] = \html_entity_decode( $settings['wpseo_titles']['breadcrumbs-sep'], ( \ENT_NOQUOTES | \ENT_HTML5 ), - 'UTF-8' + 'UTF-8', ); } @@ -872,7 +872,7 @@ protected function transform_settings( $settings ) { $settings['blogdescription'] = \html_entity_decode( $settings['blogdescription'], ( \ENT_NOQUOTES | \ENT_HTML5 ), - 'UTF-8' + 'UTF-8', ); if ( isset( $settings['wpseo_llmstxt']['other_included_pages'] ) ) { @@ -1055,7 +1055,7 @@ protected function transform_taxonomies( $taxonomies, $post_type_names ) { $taxonomy->object_type, static function ( $object_type ) use ( $post_type_names ) { return \in_array( $object_type, $post_type_names, true ); - } + }, ), 'isNew' => \in_array( $taxonomy->name, $new_taxonomies, true ), ]; @@ -1065,7 +1065,7 @@ static function ( $object_type ) use ( $post_type_names ) { $transformed, static function ( $a, $b ) { return \strnatcmp( $a['label'], $b['label'] ); - } + }, ); return $transformed; diff --git a/src/integrations/third-party/elementor.php b/src/integrations/third-party/elementor.php index 330232e2e92..eae64489f3b 100644 --- a/src/integrations/third-party/elementor.php +++ b/src/integrations/third-party/elementor.php @@ -296,7 +296,7 @@ public function save_postdata() { WPSEO_Meta::get_meta_field_defs( 'general', $post->post_type ), WPSEO_Meta::get_meta_field_defs( 'advanced', $post->post_type ), $social_fields, - WPSEO_Meta::get_meta_field_defs( 'schema', $post->post_type ) + WPSEO_Meta::get_meta_field_defs( 'schema', $post->post_type ), ); foreach ( $meta_boxes as $key => $meta_box ) { @@ -513,7 +513,7 @@ protected function render_hidden_fields() { \printf( '
    ', \esc_url( \admin_url( 'admin-ajax.php' ) ), - \esc_attr( $this->get_metabox_post()->ID ) + \esc_attr( $this->get_metabox_post()->ID ), ); \wp_nonce_field( 'wpseo_elementor_save', '_wpseo_elementor_nonce' ); @@ -541,7 +541,7 @@ protected function render_hidden_fields() { * If the DB value is empty we can auto-generate a slug. * But if not empty, we should not touch it anymore. */ - \esc_attr( $this->get_metabox_post()->post_name ) + \esc_attr( $this->get_metabox_post()->post_name ), ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output should be escaped in the filter. @@ -574,7 +574,7 @@ protected function get_metabox_post() { */ protected function get_metabox_script_data( $permalink ) { $post_formatter = new WPSEO_Metabox_Formatter( - new WPSEO_Post_Metabox_Formatter( $this->get_metabox_post(), [], $permalink ) + new WPSEO_Post_Metabox_Formatter( $this->get_metabox_post(), [], $permalink ), ); $values = $post_formatter->get_values(); @@ -758,7 +758,7 @@ protected function get_custom_fields_replace_vars( $post ) { [ \YoastSEO()->meta->for_post( $post->ID )->presentation->title, \YoastSEO()->meta->for_post( $post->ID )->presentation->meta_description, - ] + ], ); \preg_match_all( '/%%cf_([A-Za-z0-9_]+)%%/', $replace_vars_fields, $matches ); diff --git a/src/integrations/third-party/wpml-wpseo-notification.php b/src/integrations/third-party/wpml-wpseo-notification.php index 1e32e4bc291..df73a048ac7 100644 --- a/src/integrations/third-party/wpml-wpseo-notification.php +++ b/src/integrations/third-party/wpml-wpseo-notification.php @@ -109,12 +109,12 @@ protected function get_notification() { /* translators: %1$s expands to an opening anchor tag, %2$s expands to an closing anchor tag. */ \__( 'We notice that you have installed WPML. To make sure your canonical URLs are set correctly, %1$sinstall and activate the WPML SEO add-on%2$s as well!', 'wordpress-seo' ), '', - '' + '', ), [ 'id' => self::NOTIFICATION_ID, 'type' => Yoast_Notification::WARNING, - ] + ], ); } } diff --git a/src/integrations/watchers/addon-update-watcher.php b/src/integrations/watchers/addon-update-watcher.php index 2e6ef3eb742..133293c0cbc 100644 --- a/src/integrations/watchers/addon-update-watcher.php +++ b/src/integrations/watchers/addon-update-watcher.php @@ -83,8 +83,8 @@ public function replace_auto_update_toggles_of_addons( $old_html, $plugin ) { \sprintf( /* Translators: %1$s resolves to Yoast SEO. */ \esc_html__( 'Auto-updates are enabled based on this setting for %1$s.', 'wordpress-seo' ), - 'Yoast SEO' - ) + 'Yoast SEO', + ), ); } @@ -93,8 +93,8 @@ public function replace_auto_update_toggles_of_addons( $old_html, $plugin ) { \sprintf( /* Translators: %1$s resolves to Yoast SEO. */ \esc_html__( 'Auto-updates are disabled based on this setting for %1$s.', 'wordpress-seo' ), - 'Yoast SEO' - ) + 'Yoast SEO', + ), ); } diff --git a/src/integrations/watchers/indexable-ancestor-watcher.php b/src/integrations/watchers/indexable-ancestor-watcher.php index 515f528a75a..bd47e6fb5c6 100644 --- a/src/integrations/watchers/indexable-ancestor-watcher.php +++ b/src/integrations/watchers/indexable-ancestor-watcher.php @@ -153,7 +153,7 @@ public function get_children_for_term( $term_id, array $child_indexables ) { $child_indexables, static function ( $indexable ) { return $indexable->object_type === 'post'; - } + }, ); $existing_post_object_ids = \wp_list_pluck( $existing_post_indexables, 'object_id' ); @@ -218,8 +218,8 @@ protected function get_object_ids_for_term( $term_id, $child_indexables ) { FROM %i WHERE term_id IN( ' . \implode( ', ', \array_fill( 0, ( \count( $child_object_ids ) ), '%s' ) ) . ' )', $wpdb->term_taxonomy, - ...$child_object_ids - ) + ...$child_object_ids, + ), ); // In the case of faulty data having been saved the above query can return 0 results. @@ -235,8 +235,8 @@ protected function get_object_ids_for_term( $term_id, $child_indexables ) { FROM %i WHERE term_taxonomy_id IN( ' . \implode( ', ', \array_fill( 0, \count( $term_taxonomy_ids ), '%s' ) ) . ' )', $wpdb->term_relationships, - ...$term_taxonomy_ids - ) + ...$term_taxonomy_ids, + ), ); } } diff --git a/src/integrations/watchers/indexable-author-archive-watcher.php b/src/integrations/watchers/indexable-author-archive-watcher.php index 7452cc42161..f8ab5e67f4b 100644 --- a/src/integrations/watchers/indexable-author-archive-watcher.php +++ b/src/integrations/watchers/indexable-author-archive-watcher.php @@ -39,7 +39,7 @@ public function register_hooks() { 'update_option_wpseo_titles', [ $this, 'reschedule_indexable_cleanup_when_author_archives_are_disabled' ], 10, - 2 + 2, ); } diff --git a/src/integrations/watchers/indexable-post-watcher.php b/src/integrations/watchers/indexable-post-watcher.php index a9cf31f92b0..f8cd88d3214 100644 --- a/src/integrations/watchers/indexable-post-watcher.php +++ b/src/integrations/watchers/indexable-post-watcher.php @@ -321,7 +321,7 @@ protected function get_related_indexables( $post ) { } $related_indexables = \array_merge( $related_indexables, - $this->repository->find_by_multiple_ids_and_type( $term_ids, 'term', false ) + $this->repository->find_by_multiple_ids_and_type( $term_ids, 'term', false ), ); return \array_filter( $related_indexables ); diff --git a/src/integrations/watchers/option-titles-watcher.php b/src/integrations/watchers/option-titles-watcher.php index 89bf758c845..0225ffa4748 100644 --- a/src/integrations/watchers/option-titles-watcher.php +++ b/src/integrations/watchers/option-titles-watcher.php @@ -121,8 +121,8 @@ protected function delete_ancestors( $post_types ) { )', $hierarchy_table, $indexable_table, - ...$post_types - ) + ...$post_types, + ), ); return $result !== false; diff --git a/src/integrations/watchers/search-engines-discouraged-watcher.php b/src/integrations/watchers/search-engines-discouraged-watcher.php index 0ba2a5563b2..838d4d89f2e 100644 --- a/src/integrations/watchers/search-engines-discouraged-watcher.php +++ b/src/integrations/watchers/search-engines-discouraged-watcher.php @@ -212,7 +212,7 @@ protected function show_search_engines_discouraged_notice() { \printf( '
    %1$s
    ', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output from present() is considered safe. - $this->presenter->present() + $this->presenter->present(), ); } @@ -229,7 +229,7 @@ protected function notification() { 'id' => self::NOTIFICATION_ID, 'capabilities' => 'wpseo_manage_options', 'priority' => 1, - ] + ], ); } diff --git a/src/integrations/watchers/woocommerce-beta-editor-watcher.php b/src/integrations/watchers/woocommerce-beta-editor-watcher.php index f8b9a773a58..88e0241e47c 100644 --- a/src/integrations/watchers/woocommerce-beta-editor-watcher.php +++ b/src/integrations/watchers/woocommerce-beta-editor-watcher.php @@ -140,7 +140,7 @@ protected function notification() { 'id' => self::NOTIFICATION_ID, 'capabilities' => 'wpseo_manage_options', 'priority' => 1, - ] + ], ); } } diff --git a/src/integrations/woocommerce-product-category-permalink-integration.php b/src/integrations/woocommerce-product-category-permalink-integration.php index cd5ae3e3d94..a564724883a 100644 --- a/src/integrations/woocommerce-product-category-permalink-integration.php +++ b/src/integrations/woocommerce-product-category-permalink-integration.php @@ -69,7 +69,7 @@ public function restore_legacy_permalink_category( $category, $terms ) { [ 'parent' => 'DESC', 'term_id' => 'ASC', - ] + ], ); return $sorted_terms[0]; } diff --git a/src/introductions/application/delayed-premium-upsell.php b/src/introductions/application/delayed-premium-upsell.php index bfce0b1a474..2564a81f345 100644 --- a/src/introductions/application/delayed-premium-upsell.php +++ b/src/introductions/application/delayed-premium-upsell.php @@ -134,7 +134,7 @@ private function is_last_introduction_seen_older_than_a_week(): bool { $seen_introductions, static function ( $item ) { return \is_bool( $item ); - } + }, ); if ( ! empty( $old_format_introductions ) ) { @@ -151,7 +151,7 @@ static function ( $carry, $item ) { return $item; } return $carry; - } + }, ); // If the most recent introduction seen is older than a week, return true. diff --git a/src/introductions/application/introductions-collector.php b/src/introductions/application/introductions-collector.php index 317cd49d4f1..815680616af 100644 --- a/src/introductions/application/introductions-collector.php +++ b/src/introductions/application/introductions-collector.php @@ -47,7 +47,7 @@ public function get_for( $user_id ) { continue; } $bucket->add_introduction( - new Introduction_Item( $introduction->get_id(), $introduction->get_priority() ) + new Introduction_Item( $introduction->get_id(), $introduction->get_priority() ), ); } @@ -76,7 +76,7 @@ private function add_introductions( Introduction_Interface ...$introductions ) { $filtered_introductions, static function ( $introduction ) { return \is_a( $introduction, Introduction_Interface::class ); - } + }, ); } diff --git a/src/introductions/domain/introductions-bucket.php b/src/introductions/domain/introductions-bucket.php index 51a24806ae0..08018c3d9d7 100644 --- a/src/introductions/domain/introductions-bucket.php +++ b/src/introductions/domain/introductions-bucket.php @@ -43,7 +43,7 @@ public function to_array() { static function ( $item ) { return $item->to_array(); }, - $this->introductions + $this->introductions, ); } } diff --git a/src/introductions/user-interface/introductions-integration.php b/src/introductions/user-interface/introductions-integration.php index 4ab5faefaae..7075ccc364f 100644 --- a/src/introductions/user-interface/introductions-integration.php +++ b/src/introductions/user-interface/introductions-integration.php @@ -153,7 +153,7 @@ public function enqueue_assets() { 'pluginUrl' => \plugins_url( '', \WPSEO_FILE ), 'wistiaEmbedPermission' => $this->wistia_embed_permission_repository->get_value_for_user( $user_id ), 'isWooEnabled' => $this->woocommerce_conditional->is_met(), - ] + ], ); $this->admin_asset_manager->enqueue_style( 'introductions' ); } @@ -182,7 +182,7 @@ private function update_user_introductions( $user_id, $introductions ) { static function ( $carry, $item ) { return ( $carry === null || $item['priority'] < $carry['priority'] ) ? $item : $carry; }, - null + null, ); if ( $highest_priority_intro === null ) { diff --git a/src/introductions/user-interface/introductions-seen-route.php b/src/introductions/user-interface/introductions-seen-route.php index f19e86c3d79..dcf39b7544d 100644 --- a/src/introductions/user-interface/introductions-seen-route.php +++ b/src/introductions/user-interface/introductions-seen-route.php @@ -95,7 +95,7 @@ public function register_routes() { ], ], ], - ] + ], ); } @@ -119,7 +119,7 @@ public function set_introduction_seen( WP_REST_Request $request ) { return new WP_Error( 'wpseo_introductions_seen_error', $exception->getMessage(), - (object) [] + (object) [], ); } @@ -129,7 +129,7 @@ public function set_introduction_seen( WP_REST_Request $request ) { 'success' => $result, ], ], - ( $result ) ? 200 : 400 + ( $result ) ? 200 : 400, ); } return new WP_REST_Response( [], 400 ); diff --git a/src/introductions/user-interface/wistia-embed-permission-route.php b/src/introductions/user-interface/wistia-embed-permission-route.php index 619b811ac5a..a1b166748a6 100644 --- a/src/introductions/user-interface/wistia-embed-permission-route.php +++ b/src/introductions/user-interface/wistia-embed-permission-route.php @@ -81,7 +81,7 @@ public function register_routes() { ], ], ], - ] + ], ); } @@ -98,7 +98,7 @@ public function get_wistia_embed_permission() { return new WP_Error( 'wpseo_wistia_embed_permission_error', $exception->getMessage(), - (object) [] + (object) [], ); } @@ -107,7 +107,7 @@ public function get_wistia_embed_permission() { 'json' => (object) [ 'value' => $value, ], - ] + ], ); } @@ -120,7 +120,7 @@ public function get_wistia_embed_permission() { */ public function set_wistia_embed_permission( WP_REST_Request $request ) { $params = $request->get_json_params(); - $value = \boolval( $params['value'] ); + $value = (bool) $params['value']; try { $user_id = $this->user_helper->get_current_user_id(); @@ -129,7 +129,7 @@ public function set_wistia_embed_permission( WP_REST_Request $request ) { return new WP_Error( 'wpseo_wistia_embed_permission_error', $exception->getMessage(), - (object) [] + (object) [], ); } @@ -139,7 +139,7 @@ public function set_wistia_embed_permission( WP_REST_Request $request ) { 'success' => $result, ], ], - ( $result ) ? 200 : 400 + ( $result ) ? 200 : 400, ); } diff --git a/src/llms-txt/application/file/file-failure-notification-presenter.php b/src/llms-txt/application/file/file-failure-notification-presenter.php index 36e9dfe33a9..c408871ce86 100644 --- a/src/llms-txt/application/file/file-failure-notification-presenter.php +++ b/src/llms-txt/application/file/file-failure-notification-presenter.php @@ -38,7 +38,7 @@ protected function get_message() { /* translators: 1: Link start tag to the WordPress Reading Settings page, 2: Link closing tag. */ \esc_html__( 'An existing llms.txt file wasn\'t created by Yoast or has been edited manually. Yoast won\'t overwrite it. %1$sDelete it manually%2$s or turn off this feature.', 'wordpress-seo' ), '', - '' + '', ); break; case 'filesystem_permissions': @@ -53,7 +53,7 @@ protected function get_message() { return \sprintf( '%1$s %2$s', \esc_html__( 'Your llms.txt file couldn\'t be auto-generated', 'wordpress-seo' ), - $message + $message, ); } } diff --git a/src/llms-txt/application/markdown-builders/intro-builder.php b/src/llms-txt/application/markdown-builders/intro-builder.php index 9cdfc8fd634..2b28885db4e 100644 --- a/src/llms-txt/application/markdown-builders/intro-builder.php +++ b/src/llms-txt/application/markdown-builders/intro-builder.php @@ -27,7 +27,7 @@ protected function get_generator_version(): string { public function build_intro(): Intro { $intro_content = \sprintf( 'Generated by %s, this is an llms.txt file, meant for consumption by LLMs.', - $this->get_generator_version() + $this->get_generator_version(), ); return new Intro( $intro_content, [] ); diff --git a/src/llms-txt/application/markdown-builders/link-lists-builder.php b/src/llms-txt/application/markdown-builders/link-lists-builder.php index edee4c9f0ee..b1dcd516b5b 100644 --- a/src/llms-txt/application/markdown-builders/link-lists-builder.php +++ b/src/llms-txt/application/markdown-builders/link-lists-builder.php @@ -48,7 +48,7 @@ public function __construct( public function build_link_lists(): array { return \array_merge( $this->content_types_collector->get_content_types_lists(), - $this->terms_collector->get_terms_lists() + $this->terms_collector->get_terms_lists(), ); } } diff --git a/src/llms-txt/domain/content-types/content-type-entry.php b/src/llms-txt/domain/content-types/content-type-entry.php index 9264cba6b21..b2ab07d67d7 100644 --- a/src/llms-txt/domain/content-types/content-type-entry.php +++ b/src/llms-txt/domain/content-types/content-type-entry.php @@ -127,7 +127,7 @@ public static function from_meta( Meta $meta ): self { $meta->post->post_title, $meta->canonical, $meta->post->post_excerpt, - $meta->post->post_name + $meta->post->post_name, ); } @@ -145,7 +145,7 @@ public static function from_post( WP_Post $post, string $permalink ): self { $post->post_title, $permalink, $post->post_excerpt, - $post->post_name + $post->post_name, ); } } diff --git a/src/llms-txt/domain/markdown/sections/intro.php b/src/llms-txt/domain/markdown/sections/intro.php index 855452f7187..3fef9827fb8 100644 --- a/src/llms-txt/domain/markdown/sections/intro.php +++ b/src/llms-txt/domain/markdown/sections/intro.php @@ -73,12 +73,12 @@ public function render(): string { static function ( $link ) { return $link->render(); }, - $this->intro_links + $this->intro_links, ); $this->intro_content = \sprintf( $this->intro_content, - ...$rendered_links + ...$rendered_links, ); return $this->intro_content; } diff --git a/src/llms-txt/infrastructure/file/wordpress-file-system-adapter.php b/src/llms-txt/infrastructure/file/wordpress-file-system-adapter.php index 1add0ed8f63..edeeab169f2 100644 --- a/src/llms-txt/infrastructure/file/wordpress-file-system-adapter.php +++ b/src/llms-txt/infrastructure/file/wordpress-file-system-adapter.php @@ -23,7 +23,7 @@ public function set_file_content( string $content ): bool { $result = $wp_filesystem->put_contents( $this->get_llms_file_path(), $content, - \FS_CHMOD_FILE + \FS_CHMOD_FILE, ); return $result; diff --git a/src/llms-txt/infrastructure/markdown-services/terms-collector.php b/src/llms-txt/infrastructure/markdown-services/terms-collector.php index ca50caf2acf..abfa8ca3d40 100644 --- a/src/llms-txt/infrastructure/markdown-services/terms-collector.php +++ b/src/llms-txt/infrastructure/markdown-services/terms-collector.php @@ -48,7 +48,7 @@ public function get_terms_lists(): array { 'number' => 5, 'orderby' => 'count', 'order' => 'DESC', - ] + ], ); $term_links = new Link_List( $taxonomy->label, [] ); diff --git a/src/llms-txt/user-interface/available-posts-route.php b/src/llms-txt/user-interface/available-posts-route.php index 0734d0f78d6..517f4a5fb60 100644 --- a/src/llms-txt/user-interface/available-posts-route.php +++ b/src/llms-txt/user-interface/available-posts-route.php @@ -91,7 +91,7 @@ public function register_routes() { ], ], ], - ] + ], ); } @@ -113,13 +113,13 @@ public function get_available_posts( WP_REST_Request $request ): WP_REST_Respons [ 'error' => $exception->getMessage(), ], - $exception->getCode() + $exception->getCode(), ); } return new WP_REST_Response( $available_posts_container->to_array(), - 200 + 200, ); } diff --git a/src/llms-txt/user-interface/file-failure-llms-txt-notification-integration.php b/src/llms-txt/user-interface/file-failure-llms-txt-notification-integration.php index ae8c82e7f77..0f72c6ade2c 100644 --- a/src/llms-txt/user-interface/file-failure-llms-txt-notification-integration.php +++ b/src/llms-txt/user-interface/file-failure-llms-txt-notification-integration.php @@ -121,7 +121,7 @@ private function maybe_add_file_failure_notification() { 'id' => self::NOTIFICATION_ID, 'capabilities' => 'wpseo_manage_options', 'priority' => 1, - ] + ], ); $this->notification_center->restore_notification( $notification ); $this->notification_center->add_notification( $notification ); diff --git a/src/llms-txt/user-interface/health-check/file-reports.php b/src/llms-txt/user-interface/health-check/file-reports.php index 1949fafa3ab..2dbb040ed4b 100644 --- a/src/llms-txt/user-interface/health-check/file-reports.php +++ b/src/llms-txt/user-interface/health-check/file-reports.php @@ -68,7 +68,7 @@ public function get_generation_failure_result( $reason ) { '

    ', '

    ', '

    ', - '

    ' + '

    ', ); break; case 'filesystem_permissions': @@ -79,7 +79,7 @@ public function get_generation_failure_result( $reason ) { '

    ', '

    ', '

    ', - '

    ' + '

    ', ); break; default: diff --git a/src/llms-txt/user-interface/llms-txt-cron-callback-integration.php b/src/llms-txt/user-interface/llms-txt-cron-callback-integration.php index 0380afcde0e..c451256e6ca 100644 --- a/src/llms-txt/user-interface/llms-txt-cron-callback-integration.php +++ b/src/llms-txt/user-interface/llms-txt-cron-callback-integration.php @@ -75,7 +75,7 @@ public function register_hooks() { [ $this, 'populate_file', - ] + ], ); } diff --git a/src/loader.php b/src/loader.php index 5ebb14ef71b..22f46433c80 100644 --- a/src/loader.php +++ b/src/loader.php @@ -257,8 +257,8 @@ protected function conditionals_are_met( $loadable_class ) { /* translators: %1$s expands to Yoast SEO, %2$s expands to the name of the class that could not be found. */ \__( '%1$s attempted to load the class %2$s but it could not be found.', 'wordpress-seo' ), 'Yoast SEO', - $loadable_class - ) + $loadable_class, + ), ); } return false; diff --git a/src/main.php b/src/main.php index 9040dbb9984..37b0328eaf5 100644 --- a/src/main.php +++ b/src/main.php @@ -49,7 +49,7 @@ protected function get_container() { __DIR__ . '/generated/container.php', __DIR__ . '/../config/dependency-injection/services.php', __DIR__ . '/../vendor/composer/autoload_classmap.php', - 'Yoast\WP\SEO\Generated' + 'Yoast\WP\SEO\Generated', ); } diff --git a/src/memoizers/meta-tags-context-memoizer.php b/src/memoizers/meta-tags-context-memoizer.php index b54aa929381..d293456e7c5 100644 --- a/src/memoizers/meta-tags-context-memoizer.php +++ b/src/memoizers/meta-tags-context-memoizer.php @@ -146,7 +146,7 @@ public function get( Indexable $indexable, $page_type ) { 'blocks' => $blocks, 'post' => $post, 'page_type' => $page_type, - ] + ], ); $context->presentation = $this->presentation_memoizer->get( $indexable, $context, $page_type ); diff --git a/src/memoizers/presentation-memoizer.php b/src/memoizers/presentation-memoizer.php index 366f00be59e..fb619564a46 100644 --- a/src/memoizers/presentation-memoizer.php +++ b/src/memoizers/presentation-memoizer.php @@ -57,7 +57,7 @@ public function get( Indexable $indexable, Meta_Tags_Context $context, $page_typ [ 'model' => $indexable, 'context' => $context, - ] + ], ); $this->cache[ $indexable->id ] = $context->presentation; diff --git a/src/models/indexable-extension.php b/src/models/indexable-extension.php index 72b9fdaf31b..19b4a254d8d 100644 --- a/src/models/indexable-extension.php +++ b/src/models/indexable-extension.php @@ -22,9 +22,7 @@ abstract class Indexable_Extension extends Model { * @return Indexable The indexable. */ public function indexable() { - if ( $this->indexable === null ) { - $this->indexable = $this->belongs_to( 'Indexable', 'indexable_id', 'id' )->find_one(); - } + $this->indexable ??= $this->belongs_to( 'Indexable', 'indexable_id', 'id' )->find_one(); return $this->indexable; } diff --git a/src/plans/user-interface/upgrade-sidebar-menu-integration.php b/src/plans/user-interface/upgrade-sidebar-menu-integration.php index 178e22e5175..d4e94c8fa11 100644 --- a/src/plans/user-interface/upgrade-sidebar-menu-integration.php +++ b/src/plans/user-interface/upgrade-sidebar-menu-integration.php @@ -160,6 +160,6 @@ public function do_redirect(): void { } \wp_redirect( $link );//phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect -- Safe redirect is used here. - exit; + exit(); } } diff --git a/src/presentations/indexable-post-type-presentation.php b/src/presentations/indexable-post-type-presentation.php index e497ef14abf..dfd150cb125 100644 --- a/src/presentations/indexable-post-type-presentation.php +++ b/src/presentations/indexable-post-type-presentation.php @@ -314,7 +314,7 @@ public function generate_robots() { 'imageindex' => ( $this->model->is_robots_noimageindex === true ) ? 'noimageindex' : null, 'archive' => ( $this->model->is_robots_noarchive === true ) ? 'noarchive' : null, 'snippet' => ( $this->model->is_robots_nosnippet === true ) ? 'nosnippet' : null, - ] + ], ); // No snippet means max snippet can be omitted. diff --git a/src/presenters/abstract-indexable-tag-presenter.php b/src/presenters/abstract-indexable-tag-presenter.php index b9cef1acb17..41e92bb10c0 100644 --- a/src/presenters/abstract-indexable-tag-presenter.php +++ b/src/presenters/abstract-indexable-tag-presenter.php @@ -48,7 +48,7 @@ public function present() { $this->tag_format, $this->escape_value( $value ), $this->key, - \is_admin_bar_showing() ? ' class="yoast-seo-meta-tag"' : '' + \is_admin_bar_showing() ? ' class="yoast-seo-meta-tag"' : '', ); } diff --git a/src/presenters/admin/badge-presenter.php b/src/presenters/admin/badge-presenter.php index 217eb9977e2..088aa244ebe 100644 --- a/src/presenters/admin/badge-presenter.php +++ b/src/presenters/admin/badge-presenter.php @@ -77,14 +77,14 @@ public function present() { '%3$s', \esc_attr( $this->id ), \esc_url( $this->link ), - \esc_html__( 'New', 'wordpress-seo' ) + \esc_html__( 'New', 'wordpress-seo' ), ); } return \sprintf( '%2$s', \esc_attr( $this->id ), - \esc_html__( 'New', 'wordpress-seo' ) + \esc_html__( 'New', 'wordpress-seo' ), ); } diff --git a/src/presenters/admin/beta-badge-presenter.php b/src/presenters/admin/beta-badge-presenter.php index 684d1eb7bd1..04fce751857 100644 --- a/src/presenters/admin/beta-badge-presenter.php +++ b/src/presenters/admin/beta-badge-presenter.php @@ -46,14 +46,14 @@ public function present() { '%3$s', \esc_attr( $this->id ), \esc_url( $this->link ), - 'Beta' // We don't want this string to be translatable. + 'Beta', // We don't want this string to be translatable. ); } return \sprintf( '%2$s', \esc_attr( $this->id ), - 'Beta' // We don't want this string to be translatable. + 'Beta', // We don't want this string to be translatable. ); } } diff --git a/src/presenters/admin/help-link-presenter.php b/src/presenters/admin/help-link-presenter.php index 45db58bfa64..b8a7256c72b 100644 --- a/src/presenters/admin/help-link-presenter.php +++ b/src/presenters/admin/help-link-presenter.php @@ -80,7 +80,7 @@ public function present() { '%3$s', \esc_url( $this->link ), $target_blank_attribute, - \esc_html( $this->link_text . $new_tab_message ) + \esc_html( $this->link_text . $new_tab_message ), ); } } diff --git a/src/presenters/admin/indexing-error-presenter.php b/src/presenters/admin/indexing-error-presenter.php index e5079f0a9af..7c773569880 100644 --- a/src/presenters/admin/indexing-error-presenter.php +++ b/src/presenters/admin/indexing-error-presenter.php @@ -63,7 +63,7 @@ public function __construct( protected function generate_first_paragraph( $is_premium, $has_valid_premium_subscription ) { $message = \__( 'Oops, something has gone wrong and we couldn\'t complete the optimization of your SEO data. Please click the button again to re-start the process. ', - 'wordpress-seo' + 'wordpress-seo', ); if ( $is_premium ) { @@ -75,10 +75,10 @@ protected function generate_first_paragraph( $is_premium, $has_valid_premium_sub /* translators: %1$s expands to an opening anchor tag for a link leading to the Premium installation page, %2$s expands to a closing anchor tag. */ \__( 'Oops, something has gone wrong and we couldn\'t complete the optimization of your SEO data. Please make sure to activate your subscription in MyYoast by completing %1$sthese steps%2$s.', - 'wordpress-seo' + 'wordpress-seo', ), '', - '' + '', ); } } @@ -101,10 +101,10 @@ protected function generate_second_paragraph( $is_premium, $has_valid_premium_su /* translators: %1$s expands to an opening anchor tag for a link leading to the Premium installation page, %2$s expands to a closing anchor tag. */ \__( 'Below are the technical details for the error. See %1$sthis page%2$s for a more detailed explanation.', - 'wordpress-seo' + 'wordpress-seo', ), '', - '' + '', ); } diff --git a/src/presenters/admin/indexing-failed-notification-presenter.php b/src/presenters/admin/indexing-failed-notification-presenter.php index 28ce7287ae4..0ba6d675412 100644 --- a/src/presenters/admin/indexing-failed-notification-presenter.php +++ b/src/presenters/admin/indexing-failed-notification-presenter.php @@ -58,10 +58,10 @@ public function present() { /* Translators: %1$s expands to an opening anchor tag for a link leading to the Yoast SEO tools page, %2$s expands to a closing anchor tag. */ \esc_html__( 'Something has gone wrong and we couldn\'t complete the optimization of your SEO data. Please %1$sre-start the process%2$s.', - 'wordpress-seo' + 'wordpress-seo', ), '', - '' + '', ); if ( $this->product_helper->is_premium() ) { @@ -76,10 +76,10 @@ public function present() { /* Translators: %1$s expands to an opening anchor tag for a link leading to the Premium installation page, %2$s expands to a closing anchor tag. */ \esc_html__( 'Oops, something has gone wrong and we couldn\'t complete the optimization of your SEO data. Please make sure to activate your subscription in MyYoast by completing %1$sthese steps%2$s.', - 'wordpress-seo' + 'wordpress-seo', ), '', - '' + '', ); } } diff --git a/src/presenters/admin/indexing-list-item-presenter.php b/src/presenters/admin/indexing-list-item-presenter.php index 09a0458ec46..38f24353d62 100644 --- a/src/presenters/admin/indexing-list-item-presenter.php +++ b/src/presenters/admin/indexing-list-item-presenter.php @@ -39,7 +39,7 @@ public function present() { '%1$s %3$s', \esc_html__( 'You can speed up your site and get insight into your internal linking structure by letting us perform a few optimizations to the way SEO data is stored. If you have a lot of content it might take a while, but trust us, it\'s worth it.', 'wordpress-seo' ), \esc_url( $this->short_link_helper->get( 'https://yoa.st/3-z' ) ), - \esc_html__( 'Learn more about the benefits of optimized SEO data.', 'wordpress-seo' ) + \esc_html__( 'Learn more about the benefits of optimized SEO data.', 'wordpress-seo' ), ); $output .= '
    '; diff --git a/src/presenters/admin/indexing-notification-presenter.php b/src/presenters/admin/indexing-notification-presenter.php index f57b343a971..03b96c2fefd 100644 --- a/src/presenters/admin/indexing-notification-presenter.php +++ b/src/presenters/admin/indexing-notification-presenter.php @@ -127,7 +127,7 @@ protected function get_time_estimate( $total_unindexed ) { $estimate .= \sprintf( /* translators: 1: Expands to Yoast SEO */ \esc_html__( 'Wait for a week or so, until %1$s automatically processes most of your content in the background.', 'wordpress-seo' ), - 'Yoast SEO' + 'Yoast SEO', ); $estimate .= ''; $estimate .= '
  • '; @@ -136,7 +136,7 @@ protected function get_time_estimate( $total_unindexed ) { \esc_html__( '%1$sRun the indexation process on your server%2$s using %3$sWP CLI%2$s.', 'wordpress-seo' ), '', '', - '' + '', ); $estimate .= '
  • '; diff --git a/src/presenters/admin/light-switch-presenter.php b/src/presenters/admin/light-switch-presenter.php index 837c4bc4642..2ad3ec1d26c 100644 --- a/src/presenters/admin/light-switch-presenter.php +++ b/src/presenters/admin/light-switch-presenter.php @@ -137,7 +137,7 @@ public function present() { $strong_class, // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: $strong_class output is hardcoded. \esc_attr( $this->var . '-label' ), \esc_html( $this->label ), - $this->help // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: The help contains HTML. + $this->help, // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: The help contains HTML. ); $output .= '', - '' + '', ); $reassurance = \sprintf( /* translators: %s: Yoast SEO. */ \esc_html__( 'Your site will continue to work normally, but won\'t take full advantage of %s.', 'wordpress-seo' ), - 'Yoast SEO' + 'Yoast SEO', ); $debug_info = \sprintf( '
    %1$s

    %2$s

    ', \esc_html__( 'Show debug information', 'wordpress-seo' ), - \esc_html( $this->migration_error['message'] ) + \esc_html( $this->migration_error['message'] ), ); return \sprintf( @@ -71,7 +71,7 @@ public function present() { $message, $support, $reassurance, - $debug_info + $debug_info, ); } } diff --git a/src/presenters/admin/notice-presenter.php b/src/presenters/admin/notice-presenter.php index d7d5bd70fc2..abd048b9de2 100644 --- a/src/presenters/admin/notice-presenter.php +++ b/src/presenters/admin/notice-presenter.php @@ -105,7 +105,7 @@ public function present() { $out .= ''; $out .= \sprintf( '

    %s

    ', - \esc_html( $this->title ) + \esc_html( $this->title ), ); $out .= '
    '; $out .= '
    '; diff --git a/src/presenters/admin/premium-badge-presenter.php b/src/presenters/admin/premium-badge-presenter.php index bfb8d95ad4c..3b4de118658 100644 --- a/src/presenters/admin/premium-badge-presenter.php +++ b/src/presenters/admin/premium-badge-presenter.php @@ -46,14 +46,14 @@ public function present() { '%3$s', \esc_attr( $this->id ), \esc_url( $this->link ), - 'Premium' // We don't want this string to be translatable. + 'Premium', // We don't want this string to be translatable. ); } return \sprintf( '%2$s', \esc_attr( $this->id ), - 'Premium' // We don't want this string to be translatable. + 'Premium', // We don't want this string to be translatable. ); } } diff --git a/src/presenters/admin/search-engines-discouraged-presenter.php b/src/presenters/admin/search-engines-discouraged-presenter.php index c8ef2a30e86..035872f53b9 100644 --- a/src/presenters/admin/search-engines-discouraged-presenter.php +++ b/src/presenters/admin/search-engines-discouraged-presenter.php @@ -35,10 +35,10 @@ protected function get_message() { /* translators: 1: Link start tag to the WordPress Reading Settings page, 2: Link closing tag. */ \esc_html__( 'If you want search engines to show this site in their results, you must %1$sgo to your Reading Settings%2$s and uncheck the box for Search Engine Visibility.', 'wordpress-seo' ), '', - '' + '', ), \esc_js( \wp_create_nonce( 'wpseo-ignore' ) ), - \esc_html__( 'I don\'t want this site to show in the search results.', 'wordpress-seo' ) + \esc_html__( 'I don\'t want this site to show in the search results.', 'wordpress-seo' ), ); } } diff --git a/src/presenters/admin/woocommerce-beta-editor-presenter.php b/src/presenters/admin/woocommerce-beta-editor-presenter.php index 048121b51c6..feada41238f 100644 --- a/src/presenters/admin/woocommerce-beta-editor-presenter.php +++ b/src/presenters/admin/woocommerce-beta-editor-presenter.php @@ -53,8 +53,8 @@ protected function get_message() { \esc_html__( 'The %1$s interface is currently unavailable in the beta WooCommerce product editor. To resolve any issues, please disable the beta editor. %2$sLearn how to disable the beta WooCommerce product editor.%3$s', 'wordpress-seo' ), 'Yoast SEO', '', - '' - ) + '', + ), ); } } diff --git a/src/presenters/debug/marker-close-presenter.php b/src/presenters/debug/marker-close-presenter.php index b36ad7fa6f5..8b534442069 100644 --- a/src/presenters/debug/marker-close-presenter.php +++ b/src/presenters/debug/marker-close-presenter.php @@ -26,7 +26,7 @@ public function present() { return \sprintf( '', - \esc_html( $this->helpers->product->get_name() ) + \esc_html( $this->helpers->product->get_name() ), ); } diff --git a/src/presenters/debug/marker-open-presenter.php b/src/presenters/debug/marker-open-presenter.php index 09c821a65f4..b6679213bcd 100644 --- a/src/presenters/debug/marker-open-presenter.php +++ b/src/presenters/debug/marker-open-presenter.php @@ -34,7 +34,7 @@ public function present() { '', $product_name, $version, - $url + $url, ); } diff --git a/src/presenters/meta-description-presenter.php b/src/presenters/meta-description-presenter.php index 699632a6e86..57ead3c5aaf 100644 --- a/src/presenters/meta-description-presenter.php +++ b/src/presenters/meta-description-presenter.php @@ -34,7 +34,7 @@ public function present() { /* translators: %1$s resolves to Yoast SEO, %2$s resolves to the Settings submenu item. */ \esc_html__( 'Admin only notice: this page does not show a meta description because it does not have one, either write it for this page specifically or go into the [%1$s - %2$s] menu and set up a template.', 'wordpress-seo' ), \esc_html__( 'Yoast SEO', 'wordpress-seo' ), - \esc_html__( 'Settings', 'wordpress-seo' ) + \esc_html__( 'Settings', 'wordpress-seo' ), ) . ' -->'; } diff --git a/src/presenters/open-graph/image-presenter.php b/src/presenters/open-graph/image-presenter.php index 7da1a3119b7..f2e0f8944de 100644 --- a/src/presenters/open-graph/image-presenter.php +++ b/src/presenters/open-graph/image-presenter.php @@ -78,7 +78,7 @@ public function get() { // First filter the object. $this->filter( $open_graph_image ), // Then strip all keys that aren't in the image tags or the url. - \array_flip( \array_merge( static::$image_tags, [ 'url' ] ) ) + \array_flip( \array_merge( static::$image_tags, [ 'url' ] ) ), ); } diff --git a/src/presenters/score-icon-presenter.php b/src/presenters/score-icon-presenter.php index 322684c15c4..eb3d122eeee 100644 --- a/src/presenters/score-icon-presenter.php +++ b/src/presenters/score-icon-presenter.php @@ -42,7 +42,7 @@ public function present() { '', \esc_attr( $this->title ), \esc_html( $this->title ), - \esc_attr( $this->css_class ) + \esc_attr( $this->css_class ), ); } } diff --git a/src/promotions/domain/black-friday-promotion.php b/src/promotions/domain/black-friday-promotion.php index fbf0e4958e4..fba11dded86 100644 --- a/src/promotions/domain/black-friday-promotion.php +++ b/src/promotions/domain/black-friday-promotion.php @@ -13,7 +13,7 @@ class Black_Friday_Promotion extends Abstract_Promotion implements Promotion_Int public function __construct() { parent::__construct( 'black-friday-promotion', - new Time_Interval( \gmmktime( 10, 00, 00, 11, 27, 2025 ), \gmmktime( 10, 00, 00, 12, 2, 2025 ) ) + new Time_Interval( \gmmktime( 10, 00, 00, 11, 27, 2025 ), \gmmktime( 10, 00, 00, 12, 2, 2025 ) ), ); } } diff --git a/src/repositories/indexable-cleanup-repository.php b/src/repositories/indexable-cleanup-repository.php index 11c630a8880..61ece88f8fc 100644 --- a/src/repositories/indexable-cleanup-repository.php +++ b/src/repositories/indexable-cleanup-repository.php @@ -149,7 +149,7 @@ public function clean_indexables_for_non_publicly_viewable_post( $limit ) { WHERE object_type = 'post' AND object_sub_type IS NOT NULL LIMIT %d", - $limit + $limit, ); } else { @@ -160,7 +160,7 @@ public function clean_indexables_for_non_publicly_viewable_post( $limit ) { AND object_sub_type IS NOT NULL AND object_sub_type NOT IN ( " . \implode( ', ', \array_fill( 0, \count( $included_post_types ), '%s' ) ) . ' ) LIMIT %d', - \array_merge( $included_post_types, [ $limit ] ) + \array_merge( $included_post_types, [ $limit ] ), ); } // phpcs:enable @@ -217,7 +217,7 @@ public function clean_indexables_for_non_publicly_viewable_taxonomies( $limit ) WHERE object_type = 'term' AND object_sub_type IS NOT NULL LIMIT %d", - $limit + $limit, ); } else { @@ -228,7 +228,7 @@ public function clean_indexables_for_non_publicly_viewable_taxonomies( $limit ) AND object_sub_type IS NOT NULL AND object_sub_type NOT IN ( " . \implode( ', ', \array_fill( 0, \count( $included_taxonomies ), '%s' ) ) . ' ) LIMIT %d', - \array_merge( $included_taxonomies, [ $limit ] ) + \array_merge( $included_taxonomies, [ $limit ] ), ); } // phpcs:enable @@ -265,7 +265,7 @@ public function clean_indexables_for_non_publicly_viewable_post_type_archive_pag WHERE object_type = 'post-type-archive' AND object_sub_type IS NOT NULL LIMIT %d", - $limit + $limit, ); } else { @@ -276,7 +276,7 @@ public function clean_indexables_for_non_publicly_viewable_post_type_archive_pag AND object_sub_type IS NOT NULL AND object_sub_type NOT IN ( " . \implode( ', ', \array_fill( 0, \count( $post_archives ), '%s' ) ) . ' ) LIMIT %d', - \array_merge( $post_archives, [ $limit ] ) + \array_merge( $post_archives, [ $limit ] ), ); } // phpcs:enable @@ -409,7 +409,7 @@ public function clean_indexables_for_authors_without_archive( $limit ) { WHERE post_type IN ( " . \implode( ', ', \array_fill( 0, \count( $author_archive_post_types ), '%s' ) ) . ' ) AND post_status IN ( ' . \implode( ', ', \array_fill( 0, \count( $viewable_post_stati ), '%s' ) ) . ' ) ) LIMIT %d', - \array_merge( $author_archive_post_types, $viewable_post_stati, [ $limit ] ) + \array_merge( $author_archive_post_types, $viewable_post_stati, [ $limit ] ), ); // phpcs:enable @@ -443,7 +443,7 @@ public function count_indexables_for_authors_without_archive() { WHERE post_type IN ( " . \implode( ', ', \array_fill( 0, \count( $author_archive_post_types ), '%s' ) ) . ' ) AND post_status IN ( ' . \implode( ', ', \array_fill( 0, \count( $viewable_post_stati ), '%s' ) ) . ' ) )', - \array_merge( $author_archive_post_types, $viewable_post_stati ) + \array_merge( $author_archive_post_types, $viewable_post_stati ), ); // phpcs:enable @@ -480,7 +480,7 @@ public function clean_indexables_for_object_type_and_source_table( $source_table AND indexable_table.object_id IS NOT NULL AND indexable_table.object_type = '{$object_type}' LIMIT %d", - $limit + $limit, ); // phpcs:enable @@ -518,7 +518,7 @@ public function clean_indexables_for_orphaned_users( $limit ) { AND indexable_table.object_id IS NOT NULL AND indexable_table.object_type = 'user' LIMIT %d", - $limit + $limit, ); // phpcs:enable @@ -555,7 +555,7 @@ public function count_indexables_for_object_type_and_source_table( string $sourc ON indexable_table.object_id = source_table.{$source_identifier} WHERE source_table.{$source_identifier} IS NULL AND indexable_table.object_id IS NOT NULL - AND indexable_table.object_type = '{$object_type}'" + AND indexable_table.object_type = '{$object_type}'", )[0]; // phpcs:enable } @@ -578,7 +578,7 @@ public function count_indexables_for_orphaned_users() { ON indexable_table.object_id = source_table.ID WHERE source_table.ID IS NULL AND indexable_table.object_id IS NOT NULL - AND indexable_table.object_type = 'user'" + AND indexable_table.object_type = 'user'", )[0]; // phpcs:enable } @@ -609,7 +609,7 @@ public function cleanup_orphaned_from_table( $table, $column, $limit ) { WHERE indexable_table.id IS NULL AND table_to_clean.{$column} IS NOT NULL LIMIT %d", - $limit + $limit, ); // phpcs:enable @@ -647,7 +647,7 @@ public function count_orphaned_from_table( string $table, string $column ) { LEFT JOIN {$indexable_table} AS indexable_table ON table_to_clean.{$column} = indexable_table.id WHERE indexable_table.id IS NULL - AND table_to_clean.{$column} IS NOT NULL" + AND table_to_clean.{$column} IS NOT NULL", )[0]; // phpcs:enable } @@ -697,7 +697,7 @@ private function get_reassigned_authors( $limit ) { GROUP BY {$indexable_table}.author_id, {$posts_table}.post_author ORDER BY {$indexable_table}.author_id LIMIT %d", - $limit + $limit, ); // phpcs:enable @@ -724,7 +724,7 @@ private function update_indexable_authors( $reassigned_authors_objs, $limit ) { static function ( $obj ) { return (array) $obj; }, - $reassigned_authors_objs + $reassigned_authors_objs, ); $reassigned_authors = \array_combine( \array_column( $reassigned_authors_array, 'author_id' ), \array_column( $reassigned_authors_array, 'post_author' ) ); @@ -738,7 +738,7 @@ static function ( $obj ) { WHERE {$indexable_table}.author_id = {$old_author_id} AND object_type='post' LIMIT %d", - $limit + $limit, ); // phpcs:enable diff --git a/src/repositories/indexable-hierarchy-repository.php b/src/repositories/indexable-hierarchy-repository.php index 1d83ed759b7..3db994da330 100644 --- a/src/repositories/indexable-hierarchy-repository.php +++ b/src/repositories/indexable-hierarchy-repository.php @@ -84,7 +84,7 @@ public function add_ancestor( $indexable_id, $ancestor_id, $depth ) { 'ancestor_id' => $ancestor_id, 'depth' => $depth, 'blog_id' => \get_current_blog_id(), - ] + ], ); return $hierarchy->save(); diff --git a/src/repositories/indexable-repository.php b/src/repositories/indexable-repository.php index 1839b86dc08..76ea78a3542 100644 --- a/src/repositories/indexable-repository.php +++ b/src/repositories/indexable-repository.php @@ -149,7 +149,7 @@ public function for_current_page() { 'object_type' => 'unknown', 'post_status' => 'unindexed', 'version' => 1, - ] + ], ); } @@ -600,7 +600,7 @@ public function reset_permalink( $type = null, $subtype = null, $object_id = nul 'permalink' => null, 'permalink_hash' => null, 'version' => 0, - ] + ], ); if ( $type !== null ) { diff --git a/src/repositories/seo-links-repository.php b/src/repositories/seo-links-repository.php index 325f9ed2b65..a0648fe8050 100644 --- a/src/repositories/seo-links-repository.php +++ b/src/repositories/seo-links-repository.php @@ -175,7 +175,7 @@ public function get_incoming_link_counts_for_indexable_ids( $indexable_ids ) { // Loop over the original ID's and search them in the returned ID's. If they don't exist, add them with an incoming count of 0. foreach ( $indexable_ids as $id ) { // Cast the ID to string, as the arrays only contain stringified versions of the ID. - $id = \strval( $id ); + $id = (string) $id; if ( isset( $returned_ids[ $id ] ) === false ) { $indexable_counts[] = [ 'incoming' => '0', diff --git a/src/routes/abstract-action-route.php b/src/routes/abstract-action-route.php index 9ee3f07aa6e..e26ef329629 100644 --- a/src/routes/abstract-action-route.php +++ b/src/routes/abstract-action-route.php @@ -24,7 +24,7 @@ protected function respond_with( $objects, $next_url ) { [ 'objects' => $objects, 'next_url' => $next_url, - ] + ], ); } } diff --git a/src/routes/alert-dismissal-route.php b/src/routes/alert-dismissal-route.php index b6056647f34..515eaf8cce9 100644 --- a/src/routes/alert-dismissal-route.php +++ b/src/routes/alert-dismissal-route.php @@ -89,7 +89,7 @@ public function dismiss( WP_REST_Request $request ) { 'success' => $success, 'status' => $status, ], - $status + $status, ); } diff --git a/src/routes/first-time-configuration-route.php b/src/routes/first-time-configuration-route.php index 7774bfe58dc..41b339a9a5a 100644 --- a/src/routes/first-time-configuration-route.php +++ b/src/routes/first-time-configuration-route.php @@ -218,7 +218,7 @@ public function set_social_profiles( WP_REST_Request $request ) { ->set_social_profiles( $request->get_json_params() ); return new WP_REST_Response( - [ 'json' => $data ] + [ 'json' => $data ], ); } diff --git a/src/routes/importing-route.php b/src/routes/importing-route.php index c30ad66f11e..91882146b4e 100644 --- a/src/routes/importing-route.php +++ b/src/routes/importing-route.php @@ -68,7 +68,7 @@ public function register_routes() { 'callback' => [ $this, 'execute' ], 'permission_callback' => [ $this, 'is_user_permitted_to_import' ], 'methods' => [ 'POST' ], - ] + ], ); } @@ -94,7 +94,7 @@ public function execute( $data ) { 'Requested importer not found', [ 'status' => 404, - ] + ], ); } @@ -106,21 +106,21 @@ public function execute( $data ) { return $this->respond_with( $result, - $next_url + $next_url, ); } catch ( Exception $exception ) { if ( $exception instanceof Aioseo_Validation_Exception ) { return new WP_Error( 'wpseo_error_validation', $exception->getMessage(), - [ 'stackTrace' => $exception->getTraceAsString() ] + [ 'stackTrace' => $exception->getTraceAsString() ], ); } return new WP_Error( 'wpseo_error_indexing', $exception->getMessage(), - [ 'stackTrace' => $exception->getTraceAsString() ] + [ 'stackTrace' => $exception->getTraceAsString() ], ); } } diff --git a/src/routes/indexing-route.php b/src/routes/indexing-route.php index 03f98c84d43..898907cefc3 100644 --- a/src/routes/indexing-route.php +++ b/src/routes/indexing-route.php @@ -424,7 +424,7 @@ protected function run_indexation_action( Indexation_Action_Interface $indexatio return new WP_Error( 'wpseo_error_indexing', $exception->getMessage(), - [ 'stackTrace' => $exception->getTraceAsString() ] + [ 'stackTrace' => $exception->getTraceAsString() ], ); } } diff --git a/src/routes/integrations-route.php b/src/routes/integrations-route.php index 2e6dec53d14..b457735dcc3 100644 --- a/src/routes/integrations-route.php +++ b/src/routes/integrations-route.php @@ -95,7 +95,7 @@ public function set_integration_active( WP_REST_Request $request ) { ->set_integration_active( $integration_name, $value ); return new WP_REST_Response( - [ 'json' => $data ] + [ 'json' => $data ], ); } } diff --git a/src/routes/semrush-route.php b/src/routes/semrush-route.php index 9e089c8714c..78176504a65 100644 --- a/src/routes/semrush-route.php +++ b/src/routes/semrush-route.php @@ -220,7 +220,7 @@ public function get_related_keyphrases( WP_REST_Request $request ) { ->phrases_action ->get_related_keyphrases( $request['keyphrase'], - $request['country_code'] + $request['country_code'], ); return new WP_REST_Response( $data, $data->status ); diff --git a/src/routes/supported-features-route.php b/src/routes/supported-features-route.php index dd19898ef4d..14fc519d1ff 100644 --- a/src/routes/supported-features-route.php +++ b/src/routes/supported-features-route.php @@ -53,7 +53,7 @@ public function get_supported_features() { return new WP_REST_Response( [ 'addon-installation' => 1, - ] + ], ); } } diff --git a/src/routes/workouts-route.php b/src/routes/workouts-route.php index af97b54ad35..921e9a16701 100644 --- a/src/routes/workouts-route.php +++ b/src/routes/workouts-route.php @@ -81,7 +81,7 @@ public function get_workouts() { $workouts_option = \apply_filters( 'Yoast\WP\SEO\workouts_options', $workouts_option ); return new WP_REST_Response( - [ 'json' => $workouts_option ] + [ 'json' => $workouts_option ], ); } @@ -105,7 +105,7 @@ public function set_workouts( $request ) { $result = \apply_filters( 'Yoast\WP\SEO\workouts_route_save', null, $workouts_data ); return new WP_REST_Response( - [ 'json' => $result ] + [ 'json' => $result ], ); } diff --git a/src/schema-aggregator/application/aggregate-site-schema-command-handler.php b/src/schema-aggregator/application/aggregate-site-schema-command-handler.php index 626456dbe46..04d169f22e9 100644 --- a/src/schema-aggregator/application/aggregate-site-schema-command-handler.php +++ b/src/schema-aggregator/application/aggregate-site-schema-command-handler.php @@ -60,7 +60,7 @@ public function handle( Aggregate_Site_Schema_Command $command ): array { $schema_pieces = $this->schema_piece_repository->get( $command->get_page_controls()->get_page(), $command->get_page_controls()->get_page_size(), - $command->get_page_controls()->get_post_type() + $command->get_page_controls()->get_post_type(), ); $aggregated_schema_pieces = $this->schema_piece_aggregator->aggregate( $schema_pieces ); diff --git a/src/schema-aggregator/application/cache/manager.php b/src/schema-aggregator/application/cache/manager.php index ca36462669d..8f545c58bb8 100644 --- a/src/schema-aggregator/application/cache/manager.php +++ b/src/schema-aggregator/application/cache/manager.php @@ -140,8 +140,8 @@ public function invalidate( string $post_type, ?int $page = null, ?int $per_page $wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s OR option_name LIKE %s", $pattern, - $timeout_pattern - ) + $timeout_pattern, + ), ); return $deleted !== false; @@ -170,8 +170,8 @@ public function invalidate_all(): bool { $wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s OR option_name LIKE %s", $pattern, - $timeout_pattern - ) + $timeout_pattern, + ), ); if ( $deleted === false ) { @@ -202,7 +202,7 @@ private function get_cache_key( string $post_type, int $page, int $per_page ): s $page, $per_page, $post_type, - self::CACHE_VERSION + self::CACHE_VERSION, ); } } diff --git a/src/schema-aggregator/application/cache/xml-manager.php b/src/schema-aggregator/application/cache/xml-manager.php index 3e0f72b0f2c..7a848d42308 100644 --- a/src/schema-aggregator/application/cache/xml-manager.php +++ b/src/schema-aggregator/application/cache/xml-manager.php @@ -111,7 +111,7 @@ private function get_cache_key(): string { return \sprintf( '%s_xml_sitemap_v%d', self::CACHE_PREFIX, - self::CACHE_VERSION + self::CACHE_VERSION, ); } } diff --git a/src/schema-aggregator/application/enhancement/article-schema-enhancer.php b/src/schema-aggregator/application/enhancement/article-schema-enhancer.php index 581b5f1ff5a..e6ebad11d15 100644 --- a/src/schema-aggregator/application/enhancement/article-schema-enhancer.php +++ b/src/schema-aggregator/application/enhancement/article-schema-enhancer.php @@ -54,7 +54,7 @@ public function enhance( Schema_Piece $schema_piece, Indexable $indexable ): Sch 'NewsArticle', 'BlogPosting', ], - true + true, ) ) { $schema_data = $this->enhance_schema_piece( $schema_data, $indexable ); } diff --git a/src/schema-aggregator/application/properties-merger.php b/src/schema-aggregator/application/properties-merger.php index 5fb1f0cb71e..7be7f4d438e 100644 --- a/src/schema-aggregator/application/properties-merger.php +++ b/src/schema-aggregator/application/properties-merger.php @@ -53,7 +53,7 @@ private function merge_properties( array $entity1, array $entity2 ): array { if ( $key === '@type' ) { $merged['@type'] = $this->merge_types( ( $merged['@type'] ?? null ), - $value + $value, ); continue; } diff --git a/src/schema-aggregator/application/schema-aggregator-response-composer.php b/src/schema-aggregator/application/schema-aggregator-response-composer.php index 73a62b5b132..2fd5518d1d5 100644 --- a/src/schema-aggregator/application/schema-aggregator-response-composer.php +++ b/src/schema-aggregator/application/schema-aggregator-response-composer.php @@ -26,7 +26,7 @@ public function compose( Schema_Piece_Collection $schema_pieces, bool $is_debug [ '@context' => 'https://schema.org', ], - $piece->get_data() + $piece->get_data(), ); } if ( $is_debug ) { diff --git a/src/schema-aggregator/infrastructure/config.php b/src/schema-aggregator/infrastructure/config.php index ee97b1d13de..300020ae114 100644 --- a/src/schema-aggregator/infrastructure/config.php +++ b/src/schema-aggregator/infrastructure/config.php @@ -90,12 +90,12 @@ public function get_expiration( array $data ): int { $size = \strlen( $serialized ); // Large payloads: cache longer. - if ( $size > 1048576 ) { + if ( $size > 1_048_576 ) { $cache_ttl = ( 6 * \HOUR_IN_SECONDS ); } // Small payloads: cache shorter. - if ( $size < 102400 ) { + if ( $size < 102_400 ) { $cache_ttl = ( 30 * \MINUTE_IN_SECONDS ); } diff --git a/src/schema-aggregator/infrastructure/elements-context-map/elements-context-map-repository.php b/src/schema-aggregator/infrastructure/elements-context-map/elements-context-map-repository.php index bfd57fc3184..8e3af171ece 100644 --- a/src/schema-aggregator/infrastructure/elements-context-map/elements-context-map-repository.php +++ b/src/schema-aggregator/infrastructure/elements-context-map/elements-context-map-repository.php @@ -36,9 +36,7 @@ public function __construct( Map_Loader_Interface $map_loader ) { * @return array> The elements context-map. */ public function get_map(): array { - if ( $this->map === null ) { - $this->map = $this->map_loader->load(); - } + $this->map ??= $this->map_loader->load(); return $this->map; } diff --git a/src/schema-aggregator/infrastructure/elements-context-map/filtered-map-loader.php b/src/schema-aggregator/infrastructure/elements-context-map/filtered-map-loader.php index 349efd58f31..e1d27c7a5f8 100644 --- a/src/schema-aggregator/infrastructure/elements-context-map/filtered-map-loader.php +++ b/src/schema-aggregator/infrastructure/elements-context-map/filtered-map-loader.php @@ -72,13 +72,13 @@ private function validate_main_map_lightweight( $map ): void { if ( ! \is_string( $first_key ) ) { throw new InvalidArgumentException( - 'Filter "wpseo_schema_aggregator_elements_context_map" must return an array with string keys (context names).' + 'Filter "wpseo_schema_aggregator_elements_context_map" must return an array with string keys (context names).', ); } if ( ! \is_array( $first_value ) ) { throw new InvalidArgumentException( - 'Filter "wpseo_schema_aggregator_elements_context_map" must return an array with array values (element lists).' + 'Filter "wpseo_schema_aggregator_elements_context_map" must return an array with array values (element lists).', ); } } diff --git a/src/schema-aggregator/infrastructure/indexable-repository/indexable-repository.php b/src/schema-aggregator/infrastructure/indexable-repository/indexable-repository.php index 1bd3dd371f6..426f8fae66f 100644 --- a/src/schema-aggregator/infrastructure/indexable-repository/indexable-repository.php +++ b/src/schema-aggregator/infrastructure/indexable-repository/indexable-repository.php @@ -40,7 +40,7 @@ public function get( int $page, int $page_size, string $post_type ): array { return $this->indexable_repository->find_all_public_paginated( $page, $page_size, - $post_type + $post_type, ); } } diff --git a/src/schema-aggregator/infrastructure/indexable-repository/wordpress-query-repository.php b/src/schema-aggregator/infrastructure/indexable-repository/wordpress-query-repository.php index 87ee30fedfb..f83c2e425cb 100644 --- a/src/schema-aggregator/infrastructure/indexable-repository/wordpress-query-repository.php +++ b/src/schema-aggregator/infrastructure/indexable-repository/wordpress-query-repository.php @@ -57,7 +57,7 @@ public function get( int $page, int $page_size, string $post_type ): array { 'paged' => $page, 'fields' => 'ids', 'no_found_rows' => false, - ] + ], ); if ( ! $query instanceof WP_Query ) { diff --git a/src/schema-aggregator/infrastructure/schema_map/schema-map-indexable-repository.php b/src/schema-aggregator/infrastructure/schema_map/schema-map-indexable-repository.php index d27550f2ef8..c3961736924 100644 --- a/src/schema-aggregator/infrastructure/schema_map/schema-map-indexable-repository.php +++ b/src/schema-aggregator/infrastructure/schema_map/schema-map-indexable-repository.php @@ -123,8 +123,8 @@ public function get_lastmod_for_post_type( string $post_type, int $page, int $pe ", $post_type, $per_page, - $offset - ) + $offset, + ), ); // Convert to ISO 8601 format or use current time if no posts. if ( $lastmod && ! empty( $lastmod ) ) { diff --git a/src/schema-aggregator/infrastructure/schema_map/schema-map-wordpress-repository.php b/src/schema-aggregator/infrastructure/schema_map/schema-map-wordpress-repository.php index e62afdb9c78..e51ba13f265 100644 --- a/src/schema-aggregator/infrastructure/schema_map/schema-map-wordpress-repository.php +++ b/src/schema-aggregator/infrastructure/schema_map/schema-map-wordpress-repository.php @@ -96,8 +96,8 @@ public function get_lastmod_for_post_type( string $post_type, int $page, int $pe ) AS posts_range", $post_type, $per_page, - $offset - ) + $offset, + ), ); // phpcs:enable // Convert to ISO 8601 format or use current time if no posts. diff --git a/src/schema-aggregator/user-interface/site-schema-aggregator-cache-cli-command.php b/src/schema-aggregator/user-interface/site-schema-aggregator-cache-cli-command.php index 52a740c41cc..269fdbf3333 100644 --- a/src/schema-aggregator/user-interface/site-schema-aggregator-cache-cli-command.php +++ b/src/schema-aggregator/user-interface/site-schema-aggregator-cache-cli-command.php @@ -87,7 +87,7 @@ public function aggregate_site_schema_clear_cache( $args = null, $assoc_args = n $this->cache_manager->invalidate( $assoc_args['post_type'], $assoc_args['page'] ); $this->xml_manager->invalidate(); WP_CLI::log( - \__( 'The site schema cache has been cleared successfully.', 'wordpress-seo' ) + \__( 'The site schema cache has been cleared successfully.', 'wordpress-seo' ), ); return; @@ -96,7 +96,7 @@ public function aggregate_site_schema_clear_cache( $args = null, $assoc_args = n $this->xml_manager->invalidate(); WP_CLI::log( - \__( 'All site schema cache has been cleared successfully.', 'wordpress-seo' ) + \__( 'All site schema cache has been cleared successfully.', 'wordpress-seo' ), ); } } diff --git a/src/schema-aggregator/user-interface/site-schema-aggregator-cli-command.php b/src/schema-aggregator/user-interface/site-schema-aggregator-cli-command.php index f923a7b0219..0630d896255 100644 --- a/src/schema-aggregator/user-interface/site-schema-aggregator-cli-command.php +++ b/src/schema-aggregator/user-interface/site-schema-aggregator-cli-command.php @@ -105,7 +105,7 @@ public function aggregate_site_schema( $args = null, $assoc_args = null ) { $output = WPSEO_Utils::format_json_encode( $result ); $output = \str_replace( "\n", \PHP_EOL . "\t", $output ); WP_CLI::log( - $output + $output, ); } } diff --git a/src/schema-aggregator/user-interface/site-schema-aggregator-route.php b/src/schema-aggregator/user-interface/site-schema-aggregator-route.php index 0ebdda56bc2..8a074f45c05 100644 --- a/src/schema-aggregator/user-interface/site-schema-aggregator-route.php +++ b/src/schema-aggregator/user-interface/site-schema-aggregator-route.php @@ -161,7 +161,7 @@ public function aggregate_site_schema( WP_REST_Request $request ) { return new WP_Error( 'wpseo_aggregate_site_schema_error', $exception->getMessage(), - (object) [] + (object) [], ); } } diff --git a/src/schema/application/configuration/schema-configuration.php b/src/schema/application/configuration/schema-configuration.php index 06c04080489..a9a7917fe3c 100644 --- a/src/schema/application/configuration/schema-configuration.php +++ b/src/schema/application/configuration/schema-configuration.php @@ -92,7 +92,7 @@ public function get_schema_api_integrations(): array { $woocommerce_seo_activate_url = \wp_nonce_url( \self_admin_url( 'plugins.php?action=activate&plugin=' . $woocommerce_seo_file ), - 'activate-plugin_' . $woocommerce_seo_file + 'activate-plugin_' . $woocommerce_seo_file, ); $is_premium = $this->product_helper->is_premium(); diff --git a/src/services/health-check/default-tagline-reports.php b/src/services/health-check/default-tagline-reports.php index 413b0689b53..46aef484679 100644 --- a/src/services/health-check/default-tagline-reports.php +++ b/src/services/health-check/default-tagline-reports.php @@ -62,7 +62,7 @@ private function get_actions() { /* translators: 1: link open tag; 2: link close tag. */ \esc_html__( '%1$sYou can change the tagline in the customizer%2$s.', 'wordpress-seo' ), '', - '' + '', ); } } diff --git a/src/services/health-check/links-table-reports.php b/src/services/health-check/links-table-reports.php index 1e71e23b712..e06bebd1b78 100644 --- a/src/services/health-check/links-table-reports.php +++ b/src/services/health-check/links-table-reports.php @@ -72,7 +72,7 @@ private function get_success_description() { /* translators: 1: Link to the Yoast SEO blog, 2: Link closing tag. */ \esc_html__( 'The text link counter helps you improve your site structure. %1$sFind out how the text link counter can enhance your SEO%2$s.', 'wordpress-seo' ), '', - WPSEO_Admin_Utils::get_new_tab_message() . '' + WPSEO_Admin_Utils::get_new_tab_message() . '', ); } @@ -85,7 +85,7 @@ private function get_links_table_not_accessible_description() { return \sprintf( /* translators: 1: Yoast SEO. */ \__( 'For this feature to work, %1$s needs to create a table in your database. We were unable to create this table automatically.', 'wordpress-seo' ), - 'Yoast SEO' + 'Yoast SEO', ); } @@ -99,7 +99,7 @@ private function get_actions() { /* translators: 1: Link to the Yoast help center, 2: Link closing tag. */ \esc_html__( '%1$sFind out how to solve this problem on our help center%2$s.', 'wordpress-seo' ), '', - WPSEO_Admin_Utils::get_new_tab_message() . '' + WPSEO_Admin_Utils::get_new_tab_message() . '', ); } } diff --git a/src/services/health-check/page-comments-reports.php b/src/services/health-check/page-comments-reports.php index 17812d2c648..4e0f345c28a 100644 --- a/src/services/health-check/page-comments-reports.php +++ b/src/services/health-check/page-comments-reports.php @@ -57,7 +57,7 @@ private function get_has_comments_on_multiple_pages_actions() { /* translators: 1: Opening tag of the link to the discussion settings page, 2: Link closing tag. */ \esc_html__( '%1$sGo to the Discussion Settings page%2$s', 'wordpress-seo' ), '', - '' + '', ); } } diff --git a/src/services/health-check/postname-permalink-reports.php b/src/services/health-check/postname-permalink-reports.php index 6cbe125363f..469f7fa7610 100644 --- a/src/services/health-check/postname-permalink-reports.php +++ b/src/services/health-check/postname-permalink-reports.php @@ -56,7 +56,7 @@ private function get_has_no_postname_in_permalink_description() { return \sprintf( /* translators: %s expands to '/%postname%/' */ \__( 'It\'s highly recommended to have your postname in the URL of your posts and pages. Consider setting your permalink structure to %s.', 'wordpress-seo' ), - '/%postname%/' + '/%postname%/', ); } @@ -70,7 +70,7 @@ private function get_has_no_postname_in_permalink_actions() { /* translators: %1$s is a link start tag to the permalink settings page, %2$s is the link closing tag. */ \__( 'You can fix this on the %1$sPermalink settings page%2$s.', 'wordpress-seo' ), '', - '' + '', ); } } diff --git a/src/services/health-check/report-builder.php b/src/services/health-check/report-builder.php index 1e56466191e..1d5ae6b98ec 100644 --- a/src/services/health-check/report-builder.php +++ b/src/services/health-check/report-builder.php @@ -201,7 +201,7 @@ private function get_signature() { \esc_html__( '%1$sThis was reported by the %2$s plugin%3$s', 'wordpress-seo' ), '

    ', 'Yoast SEO', - '

    ' + '

    ', ); } } diff --git a/src/services/importing/aioseo/aioseo-replacevar-service.php b/src/services/importing/aioseo/aioseo-replacevar-service.php index a7ef3324a22..3f9cd130ac5 100644 --- a/src/services/importing/aioseo/aioseo-replacevar-service.php +++ b/src/services/importing/aioseo/aioseo-replacevar-service.php @@ -81,7 +81,7 @@ public function transform( $aioseo_replacevar ) { static function ( $cf_matches ) { return '%%cf_' . $cf_matches[1] . '%%'; }, - $yoast_replacevar + $yoast_replacevar, ); // Transform the '#tax_name-' tags into '%%ct_%%' ones. @@ -90,7 +90,7 @@ static function ( $cf_matches ) { static function ( $ct_matches ) { return '%%ct_' . $ct_matches[1] . '%%'; }, - $yoast_replacevar + $yoast_replacevar, ); return $yoast_replacevar; diff --git a/src/services/importing/aioseo/aioseo-social-images-provider-service.php b/src/services/importing/aioseo/aioseo-social-images-provider-service.php index ad4871f680b..05044c692a0 100644 --- a/src/services/importing/aioseo/aioseo-social-images-provider-service.php +++ b/src/services/importing/aioseo/aioseo-social-images-provider-service.php @@ -126,7 +126,7 @@ public function get_first_attached_image( $post_id ) { 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', - ] + ], ); if ( $attachments && ! empty( $attachments ) ) { diff --git a/src/services/importing/importable-detector-service.php b/src/services/importing/importable-detector-service.php index b779b54d84d..66330bc1475 100644 --- a/src/services/importing/importable-detector-service.php +++ b/src/services/importing/importable-detector-service.php @@ -80,7 +80,7 @@ public function filter_actions( $all_actions, $plugin = null, $type = null ) { $all_actions, static function ( $action ) use ( $plugin, $type ) { return $action->is_compatible_with( $plugin, $type ); - } + }, ); } } diff --git a/src/surfaces/meta-surface.php b/src/surfaces/meta-surface.php index f54b14dbc70..ebcd6c92750 100644 --- a/src/surfaces/meta-surface.php +++ b/src/surfaces/meta-surface.php @@ -145,9 +145,7 @@ public function for_posts_page() { * @return Meta|false The meta values. False if none could be found. */ public function for_post_type_archive( $post_type = null ) { - if ( $post_type === null ) { - $post_type = \get_post_type(); - } + $post_type ??= \get_post_type(); $indexable = $this->repository->find_for_post_type_archive( $post_type ); @@ -226,7 +224,7 @@ public function for_posts( $ids ) { function ( $indexable ) { return $this->build_meta( $this->context_memoizer->get( $indexable, 'Post_Type' ) ); }, - $indexables + $indexables, ); } @@ -277,9 +275,7 @@ public function for_indexable( $indexable, $page_type = null ) { if ( ! \is_a( $indexable, Indexable::class ) ) { return false; } - if ( $page_type === null ) { - $page_type = $this->indexable_helper->get_page_type_for_indexable( $indexable ); - } + $page_type ??= $this->indexable_helper->get_page_type_for_indexable( $indexable ); return $this->build_meta( $this->context_memoizer->get( $indexable, $page_type ) ); } @@ -294,10 +290,8 @@ public function for_indexable( $indexable, $page_type = null ) { */ public function for_indexables( $indexables, $page_type = null ) { $closure = function ( $indexable ) use ( $page_type ) { - $this_page_type = $page_type; - if ( $this_page_type === null ) { - $this_page_type = $this->indexable_helper->get_page_type_for_indexable( $indexable ); - } + $this_page_type = $page_type; + $this_page_type ??= $this->indexable_helper->get_page_type_for_indexable( $indexable ); return $this->build_meta( $this->context_memoizer->get( $indexable, $this_page_type ) ); }; diff --git a/src/task-list/application/tasks/complete-ftc.php b/src/task-list/application/tasks/complete-ftc.php index ad137e22529..162fb7185d1 100644 --- a/src/task-list/application/tasks/complete-ftc.php +++ b/src/task-list/application/tasks/complete-ftc.php @@ -77,7 +77,7 @@ public function get_call_to_action(): Call_To_Action_Entry { return new Call_To_Action_Entry( \__( 'Start configuration', 'wordpress-seo' ), 'link', - $this->get_link() + $this->get_link(), ); } diff --git a/src/task-list/application/tasks/create-new-content.php b/src/task-list/application/tasks/create-new-content.php index 7624b3da101..f17033d040e 100644 --- a/src/task-list/application/tasks/create-new-content.php +++ b/src/task-list/application/tasks/create-new-content.php @@ -70,7 +70,7 @@ public function get_is_completed(): bool { 'after' => '30 days ago', ], ], - ] + ], ); return ! empty( $recent_posts ); @@ -94,7 +94,7 @@ public function get_call_to_action(): Call_To_Action_Entry { return new Call_To_Action_Entry( \__( 'Create new post', 'wordpress-seo' ), 'add', - $this->get_link() + $this->get_link(), ); } @@ -107,7 +107,7 @@ public function get_copy_set(): Copy_Set { return new Copy_Set( \__( 'Create new content', 'wordpress-seo' ), \__( 'Long gaps without new content slow down your traffic growth. Publishing regularly gives search engines and visitors a reason to return.', 'wordpress-seo' ), - \__( 'Plan a topic, write your post, and use the SEO and Readability Analyses to refine it before publishing.', 'wordpress-seo' ) + \__( 'Plan a topic, write your post, and use the SEO and Readability Analyses to refine it before publishing.', 'wordpress-seo' ), ); } } diff --git a/src/task-list/application/tasks/delete-hello-world.php b/src/task-list/application/tasks/delete-hello-world.php index 01fe6c899c3..9ec587b5e50 100644 --- a/src/task-list/application/tasks/delete-hello-world.php +++ b/src/task-list/application/tasks/delete-hello-world.php @@ -53,7 +53,7 @@ public function get_is_completed(): bool { 'post_id' => 1, 'number' => 1, 'order' => 'ASC', - ] + ], ); if ( empty( $comments ) || \is_a( $comments[0], WP_Comment::class ) === false || $comments[0]->comment_author_email !== 'wapuu@wordpress.example' ) { @@ -101,7 +101,7 @@ public function get_call_to_action(): Call_To_Action_Entry { return new Call_To_Action_Entry( \__( 'Delete for me', 'wordpress-seo' ), 'delete', - $this->get_link() + $this->get_link(), ); } @@ -114,7 +114,7 @@ public function get_copy_set(): Copy_Set { return new Copy_Set( \__( 'Remove the “Hello World” post', 'wordpress-seo' ), \__( 'Leaving placeholder content makes your site look unfinished and untrustworthy. Removing it keeps your site clean and professional for visitors and search engines.', 'wordpress-seo' ), - null + null, ); } } diff --git a/src/task-list/application/tasks/enable-llms-txt.php b/src/task-list/application/tasks/enable-llms-txt.php index 85a31d9b5c3..9d7dbd42a55 100644 --- a/src/task-list/application/tasks/enable-llms-txt.php +++ b/src/task-list/application/tasks/enable-llms-txt.php @@ -93,7 +93,7 @@ public function get_call_to_action(): Call_To_Action_Entry { return new Call_To_Action_Entry( \__( 'Enable llms.txt', 'wordpress-seo' ), 'default', - $this->get_link() + $this->get_link(), ); } @@ -105,7 +105,7 @@ public function get_call_to_action(): Call_To_Action_Entry { public function get_copy_set(): Copy_Set { return new Copy_Set( \__( 'Create an llms.txt file', 'wordpress-seo' ), - \__( 'Without llms.txt, AI crawlers may not know how to treat your content. Publishing it helps communicate your preferences in a clearer way to AI tools.', 'wordpress-seo' ) + \__( 'Without llms.txt, AI crawlers may not know how to treat your content. Publishing it helps communicate your preferences in a clearer way to AI tools.', 'wordpress-seo' ), ); } diff --git a/src/task-list/application/tasks/set-search-appearance-templates.php b/src/task-list/application/tasks/set-search-appearance-templates.php index cee97ea166b..4b77f74830f 100644 --- a/src/task-list/application/tasks/set-search-appearance-templates.php +++ b/src/task-list/application/tasks/set-search-appearance-templates.php @@ -100,7 +100,7 @@ public function get_link(): ?string { $post_type = \get_post_type_object( $this->get_post_type() ); $link = \sprintf( 'admin.php?page=wpseo_page_settings#/post-type/%s', - $this->route_helper->get_route( $post_type->name, $post_type->rewrite, $post_type->rest_base ) + $this->route_helper->get_route( $post_type->name, $post_type->rewrite, $post_type->rest_base ), ); return \self_admin_url( $link ); @@ -115,7 +115,7 @@ public function get_call_to_action(): Call_To_Action_Entry { return new Call_To_Action_Entry( \__( 'Set search templates', 'wordpress-seo' ), 'link', - $this->get_link() + $this->get_link(), ); } @@ -132,7 +132,7 @@ public function get_copy_set(): Copy_Set { \sprintf( \__( 'Set search appearance templates for your content type: %1$s', 'wordpress-seo' ), $post_type->label ), /* translators: %1$s expands to the post type name this task is about */ \sprintf( \__( 'Generic titles and descriptions make your results unclear in search. Templates ensure every %1$s has a clear, click-worthy snippet automatically.', 'wordpress-seo' ), $post_type->name ), - \__( 'Go to Search appearance, choose your post type, and set default title and meta description patterns.', 'wordpress-seo' ) + \__( 'Go to Search appearance, choose your post type, and set default title and meta description patterns.', 'wordpress-seo' ), ); } } diff --git a/src/task-list/infrastructure/tasks-collectors/tasks-collector.php b/src/task-list/infrastructure/tasks-collectors/tasks-collector.php index b6802e1fecf..0781b80fe15 100644 --- a/src/task-list/infrastructure/tasks-collectors/tasks-collector.php +++ b/src/task-list/infrastructure/tasks-collectors/tasks-collector.php @@ -136,9 +136,9 @@ public function get_tasks_data(): array { $task->get_call_to_action()->get_label(), $task->get_call_to_action()->get_type(), $this->tracking_link_adapter->create_tracking_link_for_tasks( - $task->get_call_to_action()->get_href() - ) - ) + $task->get_call_to_action()->get_href(), + ), + ), ); $tasks_data[ $task->get_id() ] = $task->to_array(); diff --git a/src/task-list/user-interface/tasks/complete-task-route.php b/src/task-list/user-interface/tasks/complete-task-route.php index 6e974b3bde7..5efd5506a51 100644 --- a/src/task-list/user-interface/tasks/complete-task-route.php +++ b/src/task-list/user-interface/tasks/complete-task-route.php @@ -111,7 +111,7 @@ public function register_routes() { ], ], ], - ] + ], ); } @@ -142,7 +142,7 @@ public function complete_task( WP_REST_Request $request ): WP_REST_Response { 'success' => false, 'error' => $exception->getMessage(), ], - $exception->getCode() + $exception->getCode(), ); } @@ -152,7 +152,7 @@ public function complete_task( WP_REST_Request $request ): WP_REST_Response { [ 'success' => true, ], - 200 + 200, ); } diff --git a/src/task-list/user-interface/tasks/get-tasks-route.php b/src/task-list/user-interface/tasks/get-tasks-route.php index 1d6a7632286..1f61a6541e3 100644 --- a/src/task-list/user-interface/tasks/get-tasks-route.php +++ b/src/task-list/user-interface/tasks/get-tasks-route.php @@ -113,7 +113,7 @@ public function register_routes() { ], ], ], - ] + ], ); } @@ -133,7 +133,7 @@ public function get_tasks(): WP_REST_Response { 'success' => false, 'error' => $exception->getMessage(), ], - $exception->getCode() + $exception->getCode(), ); } @@ -142,7 +142,7 @@ public function get_tasks(): WP_REST_Response { 'success' => true, 'tasks' => $tasks_data, ], - 200 + 200, ); } diff --git a/src/tracking/infrastructure/tracking-link-adapter.php b/src/tracking/infrastructure/tracking-link-adapter.php index 61b96fefab4..a2ed73befa6 100644 --- a/src/tracking/infrastructure/tracking-link-adapter.php +++ b/src/tracking/infrastructure/tracking-link-adapter.php @@ -25,7 +25,7 @@ public function create_tracking_link_for_tasks( ?string $url ): ?string { 'wpseo_tracked_action' => 'task_first_actioned_on', 'wpseo_tracking_nonce' => \wp_create_nonce( 'wpseo_tracking_nonce' ), ], - $url + $url, ); } } diff --git a/src/tracking/user-interface/action-tracking-route.php b/src/tracking/user-interface/action-tracking-route.php index 5145b257313..82edd93ed6b 100644 --- a/src/tracking/user-interface/action-tracking-route.php +++ b/src/tracking/user-interface/action-tracking-route.php @@ -96,7 +96,7 @@ public function register_routes() { ], ], ], - ] + ], ); } @@ -124,7 +124,7 @@ public function track_action( WP_REST_Request $request ): WP_REST_Response { 'success' => false, 'error' => $exception->getMessage(), ], - $exception->getCode() + $exception->getCode(), ); } @@ -133,7 +133,7 @@ public function track_action( WP_REST_Request $request ): WP_REST_Response { 'success' => true, 'action' => $action_to_track, ], - 200 + 200, ); } diff --git a/src/user-meta/application/custom-meta-collector.php b/src/user-meta/application/custom-meta-collector.php index e09f620602b..d3856a3997d 100644 --- a/src/user-meta/application/custom-meta-collector.php +++ b/src/user-meta/application/custom-meta-collector.php @@ -48,7 +48,7 @@ public function get_sorted_custom_meta(): array { $custom_meta, static function ( Custom_Meta_Interface $a, Custom_Meta_Interface $b ) { return ( $a->get_render_priority() <=> $b->get_render_priority() ); - } + }, ); return $custom_meta; diff --git a/src/user-meta/infrastructure/cleanup-repository.php b/src/user-meta/infrastructure/cleanup-repository.php index 22bdc90255f..fe6a1833377 100644 --- a/src/user-meta/infrastructure/cleanup-repository.php +++ b/src/user-meta/infrastructure/cleanup-repository.php @@ -25,7 +25,7 @@ public function delete_empty_usermeta_query( $meta_keys, $limit ) { AND meta_value = "" ORDER BY user_id LIMIT %d', - \array_merge( [ $wpdb->usermeta ], $meta_keys, [ $limit ] ) + \array_merge( [ $wpdb->usermeta ], $meta_keys, [ $limit ] ), ); // phpcs:enable diff --git a/src/user-meta/user-interface/cleanup-integration.php b/src/user-meta/user-interface/cleanup-integration.php index a3ecbcf7864..3cde4802175 100644 --- a/src/user-meta/user-interface/cleanup-integration.php +++ b/src/user-meta/user-interface/cleanup-integration.php @@ -52,7 +52,7 @@ public function add_user_meta_cleanup_tasks( $tasks ) { 'clean_selected_empty_usermeta' => function ( $limit ) { return $this->cleanup_service->cleanup_selected_empty_usermeta( $limit ); }, - ] + ], ); } } diff --git a/src/values/oauth/oauth-token.php b/src/values/oauth/oauth-token.php index 3a9dd75b060..8429dd33e80 100644 --- a/src/values/oauth/oauth-token.php +++ b/src/values/oauth/oauth-token.php @@ -108,7 +108,7 @@ public static function from_response( AccessTokenInterface $response ) { $response->getRefreshToken(), $response->getExpires(), $response->hasExpired(), - \time() + \time(), ); } diff --git a/src/wrappers/wp-remote-handler.php b/src/wrappers/wp-remote-handler.php index 0790a7f62ac..93e427f70fe 100644 --- a/src/wrappers/wp-remote-handler.php +++ b/src/wrappers/wp-remote-handler.php @@ -57,7 +57,7 @@ public function __invoke( RequestInterface $request, array $options ) { $raw_response['headers']->getAll(), $raw_response['body'], $args['httpVersion'], - $raw_response['response']['message'] + $raw_response['response']['message'], ); return new FulfilledPromise( $response ); diff --git a/tests/Unit/AI_Authorization/Application/Code_Verifier_Handler/Constructor_Test.php b/tests/Unit/AI_Authorization/Application/Code_Verifier_Handler/Constructor_Test.php index 3b7f57f1ac4..5b53bc999db 100644 --- a/tests/Unit/AI_Authorization/Application/Code_Verifier_Handler/Constructor_Test.php +++ b/tests/Unit/AI_Authorization/Application/Code_Verifier_Handler/Constructor_Test.php @@ -24,11 +24,11 @@ final class Constructor_Test extends Abstract_Code_Verifier_Handler_Test { public function test_constructor() { $this->assertInstanceOf( Date_Helper::class, - $this->getPropertyValue( $this->instance, 'date_helper' ) + $this->getPropertyValue( $this->instance, 'date_helper' ), ); $this->assertInstanceOf( Code_Verifier_User_Meta_Repository::class, - $this->getPropertyValue( $this->instance, 'code_verifier_repository' ) + $this->getPropertyValue( $this->instance, 'code_verifier_repository' ), ); } } diff --git a/tests/Unit/AI_Authorization/Application/Code_Verifier_Handler/Generate_Test.php b/tests/Unit/AI_Authorization/Application/Code_Verifier_Handler/Generate_Test.php index 06f1f21db66..3f30d3bfaba 100644 --- a/tests/Unit/AI_Authorization/Application/Code_Verifier_Handler/Generate_Test.php +++ b/tests/Unit/AI_Authorization/Application/Code_Verifier_Handler/Generate_Test.php @@ -21,7 +21,7 @@ final class Generate_Test extends Abstract_Code_Verifier_Handler_Test { */ public function test_generate() { $user_email = 'test@example.com'; - $current_time = 1640995200; + $current_time = 1_640_995_200; $generated_code = 'mocked_generated_code_123'; $this->code_generator diff --git a/tests/Unit/AI_Authorization/Application/Token_Manager/Constructor_Test.php b/tests/Unit/AI_Authorization/Application/Token_Manager/Constructor_Test.php index d77a76069c0..3e9eca25b32 100644 --- a/tests/Unit/AI_Authorization/Application/Token_Manager/Constructor_Test.php +++ b/tests/Unit/AI_Authorization/Application/Token_Manager/Constructor_Test.php @@ -30,35 +30,35 @@ final class Constructor_Test extends Abstract_Token_Manager_Test { public function test_constructor() { $this->assertInstanceOf( Access_Token_User_Meta_Repository_Interface::class, - $this->getPropertyValue( $this->instance, 'access_token_repository' ) + $this->getPropertyValue( $this->instance, 'access_token_repository' ), ); $this->assertInstanceOf( Code_Verifier_Handler::class, - $this->getPropertyValue( $this->instance, 'code_verifier' ) + $this->getPropertyValue( $this->instance, 'code_verifier' ), ); $this->assertInstanceOf( Consent_Handler::class, - $this->getPropertyValue( $this->instance, 'consent_handler' ) + $this->getPropertyValue( $this->instance, 'consent_handler' ), ); $this->assertInstanceOf( Refresh_Token_User_Meta_Repository_Interface::class, - $this->getPropertyValue( $this->instance, 'refresh_token_repository' ) + $this->getPropertyValue( $this->instance, 'refresh_token_repository' ), ); $this->assertInstanceOf( User_Helper::class, - $this->getPropertyValue( $this->instance, 'user_helper' ) + $this->getPropertyValue( $this->instance, 'user_helper' ), ); $this->assertInstanceOf( Request_Handler::class, - $this->getPropertyValue( $this->instance, 'request_handler' ) + $this->getPropertyValue( $this->instance, 'request_handler' ), ); $this->assertInstanceOf( Code_Verifier_User_Meta_Repository::class, - $this->getPropertyValue( $this->instance, 'code_verifier_repository' ) + $this->getPropertyValue( $this->instance, 'code_verifier_repository' ), ); $this->assertInstanceOf( WordPress_URLs::class, - $this->getPropertyValue( $this->instance, 'urls' ) + $this->getPropertyValue( $this->instance, 'urls' ), ); } } diff --git a/tests/Unit/AI_Authorization/Application/Token_Manager/Get_Or_Request_Access_Token_Test.php b/tests/Unit/AI_Authorization/Application/Token_Manager/Get_Or_Request_Access_Token_Test.php index 383a2097a38..7b138d7ccbb 100644 --- a/tests/Unit/AI_Authorization/Application/Token_Manager/Get_Or_Request_Access_Token_Test.php +++ b/tests/Unit/AI_Authorization/Application/Token_Manager/Get_Or_Request_Access_Token_Test.php @@ -66,7 +66,7 @@ public function test_get_or_request_access_token_no_token() { $new_access_jwt = 'new-access-token'; $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $this->user_helper ->expects( 'get_meta' ) @@ -146,7 +146,7 @@ public function test_get_or_request_access_token_null_token() { $new_access_jwt = 'new-access-token'; $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $this->user_helper ->expects( 'get_meta' ) @@ -227,7 +227,7 @@ public function test_get_or_request_access_token_non_string_token() { $new_access_jwt = 'new-access-token'; $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $this->user_helper ->expects( 'get_meta' ) @@ -304,14 +304,14 @@ public function test_get_or_request_access_token_expired_token_refresh_success() $user->ID = 123; $user->user_email = 'test@example.com'; - $expired_time = ( 1640995200 - 3600 ); // 1 hour in the past. + $expired_time = ( 1_640_995_200 - 3600 ); // 1 hour in the past. $expired_access_jwt = $this->create_jwt_token( $expired_time ); $new_access_jwt = 'refreshed-access-token'; $refresh_jwt = 'refresh-token'; $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $this->user_helper ->expects( 'get_meta' ) @@ -375,7 +375,7 @@ public function test_get_or_request_access_token_expired_token_refresh_unauthori $user->ID = 123; $user->user_email = 'test@example.com'; - $expired_time = ( 1640995200 - 3600 ); // 1 hour in the past. + $expired_time = ( 1_640_995_200 - 3600 ); // 1 hour in the past. $expired_access_jwt = $this->create_jwt_token( $expired_time ); $new_access_jwt = 'new-access-token'; $refresh_jwt = 'refresh-token'; @@ -383,7 +383,7 @@ public function test_get_or_request_access_token_expired_token_refresh_unauthori $code_verifier_refresh = Mockery::mock( Code_Verifier::class ); $code_verifier_request = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $this->user_helper ->expects( 'get_meta' ) @@ -492,13 +492,13 @@ public function test_get_or_request_access_token_expired_token_refresh_forbidden $user->ID = 123; $user->user_email = 'test@example.com'; - $expired_time = ( 1640995200 - 3600 ); // 1 hour in the past. + $expired_time = ( 1_640_995_200 - 3600 ); // 1 hour in the past. $expired_access_jwt = $this->create_jwt_token( $expired_time ); $refresh_jwt = 'refresh-token'; $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $this->user_helper ->expects( 'get_meta' ) @@ -562,7 +562,7 @@ public function test_get_or_request_access_token_token_request_bad_request() { $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $this->user_helper ->expects( 'get_meta' ) @@ -634,7 +634,7 @@ public function test_get_or_request_access_token_repository_runtime_exception() $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $this->user_helper ->expects( 'get_meta' ) @@ -712,13 +712,13 @@ public function test_get_or_request_access_token_refresh_internal_server_error() $user->ID = 123; $user->user_email = 'test@example.com'; - $expired_time = ( 1640995200 - 3600 ); // 1 hour in the past. + $expired_time = ( 1_640_995_200 - 3600 ); // 1 hour in the past. $expired_access_jwt = $this->create_jwt_token( $expired_time ); $refresh_jwt = 'refresh-token'; $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $this->user_helper ->expects( 'get_meta' ) @@ -775,13 +775,13 @@ public function test_get_or_request_access_token_refresh_not_found() { $user->ID = 123; $user->user_email = 'test@example.com'; - $expired_time = ( 1640995200 - 3600 ); // 1 hour in the past. + $expired_time = ( 1_640_995_200 - 3600 ); // 1 hour in the past. $expired_access_jwt = $this->create_jwt_token( $expired_time ); $refresh_jwt = 'refresh-token'; $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $this->user_helper ->expects( 'get_meta' ) @@ -838,13 +838,13 @@ public function test_get_or_request_access_token_refresh_payment_required() { $user->ID = 123; $user->user_email = 'test@example.com'; - $expired_time = ( 1640995200 - 3600 ); // 1 hour in the past. + $expired_time = ( 1_640_995_200 - 3600 ); // 1 hour in the past. $expired_access_jwt = $this->create_jwt_token( $expired_time ); $refresh_jwt = 'refresh-token'; $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $this->user_helper ->expects( 'get_meta' ) @@ -901,13 +901,13 @@ public function test_get_or_request_access_token_refresh_request_timeout() { $user->ID = 123; $user->user_email = 'test@example.com'; - $expired_time = ( 1640995200 - 3600 ); // 1 hour in the past. + $expired_time = ( 1_640_995_200 - 3600 ); // 1 hour in the past. $expired_access_jwt = $this->create_jwt_token( $expired_time ); $refresh_jwt = 'refresh-token'; $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $this->user_helper ->expects( 'get_meta' ) @@ -964,13 +964,13 @@ public function test_get_or_request_access_token_refresh_service_unavailable() { $user->ID = 123; $user->user_email = 'test@example.com'; - $expired_time = ( 1640995200 - 3600 ); // 1 hour in the past. + $expired_time = ( 1_640_995_200 - 3600 ); // 1 hour in the past. $expired_access_jwt = $this->create_jwt_token( $expired_time ); $refresh_jwt = 'refresh-token'; $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $this->user_helper ->expects( 'get_meta' ) @@ -1027,13 +1027,13 @@ public function test_get_or_request_access_token_refresh_too_many_requests() { $user->ID = 123; $user->user_email = 'test@example.com'; - $expired_time = ( 1640995200 - 3600 ); // 1 hour in the past + $expired_time = ( 1_640_995_200 - 3600 ); // 1 hour in the past $expired_access_jwt = $this->create_jwt_token( $expired_time ); $refresh_jwt = 'refresh-token'; $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $this->user_helper ->expects( 'get_meta' ) @@ -1092,8 +1092,8 @@ private function create_jwt_token( int $exp ): string { [ 'typ' => 'JWT', 'alg' => 'HS256', - ] - ) + ], + ), ); $payload = \base64_encode( \json_encode( [ 'exp' => $exp ] ) ); $signature = \base64_encode( 'fake-signature' ); diff --git a/tests/Unit/AI_Authorization/Application/Token_Manager/Has_Token_Expired_Test.php b/tests/Unit/AI_Authorization/Application/Token_Manager/Has_Token_Expired_Test.php index 97efdd81011..5d4f388f50e 100644 --- a/tests/Unit/AI_Authorization/Application/Token_Manager/Has_Token_Expired_Test.php +++ b/tests/Unit/AI_Authorization/Application/Token_Manager/Has_Token_Expired_Test.php @@ -151,7 +151,7 @@ public function test_has_token_expired_no_exp_field() { [ 'sub' => '1234567890', 'name' => 'John Doe', - ] + ], ); $encoded_payload = \base64_encode( $payload ); @@ -269,7 +269,7 @@ public function test_has_token_expired_realistic_expired_jwt() { 'exp' => $past_timestamp, 'iat' => ( $past_timestamp - 3600 ), 'scope' => 'ai-generation', - ] + ], ); $encoded_payload = \base64_encode( $payload ); @@ -296,7 +296,7 @@ public function test_has_token_expired_realistic_valid_jwt() { 'exp' => $future_timestamp, 'iat' => \time(), 'scope' => 'ai-generation', - ] + ], ); $encoded_payload = \base64_encode( $payload ); diff --git a/tests/Unit/AI_Authorization/Application/Token_Manager/Token_Invalidate_Test.php b/tests/Unit/AI_Authorization/Application/Token_Manager/Token_Invalidate_Test.php index fa02de50b74..de71139fa3b 100644 --- a/tests/Unit/AI_Authorization/Application/Token_Manager/Token_Invalidate_Test.php +++ b/tests/Unit/AI_Authorization/Application/Token_Manager/Token_Invalidate_Test.php @@ -43,8 +43,8 @@ static function ( Request $request ) use ( $user_id, $access_jwt ) { return $request->get_action_path() === '/token/invalidate' && $request->get_body() === [ 'user_id' => $user_id ] && $request->get_headers() === [ 'Authorization' => "Bearer $access_jwt" ]; - } - ) + }, + ), ) ->once(); @@ -86,8 +86,8 @@ static function ( Request $request ) use ( $user_id ) { return $request->get_action_path() === '/token/invalidate' && $request->get_body() === [ 'user_id' => $user_id ] && $request->get_headers() === [ 'Authorization' => 'Bearer ' ]; - } - ) + }, + ), ) ->once(); @@ -130,8 +130,8 @@ static function ( Request $request ) use ( $user_id, $access_jwt ) { return $request->get_action_path() === '/token/invalidate' && $request->get_body() === [ 'user_id' => $user_id ] && $request->get_headers() === [ 'Authorization' => "Bearer $access_jwt" ]; - } - ) + }, + ), ) ->once() ->andThrow( new Unauthorized_Exception( 'Unauthorized', 401 ) ); @@ -175,8 +175,8 @@ static function ( Request $request ) use ( $user_id, $access_jwt ) { return $request->get_action_path() === '/token/invalidate' && $request->get_body() === [ 'user_id' => $user_id ] && $request->get_headers() === [ 'Authorization' => "Bearer $access_jwt" ]; - } - ) + }, + ), ) ->once() ->andThrow( new Forbidden_Exception( 'Forbidden', 403 ) ); diff --git a/tests/Unit/AI_Authorization/Application/Token_Manager/Token_Refresh_Test.php b/tests/Unit/AI_Authorization/Application/Token_Manager/Token_Refresh_Test.php index 97c45dfb8ba..3d91600aae0 100644 --- a/tests/Unit/AI_Authorization/Application/Token_Manager/Token_Refresh_Test.php +++ b/tests/Unit/AI_Authorization/Application/Token_Manager/Token_Refresh_Test.php @@ -40,7 +40,7 @@ public function test_token_refresh_success() { $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $refresh_jwt = 'valid-refresh-token'; $this->refresh_token_repository @@ -78,8 +78,8 @@ static function ( Request $request ) use ( $code, $refresh_jwt ) { return $request->get_action_path() === '/token/refresh' && $request->get_body() === [ 'code_challenge' => \hash( 'sha256', $code ) ] && $request->get_headers() === [ 'Authorization' => "Bearer $refresh_jwt" ]; - } - ) + }, + ), ) ->once(); @@ -123,7 +123,7 @@ public function test_token_refresh_bad_request_exception() { $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $refresh_jwt = 'valid-refresh-token'; $this->refresh_token_repository @@ -177,7 +177,7 @@ public function test_token_refresh_forbidden_exception() { $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $refresh_jwt = 'valid-refresh-token'; $this->refresh_token_repository @@ -231,7 +231,7 @@ public function test_token_refresh_unauthorized_exception() { $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $refresh_jwt = 'expired-refresh-token'; $this->refresh_token_repository @@ -285,7 +285,7 @@ public function test_token_refresh_internal_server_error_exception() { $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $refresh_jwt = 'valid-refresh-token'; $this->refresh_token_repository @@ -339,7 +339,7 @@ public function test_token_refresh_not_found_exception() { $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $refresh_jwt = 'valid-refresh-token'; $this->refresh_token_repository @@ -393,7 +393,7 @@ public function test_token_refresh_payment_required_exception() { $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $refresh_jwt = 'valid-refresh-token'; $this->refresh_token_repository @@ -447,7 +447,7 @@ public function test_token_refresh_request_timeout_exception() { $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $refresh_jwt = 'valid-refresh-token'; $this->refresh_token_repository @@ -501,7 +501,7 @@ public function test_token_refresh_service_unavailable_exception() { $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $refresh_jwt = 'valid-refresh-token'; $this->refresh_token_repository @@ -555,7 +555,7 @@ public function test_token_refresh_too_many_requests_exception() { $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $refresh_jwt = 'valid-refresh-token'; $this->refresh_token_repository diff --git a/tests/Unit/AI_Authorization/Application/Token_Manager/Token_Request_Test.php b/tests/Unit/AI_Authorization/Application/Token_Manager/Token_Request_Test.php index 293da52797d..9c2825589f1 100644 --- a/tests/Unit/AI_Authorization/Application/Token_Manager/Token_Request_Test.php +++ b/tests/Unit/AI_Authorization/Application/Token_Manager/Token_Request_Test.php @@ -30,7 +30,7 @@ public function test_token_request_success() { $code_verifier = Mockery::mock( Code_Verifier::class ); $code = 'test-code-verifier'; - $created_at = 1640995200; + $created_at = 1_640_995_200; $callback_url = 'https://example.com/callback'; $refresh_callback_url = 'https://example.com/refresh-callback'; diff --git a/tests/Unit/AI_Authorization/Infrastructure/Access_Token_User_Meta_Repository/Constructor_Test.php b/tests/Unit/AI_Authorization/Infrastructure/Access_Token_User_Meta_Repository/Constructor_Test.php index 876a6a8cfd5..0e64a69896a 100644 --- a/tests/Unit/AI_Authorization/Infrastructure/Access_Token_User_Meta_Repository/Constructor_Test.php +++ b/tests/Unit/AI_Authorization/Infrastructure/Access_Token_User_Meta_Repository/Constructor_Test.php @@ -22,7 +22,7 @@ final class Constructor_Test extends Abstract_Access_Token_User_Meta_Repository_ public function test_constructor() { $this->assertInstanceOf( User_Helper::class, - $this->getPropertyValue( $this->instance, 'user_helper' ) + $this->getPropertyValue( $this->instance, 'user_helper' ), ); } } diff --git a/tests/Unit/AI_Authorization/Infrastructure/Access_Token_User_Meta_Repository/Store_Token_Test.php b/tests/Unit/AI_Authorization/Infrastructure/Access_Token_User_Meta_Repository/Store_Token_Test.php index 7e2b4bc819f..deca0b69870 100644 --- a/tests/Unit/AI_Authorization/Infrastructure/Access_Token_User_Meta_Repository/Store_Token_Test.php +++ b/tests/Unit/AI_Authorization/Infrastructure/Access_Token_User_Meta_Repository/Store_Token_Test.php @@ -26,7 +26,7 @@ public function test_store_token() { ->with( $user_id, '_yoast_wpseo_ai_generator_access_jwt', - $token + $token, ); $this->instance->store_token( $user_id, $token ); diff --git a/tests/Unit/AI_Authorization/Infrastructure/Code_Verifier_User_Meta_Repository/Constructor_Test.php b/tests/Unit/AI_Authorization/Infrastructure/Code_Verifier_User_Meta_Repository/Constructor_Test.php index f022fa72370..6dcc4c0bd31 100644 --- a/tests/Unit/AI_Authorization/Infrastructure/Code_Verifier_User_Meta_Repository/Constructor_Test.php +++ b/tests/Unit/AI_Authorization/Infrastructure/Code_Verifier_User_Meta_Repository/Constructor_Test.php @@ -23,11 +23,11 @@ final class Constructor_Test extends Abstract_Code_Verifier_User_Meta_Repository public function test_constructor() { $this->assertInstanceOf( Date_Helper::class, - $this->getPropertyValue( $this->instance, 'date_helper' ) + $this->getPropertyValue( $this->instance, 'date_helper' ), ); $this->assertInstanceOf( User_Helper::class, - $this->getPropertyValue( $this->instance, 'user_helper' ) + $this->getPropertyValue( $this->instance, 'user_helper' ), ); } } diff --git a/tests/Unit/AI_Authorization/Infrastructure/Code_Verifier_User_Meta_Repository/Store_Code_Verifier_Test.php b/tests/Unit/AI_Authorization/Infrastructure/Code_Verifier_User_Meta_Repository/Store_Code_Verifier_Test.php index fed94186779..5ccc94f95e0 100644 --- a/tests/Unit/AI_Authorization/Infrastructure/Code_Verifier_User_Meta_Repository/Store_Code_Verifier_Test.php +++ b/tests/Unit/AI_Authorization/Infrastructure/Code_Verifier_User_Meta_Repository/Store_Code_Verifier_Test.php @@ -36,7 +36,7 @@ public function test_store_code_verifier() { [ 'code' => $code, 'created_at' => $created_at, - ] + ], ); $this->instance->store_code_verifier( $user_id, $code, $created_at ); diff --git a/tests/Unit/AI_Authorization/Infrastructure/Refresh_Token_User_Meta_Repository/Constructor_Test.php b/tests/Unit/AI_Authorization/Infrastructure/Refresh_Token_User_Meta_Repository/Constructor_Test.php index 6e1eed51cb0..755dc10e802 100644 --- a/tests/Unit/AI_Authorization/Infrastructure/Refresh_Token_User_Meta_Repository/Constructor_Test.php +++ b/tests/Unit/AI_Authorization/Infrastructure/Refresh_Token_User_Meta_Repository/Constructor_Test.php @@ -22,7 +22,7 @@ final class Constructor_Test extends Abstract_Refresh_Token_User_Meta_Repository public function test_constructor() { $this->assertInstanceOf( User_Helper::class, - $this->getPropertyValue( $this->instance, 'user_helper' ) + $this->getPropertyValue( $this->instance, 'user_helper' ), ); } } diff --git a/tests/Unit/AI_Authorization/Infrastructure/Refresh_Token_User_Meta_Repository/Store_Token_Test.php b/tests/Unit/AI_Authorization/Infrastructure/Refresh_Token_User_Meta_Repository/Store_Token_Test.php index 5a4e329b972..ecb9e948918 100644 --- a/tests/Unit/AI_Authorization/Infrastructure/Refresh_Token_User_Meta_Repository/Store_Token_Test.php +++ b/tests/Unit/AI_Authorization/Infrastructure/Refresh_Token_User_Meta_Repository/Store_Token_Test.php @@ -26,7 +26,7 @@ public function test_store_token() { ->with( $user_id, '_yoast_wpseo_ai_generator_refresh_jwt', - $token + $token, ); $this->instance->store_token( $user_id, $token ); diff --git a/tests/Unit/AI_Authorization/User_Interface/Callback_Route/Abstract_Callback_Route_Test.php b/tests/Unit/AI_Authorization/User_Interface/Callback_Route/Abstract_Callback_Route_Test.php index 5bce990fe02..6c6bd8ce352 100644 --- a/tests/Unit/AI_Authorization/User_Interface/Callback_Route/Abstract_Callback_Route_Test.php +++ b/tests/Unit/AI_Authorization/User_Interface/Callback_Route/Abstract_Callback_Route_Test.php @@ -61,7 +61,7 @@ protected function setUp(): void { $this->instance = new Callback_Route( $this->access_token_repository, $this->refresh_token_repository, - $this->code_verifier_repository + $this->code_verifier_repository, ); } } diff --git a/tests/Unit/AI_Authorization/User_Interface/Callback_Route/Callback_Test.php b/tests/Unit/AI_Authorization/User_Interface/Callback_Route/Callback_Test.php index 791a32ac541..5eda0df5b1e 100644 --- a/tests/Unit/AI_Authorization/User_Interface/Callback_Route/Callback_Test.php +++ b/tests/Unit/AI_Authorization/User_Interface/Callback_Route/Callback_Test.php @@ -88,7 +88,7 @@ public function test_callback() { [ 'message' => 'Tokens successfully stored.', 'code_verifier' => 'test', - ] + ], ); $result = $this->instance->callback( $wp_rest_request ); diff --git a/tests/Unit/AI_Authorization/User_Interface/Callback_Route/Constructor_Test.php b/tests/Unit/AI_Authorization/User_Interface/Callback_Route/Constructor_Test.php index 0fcea21a7a6..d65e62ebdb1 100644 --- a/tests/Unit/AI_Authorization/User_Interface/Callback_Route/Constructor_Test.php +++ b/tests/Unit/AI_Authorization/User_Interface/Callback_Route/Constructor_Test.php @@ -25,17 +25,17 @@ final class Constructor_Test extends Abstract_Callback_Route_Test { public function test_constructor() { $this->assertInstanceOf( Access_Token_User_Meta_Repository_Interface::class, - $this->getPropertyValue( $this->instance, 'access_token_repository' ) + $this->getPropertyValue( $this->instance, 'access_token_repository' ), ); $this->assertInstanceOf( Refresh_Token_User_Meta_Repository_Interface::class, - $this->getPropertyValue( $this->instance, 'refresh_token_repository' ) + $this->getPropertyValue( $this->instance, 'refresh_token_repository' ), ); $this->assertInstanceOf( Code_Verifier_User_Meta_Repository_Interface::class, - $this->getPropertyValue( $this->instance, 'code_verifier_repository' ) + $this->getPropertyValue( $this->instance, 'code_verifier_repository' ), ); } } diff --git a/tests/Unit/AI_Authorization/User_Interface/Callback_Route/Register_Routes_Test.php b/tests/Unit/AI_Authorization/User_Interface/Callback_Route/Register_Routes_Test.php index 64f2b190c62..3649689e467 100644 --- a/tests/Unit/AI_Authorization/User_Interface/Callback_Route/Register_Routes_Test.php +++ b/tests/Unit/AI_Authorization/User_Interface/Callback_Route/Register_Routes_Test.php @@ -52,7 +52,7 @@ public function test_register_routes() { ], 'callback' => [ $this->instance, 'callback' ], 'permission_callback' => '__return_true', - ] + ], ); $this->instance->register_routes(); diff --git a/tests/Unit/AI_Authorization/User_Interface/Refresh_Callback_Route/Abstract_Refresh_Callback_Route_Test.php b/tests/Unit/AI_Authorization/User_Interface/Refresh_Callback_Route/Abstract_Refresh_Callback_Route_Test.php index 9121dfc77c8..1adfbda5d91 100644 --- a/tests/Unit/AI_Authorization/User_Interface/Refresh_Callback_Route/Abstract_Refresh_Callback_Route_Test.php +++ b/tests/Unit/AI_Authorization/User_Interface/Refresh_Callback_Route/Abstract_Refresh_Callback_Route_Test.php @@ -61,7 +61,7 @@ protected function setUp(): void { $this->instance = new Refresh_Callback_Route( $this->access_token_repository, $this->refresh_token_repository, - $this->code_verifier_repository + $this->code_verifier_repository, ); } } diff --git a/tests/Unit/AI_Authorization/User_Interface/Refresh_Callback_Route/Register_Routes_Test.php b/tests/Unit/AI_Authorization/User_Interface/Refresh_Callback_Route/Register_Routes_Test.php index dba99fc2b49..5c0958a8f80 100644 --- a/tests/Unit/AI_Authorization/User_Interface/Refresh_Callback_Route/Register_Routes_Test.php +++ b/tests/Unit/AI_Authorization/User_Interface/Refresh_Callback_Route/Register_Routes_Test.php @@ -52,7 +52,7 @@ public function test_register_routes() { ], 'callback' => [ $this->instance, 'callback' ], 'permission_callback' => '__return_true', - ] + ], ); $this->instance->register_routes(); diff --git a/tests/Unit/AI_Consent/Application/Consent_Handler/Constructor_Test.php b/tests/Unit/AI_Consent/Application/Consent_Handler/Constructor_Test.php index c1a8cd70e02..808b40a700c 100644 --- a/tests/Unit/AI_Consent/Application/Consent_Handler/Constructor_Test.php +++ b/tests/Unit/AI_Consent/Application/Consent_Handler/Constructor_Test.php @@ -23,7 +23,7 @@ final class Constructor_Test extends Abstract_Consent_Handler_Test { public function test_constructor() { $this->assertInstanceOf( User_Helper::class, - $this->getPropertyValue( $this->instance, 'user_helper' ) + $this->getPropertyValue( $this->instance, 'user_helper' ), ); } } diff --git a/tests/Unit/AI_Consent/User_Interface/AI_Consent_Integration/Constructor_Test.php b/tests/Unit/AI_Consent/User_Interface/AI_Consent_Integration/Constructor_Test.php index 43ef8b77e62..be660202f64 100644 --- a/tests/Unit/AI_Consent/User_Interface/AI_Consent_Integration/Constructor_Test.php +++ b/tests/Unit/AI_Consent/User_Interface/AI_Consent_Integration/Constructor_Test.php @@ -25,15 +25,15 @@ final class Constructor_Test extends Abstract_AI_Consent_Integration_Test { public function test_constructor() { $this->assertInstanceOf( WPSEO_Admin_Asset_Manager::class, - $this->getPropertyValue( $this->instance, 'asset_manager' ) + $this->getPropertyValue( $this->instance, 'asset_manager' ), ); $this->assertInstanceOf( User_Helper::class, - $this->getPropertyValue( $this->instance, 'user_helper' ) + $this->getPropertyValue( $this->instance, 'user_helper' ), ); $this->assertInstanceOf( Short_Link_Helper::class, - $this->getPropertyValue( $this->instance, 'short_link_helper' ) + $this->getPropertyValue( $this->instance, 'short_link_helper' ), ); } } diff --git a/tests/Unit/AI_Consent/User_Interface/AI_Consent_Integration/Enqueue_Assets_Test.php b/tests/Unit/AI_Consent/User_Interface/AI_Consent_Integration/Enqueue_Assets_Test.php index 3dde19557f8..0ebfc12b106 100644 --- a/tests/Unit/AI_Consent/User_Interface/AI_Consent_Integration/Enqueue_Assets_Test.php +++ b/tests/Unit/AI_Consent/User_Interface/AI_Consent_Integration/Enqueue_Assets_Test.php @@ -44,7 +44,7 @@ public function test_enqueue_assets() { 'hasConsent' => true, 'pluginUrl' => 'https://example.com/wp-content/plugins/wordpress-seo', 'linkParams' => [], - ] + ], ); $this->short_link_helper->expects( 'get_query_params' )->andReturn( [] ); diff --git a/tests/Unit/AI_Consent/User_Interface/Consent_Route/Constructor_Test.php b/tests/Unit/AI_Consent/User_Interface/Consent_Route/Constructor_Test.php index 2e522c0c150..3485dfeefed 100644 --- a/tests/Unit/AI_Consent/User_Interface/Consent_Route/Constructor_Test.php +++ b/tests/Unit/AI_Consent/User_Interface/Consent_Route/Constructor_Test.php @@ -23,7 +23,7 @@ final class Constructor_Test extends Abstract_Consent_Route_Test { public function test_constructor() { $this->assertInstanceOf( Consent_Handler_Interface::class, - $this->getPropertyValue( $this->instance, 'consent_handler' ) + $this->getPropertyValue( $this->instance, 'consent_handler' ), ); } } diff --git a/tests/Unit/AI_Consent/User_Interface/Consent_Route/Register_Routes_Test.php b/tests/Unit/AI_Consent/User_Interface/Consent_Route/Register_Routes_Test.php index d16c6126861..a0eddc24f7d 100644 --- a/tests/Unit/AI_Consent/User_Interface/Consent_Route/Register_Routes_Test.php +++ b/tests/Unit/AI_Consent/User_Interface/Consent_Route/Register_Routes_Test.php @@ -37,7 +37,7 @@ public function test_register_routes() { ], 'callback' => [ $this->instance, 'consent' ], 'permission_callback' => [ $this->instance, 'check_permissions' ], - ] + ], ); $this->instance->register_routes(); diff --git a/tests/Unit/AI_Free_Sparks/Application/Free_Sparks_Handler/Constructor_Test.php b/tests/Unit/AI_Free_Sparks/Application/Free_Sparks_Handler/Constructor_Test.php index 20ebebd8ea2..72877971ec3 100644 --- a/tests/Unit/AI_Free_Sparks/Application/Free_Sparks_Handler/Constructor_Test.php +++ b/tests/Unit/AI_Free_Sparks/Application/Free_Sparks_Handler/Constructor_Test.php @@ -23,7 +23,7 @@ final class Constructor_Test extends Abstract_Free_Sparks_Handler_Test { public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); } } diff --git a/tests/Unit/AI_Free_Sparks/User_Interface/Free_Sparks_Route/Constructor_Test.php b/tests/Unit/AI_Free_Sparks/User_Interface/Free_Sparks_Route/Constructor_Test.php index 20a7d8870ad..aa89d61d076 100644 --- a/tests/Unit/AI_Free_Sparks/User_Interface/Free_Sparks_Route/Constructor_Test.php +++ b/tests/Unit/AI_Free_Sparks/User_Interface/Free_Sparks_Route/Constructor_Test.php @@ -23,7 +23,7 @@ final class Constructor_Test extends Abstract_Free_Sparks_Route_Test { public function test_constructor() { $this->assertInstanceOf( Free_Sparks_Handler_Interface::class, - $this->getPropertyValue( $this->instance, 'free_sparks_handler' ) + $this->getPropertyValue( $this->instance, 'free_sparks_handler' ), ); } } diff --git a/tests/Unit/AI_Free_Sparks/User_Interface/Free_Sparks_Route/Register_Routes_Test.php b/tests/Unit/AI_Free_Sparks/User_Interface/Free_Sparks_Route/Register_Routes_Test.php index 3968b7fe9d8..8486fae939b 100644 --- a/tests/Unit/AI_Free_Sparks/User_Interface/Free_Sparks_Route/Register_Routes_Test.php +++ b/tests/Unit/AI_Free_Sparks/User_Interface/Free_Sparks_Route/Register_Routes_Test.php @@ -30,7 +30,7 @@ public function test_register_routes() { 'methods' => 'POST', 'callback' => [ $this->instance, 'start' ], 'permission_callback' => [ $this->instance, 'can_edit_posts' ], - ] + ], ); $this->instance->register_routes(); diff --git a/tests/Unit/AI_Generator/Application/Suggestions_Provider/Abstract_Suggestions_Provider_Test.php b/tests/Unit/AI_Generator/Application/Suggestions_Provider/Abstract_Suggestions_Provider_Test.php index 83f2fcecea7..9358c98841e 100644 --- a/tests/Unit/AI_Generator/Application/Suggestions_Provider/Abstract_Suggestions_Provider_Test.php +++ b/tests/Unit/AI_Generator/Application/Suggestions_Provider/Abstract_Suggestions_Provider_Test.php @@ -71,7 +71,7 @@ protected function setUp(): void { $this->consent_handler, $this->request_handler, $this->token_manager, - $this->user_helper + $this->user_helper, ); } } diff --git a/tests/Unit/AI_Generator/Application/Suggestions_Provider/Constructor_Test.php b/tests/Unit/AI_Generator/Application/Suggestions_Provider/Constructor_Test.php index 1d5f6985974..bbdc9cd3908 100644 --- a/tests/Unit/AI_Generator/Application/Suggestions_Provider/Constructor_Test.php +++ b/tests/Unit/AI_Generator/Application/Suggestions_Provider/Constructor_Test.php @@ -26,22 +26,22 @@ final class Constructor_Test extends Abstract_Suggestions_Provider_Test { public function test_constructor() { $this->assertInstanceOf( Consent_Handler::class, - $this->getPropertyValue( $this->instance, 'consent_handler' ) + $this->getPropertyValue( $this->instance, 'consent_handler' ), ); $this->assertInstanceOf( Request_Handler::class, - $this->getPropertyValue( $this->instance, 'request_handler' ) + $this->getPropertyValue( $this->instance, 'request_handler' ), ); $this->assertInstanceOf( Token_Manager::class, - $this->getPropertyValue( $this->instance, 'token_manager' ) + $this->getPropertyValue( $this->instance, 'token_manager' ), ); $this->assertInstanceOf( User_Helper::class, - $this->getPropertyValue( $this->instance, 'user_helper' ) + $this->getPropertyValue( $this->instance, 'user_helper' ), ); } } diff --git a/tests/Unit/AI_Generator/Application/Suggestions_Provider/Get_Suggestions_Test.php b/tests/Unit/AI_Generator/Application/Suggestions_Provider/Get_Suggestions_Test.php index 6fb23231246..da11c25d51e 100644 --- a/tests/Unit/AI_Generator/Application/Suggestions_Provider/Get_Suggestions_Test.php +++ b/tests/Unit/AI_Generator/Application/Suggestions_Provider/Get_Suggestions_Test.php @@ -54,7 +54,7 @@ public function test_get_suggestions() { '', '', '', - false + false, ); $this->assertArrayHasKey( 0, $suggestions_array ); @@ -107,7 +107,7 @@ public function test_get_suggestions_with_unauthorized_exception( $retry_on_unau '', '', '', - $retry_on_unauthorized + $retry_on_unauthorized, ); } @@ -161,7 +161,7 @@ public function test_get_suggestions_with_forbidden_exception() { '', '', '', - false + false, ); } } diff --git a/tests/Unit/AI_Generator/Infrastructure/WordPress_URLs/Get_License_Url_Test.php b/tests/Unit/AI_Generator/Infrastructure/WordPress_URLs/Get_License_Url_Test.php index f1fd885f3b4..d9ceb82915e 100644 --- a/tests/Unit/AI_Generator/Infrastructure/WordPress_URLs/Get_License_Url_Test.php +++ b/tests/Unit/AI_Generator/Infrastructure/WordPress_URLs/Get_License_Url_Test.php @@ -33,7 +33,7 @@ public function test_get_license_url() { $container = $this->create_container_with( [ Url_Helper::class => $url_helper, - ] + ], ); Functions\expect( 'YoastSEO' ) diff --git a/tests/Unit/AI_Generator/User_Interface/AI_Generator_Integration/Abstract_AI_Generator_Integration_Test.php b/tests/Unit/AI_Generator/User_Interface/AI_Generator_Integration/Abstract_AI_Generator_Integration_Test.php index 5c22d6e701b..f100a4c9e90 100644 --- a/tests/Unit/AI_Generator/User_Interface/AI_Generator_Integration/Abstract_AI_Generator_Integration_Test.php +++ b/tests/Unit/AI_Generator/User_Interface/AI_Generator_Integration/Abstract_AI_Generator_Integration_Test.php @@ -101,7 +101,7 @@ public function setUp(): void { $this->current_page_helper, $this->options_helper, $this->user_helper, - $this->introductions_seen_repository + $this->introductions_seen_repository, ); } } diff --git a/tests/Unit/AI_Generator/User_Interface/AI_Generator_Integration/Constructor_Test.php b/tests/Unit/AI_Generator/User_Interface/AI_Generator_Integration/Constructor_Test.php index e63a0cc1700..71a92861221 100644 --- a/tests/Unit/AI_Generator/User_Interface/AI_Generator_Integration/Constructor_Test.php +++ b/tests/Unit/AI_Generator/User_Interface/AI_Generator_Integration/Constructor_Test.php @@ -29,31 +29,31 @@ final class Constructor_Test extends Abstract_AI_Generator_Integration_Test { public function test_constructor() { $this->assertInstanceOf( WPSEO_Admin_Asset_Manager::class, - $this->getPropertyValue( $this->instance, 'asset_manager' ) + $this->getPropertyValue( $this->instance, 'asset_manager' ), ); $this->assertInstanceOf( WPSEO_Addon_Manager::class, - $this->getPropertyValue( $this->instance, 'addon_manager' ) + $this->getPropertyValue( $this->instance, 'addon_manager' ), ); $this->assertInstanceOf( API_Client::class, - $this->getPropertyValue( $this->instance, 'api_client' ) + $this->getPropertyValue( $this->instance, 'api_client' ), ); $this->assertInstanceOf( Current_Page_Helper::class, - $this->getPropertyValue( $this->instance, 'current_page_helper' ) + $this->getPropertyValue( $this->instance, 'current_page_helper' ), ); $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); $this->assertInstanceOf( User_Helper::class, - $this->getPropertyValue( $this->instance, 'user_helper' ) + $this->getPropertyValue( $this->instance, 'user_helper' ), ); $this->assertInstanceOf( Introductions_Seen_Repository::class, - $this->getPropertyValue( $this->instance, 'introductions_seen_repository' ) + $this->getPropertyValue( $this->instance, 'introductions_seen_repository' ), ); } } diff --git a/tests/Unit/AI_Generator/User_Interface/AI_Generator_Integration/Enqueue_Assets_Test.php b/tests/Unit/AI_Generator/User_Interface/AI_Generator_Integration/Enqueue_Assets_Test.php index af75e2c3d31..15652d2d4e4 100644 --- a/tests/Unit/AI_Generator/User_Interface/AI_Generator_Integration/Enqueue_Assets_Test.php +++ b/tests/Unit/AI_Generator/User_Interface/AI_Generator_Integration/Enqueue_Assets_Test.php @@ -71,7 +71,7 @@ public function test_enqueue_assets() { 'hasSeenIntroduction' => true, 'requestTimeout' => 0, 'isFreeSparks' => true, - ] + ], ); $this->asset_manager->expects( 'enqueue_style' )->once()->with( 'ai-generator' ); diff --git a/tests/Unit/AI_Generator/User_Interface/Bust_Subscription_Cache_Route/Constructor_Test.php b/tests/Unit/AI_Generator/User_Interface/Bust_Subscription_Cache_Route/Constructor_Test.php index 9ace2a136a8..05dc9792656 100644 --- a/tests/Unit/AI_Generator/User_Interface/Bust_Subscription_Cache_Route/Constructor_Test.php +++ b/tests/Unit/AI_Generator/User_Interface/Bust_Subscription_Cache_Route/Constructor_Test.php @@ -23,7 +23,7 @@ final class Constructor_Test extends Abstract_Bust_Subscription_Cache_Route_Test public function test_constructor() { $this->assertInstanceOf( WPSEO_Addon_Manager::class, - $this->getPropertyValue( $this->instance, 'addon_manager' ) + $this->getPropertyValue( $this->instance, 'addon_manager' ), ); } } diff --git a/tests/Unit/AI_Generator/User_Interface/Bust_Subscription_Cache_Route/Register_Routes_Test.php b/tests/Unit/AI_Generator/User_Interface/Bust_Subscription_Cache_Route/Register_Routes_Test.php index 5f5b090b106..860cbc94491 100644 --- a/tests/Unit/AI_Generator/User_Interface/Bust_Subscription_Cache_Route/Register_Routes_Test.php +++ b/tests/Unit/AI_Generator/User_Interface/Bust_Subscription_Cache_Route/Register_Routes_Test.php @@ -31,7 +31,7 @@ public function test_register_routes() { 'args' => [], 'callback' => [ $this->instance, 'bust_subscription_cache' ], 'permission_callback' => [ $this->instance, 'check_permissions' ], - ] + ], ); $this->instance->register_routes(); diff --git a/tests/Unit/AI_Generator/User_Interface/Get_Suggestions_Route/Constructor_Test.php b/tests/Unit/AI_Generator/User_Interface/Get_Suggestions_Route/Constructor_Test.php index ddc12bfebef..7e3e30e2da8 100644 --- a/tests/Unit/AI_Generator/User_Interface/Get_Suggestions_Route/Constructor_Test.php +++ b/tests/Unit/AI_Generator/User_Interface/Get_Suggestions_Route/Constructor_Test.php @@ -23,7 +23,7 @@ final class Constructor_Test extends Abstract_Get_Suggestions_Route_Test { public function test_constructor() { $this->assertInstanceOf( Suggestions_Provider::class, - $this->getPropertyValue( $this->instance, 'suggestions_provider' ) + $this->getPropertyValue( $this->instance, 'suggestions_provider' ), ); } } diff --git a/tests/Unit/AI_Generator/User_Interface/Get_Suggestions_Route/Get_Suggestions_Test.php b/tests/Unit/AI_Generator/User_Interface/Get_Suggestions_Route/Get_Suggestions_Test.php index 3b947dc4a82..338cf085ca0 100644 --- a/tests/Unit/AI_Generator/User_Interface/Get_Suggestions_Route/Get_Suggestions_Test.php +++ b/tests/Unit/AI_Generator/User_Interface/Get_Suggestions_Route/Get_Suggestions_Test.php @@ -61,7 +61,7 @@ public function test_get_suggestions() { $request['focus_keyphrase'], $request['language'], $request['platform'], - $request['editor'] + $request['editor'], ); $wp_rest_response @@ -115,7 +115,7 @@ public function test_get_suggestions_with_missing_license() { $request['focus_keyphrase'], $request['language'], $request['platform'], - $request['editor'] + $request['editor'], ) ->andThrow( $payment_required_exception ); @@ -140,7 +140,7 @@ public function test_get_suggestions_with_missing_license() { 'errorIdentifier' => 'test', 'missingLicenses' => 'test', ], - 0 + 0, ); $result = $this->instance->get_suggestions( $wp_rest_request ); @@ -189,7 +189,7 @@ public function test_get_suggestions_with_runtime_exception() { $request['focus_keyphrase'], $request['language'], $request['platform'], - $request['editor'] + $request['editor'], ) ->andThrow( $runtime_exception ); diff --git a/tests/Unit/AI_Generator/User_Interface/Get_Suggestions_Route/Register_Routes_Test.php b/tests/Unit/AI_Generator/User_Interface/Get_Suggestions_Route/Register_Routes_Test.php index d8425d153d2..70ba1cf85b1 100644 --- a/tests/Unit/AI_Generator/User_Interface/Get_Suggestions_Route/Register_Routes_Test.php +++ b/tests/Unit/AI_Generator/User_Interface/Get_Suggestions_Route/Register_Routes_Test.php @@ -82,7 +82,7 @@ public function test_register_routes() { ], 'callback' => [ $this->instance, 'get_suggestions' ], 'permission_callback' => [ $this->instance, 'check_permissions' ], - ] + ], ); $this->instance->register_routes(); diff --git a/tests/Unit/AI_Generator/User_Interface/Get_Usage_Route/Abstract_Get_Usage_Route_Test.php b/tests/Unit/AI_Generator/User_Interface/Get_Usage_Route/Abstract_Get_Usage_Route_Test.php index 53a6db126cc..82e905a5b7b 100644 --- a/tests/Unit/AI_Generator/User_Interface/Get_Usage_Route/Abstract_Get_Usage_Route_Test.php +++ b/tests/Unit/AI_Generator/User_Interface/Get_Usage_Route/Abstract_Get_Usage_Route_Test.php @@ -61,7 +61,7 @@ protected function setUp(): void { $this->instance = new Get_Usage_Route( $this->token_manager, $this->request_handler, - $this->addon_manager + $this->addon_manager, ); } } diff --git a/tests/Unit/AI_Generator/User_Interface/Get_Usage_Route/Constructor_Test.php b/tests/Unit/AI_Generator/User_Interface/Get_Usage_Route/Constructor_Test.php index 8db9ba7fd31..ce7a8abe3d2 100644 --- a/tests/Unit/AI_Generator/User_Interface/Get_Usage_Route/Constructor_Test.php +++ b/tests/Unit/AI_Generator/User_Interface/Get_Usage_Route/Constructor_Test.php @@ -25,17 +25,17 @@ final class Constructor_Test extends Abstract_Get_Usage_Route_Test { public function test_constructor() { $this->assertInstanceOf( Token_Manager::class, - $this->getPropertyValue( $this->instance, 'token_manager' ) + $this->getPropertyValue( $this->instance, 'token_manager' ), ); $this->assertInstanceOf( Request_Handler::class, - $this->getPropertyValue( $this->instance, 'request_handler' ) + $this->getPropertyValue( $this->instance, 'request_handler' ), ); $this->assertInstanceOf( WPSEO_Addon_Manager::class, - $this->getPropertyValue( $this->instance, 'addon_manager' ) + $this->getPropertyValue( $this->instance, 'addon_manager' ), ); } } diff --git a/tests/Unit/AI_Generator/User_Interface/Get_Usage_Route/Get_Usage_Test.php b/tests/Unit/AI_Generator/User_Interface/Get_Usage_Route/Get_Usage_Test.php index cd0da211818..26656ec3900 100644 --- a/tests/Unit/AI_Generator/User_Interface/Get_Usage_Route/Get_Usage_Test.php +++ b/tests/Unit/AI_Generator/User_Interface/Get_Usage_Route/Get_Usage_Test.php @@ -122,7 +122,7 @@ public function test_get_usage_with_bad_http_request() { 'errorIdentifier' => 'test', 'errorCode' => 0, ], - 0 + 0, ); $result = $this->instance->get_usage( $wp_rest_request ); @@ -181,7 +181,7 @@ public function test_get_usage_with_too_many_requests_exception() { 'errorCode' => 0, 'missingLicenses' => 'test', ], - 0 + 0, ); $result = $this->instance->get_usage( $wp_rest_request ); diff --git a/tests/Unit/AI_Generator/User_Interface/Get_Usage_Route/Register_Routes_Test.php b/tests/Unit/AI_Generator/User_Interface/Get_Usage_Route/Register_Routes_Test.php index 097cbf2a1b4..2ce74bc3d90 100644 --- a/tests/Unit/AI_Generator/User_Interface/Get_Usage_Route/Register_Routes_Test.php +++ b/tests/Unit/AI_Generator/User_Interface/Get_Usage_Route/Register_Routes_Test.php @@ -36,7 +36,7 @@ public function test_register_routes() { ], 'callback' => [ $this->instance, 'get_usage' ], 'permission_callback' => [ $this->instance, 'check_permissions' ], - ] + ], ); $this->instance->register_routes(); diff --git a/tests/Unit/AI_HTTP_Request/Application/Request_Handler/Abstract_Request_Handler_Test.php b/tests/Unit/AI_HTTP_Request/Application/Request_Handler/Abstract_Request_Handler_Test.php index 58dca0d1fd2..41b05dc791d 100644 --- a/tests/Unit/AI_HTTP_Request/Application/Request_Handler/Abstract_Request_Handler_Test.php +++ b/tests/Unit/AI_HTTP_Request/Application/Request_Handler/Abstract_Request_Handler_Test.php @@ -51,7 +51,7 @@ protected function setUp(): void { $this->instance = new Request_Handler( $this->api_client, - $this->response_parser + $this->response_parser, ); } } diff --git a/tests/Unit/AI_HTTP_Request/Application/Request_Handler/Constructor_Test.php b/tests/Unit/AI_HTTP_Request/Application/Request_Handler/Constructor_Test.php index 0410fe682bd..d1da25d1982 100644 --- a/tests/Unit/AI_HTTP_Request/Application/Request_Handler/Constructor_Test.php +++ b/tests/Unit/AI_HTTP_Request/Application/Request_Handler/Constructor_Test.php @@ -24,12 +24,12 @@ final class Constructor_Test extends Abstract_Request_Handler_Test { public function test_constructor() { $this->assertInstanceOf( API_Client::class, - $this->getPropertyValue( $this->instance, 'api_client' ) + $this->getPropertyValue( $this->instance, 'api_client' ), ); $this->assertInstanceOf( Response_Parser::class, - $this->getPropertyValue( $this->instance, 'response_parser' ) + $this->getPropertyValue( $this->instance, 'response_parser' ), ); } } diff --git a/tests/Unit/AI_HTTP_Request/Infrastructure/API_Client/Perform_Request_Get_Test.php b/tests/Unit/AI_HTTP_Request/Infrastructure/API_Client/Perform_Request_Get_Test.php index eaa62260e53..2aa7ee54792 100644 --- a/tests/Unit/AI_HTTP_Request/Infrastructure/API_Client/Perform_Request_Get_Test.php +++ b/tests/Unit/AI_HTTP_Request/Infrastructure/API_Client/Perform_Request_Get_Test.php @@ -51,7 +51,7 @@ public function test_perform_request_get() { [ 'body' => '{"status":"ok"}', 'response' => [ 'code' => 200 ], - ] + ], ); $result = $this->instance->perform_request( $action_path, $body, $headers, $is_post ); @@ -61,7 +61,7 @@ public function test_perform_request_get() { 'body' => '{"status":"ok"}', 'response' => [ 'code' => 200 ], ], - $result + $result, ); } } diff --git a/tests/Unit/AI_HTTP_Request/Infrastructure/API_Client/Perform_Request_Post_Test.php b/tests/Unit/AI_HTTP_Request/Infrastructure/API_Client/Perform_Request_Post_Test.php index 32fa98050c4..6587a2063a8 100644 --- a/tests/Unit/AI_HTTP_Request/Infrastructure/API_Client/Perform_Request_Post_Test.php +++ b/tests/Unit/AI_HTTP_Request/Infrastructure/API_Client/Perform_Request_Post_Test.php @@ -52,7 +52,7 @@ public function test_perform_request_post() { [ 'body' => '{"success":true}', 'response' => [ 'code' => 200 ], - ] + ], ); $result = $this->instance->perform_request( $action_path, $body, $headers, $is_post ); @@ -62,7 +62,7 @@ public function test_perform_request_post() { 'body' => '{"success":true}', 'response' => [ 'code' => 200 ], ], - $result + $result, ); } } diff --git a/tests/Unit/Actions/Alert_Dismissal_Action_Test.php b/tests/Unit/Actions/Alert_Dismissal_Action_Test.php index a217a09d8b0..5d0e29c4d72 100644 --- a/tests/Unit/Actions/Alert_Dismissal_Action_Test.php +++ b/tests/Unit/Actions/Alert_Dismissal_Action_Test.php @@ -54,7 +54,7 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( User_Helper::class, - $this->getPropertyValue( $this->instance, 'user' ) + $this->getPropertyValue( $this->instance, 'user' ), ); } @@ -93,7 +93,7 @@ public function test_dismiss_alert() { [ 'other alert' => true, 'test' => true, - ] + ], ); $this->assertTrue( $this->instance->dismiss( 'test' ) ); @@ -289,7 +289,7 @@ public function test_reset_alert() { 'some alert' => true, 'test' => true, 'other alert' => true, - ] + ], ); $this->user @@ -304,14 +304,14 @@ public function test_reset_alert() { [ 'some alert' => true, 'other alert' => true, - ] + ], ) ->once() ->andReturn( [ 'some alert' => true, 'other alert' => true, - ] + ], ); $this->assertTrue( $this->instance->reset( 'test' ) ); @@ -603,7 +603,7 @@ public function test_reset_alert_update_failure() { 'some alert' => true, 'test' => true, 'other alert' => true, - ] + ], ); $this->user @@ -618,7 +618,7 @@ public function test_reset_alert_update_failure() { [ 'some alert' => true, 'other alert' => true, - ] + ], ) ->once() ->andReturn( false ); diff --git a/tests/Unit/Actions/Configuration/First_Time_Configuration_Action_Test.php b/tests/Unit/Actions/Configuration/First_Time_Configuration_Action_Test.php index 4b64a53f373..4cf1122e92b 100644 --- a/tests/Unit/Actions/Configuration/First_Time_Configuration_Action_Test.php +++ b/tests/Unit/Actions/Configuration/First_Time_Configuration_Action_Test.php @@ -64,11 +64,11 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); $this->assertInstanceOf( Social_Profiles_Helper::class, - $this->getPropertyValue( $this->instance, 'social_profiles_helper' ) + $this->getPropertyValue( $this->instance, 'social_profiles_helper' ), ); } @@ -107,7 +107,7 @@ public function test_set_site_representation( $params, $times, $yoast_options_re $this->assertEquals( $expected, - $this->instance->set_site_representation( $params ) + $this->instance->set_site_representation( $params ), ); } @@ -211,7 +211,7 @@ public function test_set_social_profiles( $set_profiles_results, $get_profiles_r $this->assertEquals( $expected, - $this->instance->set_social_profiles( $params ) + $this->instance->set_social_profiles( $params ), ); } @@ -298,7 +298,7 @@ public function test_set_enable_tracking( $params, $old_value, $times, $option_r $this->assertEquals( $expected, - $this->instance->set_enable_tracking( $params ) + $this->instance->set_enable_tracking( $params ), ); } @@ -404,7 +404,7 @@ public function test_check_capability( $user_id, $can_edit, $expected ) { $this->assertEquals( $expected, - $this->instance->check_capability( $user_id ) + $this->instance->check_capability( $user_id ), ); } @@ -464,7 +464,7 @@ public function test_save_configuration_state( $params, $times, $yoast_options_r $this->assertEquals( $expected, - $this->instance->save_configuration_state( $params ) + $this->instance->save_configuration_state( $params ), ); } @@ -559,7 +559,7 @@ public function test_get_configuration_state() { 'finishedSteps' => [ 'step1', 'step2' ], ], ], - $this->instance->get_configuration_state() + $this->instance->get_configuration_state(), ); } @@ -583,7 +583,7 @@ public function test_get_configuration_state_failure() { 'status' => 500, 'error' => 'Could not get data from the database', ], - $this->instance->get_configuration_state() + $this->instance->get_configuration_state(), ); } } diff --git a/tests/Unit/Actions/Importing/Abstract_Aioseo_Importing_Action_Test.php b/tests/Unit/Actions/Importing/Abstract_Aioseo_Importing_Action_Test.php index 50c139bb979..28e86c93b14 100644 --- a/tests/Unit/Actions/Importing/Abstract_Aioseo_Importing_Action_Test.php +++ b/tests/Unit/Actions/Importing/Abstract_Aioseo_Importing_Action_Test.php @@ -87,7 +87,7 @@ protected function set_up() { $this->robots_transformer = Mockery::mock( Aioseo_Robots_Transformer_Service::class ); $this->mock_instance = Mockery::mock( Abstract_Aioseo_Importing_Action::class, - [ $this->import_cursor, $this->options, $this->sanitization, $this->replacevar_handler, $this->robots_provider, $this->robots_transformer ] + [ $this->import_cursor, $this->options, $this->sanitization, $this->replacevar_handler, $this->robots_provider, $this->robots_transformer ], )->makePartial()->shouldAllowMockingProtectedMethods(); } diff --git a/tests/Unit/Actions/Importing/Abstract_Aioseo_Settings_Importing_Action_Test.php b/tests/Unit/Actions/Importing/Abstract_Aioseo_Settings_Importing_Action_Test.php index c70fd1aaa41..5181bc34f4f 100644 --- a/tests/Unit/Actions/Importing/Abstract_Aioseo_Settings_Importing_Action_Test.php +++ b/tests/Unit/Actions/Importing/Abstract_Aioseo_Settings_Importing_Action_Test.php @@ -91,7 +91,7 @@ protected function set_up() { $this->robots_transformer = Mockery::mock( Aioseo_Robots_Transformer_Service::class ); $this->mock_instance = Mockery::mock( Abstract_Aioseo_Settings_Importing_Action::class, - [ $this->import_cursor, $this->options, $this->sanitization, $this->replacevar_handler, $this->robots_provider, $this->robots_transformer ] + [ $this->import_cursor, $this->options, $this->sanitization, $this->replacevar_handler, $this->robots_provider, $this->robots_transformer ], )->makePartial()->shouldAllowMockingProtectedMethods(); } @@ -323,7 +323,7 @@ public static function provider_get_limited_unindexed() { return [ [ [], true, 0 ], [ [ 0 ], false, 1 ], - [ [ 54321 ], false, 1 ], + [ [ 54_321 ], false, 1 ], ]; } diff --git a/tests/Unit/Actions/Importing/Aioseo_Cleanup_Action_Test.php b/tests/Unit/Actions/Importing/Aioseo_Cleanup_Action_Test.php index b5677bf38b0..11e3463181c 100644 --- a/tests/Unit/Actions/Importing/Aioseo_Cleanup_Action_Test.php +++ b/tests/Unit/Actions/Importing/Aioseo_Cleanup_Action_Test.php @@ -154,12 +154,12 @@ public function test_index( $completed_option, $query_times, $set_complete_times '_aioseo_og_description', '_aioseo_twitter_title', '_aioseo_twitter_description', - ] + ], ) ->andReturn( " DELETE FROM wp_postmeta - WHERE meta_key IN ('_aioseo_title','_aioseo_description','_aioseo_og_title','_aioseo_og_description','_aioseo_twitter_title','_aioseo_twitter_description')" + WHERE meta_key IN ('_aioseo_title','_aioseo_description','_aioseo_og_title','_aioseo_og_description','_aioseo_twitter_title','_aioseo_twitter_description')", ); $this->wpdb->expects( 'query' ) @@ -167,10 +167,10 @@ public function test_index( $completed_option, $query_times, $set_complete_times ->with( " DELETE FROM wp_postmeta - WHERE meta_key IN ('_aioseo_title','_aioseo_description','_aioseo_og_title','_aioseo_og_description','_aioseo_twitter_title','_aioseo_twitter_description')" + WHERE meta_key IN ('_aioseo_title','_aioseo_description','_aioseo_og_title','_aioseo_og_description','_aioseo_twitter_title','_aioseo_twitter_description')", ) ->andReturn( - $postmeta_cleanup + $postmeta_cleanup, ); $this->aioseo_helper->expects( 'aioseo_exists' ) @@ -186,7 +186,7 @@ public function test_index( $completed_option, $query_times, $set_complete_times ->times( $query_times ) ->with( $expected_truncate_query ) ->andReturn( - $truncate_cleanup + $truncate_cleanup, ); $this->options->expects( 'get' ) diff --git a/tests/Unit/Actions/Importing/Aioseo_Custom_Archive_Settings_Importing_Action_Test.php b/tests/Unit/Actions/Importing/Aioseo_Custom_Archive_Settings_Importing_Action_Test.php index 214d53ca3bd..b6d5d7616b4 100644 --- a/tests/Unit/Actions/Importing/Aioseo_Custom_Archive_Settings_Importing_Action_Test.php +++ b/tests/Unit/Actions/Importing/Aioseo_Custom_Archive_Settings_Importing_Action_Test.php @@ -159,7 +159,7 @@ protected function set_up() { $this->mock_instance = Mockery::mock( Aioseo_Custom_Archive_Settings_Importing_Action_Double::class, - [ $this->import_cursor, $this->options, $this->sanitization, $this->post_type, $this->replacevar_handler, $this->robots_provider, $this->robots_transformer ] + [ $this->import_cursor, $this->options, $this->sanitization, $this->post_type, $this->replacevar_handler, $this->robots_provider, $this->robots_transformer ], )->makePartial()->shouldAllowMockingProtectedMethods(); $this->mock_instance->set_import_helper( $this->import_helper ); } diff --git a/tests/Unit/Actions/Importing/Aioseo_Default_Archive_Settings_Importing_Action_Test.php b/tests/Unit/Actions/Importing/Aioseo_Default_Archive_Settings_Importing_Action_Test.php index 8fe47247e5e..2459fc85936 100644 --- a/tests/Unit/Actions/Importing/Aioseo_Default_Archive_Settings_Importing_Action_Test.php +++ b/tests/Unit/Actions/Importing/Aioseo_Default_Archive_Settings_Importing_Action_Test.php @@ -162,7 +162,7 @@ protected function set_up() { $this->mock_instance = Mockery::mock( Aioseo_Default_Archive_Settings_Importing_Action_Double::class, - [ $this->import_cursor, $this->options, $this->sanitization, $this->replacevar_handler, $this->robots_provider, $this->robots_transformer ] + [ $this->import_cursor, $this->options, $this->sanitization, $this->replacevar_handler, $this->robots_provider, $this->robots_transformer ], )->makePartial()->shouldAllowMockingProtectedMethods(); $this->mock_instance->set_import_helper( $this->import_helper ); } diff --git a/tests/Unit/Actions/Importing/Aioseo_General_Settings_Importing_Action_Test.php b/tests/Unit/Actions/Importing/Aioseo_General_Settings_Importing_Action_Test.php index 4d46928138e..7fa4e24ee87 100644 --- a/tests/Unit/Actions/Importing/Aioseo_General_Settings_Importing_Action_Test.php +++ b/tests/Unit/Actions/Importing/Aioseo_General_Settings_Importing_Action_Test.php @@ -151,7 +151,7 @@ protected function set_up() { $this->mock_instance = Mockery::mock( Aioseo_General_Settings_Importing_Action_Double::class, - [ $this->import_cursor, $this->options, $this->sanitization, $this->image, $this->replacevar_handler, $this->robots_provider, $this->robots_transformer ] + [ $this->import_cursor, $this->options, $this->sanitization, $this->image, $this->replacevar_handler, $this->robots_provider, $this->robots_transformer ], )->makePartial()->shouldAllowMockingProtectedMethods(); $this->mock_instance->set_import_helper( $this->import_helper ); } diff --git a/tests/Unit/Actions/Importing/Aioseo_Posts_Importing_Action_Test.php b/tests/Unit/Actions/Importing/Aioseo_Posts_Importing_Action_Test.php index 9c0b69b1665..b1047f57977 100644 --- a/tests/Unit/Actions/Importing/Aioseo_Posts_Importing_Action_Test.php +++ b/tests/Unit/Actions/Importing/Aioseo_Posts_Importing_Action_Test.php @@ -180,7 +180,7 @@ protected function set_up() { $this->replacevar_handler, $this->robots_provider, $this->robots_transformer, - $this->social_images_provider + $this->social_images_provider, ); $this->mock_instance = Mockery::mock( Aioseo_Posts_Importing_Action_Double::class, @@ -197,7 +197,7 @@ protected function set_up() { $this->robots_provider, $this->robots_transformer, $this->social_images_provider, - ] + ], )->makePartial()->shouldAllowMockingProtectedMethods(); $this->mock_instance->set_aioseo_helper( $this->aioseo_helper ); @@ -230,7 +230,7 @@ public function test_get_total_unindexed() { ->once() ->with( $expected_query, - [ 1337, 25 ] + [ 1337, 25 ], ) ->andReturn( ' @@ -238,7 +238,7 @@ public function test_get_total_unindexed() { FROM wp_aioseo_posts WHERE id > 1337 ORDER BY id - LIMIT 25' + LIMIT 25', ); $this->aioseo_helper->expects( 'get_table' ) @@ -253,7 +253,7 @@ public function test_get_total_unindexed() { FROM wp_aioseo_posts WHERE id > 1337 ORDER BY id - LIMIT 25' + LIMIT 25', ) ->andReturn( [ '1338', '1339', '1340' ] ); @@ -298,7 +298,7 @@ public function test_donot_map( $aioseo_indexables, $is_default, $check_if_defau ->once() ->with( $expected_query, - [ 1337, 25 ] + [ 1337, 25 ], ) ->andReturn( ' @@ -306,7 +306,7 @@ public function test_donot_map( $aioseo_indexables, $is_default, $check_if_defau FROM wp_aioseo_posts WHERE id > 1337 ORDER BY id - LIMIT 25' + LIMIT 25', ); $this->aioseo_helper->expects( 'get_table' ) @@ -395,7 +395,7 @@ public function test_map_with_empty_yoast_indexable() { 'focus' => [ 'keyphrase' => 'key phrase', ], - ] + ], ), 'og_image_type' => 'default', 'twitter_image_type' => 'auto', @@ -577,7 +577,7 @@ public function test_map_with_existing_yoast_indexable() { 'focus' => [ 'not_keyphrase' => 'key phrase', ], - ] + ], ), 'og_image_type' => 'attach', 'twitter_image_type' => 'auto', diff --git a/tests/Unit/Actions/Importing/Aioseo_Posttype_Defaults_Settings_Importing_Action_Test.php b/tests/Unit/Actions/Importing/Aioseo_Posttype_Defaults_Settings_Importing_Action_Test.php index 2372b729a87..e6795c63839 100644 --- a/tests/Unit/Actions/Importing/Aioseo_Posttype_Defaults_Settings_Importing_Action_Test.php +++ b/tests/Unit/Actions/Importing/Aioseo_Posttype_Defaults_Settings_Importing_Action_Test.php @@ -176,7 +176,7 @@ protected function set_up() { $this->mock_instance = Mockery::mock( Aioseo_Posttype_Defaults_Settings_Importing_Action_Double::class, - [ $this->import_cursor, $this->options, $this->sanitization, $this->replacevar_handler, $this->robots_provider, $this->robots_transformer ] + [ $this->import_cursor, $this->options, $this->sanitization, $this->replacevar_handler, $this->robots_provider, $this->robots_transformer ], )->makePartial()->shouldAllowMockingProtectedMethods(); $this->mock_instance->set_import_helper( $this->import_helper ); } diff --git a/tests/Unit/Actions/Importing/Aioseo_Taxonomy_Settings_Importing_Action_Test.php b/tests/Unit/Actions/Importing/Aioseo_Taxonomy_Settings_Importing_Action_Test.php index 3a8cfe49ef1..041f5e0c8fd 100644 --- a/tests/Unit/Actions/Importing/Aioseo_Taxonomy_Settings_Importing_Action_Test.php +++ b/tests/Unit/Actions/Importing/Aioseo_Taxonomy_Settings_Importing_Action_Test.php @@ -162,7 +162,7 @@ protected function set_up() { $this->mock_instance = Mockery::mock( Aioseo_Taxonomy_Settings_Importing_Action_Double::class, - [ $this->import_cursor, $this->options, $this->sanitization, $this->replacevar_handler, $this->robots_provider, $this->robots_transformer ] + [ $this->import_cursor, $this->options, $this->sanitization, $this->replacevar_handler, $this->robots_provider, $this->robots_transformer ], )->makePartial()->shouldAllowMockingProtectedMethods(); $this->mock_instance->set_import_helper( $this->import_helper ); } diff --git a/tests/Unit/Actions/Importing/Aioseo_Validate_Data_Action_Test.php b/tests/Unit/Actions/Importing/Aioseo_Validate_Data_Action_Test.php index 8e3133aac2f..5413db9e6e1 100644 --- a/tests/Unit/Actions/Importing/Aioseo_Validate_Data_Action_Test.php +++ b/tests/Unit/Actions/Importing/Aioseo_Validate_Data_Action_Test.php @@ -130,7 +130,7 @@ protected function set_up() { $this->general_settings_importing_action, $this->posttype_defaults_settings_importing_action, $this->taxonomy_settings_importing_action, - $this->post_importing_action + $this->post_importing_action, ); $this->instance->set_aioseo_helper( $this->aioseo_helper ); diff --git a/tests/Unit/Actions/Importing/Deactivate_Conflicting_Plugins_Action_Test.php b/tests/Unit/Actions/Importing/Deactivate_Conflicting_Plugins_Action_Test.php index 7848b33dd24..602dcf9e044 100644 --- a/tests/Unit/Actions/Importing/Deactivate_Conflicting_Plugins_Action_Test.php +++ b/tests/Unit/Actions/Importing/Deactivate_Conflicting_Plugins_Action_Test.php @@ -74,7 +74,7 @@ public function set_up() { $this->replacevar_handler, $this->robots_provider, $this->robots_transformer, - $this->conflicting_plugins_service + $this->conflicting_plugins_service, ); } diff --git a/tests/Unit/Actions/Indexables/Indexable_Head_Action_Test.php b/tests/Unit/Actions/Indexables/Indexable_Head_Action_Test.php index 591d7946933..0a91b570f06 100644 --- a/tests/Unit/Actions/Indexables/Indexable_Head_Action_Test.php +++ b/tests/Unit/Actions/Indexables/Indexable_Head_Action_Test.php @@ -55,7 +55,7 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( Meta_Surface::class, - $this->getPropertyValue( $this->instance, 'meta_surface' ) + $this->getPropertyValue( $this->instance, 'meta_surface' ), ); } @@ -100,7 +100,7 @@ public function test_retrieving_meta( $method, $input ) { 'json' => [ 'key' => 'value' ], 'status' => 200, ], - $output + $output, ); } @@ -127,7 +127,7 @@ public function test_retrieving_meta_for_posts_page() { 'json' => [ 'key' => 'value' ], 'status' => 200, ], - $this->instance->for_posts_page() + $this->instance->for_posts_page(), ); } @@ -156,7 +156,7 @@ public function test_retrieving_meta_with_meta_not_found( $method, $input ) { (object) [ 'html' => 'this is the 404 head', 'json' => [ 'key' => 'value' ], - ] + ], ); $this->meta_surface @@ -180,7 +180,7 @@ public function test_retrieving_meta_with_meta_not_found( $method, $input ) { 'json' => [ 'key' => 'value' ], 'status' => 404, ], - $this->instance->{$method}( $input ) + $this->instance->{$method}( $input ), ); } @@ -199,7 +199,7 @@ public function test_retrieving_meta_for_posts_page_with_meta_not_found() { (object) [ 'html' => 'this is the 404 head', 'json' => [ 'key' => 'value' ], - ] + ], ); $this->meta_surface @@ -216,7 +216,7 @@ public function test_retrieving_meta_for_posts_page_with_meta_not_found() { 'json' => [ 'key' => 'value' ], 'status' => 404, ], - $this->instance->for_posts_page() + $this->instance->for_posts_page(), ); } diff --git a/tests/Unit/Actions/Indexing/Abstract_Link_Indexing_Action_Test.php b/tests/Unit/Actions/Indexing/Abstract_Link_Indexing_Action_Test.php index dde441f14a9..58205c8a2bb 100644 --- a/tests/Unit/Actions/Indexing/Abstract_Link_Indexing_Action_Test.php +++ b/tests/Unit/Actions/Indexing/Abstract_Link_Indexing_Action_Test.php @@ -89,7 +89,7 @@ protected function set_up() { $this->indexable_helper, $this->repository, $this->wpdb, - ] + ], )->makePartial(); } @@ -103,19 +103,19 @@ protected function set_up() { public function test_construct() { $this->assertInstanceOf( Indexable_Link_Builder::class, - $this->getPropertyValue( $this->instance, 'link_builder' ) + $this->getPropertyValue( $this->instance, 'link_builder' ), ); $this->assertInstanceOf( Indexable_Helper::class, - $this->getPropertyValue( $this->instance, 'indexable_helper' ) + $this->getPropertyValue( $this->instance, 'indexable_helper' ), ); $this->assertInstanceOf( Indexable_Repository::class, - $this->getPropertyValue( $this->instance, 'repository' ) + $this->getPropertyValue( $this->instance, 'repository' ), ); $this->assertInstanceOf( 'wpdb', - $this->getPropertyValue( $this->instance, 'wpdb' ) + $this->getPropertyValue( $this->instance, 'wpdb' ), ); } diff --git a/tests/Unit/Actions/Indexing/Indexable_Indexing_Complete_Action_Test.php b/tests/Unit/Actions/Indexing/Indexable_Indexing_Complete_Action_Test.php index 2be268eb9b6..de5a17ebd56 100644 --- a/tests/Unit/Actions/Indexing/Indexable_Indexing_Complete_Action_Test.php +++ b/tests/Unit/Actions/Indexing/Indexable_Indexing_Complete_Action_Test.php @@ -42,7 +42,7 @@ protected function set_up() { $this->indexable_helper = Mockery::mock( Indexable_Helper::class ); $this->instance = new Indexable_Indexing_Complete_Action( - $this->indexable_helper + $this->indexable_helper, ); } @@ -56,7 +56,7 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( Indexable_Helper::class, - $this->getPropertyValue( $this->instance, 'indexable_helper' ) + $this->getPropertyValue( $this->instance, 'indexable_helper' ), ); } diff --git a/tests/Unit/Actions/Indexing/Indexable_Post_Indexation_Action_Test.php b/tests/Unit/Actions/Indexing/Indexable_Post_Indexation_Action_Test.php index d6349871fbf..c3036e8fc45 100644 --- a/tests/Unit/Actions/Indexing/Indexable_Post_Indexation_Action_Test.php +++ b/tests/Unit/Actions/Indexing/Indexable_Post_Indexation_Action_Test.php @@ -93,7 +93,7 @@ protected function set_up() { $this->repository, $this->wpdb, $this->builder_versions, - $this->post_helper + $this->post_helper, ); } @@ -287,7 +287,7 @@ public function test_index() { ->once() ->with( $expected_query, - [ 'public_post_type', 'auto-draft', 2, 25 ] + [ 'public_post_type', 'auto-draft', 2, 25 ], ) ->andReturn( 'query' ); $this->wpdb @@ -371,7 +371,7 @@ public function test_index_with_excluded_post_types() { ->once() ->with( $expected_query, - [ 'public_post_type', 'auto-draft', 2, 25 ] + [ 'public_post_type', 'auto-draft', 2, 25 ], ) ->andReturn( 'query' ); $this->wpdb @@ -427,7 +427,7 @@ public function test_index_no_indexables_created() { ->once() ->with( $expected_query, - [ 'public_post_type', 'auto-draft', 2, 25 ] + [ 'public_post_type', 'auto-draft', 2, 25 ], ) ->andReturn( 'query' ); $this->wpdb diff --git a/tests/Unit/Actions/Indexing/Indexable_Post_Type_Archive_Indexation_Action_Test.php b/tests/Unit/Actions/Indexing/Indexable_Post_Type_Archive_Indexation_Action_Test.php index bd62b306c38..bc62c5bc0ee 100644 --- a/tests/Unit/Actions/Indexing/Indexable_Post_Type_Archive_Indexation_Action_Test.php +++ b/tests/Unit/Actions/Indexing/Indexable_Post_Type_Archive_Indexation_Action_Test.php @@ -84,7 +84,7 @@ protected function set_up() { $this->repository, $this->builder, $this->post_type, - $this->versions + $this->versions, ); } diff --git a/tests/Unit/Actions/Indexing/Indexable_Term_Indexation_Action_Test.php b/tests/Unit/Actions/Indexing/Indexable_Term_Indexation_Action_Test.php index 1578689cb54..1e0226d664e 100644 --- a/tests/Unit/Actions/Indexing/Indexable_Term_Indexation_Action_Test.php +++ b/tests/Unit/Actions/Indexing/Indexable_Term_Indexation_Action_Test.php @@ -83,7 +83,7 @@ protected function set_up() { $this->taxonomy, $this->repository, $this->wpdb, - $this->versions + $this->versions, ); } @@ -113,7 +113,7 @@ public function test_get_total_unindexed() { [ 'public_taxonomy', 'other_taxonomy', - ] + ], ); $this->wpdb->expects( 'prepare' ) ->once() @@ -158,7 +158,7 @@ public function test_get_limited_unindexed_count() { [ 'public_taxonomy', 'other_taxonomy', - ] + ], ); $this->wpdb->expects( 'prepare' ) @@ -247,7 +247,7 @@ public function test_index() { [ 'public_taxonomy', 'other_taxonomy', - ] + ], ); $this->wpdb->expects( 'prepare' ) ->once() @@ -317,7 +317,7 @@ public function test_index_no_indexables_created() { [ 'public_taxonomy', 'other_taxonomy', - ] + ], ); $this->wpdb->expects( 'prepare' ) ->once() diff --git a/tests/Unit/Actions/Indexing/Indexing_Complete_Action_Test.php b/tests/Unit/Actions/Indexing/Indexing_Complete_Action_Test.php index 721985d869d..3517f539ce5 100644 --- a/tests/Unit/Actions/Indexing/Indexing_Complete_Action_Test.php +++ b/tests/Unit/Actions/Indexing/Indexing_Complete_Action_Test.php @@ -53,7 +53,7 @@ protected function set_up() { public function test_constructor() { self::assertInstanceOf( Indexing_Helper::class, - $this->getPropertyValue( $this->instance, 'indexing_helper' ) + $this->getPropertyValue( $this->instance, 'indexing_helper' ), ); } diff --git a/tests/Unit/Actions/Indexing/Post_Link_Indexing_Action_Test.php b/tests/Unit/Actions/Indexing/Post_Link_Indexing_Action_Test.php index b11d58b0e94..821dcc67f55 100644 --- a/tests/Unit/Actions/Indexing/Post_Link_Indexing_Action_Test.php +++ b/tests/Unit/Actions/Indexing/Post_Link_Indexing_Action_Test.php @@ -89,7 +89,7 @@ protected function set_up() { $this->link_builder, $this->indexable_helper, $this->repository, - $this->wpdb + $this->wpdb, ); $this->instance->set_helper( $this->post_type_helper ); } @@ -106,7 +106,7 @@ public function test_set_helper() { $this->assertInstanceOf( Post_Type_Helper::class, - $this->getPropertyValue( $this->instance, 'post_type_helper' ) + $this->getPropertyValue( $this->instance, 'post_type_helper' ), ); } @@ -357,7 +357,7 @@ public function test_index_without_link_count() { 'ID' => 8, 'post_content' => 'foo', ], - ] + ], ); $indexable = Mockery::mock( Indexable_Mock::class ); diff --git a/tests/Unit/Actions/Indexing/Term_Link_Indexing_Action_Test.php b/tests/Unit/Actions/Indexing/Term_Link_Indexing_Action_Test.php index be632fb931d..c4a3163f16b 100644 --- a/tests/Unit/Actions/Indexing/Term_Link_Indexing_Action_Test.php +++ b/tests/Unit/Actions/Indexing/Term_Link_Indexing_Action_Test.php @@ -89,7 +89,7 @@ protected function set_up() { $this->link_builder, $this->indexable_helper, $this->repository, - $this->wpdb + $this->wpdb, ); $this->instance->set_helper( $this->taxonomy_helper ); } @@ -106,7 +106,7 @@ public function test_set_helper() { $this->assertInstanceOf( Taxonomy_Helper::class, - $this->getPropertyValue( $this->instance, 'taxonomy_helper' ) + $this->getPropertyValue( $this->instance, 'taxonomy_helper' ), ); } @@ -396,7 +396,7 @@ public function test_index_without_link_count() { 'term_id' => 8, 'description' => 'foo', ], - ] + ], ); $indexable = Mockery::mock( Indexable_Mock::class ); diff --git a/tests/Unit/Actions/SEMrush/SEMrush_Login_Action_Test.php b/tests/Unit/Actions/SEMrush/SEMrush_Login_Action_Test.php index 5747721ecc0..01dbb0faad2 100644 --- a/tests/Unit/Actions/SEMrush/SEMrush_Login_Action_Test.php +++ b/tests/Unit/Actions/SEMrush/SEMrush_Login_Action_Test.php @@ -55,7 +55,7 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( SEMrush_Client::class, - $this->getPropertyValue( $this->instance, 'client' ) + $this->getPropertyValue( $this->instance, 'client' ), ); } @@ -70,7 +70,7 @@ public function test_valid_authentication() { $token_data = [ 'access_token' => 'some valid token', 'refresh_token' => 'some valid refresh token', - 'expires' => 99999999, + 'expires' => 99_999_999, 'has_expired' => false, 'created_at' => 0, ]; @@ -81,9 +81,9 @@ public function test_valid_authentication() { [ 'getToken' => '000000', 'getRefreshToken' => '000001', - 'getExpires' => 604800, + 'getExpires' => 604_800, 'hasExpired' => false, - ] + ], ); $tokens_class = Mockery::mock( OAuth_Token::class ); @@ -101,7 +101,7 @@ public function test_valid_authentication() { 'tokens' => $token_data, 'status' => 200, ], - $this->instance->authenticate( '123456' ) + $this->instance->authenticate( '123456' ), ); } @@ -123,7 +123,7 @@ public function test_invalid_authentication() { 'tokens' => [], 'error' => 'Invalid token', 'status' => 500, - ] + ], ); $this->client_instance @@ -137,7 +137,7 @@ public function test_invalid_authentication() { 'error' => 'Invalid token', 'status' => 500, ], - $this->instance->authenticate( '123456' ) + $this->instance->authenticate( '123456' ), ); } } diff --git a/tests/Unit/Actions/SEMrush/SEMrush_Options_Action_Test.php b/tests/Unit/Actions/SEMrush/SEMrush_Options_Action_Test.php index 699ad246b9f..316abd773bf 100644 --- a/tests/Unit/Actions/SEMrush/SEMrush_Options_Action_Test.php +++ b/tests/Unit/Actions/SEMrush/SEMrush_Options_Action_Test.php @@ -52,7 +52,7 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); } @@ -75,7 +75,7 @@ public function test_successful_set_country_code() { 'success' => true, 'status' => 200, ], - $this->instance->set_country_code( 'us' ) + $this->instance->set_country_code( 'us' ), ); } @@ -99,7 +99,7 @@ public function test_unsuccessful_set_country_code() { 'status' => 500, 'error' => 'Could not save option in the database', ], - $this->instance->set_country_code( 'us' ) + $this->instance->set_country_code( 'us' ), ); } } diff --git a/tests/Unit/Actions/SEMrush/SEMrush_Phrases_Action_Test.php b/tests/Unit/Actions/SEMrush/SEMrush_Phrases_Action_Test.php index e4be85ce41f..b4d8e4785fc 100644 --- a/tests/Unit/Actions/SEMrush/SEMrush_Phrases_Action_Test.php +++ b/tests/Unit/Actions/SEMrush/SEMrush_Phrases_Action_Test.php @@ -53,7 +53,7 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( SEMrush_Client::class, - $this->getPropertyValue( $this->instance, 'client' ) + $this->getPropertyValue( $this->instance, 'client' ), ); } @@ -110,7 +110,7 @@ public function test_get_related_keyphrases_from_api() { ], 'status' => 200, ], - $this->instance->get_related_keyphrases( $keyphrase, $country_code ) + $this->instance->get_related_keyphrases( $keyphrase, $country_code ), ); } @@ -135,7 +135,7 @@ public function test_get_related_keyphrases_from_cache() { 'rows' => [], ], 'status' => 200, - ] + ], ); $this->client_instance->expects( 'get' )->times( 0 ); @@ -150,7 +150,7 @@ public function test_get_related_keyphrases_from_cache() { ], 'status' => 200, ], - $this->instance->get_related_keyphrases( $keyphrase, $database ) + $this->instance->get_related_keyphrases( $keyphrase, $database ), ); } } diff --git a/tests/Unit/Actions/Wincher/Wincher_Account_Action_Test.php b/tests/Unit/Actions/Wincher/Wincher_Account_Action_Test.php index 06a9dc02cf1..129643bfd35 100644 --- a/tests/Unit/Actions/Wincher/Wincher_Account_Action_Test.php +++ b/tests/Unit/Actions/Wincher/Wincher_Account_Action_Test.php @@ -50,7 +50,7 @@ protected function set_up() { $this->options_helper = Mockery::mock( Options_Helper::class ); $this->instance = new Wincher_Account_Action( $this->client_instance, - $this->options_helper + $this->options_helper, ); } @@ -64,12 +64,12 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( Wincher_Client::class, - $this->getPropertyValue( $this->instance, 'client' ) + $this->getPropertyValue( $this->instance, 'client' ), ); $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); } @@ -94,7 +94,7 @@ public function test_check_limit() { 'history_days' => 31, ], 'status' => 200, - ] + ], ); $this->assertEquals( @@ -105,7 +105,7 @@ public function test_check_limit() { 'status' => 200, 'historyDays' => 31, ], - $this->instance->check_limit() + $this->instance->check_limit(), ); } @@ -130,7 +130,7 @@ public function test_invalid_check_limit() { 'history_days' => 31, ], 'status' => 200, - ] + ], ); $this->assertEquals( @@ -141,7 +141,7 @@ public function test_invalid_check_limit() { 'status' => 200, 'historyDays' => 31, ], - $this->instance->check_limit() + $this->instance->check_limit(), ); } @@ -160,24 +160,24 @@ public function test_unlimited_check_limit() { [ 'limits' => [ 'keywords' => [ - 'usage' => 100000, + 'usage' => 100_000, 'limit' => null, ], 'history_days' => 31, ], 'status' => 200, - ] + ], ); $this->assertEquals( (object) [ 'canTrack' => true, 'limit' => null, - 'usage' => 100000, + 'usage' => 100_000, 'status' => 200, 'historyDays' => 31, ], - $this->instance->check_limit() + $this->instance->check_limit(), ); } @@ -198,7 +198,7 @@ public function test_invalid_get_upgrade_campaign_type() { 'value' => 0.9, 'months' => 10, 'status' => 200, - ] + ], ); $this->assertEquals( @@ -207,7 +207,7 @@ public function test_invalid_get_upgrade_campaign_type() { 'months' => null, 'status' => 200, ], - $this->instance->get_upgrade_campaign() + $this->instance->get_upgrade_campaign(), ); } @@ -228,7 +228,7 @@ public function test_invalid_get_upgrade_campaign_months() { 'value' => 0.9, 'months' => 0, 'status' => 200, - ] + ], ); $this->assertEquals( @@ -237,7 +237,7 @@ public function test_invalid_get_upgrade_campaign_months() { 'months' => null, 'status' => 200, ], - $this->instance->get_upgrade_campaign() + $this->instance->get_upgrade_campaign(), ); } @@ -258,7 +258,7 @@ public function test_valid_get_upgrade_campaign() { 'value' => 0.9, 'months' => 10, 'status' => 200, - ] + ], ); $this->assertEquals( @@ -267,7 +267,7 @@ public function test_valid_get_upgrade_campaign() { 'months' => 10, 'status' => 200, ], - $this->instance->get_upgrade_campaign() + $this->instance->get_upgrade_campaign(), ); } @@ -290,7 +290,7 @@ public function test_empty_get_upgrade_campaign() { 'months' => null, 'status' => 200, ], - $this->instance->get_upgrade_campaign() + $this->instance->get_upgrade_campaign(), ); } } diff --git a/tests/Unit/Actions/Wincher/Wincher_Keyphrases_Action_Test.php b/tests/Unit/Actions/Wincher/Wincher_Keyphrases_Action_Test.php index 1c1b3afeae2..8e9bbd7fa2e 100644 --- a/tests/Unit/Actions/Wincher/Wincher_Keyphrases_Action_Test.php +++ b/tests/Unit/Actions/Wincher/Wincher_Keyphrases_Action_Test.php @@ -62,7 +62,7 @@ protected function set_up() { $this->instance = new Wincher_Keyphrases_Action( $this->client_instance, $this->options_helper, - $this->indexable_repository + $this->indexable_repository, ); } @@ -76,17 +76,17 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( Wincher_Client::class, - $this->getPropertyValue( $this->instance, 'client' ) + $this->getPropertyValue( $this->instance, 'client' ), ); $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); $this->assertInstanceOf( Indexable_Repository::class, - $this->getPropertyValue( $this->instance, 'indexable_repository' ) + $this->getPropertyValue( $this->instance, 'indexable_repository' ), ); } @@ -122,18 +122,18 @@ public function test_track_keyphrases() { 'keyword' => 'yoast seo', 'groups' => [], ], - ] - ) + ], + ), ) ->andReturns( [ 'data' => [ [ 'keyword' => 'yoast seo', - 'id' => 12345, + 'id' => 12_345, ], ], - ] + ], ); $this->assertEquals( @@ -141,11 +141,11 @@ public function test_track_keyphrases() { 'results' => (object) [ 'yoast seo' => [ 'keyword' => 'yoast seo', - 'id' => 12345, + 'id' => 12_345, ], ], ], - $this->instance->track_keyphrases( [ 'yoast seo' ], $limits ) + $this->instance->track_keyphrases( [ 'yoast seo' ], $limits ), ); } @@ -176,7 +176,7 @@ public function test_track_keyphrases_where_limit_is_reached() { 'error' => 'Account limit exceeded', 'status' => 400, ], - $this->instance->track_keyphrases( [ 'yoast seo' ], $limits ) + $this->instance->track_keyphrases( [ 'yoast seo' ], $limits ), ); } @@ -207,7 +207,7 @@ public function test_track_keyphrases_where_limit_will_be_exceeded() { 'error' => 'Account limit exceeded', 'status' => 400, ], - $this->instance->track_keyphrases( [ 'yoast seo', 'wincher' ], $limits ) + $this->instance->track_keyphrases( [ 'yoast seo', 'wincher' ], $limits ), ); } @@ -233,14 +233,14 @@ public function test_untrack_keyphrase() { [ 'data' => [], 'status' => 200, - ] + ], ); $this->assertEquals( (object) [ 'status' => 200, ], - $this->instance->untrack_keyphrase( 12345 ) + $this->instance->untrack_keyphrase( 12_345 ), ); } @@ -264,7 +264,7 @@ public function test_get_tracked_keyphrases() { [ [ 'primary_focus_keyword' => 'yoast seo' ], [ 'primary_focus_keyword' => 'wincher' ], - ] + ], ); Monkey\Filters\expectApplied( 'wpseo_wincher_all_keyphrases' ); @@ -279,25 +279,25 @@ public function test_get_tracked_keyphrases() { 'keywords' => [ 'yoast seo', 'wincher' ], 'url' => null, 'start_at' => null, - ] + ], ), [ 'timeout' => 60, - ] + ], ) ->andReturns( [ 'data' => [ [ 'keyword' => 'yoast seo', - 'id' => 12345, + 'id' => 12_345, ], [ 'keyword' => 'wincher', - 'id' => 12346, + 'id' => 12_346, ], ], - ] + ], ); $this->assertEquals( @@ -305,15 +305,15 @@ public function test_get_tracked_keyphrases() { 'results' => (object) [ 'yoast seo' => [ 'keyword' => 'yoast seo', - 'id' => 12345, + 'id' => 12_345, ], 'wincher' => [ 'keyword' => 'wincher', - 'id' => 12346, + 'id' => 12_346, ], ], ], - $this->instance->get_tracked_keyphrases() + $this->instance->get_tracked_keyphrases(), ); } @@ -341,23 +341,23 @@ public function test_get_tracked_keyphrases_no_data_key() { 'keywords' => [ 'yoast seo' ], 'url' => null, 'start_at' => null, - ] + ], ), [ 'timeout' => 60, - ] + ], ) ->andReturns( [ 'some_other_key' => [], - ] + ], ); $this->assertEquals( (object) [ 'some_other_key' => [], ], - $this->instance->get_tracked_keyphrases( [ 'yoast seo' ] ) + $this->instance->get_tracked_keyphrases( [ 'yoast seo' ] ), ); } @@ -378,7 +378,7 @@ public function test_get_tracked_keyphrases_does_not_call_api_when_no_keyphrases 'results' => (object) [], 'status' => 200, ], - $this->instance->get_tracked_keyphrases( [] ) + $this->instance->get_tracked_keyphrases( [] ), ); } @@ -406,25 +406,25 @@ public function test_get_tracked_keyphrases_filtered_by_used_keyphrases() { 'keywords' => [ 'yoast seo' ], 'url' => null, 'start_at' => null, - ] + ], ), [ 'timeout' => 60, - ] + ], ) ->andReturns( [ 'data' => [ [ 'keyword' => 'yoast seo', - 'id' => 12345, + 'id' => 12_345, ], [ 'keyword' => 'wincher', - 'id' => 12346, + 'id' => 12_346, ], ], - ] + ], ); $this->assertEquals( @@ -432,11 +432,11 @@ public function test_get_tracked_keyphrases_filtered_by_used_keyphrases() { 'results' => (object) [ 'yoast seo' => [ 'keyword' => 'yoast seo', - 'id' => 12345, + 'id' => 12_345, ], ], ], - $this->instance->get_tracked_keyphrases( [ 'yoast seo' ] ) + $this->instance->get_tracked_keyphrases( [ 'yoast seo' ] ), ); } @@ -464,27 +464,27 @@ public function test_get_tracked_keyphrases_with_permalink() { 'keywords' => [ 'yoast seo', 'blog seo' ], 'url' => 'https://yoast.com/blog/', 'start_at' => null, - ] + ], ), [ 'timeout' => 60, - ] + ], ) ->andReturns( [ 'data' => [ [ 'keyword' => 'yoast seo', - 'id' => 22345, + 'id' => 22_345, 'position' => 20, ], [ 'keyword' => 'blog seo', - 'id' => 22346, + 'id' => 22_346, 'position' => 22, ], ], - ] + ], ); $this->assertEquals( @@ -492,17 +492,17 @@ public function test_get_tracked_keyphrases_with_permalink() { 'results' => (object) [ 'yoast seo' => [ 'keyword' => 'yoast seo', - 'id' => 22345, + 'id' => 22_345, 'position' => 20, ], 'blog seo' => [ 'keyword' => 'blog seo', - 'id' => 22346, + 'id' => 22_346, 'position' => 22, ], ], ], - $this->instance->get_tracked_keyphrases( [ 'yoast seo', 'blog seo' ], 'https://yoast.com/blog/' ) + $this->instance->get_tracked_keyphrases( [ 'yoast seo', 'blog seo' ], 'https://yoast.com/blog/' ), ); } } diff --git a/tests/Unit/Actions/Wincher/Wincher_Login_Action_Test.php b/tests/Unit/Actions/Wincher/Wincher_Login_Action_Test.php index 36822170778..bbb4199dee2 100644 --- a/tests/Unit/Actions/Wincher/Wincher_Login_Action_Test.php +++ b/tests/Unit/Actions/Wincher/Wincher_Login_Action_Test.php @@ -53,7 +53,7 @@ protected function set_up() { $this->options_helper = Mockery::mock( Options_Helper::class ); $this->instance = new Wincher_Login_Action( $this->client_instance, - $this->options_helper + $this->options_helper, ); } @@ -67,12 +67,12 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( Wincher_Client::class, - $this->getPropertyValue( $this->instance, 'client' ) + $this->getPropertyValue( $this->instance, 'client' ), ); $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); } @@ -87,7 +87,7 @@ public function test_valid_authentication() { $token_data = [ 'access_token' => 'some valid token', 'refresh_token' => 'some valid refresh token', - 'expires' => 99999999, + 'expires' => 99_999_999, 'has_expired' => false, 'created_at' => 0, ]; @@ -98,9 +98,9 @@ public function test_valid_authentication() { [ 'getToken' => '000000', 'getRefreshToken' => '000001', - 'getExpires' => 604800, + 'getExpires' => 604_800, 'hasExpired' => false, - ] + ], ); $tokens_class = Mockery::mock( OAuth_Token::class ); @@ -123,7 +123,7 @@ public function test_valid_authentication() { 'tokens' => $token_data, 'status' => 200, ], - $this->instance->authenticate( '123456', '12345' ) + $this->instance->authenticate( '123456', '12345' ), ); } @@ -145,7 +145,7 @@ public function test_invalid_authentication() { 'tokens' => [], 'error' => 'Invalid token', 'status' => 500, - ] + ], ); $this->options_helper @@ -163,7 +163,7 @@ public function test_invalid_authentication() { 'error' => 'Invalid token', 'status' => 500, ], - $this->instance->authenticate( '123456', '12345' ) + $this->instance->authenticate( '123456', '12345' ), ); } } diff --git a/tests/Unit/Admin/Admin_Features_Test.php b/tests/Unit/Admin/Admin_Features_Test.php index 6a94132a0c6..f496c4d7251 100644 --- a/tests/Unit/Admin/Admin_Features_Test.php +++ b/tests/Unit/Admin/Admin_Features_Test.php @@ -32,7 +32,7 @@ private function setup_yoastseo_with_expectations() { $container = $this->create_container_with( [ Url_Helper::class => $url_helper, - ] + ], ); Monkey\Functions\expect( 'YoastSEO' ) diff --git a/tests/Unit/Admin/Capabilities/Capabilities_Utils_Test.php b/tests/Unit/Admin/Capabilities/Capabilities_Utils_Test.php index 10dd1e2b424..de1b79cb7da 100644 --- a/tests/Unit/Admin/Capabilities/Capabilities_Utils_Test.php +++ b/tests/Unit/Admin/Capabilities/Capabilities_Utils_Test.php @@ -40,7 +40,7 @@ protected function set_up() { ->andReturn( [ 'administrator' => 'Administrator', - ] + ], ); Monkey\Functions\expect( 'wp_roles' ) @@ -65,7 +65,7 @@ public function test_get_applicable_users() { 'capabilities' => [ 'wpseo_manage_options' => true, ], - ] + ], ); Monkey\Functions\expect( 'get_users' ) diff --git a/tests/Unit/Admin/Gutenberg_Compatibility_Notification_Test.php b/tests/Unit/Admin/Gutenberg_Compatibility_Notification_Test.php index 7770b36e930..dd16339ba57 100644 --- a/tests/Unit/Admin/Gutenberg_Compatibility_Notification_Test.php +++ b/tests/Unit/Admin/Gutenberg_Compatibility_Notification_Test.php @@ -95,7 +95,7 @@ public function test_manage_notification_remove_notification( $installed, $fully [ 'is_installed' => $installed, 'is_fully_compatible' => $fully_compatible, - ] + ], ); $this->notification_center_mock->expects( 'remove_notification_by_id' )->once()->with( 'wpseo-outdated-gutenberg-plugin' ); @@ -142,7 +142,7 @@ public function test_manage_notification_gutenberg_show_notification() { [ 'is_installed' => true, 'is_fully_compatible' => false, - ] + ], ); Monkey\Functions\expect( 'get_current_user_id' ) @@ -153,7 +153,7 @@ public function test_manage_notification_gutenberg_show_notification() { static function ( $arg ) { // Verify that the added notification is a Yoast_Notification object and has the correct id. return ( \is_a( $arg, Yoast_Notification::class ) && $arg->get_id() === 'wpseo-outdated-gutenberg-plugin' ); - } + }, ); $this->gutenberg_notification->manage_notification(); diff --git a/tests/Unit/Admin/Import/Plugins/Import_AIOSEO_V4_Test.php b/tests/Unit/Admin/Import/Plugins/Import_AIOSEO_V4_Test.php index 3c61ac7d25e..61eff01c12f 100644 --- a/tests/Unit/Admin/Import/Plugins/Import_AIOSEO_V4_Test.php +++ b/tests/Unit/Admin/Import/Plugins/Import_AIOSEO_V4_Test.php @@ -59,7 +59,7 @@ public function test_meta_key_clone_replace() { $wpdb->expects( 'prepare' ) ->with( 'SELECT meta_value FROM tmp_meta_table WHERE meta_value LIKE %s', - '%#custom_field-%' + '%#custom_field-%', ); $wpdb->expects( 'get_col' ) @@ -70,35 +70,35 @@ public function test_meta_key_clone_replace() { '#custom_field-veldje', '#custom_field-some_custom_field #separator_sa #site_title  #custom_field-some_custom_field', '#custom_field-some_custom_field %%hello%% some stuff#site_title  ', - ] + ], ); $wpdb->expects( 'prepare' ) ->with( 'UPDATE tmp_meta_table SET meta_value = REPLACE( meta_value, %s, %s )', '#custom_field-veldje', - '%%cf_veldje%%' + '%%cf_veldje%%', ); $wpdb->expects( 'prepare' ) ->with( 'UPDATE tmp_meta_table SET meta_value = REPLACE( meta_value, %s, %s )', '#custom_field-gras', - '%%cf_gras%%' + '%%cf_gras%%', ); $wpdb->expects( 'prepare' ) ->with( 'UPDATE tmp_meta_table SET meta_value = REPLACE( meta_value, %s, %s )', '#custom_field-groen', - '%%cf_groen%%' + '%%cf_groen%%', ); $wpdb->expects( 'prepare' ) ->with( 'UPDATE tmp_meta_table SET meta_value = REPLACE( meta_value, %s, %s )', '#custom_field-some_custom_field', - '%%cf_some_custom_field%%' + '%%cf_some_custom_field%%', ); // Custom taxonomies. @@ -106,7 +106,7 @@ public function test_meta_key_clone_replace() { $wpdb->expects( 'prepare' ) ->with( 'SELECT meta_value FROM tmp_meta_table WHERE meta_value LIKE %s', - '%#tax_name-%' + '%#tax_name-%', ); $wpdb->expects( 'get_col' ) @@ -115,21 +115,21 @@ public function test_meta_key_clone_replace() { '#post_title#tax_name-taxonomy', 'some text | #tax_name-taxonomy', '#tax_name-taxonomy#tax_name-category', - ] + ], ); $wpdb->expects( 'prepare' ) ->with( 'UPDATE tmp_meta_table SET meta_value = REPLACE( meta_value, %s, %s )', '#tax_name-taxonomy', - '%%ct_taxonomy%%' + '%%ct_taxonomy%%', ); $wpdb->expects( 'prepare' ) ->with( 'UPDATE tmp_meta_table SET meta_value = REPLACE( meta_value, %s, %s )', '#tax_name-category', - '%%ct_category%%' + '%%ct_category%%', ); // The `$replace_values` argument is not used by the class, so pass an empty array. @@ -163,7 +163,7 @@ public function test_meta_key_clone_replace_no_custom_field_replace_vars() { $wpdb->expects( 'prepare' ) ->with( 'SELECT meta_value FROM tmp_meta_table WHERE meta_value LIKE %s', - '%#custom_field-%' + '%#custom_field-%', ); $wpdb->expects( 'get_col' ) @@ -174,7 +174,7 @@ public function test_meta_key_clone_replace_no_custom_field_replace_vars() { $wpdb->expects( 'prepare' ) ->with( 'SELECT meta_value FROM tmp_meta_table WHERE meta_value LIKE %s', - '%#tax_name-%' + '%#tax_name-%', ); $wpdb->expects( 'get_col' ) @@ -221,7 +221,7 @@ private function set_replace_vars_prepare_expectations( $wpdb ) { ->with( 'UPDATE tmp_meta_table SET meta_value = REPLACE( meta_value, %s, %s )', $aioseo_variable, - $yoast_variable + $yoast_variable, ); } } diff --git a/tests/Unit/Admin/Import/Plugins/Importers_Test.php b/tests/Unit/Admin/Import/Plugins/Importers_Test.php index e7238d27b9c..57505a87682 100644 --- a/tests/Unit/Admin/Import/Plugins/Importers_Test.php +++ b/tests/Unit/Admin/Import/Plugins/Importers_Test.php @@ -40,7 +40,7 @@ public function test_get_importers() { 'WPSEO_Import_WooThemes_SEO', 'WPSEO_Import_WPSEO', ], - WPSEO_Plugin_Importers::get() + WPSEO_Plugin_Importers::get(), ); } } diff --git a/tests/Unit/Admin/Input_Validation_Test.php b/tests/Unit/Admin/Input_Validation_Test.php index 14e17914df7..c401c20869d 100644 --- a/tests/Unit/Admin/Input_Validation_Test.php +++ b/tests/Unit/Admin/Input_Validation_Test.php @@ -48,7 +48,7 @@ public function test_document_title_updated_with_error() { 'message' => 'This is the error message', 'type' => 'error', ], - ] + ], ); $title_with_error_message = Yoast_Input_Validation::add_yoast_admin_document_title_errors( $admin_title ); @@ -83,7 +83,7 @@ public function test_document_title_updated_with_errors() { 'message' => 'This is the second error message', 'type' => 'error', ], - ] + ], ); $title_with_error_message = Yoast_Input_Validation::add_yoast_admin_document_title_errors( $admin_title ); @@ -112,7 +112,7 @@ public function test_document_title_not_updated_with_non_yoast_errors() { 'message' => 'This is the error message', 'type' => 'error', ], - ] + ], ); $title_with_error_message = Yoast_Input_Validation::add_yoast_admin_document_title_errors( $admin_title ); @@ -141,7 +141,7 @@ public function test_document_title_not_updated_with_settings_updated_error() { 'message' => 'This is the error message', 'type' => 'error', ], - ] + ], ); $title_with_error_message = Yoast_Input_Validation::add_yoast_admin_document_title_errors( $admin_title ); diff --git a/tests/Unit/Admin/Metabox/Metabox_Collapsibles_Sections_Test.php b/tests/Unit/Admin/Metabox/Metabox_Collapsibles_Sections_Test.php index 5c631f678ea..d7defd99db3 100644 --- a/tests/Unit/Admin/Metabox/Metabox_Collapsibles_Sections_Test.php +++ b/tests/Unit/Admin/Metabox/Metabox_Collapsibles_Sections_Test.php @@ -48,13 +48,13 @@ public function test_display_content_with_collapsible( $expected ) { $collapsibles[] = new WPSEO_Metabox_Collapsible( 'collapsible-1', 'Collapsible 1 content', - 'Collapsible 1 label' + 'Collapsible 1 label', ); $section = new WPSEO_Metabox_Collapsibles_Sections( 'collapsibles-tab', 'Metabox Tab Title', - $collapsibles + $collapsibles, ); $section->display_content(); @@ -95,13 +95,13 @@ public function test_display_link_with_collapsible() { $collapsibles[] = new WPSEO_Metabox_Collapsible( 'collapsible-1', 'Collapsible 1 content', - 'Collapsible 1 label' + 'Collapsible 1 label', ); $section = new WPSEO_Metabox_Collapsibles_Sections( 'collapsibles-tab', 'Metabox Tab Title', - $collapsibles + $collapsibles, ); $section->display_link(); diff --git a/tests/Unit/Admin/Metabox/Metabox_Editor_Test.php b/tests/Unit/Admin/Metabox/Metabox_Editor_Test.php index 4f33e97dc36..b9b945ee420 100644 --- a/tests/Unit/Admin/Metabox/Metabox_Editor_Test.php +++ b/tests/Unit/Admin/Metabox/Metabox_Editor_Test.php @@ -154,7 +154,7 @@ public function test_add_custom_element_other_properties() { [ 'custom_elements' => '', 'other_property' => 'hello world', - ] + ], ); \ksort( $actual ); diff --git a/tests/Unit/Admin/Metabox/Metabox_Section_Additional_Test.php b/tests/Unit/Admin/Metabox/Metabox_Section_Additional_Test.php index 342fa146a9c..861b6ee1402 100644 --- a/tests/Unit/Admin/Metabox/Metabox_Section_Additional_Test.php +++ b/tests/Unit/Admin/Metabox/Metabox_Section_Additional_Test.php @@ -77,7 +77,7 @@ public function test_display_link( $expected ) { [ 'link_class' => 'additional-class', 'link_aria_label' => 'additional-aria', - ] + ], ); $section->display_link(); @@ -114,7 +114,7 @@ public function test_display_link_no_aria_label() { 'additional-tab', 'Additional Tab', 'Additional Content', - [ 'link_class' => 'additional-class' ] + [ 'link_class' => 'additional-class' ], ); $section->display_link(); diff --git a/tests/Unit/Admin/Metabox/Metabox_Test.php b/tests/Unit/Admin/Metabox/Metabox_Test.php index 16cff0e539b..b1d5a020ae1 100644 --- a/tests/Unit/Admin/Metabox/Metabox_Test.php +++ b/tests/Unit/Admin/Metabox/Metabox_Test.php @@ -79,7 +79,7 @@ public function test_get_additional_meta_sections() { 'link_aria_label' => 'this-is-a-tab', ], ], - ] + ], ); $actual = $this->instance->get_additional_tabs(); @@ -112,7 +112,7 @@ public function test_get_additional_meta_sections_ignores_non_arrays() { 'content' => 'Testing 1 2 3', ], 123, - ] + ], ); $actual = $this->instance->get_additional_tabs(); @@ -142,7 +142,7 @@ public function test_get_additional_meta_sections_ignores_invalid_sections() { 'link_content' => 'Testing Tab', 'content' => 'Testing 1 2 3', ], - ] + ], ); $actual = $this->instance->get_additional_tabs(); diff --git a/tests/Unit/Admin/MyYoast_Proxy_Test.php b/tests/Unit/Admin/MyYoast_Proxy_Test.php index a7c6e74ea4e..bd9adcaf176 100644 --- a/tests/Unit/Admin/MyYoast_Proxy_Test.php +++ b/tests/Unit/Admin/MyYoast_Proxy_Test.php @@ -221,7 +221,7 @@ public function test_render_proxy_page_for_the_research_webworker_file() { ->method( 'set_header' ) ->withConsecutive( [ 'Content-Type: text/javascript; charset=UTF-8' ], - [ 'Cache-Control: max-age=' . WPSEO_MyYoast_Proxy::CACHE_CONTROL_MAX_AGE ] + [ 'Cache-Control: max-age=' . WPSEO_MyYoast_Proxy::CACHE_CONTROL_MAX_AGE ], ); $instance @@ -280,7 +280,7 @@ public function test_render_proxy_page_for_the_research_webworker_file_errored_a [ 'Cache-Control: max-age=' . WPSEO_MyYoast_Proxy::CACHE_CONTROL_MAX_AGE ], [ 'Content-Type: text/plain' ], [ 'Cache-Control: max-age=0' ], - [ 'HTTP/1.0 500 Received unexpected response from MyYoast' ] + [ 'HTTP/1.0 500 Received unexpected response from MyYoast' ], ); $instance->render_proxy_page(); diff --git a/tests/Unit/Admin/Plugin_Availability_Test.php b/tests/Unit/Admin/Plugin_Availability_Test.php index bb2d82f357e..71637e9840e 100644 --- a/tests/Unit/Admin/Plugin_Availability_Test.php +++ b/tests/Unit/Admin/Plugin_Availability_Test.php @@ -53,7 +53,7 @@ public function test_get_plugins_with_dependencies() { $container = $this->create_container_with( [ Short_Link_Helper::class => $short_link, - ] + ], ); Monkey\Functions\expect( 'YoastSEO' ) @@ -78,7 +78,7 @@ public function test_get_plugins_with_dependencies() { 'premium' => true, ], ], - $this->instance->get_plugins_with_dependencies() + $this->instance->get_plugins_with_dependencies(), ); } @@ -97,7 +97,7 @@ public function test_get_dependencies() { $container = $this->create_container_with( [ Short_Link_Helper::class => $short_link, - ] + ], ); Monkey\Functions\expect( 'YoastSEO' ) @@ -138,7 +138,7 @@ public function test_dependencies_are_satisfied() { $container = $this->create_container_with( [ Short_Link_Helper::class => $short_link, - ] + ], ); Monkey\Functions\expect( 'YoastSEO' ) diff --git a/tests/Unit/Admin/Suggested_Plugins_Construct_Test.php b/tests/Unit/Admin/Suggested_Plugins_Construct_Test.php index 2a86509deb7..071cd320d18 100644 --- a/tests/Unit/Admin/Suggested_Plugins_Construct_Test.php +++ b/tests/Unit/Admin/Suggested_Plugins_Construct_Test.php @@ -22,12 +22,12 @@ final class Suggested_Plugins_Construct_Test extends Suggested_Plugins_TestCase public function test_construct() { $this->assertInstanceOf( WPSEO_Plugin_Availability::class, - $this->getPropertyValue( $this->instance, 'availability_checker' ) + $this->getPropertyValue( $this->instance, 'availability_checker' ), ); $this->assertInstanceOf( Yoast_Notification_Center::class, - $this->getPropertyValue( $this->instance, 'notification_center' ) + $this->getPropertyValue( $this->instance, 'notification_center' ), ); } } diff --git a/tests/Unit/Admin/Suggested_Plugins_Register_Hooks_Test.php b/tests/Unit/Admin/Suggested_Plugins_Register_Hooks_Test.php index e34fca92371..4482b665efd 100644 --- a/tests/Unit/Admin/Suggested_Plugins_Register_Hooks_Test.php +++ b/tests/Unit/Admin/Suggested_Plugins_Register_Hooks_Test.php @@ -23,16 +23,16 @@ public function test_register_hooks() { 10, \has_action( 'admin_init', - [ $this->availability_checker, 'register' ] - ) + [ $this->availability_checker, 'register' ], + ), ); $this->assertEquals( 10, \has_action( 'admin_init', - [ $this->instance, 'add_notifications' ] - ) + [ $this->instance, 'add_notifications' ], + ), ); } } diff --git a/tests/Unit/Admin/Tracking/Tracking_Test.php b/tests/Unit/Admin/Tracking/Tracking_Test.php index 2708fff9105..568be2013fc 100644 --- a/tests/Unit/Admin/Tracking/Tracking_Test.php +++ b/tests/Unit/Admin/Tracking/Tracking_Test.php @@ -29,7 +29,7 @@ public function test_constructor_empty_if_not_in_production() { Monkey\Functions\stubs( [ 'wp_get_environment_type' => 'development', - ] + ], ); WPSEO_Options::set( 'tracking', true ); @@ -62,7 +62,7 @@ public function test_constructor_not_empty_if_in_production() { Monkey\Functions\stubs( [ 'wp_get_environment_type' => 'production', - ] + ], ); WPSEO_Options::set( 'tracking', true ); @@ -96,7 +96,7 @@ public function test_get_collector() { [ Missing_Indexables_Collector::class => Mockery::mock( Missing_Indexables_Collector::class ), To_Be_Cleaned_Indexables_Collector::class => Mockery::mock( To_Be_Cleaned_Indexables_Collector::class ), - ] + ], ); Monkey\Functions\expect( 'YoastSEO' ) diff --git a/tests/Unit/Admin/Views/Feature_Toggles_Test.php b/tests/Unit/Admin/Views/Feature_Toggles_Test.php index 9f7684bf028..c4cbd7a6a78 100644 --- a/tests/Unit/Admin/Views/Feature_Toggles_Test.php +++ b/tests/Unit/Admin/Views/Feature_Toggles_Test.php @@ -122,7 +122,7 @@ public function test_feature_toggles() { $container = $this->create_container_with( [ Short_Link_Helper::class => $short_link_mock, - ] + ], ); Functions\expect( 'YoastSEO' ) @@ -197,7 +197,7 @@ public function test_toggle_sorting() { $container = $this->create_container_with( [ Short_Link_Helper::class => $short_link_mock, - ] + ], ); Functions\expect( 'YoastSEO' ) diff --git a/tests/Unit/Alerts/Application/Default_SEO_Data/Abstract_Default_SEO_Data_Alert_Test.php b/tests/Unit/Alerts/Application/Default_SEO_Data/Abstract_Default_SEO_Data_Alert_Test.php index b6645ceb48a..45611b6a835 100644 --- a/tests/Unit/Alerts/Application/Default_SEO_Data/Abstract_Default_SEO_Data_Alert_Test.php +++ b/tests/Unit/Alerts/Application/Default_SEO_Data/Abstract_Default_SEO_Data_Alert_Test.php @@ -93,7 +93,7 @@ protected function set_up() { $this->short_link_helper, $this->product_helper, $this->indexable_helper, - $this->post_type_helper + $this->post_type_helper, ); } } diff --git a/tests/Unit/Alerts/Application/Default_SEO_Data/Default_SEO_Data_Alert_Add_Notifications_Test.php b/tests/Unit/Alerts/Application/Default_SEO_Data/Default_SEO_Data_Alert_Add_Notifications_Test.php index cc0252cf173..82e4d6bc24d 100644 --- a/tests/Unit/Alerts/Application/Default_SEO_Data/Default_SEO_Data_Alert_Add_Notifications_Test.php +++ b/tests/Unit/Alerts/Application/Default_SEO_Data/Default_SEO_Data_Alert_Add_Notifications_Test.php @@ -118,7 +118,7 @@ public function test_add_notifications( static function ( $notification ) use ( $expected_message ) { $notification_array = $notification->to_array(); return $notification_array['message'] === $expected_message; - } + }, ); $this->instance->add_notifications(); diff --git a/tests/Unit/Alerts/Application/Default_SEO_Data/Default_SEO_Data_Alert_Constructor_Test.php b/tests/Unit/Alerts/Application/Default_SEO_Data/Default_SEO_Data_Alert_Constructor_Test.php index a22b89e403d..0dd7aaedf88 100644 --- a/tests/Unit/Alerts/Application/Default_SEO_Data/Default_SEO_Data_Alert_Constructor_Test.php +++ b/tests/Unit/Alerts/Application/Default_SEO_Data/Default_SEO_Data_Alert_Constructor_Test.php @@ -29,27 +29,27 @@ final class Default_SEO_Data_Alert_Constructor_Test extends Abstract_Default_SEO public function test_constructor() { $this->assertInstanceOf( Yoast_Notification_Center::class, - $this->getPropertyValue( $this->instance, 'notification_center' ) + $this->getPropertyValue( $this->instance, 'notification_center' ), ); $this->assertInstanceOf( Default_SEO_Data_Collector::class, - $this->getPropertyValue( $this->instance, 'default_seo_data_collector' ) + $this->getPropertyValue( $this->instance, 'default_seo_data_collector' ), ); $this->assertInstanceOf( Short_Link_Helper::class, - $this->getPropertyValue( $this->instance, 'short_link_helper' ) + $this->getPropertyValue( $this->instance, 'short_link_helper' ), ); $this->assertInstanceOf( Product_Helper::class, - $this->getPropertyValue( $this->instance, 'product_helper' ) + $this->getPropertyValue( $this->instance, 'product_helper' ), ); $this->assertInstanceOf( Indexable_Helper::class, - $this->getPropertyValue( $this->instance, 'indexable_helper' ) + $this->getPropertyValue( $this->instance, 'indexable_helper' ), ); $this->assertInstanceOf( Post_Type_Helper::class, - $this->getPropertyValue( $this->instance, 'post_type_helper' ) + $this->getPropertyValue( $this->instance, 'post_type_helper' ), ); } } diff --git a/tests/Unit/Alerts/Application/Default_SEO_Data/Default_SEO_Data_Alert_Register_Hooks_Test.php b/tests/Unit/Alerts/Application/Default_SEO_Data/Default_SEO_Data_Alert_Register_Hooks_Test.php index 9246c783016..ae0310aaaad 100644 --- a/tests/Unit/Alerts/Application/Default_SEO_Data/Default_SEO_Data_Alert_Register_Hooks_Test.php +++ b/tests/Unit/Alerts/Application/Default_SEO_Data/Default_SEO_Data_Alert_Register_Hooks_Test.php @@ -26,8 +26,8 @@ public function test_register_hooks() { 10, \has_action( 'admin_init', - [ $this->instance, 'add_notifications' ] - ) + [ $this->instance, 'add_notifications' ], + ), ); } } diff --git a/tests/Unit/Alerts/Infrastructure/Default_SEO_Data/Abstract_Default_SEO_Data_Collector_Test.php b/tests/Unit/Alerts/Infrastructure/Default_SEO_Data/Abstract_Default_SEO_Data_Collector_Test.php index db861aac8e7..1a6ff654076 100644 --- a/tests/Unit/Alerts/Infrastructure/Default_SEO_Data/Abstract_Default_SEO_Data_Collector_Test.php +++ b/tests/Unit/Alerts/Infrastructure/Default_SEO_Data/Abstract_Default_SEO_Data_Collector_Test.php @@ -40,7 +40,7 @@ protected function set_up() { $this->options_helper = Mockery::mock( Options_Helper::class ); $this->instance = new Default_SEO_Data_Collector( - $this->options_helper + $this->options_helper, ); } } diff --git a/tests/Unit/Alerts/Infrastructure/Default_SEO_Data/Default_SEO_Data_Alert_Constructor_Test.php b/tests/Unit/Alerts/Infrastructure/Default_SEO_Data/Default_SEO_Data_Alert_Constructor_Test.php index 098272231d3..7e07eafd65c 100644 --- a/tests/Unit/Alerts/Infrastructure/Default_SEO_Data/Default_SEO_Data_Alert_Constructor_Test.php +++ b/tests/Unit/Alerts/Infrastructure/Default_SEO_Data/Default_SEO_Data_Alert_Constructor_Test.php @@ -24,7 +24,7 @@ final class Default_SEO_Data_Alert_Constructor_Test extends Abstract_Default_SEO public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); } } diff --git a/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Cron_Callback/Abstract_Default_SEO_Data_Cron_Callback_Integration_Test.php b/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Cron_Callback/Abstract_Default_SEO_Data_Cron_Callback_Integration_Test.php index 32f9103771b..ef88ac25254 100644 --- a/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Cron_Callback/Abstract_Default_SEO_Data_Cron_Callback_Integration_Test.php +++ b/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Cron_Callback/Abstract_Default_SEO_Data_Cron_Callback_Integration_Test.php @@ -63,7 +63,7 @@ protected function set_up() { $this->instance = new Default_SEO_Data_Cron_Callback_Integration( $this->options_helper, $this->scheduler, - $this->indexable_repository + $this->indexable_repository, ); } } diff --git a/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Cron_Callback/Default_SEO_Data_Cron_Callback_Integration_Constructor_Test.php b/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Cron_Callback/Default_SEO_Data_Cron_Callback_Integration_Constructor_Test.php index 59fbf588ee2..399884ee994 100644 --- a/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Cron_Callback/Default_SEO_Data_Cron_Callback_Integration_Constructor_Test.php +++ b/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Cron_Callback/Default_SEO_Data_Cron_Callback_Integration_Constructor_Test.php @@ -27,15 +27,15 @@ final class Default_SEO_Data_Cron_Callback_Integration_Constructor_Test extends public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); $this->assertInstanceOf( Default_SEO_Data_Cron_Scheduler::class, - $this->getPropertyValue( $this->instance, 'scheduler' ) + $this->getPropertyValue( $this->instance, 'scheduler' ), ); $this->assertInstanceOf( Indexable_Repository::class, - $this->getPropertyValue( $this->instance, 'indexable_repository' ) + $this->getPropertyValue( $this->instance, 'indexable_repository' ), ); } } diff --git a/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Cron_Scheduler/Default_SEO_Data_Cron_Scheduler_Schedule_Default_SEO_Data_Detection_Test.php b/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Cron_Scheduler/Default_SEO_Data_Cron_Scheduler_Schedule_Default_SEO_Data_Detection_Test.php index 41f9399ddd2..85f2b7b9d1a 100644 --- a/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Cron_Scheduler/Default_SEO_Data_Cron_Scheduler_Schedule_Default_SEO_Data_Detection_Test.php +++ b/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Cron_Scheduler/Default_SEO_Data_Cron_Scheduler_Schedule_Default_SEO_Data_Detection_Test.php @@ -50,7 +50,7 @@ public function test_schedule_default_seo_data_detection( */ public static function schedule_default_seo_data_detection_provider() { yield 'Cron already scheduled - do not schedule again' => [ - 'wp_next_scheduled_result' => 1234567890, + 'wp_next_scheduled_result' => 1_234_567_890, 'wp_schedule_event_times' => 0, ]; diff --git a/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Cron_Scheduler/Default_SEO_Data_Cron_Scheduler_Unschedule_Default_SEO_Data_Detection_Test.php b/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Cron_Scheduler/Default_SEO_Data_Cron_Scheduler_Unschedule_Default_SEO_Data_Detection_Test.php index 6c0b6ae9d8d..47f306b6b3e 100644 --- a/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Cron_Scheduler/Default_SEO_Data_Cron_Scheduler_Unschedule_Default_SEO_Data_Detection_Test.php +++ b/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Cron_Scheduler/Default_SEO_Data_Cron_Scheduler_Unschedule_Default_SEO_Data_Detection_Test.php @@ -56,7 +56,7 @@ public static function unschedule_default_seo_data_detection_provider() { ]; yield 'Cron scheduled - unschedule it' => [ - 'wp_next_scheduled_result' => 1234567890, + 'wp_next_scheduled_result' => 1_234_567_890, 'wp_unschedule_event_times' => 1, ]; } diff --git a/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Watcher/Abstract_Default_SEO_Data_Watcher_Test.php b/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Watcher/Abstract_Default_SEO_Data_Watcher_Test.php index 41216cb243a..c6d7ab7c358 100644 --- a/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Watcher/Abstract_Default_SEO_Data_Watcher_Test.php +++ b/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Watcher/Abstract_Default_SEO_Data_Watcher_Test.php @@ -53,7 +53,7 @@ protected function set_up() { $this->instance = new Default_SEO_Data_Watcher( $this->indexable_repository, - $this->options_helper + $this->options_helper, ); } } diff --git a/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Watcher/Default_SEO_Data_Watcher_Constructor_Test.php b/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Watcher/Default_SEO_Data_Watcher_Constructor_Test.php index b75cd2fccf0..f52c44dcb7a 100644 --- a/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Watcher/Default_SEO_Data_Watcher_Constructor_Test.php +++ b/tests/Unit/Alerts/User_Interface/Default_SEO_Data/Watcher/Default_SEO_Data_Watcher_Constructor_Test.php @@ -26,11 +26,11 @@ final class Default_SEO_Data_Watcher_Constructor_Test extends Abstract_Default_S public function test_constructor() { $this->assertInstanceOf( Indexable_Repository::class, - $this->getPropertyValue( $this->instance, 'indexable_repository' ) + $this->getPropertyValue( $this->instance, 'indexable_repository' ), ); $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); } } diff --git a/tests/Unit/Analytics/Application/Missing_Indexables_Collector_Test.php b/tests/Unit/Analytics/Application/Missing_Indexables_Collector_Test.php index e0730a5cab5..e657f7f9b22 100644 --- a/tests/Unit/Analytics/Application/Missing_Indexables_Collector_Test.php +++ b/tests/Unit/Analytics/Application/Missing_Indexables_Collector_Test.php @@ -36,7 +36,7 @@ public function test_collector_get( $additional_indexation_actions, $initial_ind $sut = new Missing_Indexables_Collector( $initial_indexation_actions ); $this->assertEquals( $expected_result, - $sut->get() + $sut->get(), ); } diff --git a/tests/Unit/Analytics/Application/To_Be_Cleaned_Indexables_Collector_Test.php b/tests/Unit/Analytics/Application/To_Be_Cleaned_Indexables_Collector_Test.php index bbbfb8372be..a5801be7113 100644 --- a/tests/Unit/Analytics/Application/To_Be_Cleaned_Indexables_Collector_Test.php +++ b/tests/Unit/Analytics/Application/To_Be_Cleaned_Indexables_Collector_Test.php @@ -122,7 +122,7 @@ public function test_collector_get(): void { ], ], ], - $this->sut->get() + $this->sut->get(), ); } } diff --git a/tests/Unit/Analytics/Domain/Missing_Indexable_Bucket_Test.php b/tests/Unit/Analytics/Domain/Missing_Indexable_Bucket_Test.php index 1ca08094516..ba5ca076408 100644 --- a/tests/Unit/Analytics/Domain/Missing_Indexable_Bucket_Test.php +++ b/tests/Unit/Analytics/Domain/Missing_Indexable_Bucket_Test.php @@ -53,7 +53,7 @@ public function test_missing_indexable_bucket(): void { 'count' => 0, ], ], - $this->sut->to_array() + $this->sut->to_array(), ); } } diff --git a/tests/Unit/Analytics/Domain/Missing_Indexable_Count_Test.php b/tests/Unit/Analytics/Domain/Missing_Indexable_Count_Test.php index b83f2769756..7f8885c3741 100644 --- a/tests/Unit/Analytics/Domain/Missing_Indexable_Count_Test.php +++ b/tests/Unit/Analytics/Domain/Missing_Indexable_Count_Test.php @@ -44,7 +44,7 @@ public function test_missing_indexable_count_to_array(): void { 'indexable_type' => 'indexable_type', 'count' => 0, ], - $this->sut->to_array() + $this->sut->to_array(), ); } diff --git a/tests/Unit/Analytics/Domain/To_Be_Cleaned_Indexable_Bucket_Test.php b/tests/Unit/Analytics/Domain/To_Be_Cleaned_Indexable_Bucket_Test.php index 1e64251cf46..f947146eb5c 100644 --- a/tests/Unit/Analytics/Domain/To_Be_Cleaned_Indexable_Bucket_Test.php +++ b/tests/Unit/Analytics/Domain/To_Be_Cleaned_Indexable_Bucket_Test.php @@ -53,7 +53,7 @@ public function test_missing_indexable_bucket(): void { 'cleanup_name' => 'cleanup_name', ], ], - $this->sut->to_array() + $this->sut->to_array(), ); } } diff --git a/tests/Unit/Analytics/Domain/To_Be_Cleaned_Indexable_Count_Test.php b/tests/Unit/Analytics/Domain/To_Be_Cleaned_Indexable_Count_Test.php index 096144984f6..9026f4f4f0a 100644 --- a/tests/Unit/Analytics/Domain/To_Be_Cleaned_Indexable_Count_Test.php +++ b/tests/Unit/Analytics/Domain/To_Be_Cleaned_Indexable_Count_Test.php @@ -44,7 +44,7 @@ public function test_to_be_cleaned_count_to_array(): void { 'count' => 0, 'cleanup_name' => 'cleanup_name', ], - $this->sut->to_array() + $this->sut->to_array(), ); } diff --git a/tests/Unit/Analytics/User_Interface/Last_Completed_Indexation_Integration_Test.php b/tests/Unit/Analytics/User_Interface/Last_Completed_Indexation_Integration_Test.php index 54058f66c49..6ddd095aaed 100644 --- a/tests/Unit/Analytics/User_Interface/Last_Completed_Indexation_Integration_Test.php +++ b/tests/Unit/Analytics/User_Interface/Last_Completed_Indexation_Integration_Test.php @@ -97,6 +97,6 @@ public function test_maybe_set_indexables_unindexed_calculated_with_many_indexab ->with( 'update_option_wpseo', [ 'WPSEO_Utils', 'clear_cache' ] ) ->never(); - $this->sut->maybe_set_indexables_unindexed_calculated( 'name', 100000 ); + $this->sut->maybe_set_indexables_unindexed_calculated( 'name', 100_000 ); } } diff --git a/tests/Unit/Builders/Indexable_Author_Builder_Test.php b/tests/Unit/Builders/Indexable_Author_Builder_Test.php index df0f97b91d9..130fbcf16a9 100644 --- a/tests/Unit/Builders/Indexable_Author_Builder_Test.php +++ b/tests/Unit/Builders/Indexable_Author_Builder_Test.php @@ -207,14 +207,14 @@ public function test_build() { AND p.%i = '' AND p.%i = %d ", - [ 'post_modified_gmt', 'post_date_gmt', $this->wpdb->posts, 'post_status', 'publish', 'post_password', 'post_author', 1 ] + [ 'post_modified_gmt', 'post_date_gmt', $this->wpdb->posts, 'post_status', 'publish', 'post_password', 'post_author', 1 ], )->andReturn( 'PREPARED_QUERY' ); $this->wpdb->expects( 'get_row' )->once()->with( 'PREPARED_QUERY' )->andReturn( (object) [ 'last_modified' => '1234-12-12 00:00:00', 'published_at' => '1234-12-12 00:00:00', - ] + ], ); $this->indexable_mock->orm->expects( 'set' )->with( 'object_published_at', '1234-12-12 00:00:00' ); @@ -293,14 +293,14 @@ public function test_build_when_user_is_explicitly_included_by_filter() { AND p.%i = '' AND p.%i = %d ", - [ 'post_modified_gmt', 'post_date_gmt', $this->wpdb->posts, 'post_status', 'publish', 'post_password', 'post_author', 1 ] + [ 'post_modified_gmt', 'post_date_gmt', $this->wpdb->posts, 'post_status', 'publish', 'post_password', 'post_author', 1 ], )->andReturn( 'PREPARED_QUERY' ); $this->wpdb->expects( 'get_row' )->once()->with( 'PREPARED_QUERY' )->andReturn( (object) [ 'last_modified' => '1234-12-12 00:00:00', 'published_at' => '1234-12-12 00:00:00', - ] + ], ); $this->indexable_mock->orm->expects( 'set' )->with( 'object_published_at', '1234-12-12 00:00:00' ); @@ -372,14 +372,14 @@ public function test_build_without_alternative_image() { AND p.%i = '' AND p.%i = %d ", - [ 'post_modified_gmt', 'post_date_gmt', $this->wpdb->posts, 'post_status', 'publish', 'post_password', 'post_author', 1 ] + [ 'post_modified_gmt', 'post_date_gmt', $this->wpdb->posts, 'post_status', 'publish', 'post_password', 'post_author', 1 ], )->andReturn( 'PREPARED_QUERY' ); $this->wpdb->expects( 'get_row' )->once()->with( 'PREPARED_QUERY' )->andReturn( (object) [ 'last_modified' => '1234-12-12 00:00:00', 'published_at' => '1234-12-12 00:00:00', - ] + ], ); $this->indexable_mock->orm->expects( 'set' )->with( 'object_published_at', '1234-12-12 00:00:00' ); @@ -392,7 +392,7 @@ public function test_build_without_alternative_image() { [ 'size' => 500, 'scheme' => 'https', - ] + ], ) ->andReturn( '' ); @@ -463,14 +463,14 @@ public function test_build_with_undefined_author_meta() { AND p.%i = '' AND p.%i = %d ", - [ 'post_modified_gmt', 'post_date_gmt', $this->wpdb->posts, 'post_status', 'publish', 'post_password', 'post_author', 1 ] + [ 'post_modified_gmt', 'post_date_gmt', $this->wpdb->posts, 'post_status', 'publish', 'post_password', 'post_author', 1 ], )->andReturn( 'PREPARED_QUERY' ); $this->wpdb->expects( 'get_row' )->once()->with( 'PREPARED_QUERY' )->andReturn( (object) [ 'last_modified' => '1234-12-12 00:00:00', 'published_at' => '1234-12-12 00:00:00', - ] + ], ); $this->indexable_mock->orm->expects( 'set' )->with( 'object_published_at', '1234-12-12 00:00:00' ); diff --git a/tests/Unit/Builders/Indexable_Builder/Abstract_Indexable_Builder_TestCase.php b/tests/Unit/Builders/Indexable_Builder/Abstract_Indexable_Builder_TestCase.php index c96849448d8..910fdc0a592 100644 --- a/tests/Unit/Builders/Indexable_Builder/Abstract_Indexable_Builder_TestCase.php +++ b/tests/Unit/Builders/Indexable_Builder/Abstract_Indexable_Builder_TestCase.php @@ -177,7 +177,7 @@ protected function set_up() { $this->primary_term_builder, $this->indexable_helper, $this->version_manager, - $this->link_builder + $this->link_builder, ); $this->instance->set_indexable_repository( $this->indexable_repository ); diff --git a/tests/Unit/Builders/Indexable_Builder/Build_Test.php b/tests/Unit/Builders/Indexable_Builder/Build_Test.php index 91e5ee6b4a3..7c266764396 100644 --- a/tests/Unit/Builders/Indexable_Builder/Build_Test.php +++ b/tests/Unit/Builders/Indexable_Builder/Build_Test.php @@ -166,7 +166,7 @@ static function ( $indexable ) { $indexable->version = 2; return $indexable; - } + }, ); $this->expect_save_indexable( $this->indexable ); @@ -254,7 +254,7 @@ static function ( $indexable ) { $indexable->version = 2; return $indexable; - } + }, ); $expected_indexable = clone $empty_indexable; @@ -301,7 +301,7 @@ static function ( $indexable ) { $indexable->version = 2; return $indexable; - } + }, ); $expected_indexable = clone $this->indexable; diff --git a/tests/Unit/Builders/Indexable_Builder/Ensure_Indexable_Test.php b/tests/Unit/Builders/Indexable_Builder/Ensure_Indexable_Test.php index b7956215b9a..58d84fc03ae 100644 --- a/tests/Unit/Builders/Indexable_Builder/Ensure_Indexable_Test.php +++ b/tests/Unit/Builders/Indexable_Builder/Ensure_Indexable_Test.php @@ -41,7 +41,7 @@ protected function set_up() { $this->primary_term_builder, $this->indexable_helper, $this->version_manager, - $this->link_builder + $this->link_builder, ); $this->instance->set_indexable_repository( $this->indexable_repository ); diff --git a/tests/Unit/Builders/Indexable_Builder/Is_Type_With_No_Id_Test.php b/tests/Unit/Builders/Indexable_Builder/Is_Type_With_No_Id_Test.php index a3e140f9c97..abf399748a6 100644 --- a/tests/Unit/Builders/Indexable_Builder/Is_Type_With_No_Id_Test.php +++ b/tests/Unit/Builders/Indexable_Builder/Is_Type_With_No_Id_Test.php @@ -34,7 +34,7 @@ protected function set_up() { $this->primary_term_builder, $this->indexable_helper, $this->version_manager, - $this->link_builder + $this->link_builder, ); $this->instance->set_indexable_repository( $this->indexable_repository ); diff --git a/tests/Unit/Builders/Indexable_Builder/Maybe_Build_Author_Indexable_Test.php b/tests/Unit/Builders/Indexable_Builder/Maybe_Build_Author_Indexable_Test.php index 9e329f37219..2c03814459e 100644 --- a/tests/Unit/Builders/Indexable_Builder/Maybe_Build_Author_Indexable_Test.php +++ b/tests/Unit/Builders/Indexable_Builder/Maybe_Build_Author_Indexable_Test.php @@ -37,7 +37,7 @@ protected function set_up() { $this->primary_term_builder, $this->indexable_helper, $this->version_manager, - $this->link_builder + $this->link_builder, ); $this->instance->set_indexable_repository( $this->indexable_repository ); diff --git a/tests/Unit/Builders/Indexable_Builder/Save_Indexable_Test.php b/tests/Unit/Builders/Indexable_Builder/Save_Indexable_Test.php index aff8a1f6c5c..77d6c4dfdc0 100644 --- a/tests/Unit/Builders/Indexable_Builder/Save_Indexable_Test.php +++ b/tests/Unit/Builders/Indexable_Builder/Save_Indexable_Test.php @@ -35,7 +35,7 @@ protected function set_up() { $this->primary_term_builder, $this->indexable_helper, $this->version_manager, - $this->link_builder + $this->link_builder, ); $this->instance->set_indexable_repository( $this->indexable_repository ); diff --git a/tests/Unit/Builders/Indexable_Builder/Set_Indexable_Repository_Test.php b/tests/Unit/Builders/Indexable_Builder/Set_Indexable_Repository_Test.php index fb2ea3a1f25..648f8c3d02c 100644 --- a/tests/Unit/Builders/Indexable_Builder/Set_Indexable_Repository_Test.php +++ b/tests/Unit/Builders/Indexable_Builder/Set_Indexable_Repository_Test.php @@ -37,62 +37,62 @@ public function test_construct() { $this->assertInstanceOf( Indexable_Author_Builder::class, $this->getPropertyValue( $this->instance, 'author_builder' ), - 'Author builder should be of class Indexable_Author_Builder.' + 'Author builder should be of class Indexable_Author_Builder.', ); $this->assertInstanceOf( Indexable_Post_Builder::class, $this->getPropertyValue( $this->instance, 'post_builder' ), - 'Post builder should be of class Indexable_Post_Builder.' + 'Post builder should be of class Indexable_Post_Builder.', ); $this->assertInstanceOf( Indexable_Term_Builder::class, $this->getPropertyValue( $this->instance, 'term_builder' ), - 'Term builder should be of class Indexable_Term_Builder.' + 'Term builder should be of class Indexable_Term_Builder.', ); $this->assertInstanceOf( Indexable_Home_Page_Builder::class, $this->getPropertyValue( $this->instance, 'home_page_builder' ), - 'Home page builder should be of class Indexable_Home_Page_Builder.' + 'Home page builder should be of class Indexable_Home_Page_Builder.', ); $this->assertInstanceOf( Indexable_Post_Type_Archive_Builder::class, $this->getPropertyValue( $this->instance, 'post_type_archive_builder' ), - 'Post type archive builder should be of class Indexable_Post_Type_Archive_Builder.' + 'Post type archive builder should be of class Indexable_Post_Type_Archive_Builder.', ); $this->assertInstanceOf( Indexable_Date_Archive_Builder::class, $this->getPropertyValue( $this->instance, 'date_archive_builder' ), - 'Date archive builder should be of class Indexable_Date_Archive_Builder.' + 'Date archive builder should be of class Indexable_Date_Archive_Builder.', ); $this->assertInstanceOf( Indexable_System_Page_Builder::class, $this->getPropertyValue( $this->instance, 'system_page_builder' ), - 'System page builder should be of class Indexable_System_Page_Builder.' + 'System page builder should be of class Indexable_System_Page_Builder.', ); $this->assertInstanceOf( Indexable_Hierarchy_Builder::class, $this->getPropertyValue( $this->instance, 'hierarchy_builder' ), - 'Hierarchy builder should be of class Indexable_Hierarchy_Builder.' + 'Hierarchy builder should be of class Indexable_Hierarchy_Builder.', ); $this->assertInstanceOf( Primary_Term_Builder::class, $this->getPropertyValue( $this->instance, 'primary_term_builder' ), - 'Primary term builder should be of class Primary_Term_Builder.' + 'Primary term builder should be of class Primary_Term_Builder.', ); $this->assertInstanceOf( Indexable_Helper::class, $this->getPropertyValue( $this->instance, 'indexable_helper' ), - 'Indexable helper should be of class Indexable_Helper.' + 'Indexable helper should be of class Indexable_Helper.', ); $this->assertInstanceOf( Indexable_Version_Manager::class, $this->getPropertyValue( $this->instance, 'version_manager' ), - 'Version manager should be of class Indexable_Version_Manager.' + 'Version manager should be of class Indexable_Version_Manager.', ); $this->assertInstanceOf( Indexable_Link_Builder::class, $this->getPropertyValue( $this->instance, 'link_builder' ), - 'Link builder should be of class Indexable_Link_Builder.' + 'Link builder should be of class Indexable_Link_Builder.', ); } @@ -109,7 +109,7 @@ public function test_set_indexable_repository() { $this->assertSame( $indexable_repository, $this->getPropertyValue( $this->instance, 'indexable_repository' ), - 'Indexable repository should be set.' + 'Indexable repository should be set.', ); } } diff --git a/tests/Unit/Builders/Indexable_Hierarchy_Builder_Test.php b/tests/Unit/Builders/Indexable_Hierarchy_Builder_Test.php index 3e838e9bac4..f244e7b3bf7 100644 --- a/tests/Unit/Builders/Indexable_Hierarchy_Builder_Test.php +++ b/tests/Unit/Builders/Indexable_Hierarchy_Builder_Test.php @@ -98,7 +98,7 @@ protected function set_up() { $this->primary_term_repository, $this->options, $this->post, - $this->indexable_helper + $this->indexable_helper, ); $this->instance->set_indexable_repository( $this->indexable_repository ); } @@ -131,7 +131,7 @@ public function test_no_parents() { (object) [ 'post_parent' => 0, 'post_type' => 'post', - ] + ], ); $this->indexable_hierarchy_repository->expects( 'add_ancestor' )->with( 1, 0, 0 ); @@ -172,7 +172,7 @@ public function test_no_parents_and_has_ancestors_set_to_false() { (object) [ 'post_parent' => 0, 'post_type' => 'post', - ] + ], ); $this->indexable_hierarchy_repository->expects( 'add_ancestor' )->with( 1, 0, 0 ); @@ -247,7 +247,7 @@ public function test_post_parents() { (object) [ 'post_parent' => 2, 'post_type' => 'post', - ] + ], ); $this->post->expects( 'get_post' ) ->twice() @@ -256,7 +256,7 @@ public function test_post_parents() { (object) [ 'post_parent' => 0, 'post_type' => 'post', - ] + ], ); $actual = $this->instance->build( $indexable ); @@ -309,7 +309,7 @@ public function test_post_parent_with_no_indexable_id_set() { (object) [ 'post_parent' => 2, 'post_type' => 'post', - ] + ], ); $this->post ->expects( 'get_post' ) @@ -319,7 +319,7 @@ public function test_post_parent_with_no_indexable_id_set() { (object) [ 'post_parent' => 0, 'post_type' => 'post', - ] + ], ); $actual = $this->instance->build( $indexable ); @@ -363,7 +363,7 @@ public function test_post_parents_with_an_unindexed_ancestor() { (object) [ 'post_parent' => 2, 'post_type' => 'post', - ] + ], ); $this->post @@ -374,7 +374,7 @@ public function test_post_parents_with_an_unindexed_ancestor() { (object) [ 'post_parent' => 0, 'post_type' => 'post', - ] + ], ); $this->indexable_hierarchy_repository->expects( 'add_ancestor' )->with( 1, 0, 0 ); @@ -423,7 +423,7 @@ public function test_post_parents_with_parent_already_added() { (object) [ 'post_parent' => 2, 'post_type' => 'post', - ] + ], ); $this->post @@ -434,7 +434,7 @@ public function test_post_parents_with_parent_already_added() { (object) [ 'post_parent' => 2, 'post_type' => 'post', - ] + ], ); $actual = $this->instance->build( $indexable ); @@ -475,7 +475,7 @@ public function test_post_parents_having_the_parent_is_the_main_object() { (object) [ 'post_parent' => 2, 'post_type' => 'post', - ] + ], ); $this->post @@ -486,7 +486,7 @@ public function test_post_parents_having_the_parent_is_the_main_object() { (object) [ 'post_parent' => 0, 'post_type' => 'post', - ] + ], ); $this->indexable_hierarchy_repository->expects( 'add_ancestor' )->with( 1, 0, 0 ); @@ -536,7 +536,7 @@ public function test_primary_term_parents() { 'term_id' => 2, 'taxonomy' => 'tag', 'parent' => 0, - ] + ], ); $this->indexable_hierarchy_repository->expects( 'clear_ancestors' )->with( 1 )->andReturnTrue(); @@ -556,7 +556,7 @@ public function test_primary_term_parents() { 'ID' => 1, 'post_parent' => 0, 'post_type' => 'post', - ] + ], ); $actual = $this->instance->build( $indexable ); @@ -595,7 +595,7 @@ public function test_primary_term_parents_and_term_is_unindexed() { 'term_id' => 2, 'taxonomy' => 'tag', 'parent' => 0, - ] + ], ); $this->indexable_hierarchy_repository @@ -627,7 +627,7 @@ public function test_primary_term_parents_and_term_is_unindexed() { 'ID' => 1, 'post_parent' => 0, 'post_type' => 'post', - ] + ], ); $this->indexable_hierarchy_repository->expects( 'add_ancestor' )->with( 1, 0, 0 ); @@ -688,7 +688,7 @@ public function test_many_primary_term_parents() { 'term_id' => 2, 'taxonomy' => 'tag', 'parent' => 3, - ] + ], ); Monkey\Functions\expect( 'get_term' ) ->once() @@ -698,7 +698,7 @@ public function test_many_primary_term_parents() { 'term_id' => 3, 'taxonomy' => 'tag', 'parent' => 0, - ] + ], ); $this->indexable_helper->expects( 'should_index_indexable' )->with( $indexable )->andReturnTrue(); $this->indexable_hierarchy_repository->expects( 'clear_ancestors' )->with( 1 )->andReturnTrue(); @@ -720,7 +720,7 @@ public function test_many_primary_term_parents() { 'ID' => 1, 'post_parent' => 0, 'post_type' => 'post', - ] + ], ); $actual = $this->instance->build( $indexable ); @@ -767,7 +767,7 @@ public function test_term_parent() { 'taxonomy' => 'tag', 'parent' => 0, ], - ] + ], ); Monkey\Functions\expect( 'get_term' ) ->with( 2 ) @@ -776,7 +776,7 @@ public function test_term_parent() { 'term_id' => 2, 'taxonomy' => 'tag', 'parent' => 0, - ] + ], ); Monkey\Functions\expect( 'get_post_meta' )->with( 1, WPSEO_Meta::$meta_prefix . 'primary_term', true )->andReturn( '' ); @@ -796,7 +796,7 @@ public function test_term_parent() { 'ID' => 1, 'post_parent' => 0, 'post_type' => 'post', - ] + ], ); $actual = $this->instance->build( $indexable ); @@ -832,7 +832,7 @@ public function test_term_parent_where_terms_not_array() { 'term_id' => 2, 'taxonomy' => 'tag', 'parent' => 0, - ] + ], ); Monkey\Functions\expect( 'get_post_meta' )->with( 1, WPSEO_Meta::$meta_prefix . 'primary_term', true )->andReturn( '' ); $this->indexable_helper->expects( 'should_index_indexable' )->with( $indexable )->andReturnTrue(); @@ -849,7 +849,7 @@ public function test_term_parent_where_terms_not_array() { 'ID' => 1, 'post_parent' => 0, 'post_type' => 'post', - ] + ], ); $this->indexable_hierarchy_repository->expects( 'add_ancestor' )->with( 1, 0, 0 ); @@ -887,7 +887,7 @@ public function test_term_parent_where_terms_empty() { 'term_id' => 2, 'taxonomy' => 'tag', 'parent' => 0, - ] + ], ); Monkey\Functions\expect( 'get_post_meta' )->with( 1, WPSEO_Meta::$meta_prefix . 'primary_term', true )->andReturn( '' ); @@ -904,7 +904,7 @@ public function test_term_parent_where_terms_empty() { 'ID' => 1, 'post_parent' => 0, 'post_type' => 'post', - ] + ], ); $this->indexable_hierarchy_repository->expects( 'add_ancestor' )->with( 1, 0, 0 ); @@ -965,7 +965,7 @@ public function test_deepest_term_parent() { 'taxonomy' => 'tag', 'parent' => 4, ], - ] + ], ); Monkey\Functions\expect( 'get_term' ) ->once() @@ -975,7 +975,7 @@ public function test_deepest_term_parent() { 'term_id' => 3, 'taxonomy' => 'tag', 'parent' => 4, - ] + ], ); Monkey\Functions\expect( 'get_term' ) ->twice() @@ -985,7 +985,7 @@ public function test_deepest_term_parent() { 'term_id' => 4, 'taxonomy' => 'tag', 'parent' => 0, - ] + ], ); Monkey\Functions\expect( 'get_post_meta' )->with( 1, WPSEO_Meta::$meta_prefix . 'primary_term', true )->andReturn( '' ); $this->indexable_helper->expects( 'should_index_indexable' )->with( $indexable )->andReturnTrue(); @@ -1008,7 +1008,7 @@ public function test_deepest_term_parent() { 'ID' => 1, 'post_parent' => 0, 'post_type' => 'post', - ] + ], ); $actual = $this->instance->build( $indexable ); @@ -1050,7 +1050,7 @@ public function test_term() { 'term_id' => 1, 'taxonomy' => 'tag', 'parent' => 2, - ] + ], ); Monkey\Functions\expect( 'get_term' ) ->once() @@ -1060,7 +1060,7 @@ public function test_term() { 'term_id' => 2, 'taxonomy' => 'tag', 'parent' => 0, - ] + ], ); $this->indexable_hierarchy_repository->expects( 'clear_ancestors' )->with( 1 )->andReturnTrue(); @@ -1099,7 +1099,7 @@ public function test_term_with_ancestor_not_indexed() { 'term_id' => 1, 'taxonomy' => 'tag', 'parent' => 2, - ] + ], ); Monkey\Functions\expect( 'get_term' ) @@ -1110,7 +1110,7 @@ public function test_term_with_ancestor_not_indexed() { 'term_id' => 2, 'taxonomy' => 'tag', 'parent' => 0, - ] + ], ); $this->indexable_hierarchy_repository @@ -1154,7 +1154,7 @@ public function test_term_with_ancestor_is_the_main_object() { 'term_id' => 1, 'taxonomy' => 'tag', 'parent' => 2, - ] + ], ); Monkey\Functions\expect( 'get_term' ) @@ -1165,7 +1165,7 @@ public function test_term_with_ancestor_is_the_main_object() { 'term_id' => 2, 'taxonomy' => 'tag', 'parent' => 0, - ] + ], ); $this->indexable_hierarchy_repository @@ -1211,7 +1211,7 @@ public function test_term_with_ancestor_is_already_added() { 'term_id' => 1, 'taxonomy' => 'tag', 'parent' => 2, - ] + ], ); Monkey\Functions\expect( 'get_term' ) @@ -1222,7 +1222,7 @@ public function test_term_with_ancestor_is_already_added() { 'term_id' => 2, 'taxonomy' => 'tag', 'parent' => 3, - ] + ], ); Monkey\Functions\expect( 'get_term' ) @@ -1233,7 +1233,7 @@ public function test_term_with_ancestor_is_already_added() { 'term_id' => 3, 'taxonomy' => 'tag', 'parent' => 0, - ] + ], ); $this->indexable_hierarchy_repository @@ -1305,7 +1305,7 @@ public function test_primary_term_parents_with_no_primary_term_set() { 'ID' => 1, 'post_parent' => 0, 'post_type' => 'post', - ] + ], ); $this->options @@ -1334,7 +1334,7 @@ public function test_primary_term_parents_with_no_primary_term_set() { 'parent' => 0, 'term_order' => 1, ], - ] + ], ); Monkey\Functions\expect( 'get_term' ) @@ -1345,7 +1345,7 @@ public function test_primary_term_parents_with_no_primary_term_set() { 'taxonomy' => 'tag', 'parent' => 0, 'term_order' => 1, - ] + ], ); Monkey\Functions\expect( 'get_post_meta' )->with( 1, WPSEO_Meta::$meta_prefix . 'primary_term', true )->andReturn( '' ); diff --git a/tests/Unit/Builders/Indexable_Home_Page_Builder_Test.php b/tests/Unit/Builders/Indexable_Home_Page_Builder_Test.php index 4cb83eb2b0f..4f0f3e867b7 100644 --- a/tests/Unit/Builders/Indexable_Home_Page_Builder_Test.php +++ b/tests/Unit/Builders/Indexable_Home_Page_Builder_Test.php @@ -56,7 +56,7 @@ final class Indexable_Home_Page_Builder_Test extends TestCase { 'size' => 'full', 'id' => 6, 'alt' => '', - 'pixels' => 307200, + 'pixels' => 307_200, 'type' => 'image\/jpeg', ]; @@ -188,7 +188,7 @@ protected function set_up() { $this->options_mock, $this->url_mock, $this->versions, - $this->post_helper + $this->post_helper, ); $this->instance->set_social_image_helpers( $this->image_mock, $this->open_graph_image_mock, $this->twitter_image_mock ); } @@ -225,13 +225,13 @@ public function test_build() { AND p.%i = '' AND p.%i = 'post' ", - [ 'post_modified_gmt', 'post_date_gmt', $this->wpdb->posts, 'post_status', 'publish', 'post_password', 'post_type' ] + [ 'post_modified_gmt', 'post_date_gmt', $this->wpdb->posts, 'post_status', 'publish', 'post_password', 'post_type' ], )->andReturn( 'PREPARED_QUERY' ); $this->wpdb->expects( 'get_row' )->once()->with( 'PREPARED_QUERY' )->andReturn( (object) [ 'last_modified' => '1234-12-12 00:00:00', 'published_at' => '1234-12-12 00:00:00', - ] + ], ); $this->indexable_mock->orm->expects( 'set' )->with( 'object_published_at', '1234-12-12 00:00:00' ); @@ -273,13 +273,13 @@ public function test_build_with_fallback_description() { AND p.%i = '' AND p.%i = 'post' ", - [ 'post_modified_gmt', 'post_date_gmt', $this->wpdb->posts, 'post_status', 'publish', 'post_password', 'post_type' ] + [ 'post_modified_gmt', 'post_date_gmt', $this->wpdb->posts, 'post_status', 'publish', 'post_password', 'post_type' ], )->andReturn( 'PREPARED_QUERY' ); $this->wpdb->expects( 'get_row' )->once()->with( 'PREPARED_QUERY' )->andReturn( (object) [ 'last_modified' => '1234-12-12 00:00:00', 'published_at' => '1234-12-12 00:00:00', - ] + ], ); $this->indexable_mock->orm->expects( 'set' )->with( 'object_published_at', '1234-12-12 00:00:00' ); @@ -320,13 +320,13 @@ public function test_build_open_graph_image_meta_data() { AND p.%i = '' AND p.%i = 'post' ", - [ 'post_modified_gmt', 'post_date_gmt', $this->wpdb->posts, 'post_status', 'publish', 'post_password', 'post_type' ] + [ 'post_modified_gmt', 'post_date_gmt', $this->wpdb->posts, 'post_status', 'publish', 'post_password', 'post_type' ], )->andReturn( 'PREPARED_QUERY' ); $this->wpdb->expects( 'get_row' )->once()->with( 'PREPARED_QUERY' )->andReturn( (object) [ 'last_modified' => '1234-12-12 00:00:00', 'published_at' => '1234-12-12 00:00:00', - ] + ], ); $this->indexable_mock->orm->expects( 'set' )->with( 'object_published_at', '1234-12-12 00:00:00' ); diff --git a/tests/Unit/Builders/Indexable_Link_Builder/Abstract_Indexable_Link_Builder_TestCase.php b/tests/Unit/Builders/Indexable_Link_Builder/Abstract_Indexable_Link_Builder_TestCase.php index 09ea9828d44..21e07833c85 100644 --- a/tests/Unit/Builders/Indexable_Link_Builder/Abstract_Indexable_Link_Builder_TestCase.php +++ b/tests/Unit/Builders/Indexable_Link_Builder/Abstract_Indexable_Link_Builder_TestCase.php @@ -115,7 +115,7 @@ protected function set_up() { $this->post_helper, $this->options_helper, $this->indexable_helper, - $this->image_content_extractor + $this->image_content_extractor, ); $this->instance->set_dependencies( $this->indexable_repository, $this->image_helper ); @@ -125,9 +125,9 @@ static function ( $haystack, $prop ) { static function ( $e ) use ( $prop ) { return $e->{$prop}; }, - $haystack + $haystack, ); - } + }, ); $this->image_url = 'http://basic.wordpress.test/wp-content/uploads/2022/11/WordPress8.jpg?quality=90&grain=0.5'; @@ -200,7 +200,7 @@ public function expect_seo_links_repository_query_create( $indexable, $seo_link 'type' => SEO_Links::TYPE_INTERNAL_IMAGE, 'indexable_id' => $indexable->id, 'post_id' => $indexable->object_id, - ] + ], )->andReturn( $seo_link ); } } diff --git a/tests/Unit/Builders/Indexable_Link_Builder/Build_Test.php b/tests/Unit/Builders/Indexable_Link_Builder/Build_Test.php index cb653e42dde..cab197c3c73 100644 --- a/tests/Unit/Builders/Indexable_Link_Builder/Build_Test.php +++ b/tests/Unit/Builders/Indexable_Link_Builder/Build_Test.php @@ -181,7 +181,7 @@ public function test_build( $content, $link_type, $is_image, $images ) { 'type' => $link_type, 'indexable_id' => $indexable->id, 'post_id' => $indexable->object_id, - ] + ], )->andReturn( $new_seo_link ); $query_mock->expects( 'create' )->once()->with( [ @@ -189,7 +189,7 @@ public function test_build( $content, $link_type, $is_image, $images ) { 'type' => $link_type, 'indexable_id' => $indexable->id, 'post_id' => $indexable->object_id, - ] + ], )->andReturn( $existing_seo_link ); $old_seo_link = new SEO_Links_Mock(); @@ -210,7 +210,7 @@ public function test_build( $content, $link_type, $is_image, $images ) { 'target_indexable_id' => 3, 'incoming' => 0, ], - ] + ], ); $this->indexable_repository->expects( 'update_incoming_link_count' )->once()->with( 3, 0 ); @@ -301,7 +301,7 @@ public function test_build_target_indexable_does_not_exist() { 'type' => $link_type, 'indexable_id' => $indexable->id, 'post_id' => $indexable->object_id, - ] + ], )->andReturn( $seo_link ); $old_seo_link = new SEO_Links_Mock(); @@ -324,7 +324,7 @@ public function test_build_target_indexable_does_not_exist() { 'target_indexable_id' => 3, 'incoming' => 0, ], - ] + ], ); $this->indexable_repository->expects( 'update_incoming_link_count' )->once()->with( 2, 0 ); $this->indexable_repository->expects( 'update_incoming_link_count' )->once()->with( 3, 0 ); diff --git a/tests/Unit/Builders/Indexable_Link_Builder/Create_Internal_Link_Test.php b/tests/Unit/Builders/Indexable_Link_Builder/Create_Internal_Link_Test.php index 50b3c21d9a2..6b502f39308 100644 --- a/tests/Unit/Builders/Indexable_Link_Builder/Create_Internal_Link_Test.php +++ b/tests/Unit/Builders/Indexable_Link_Builder/Create_Internal_Link_Test.php @@ -56,7 +56,7 @@ public function test_build_create_internal_link() { 'scheme' => 'http', 'host' => 'basic.wordpress.test', ], - ] + ], ); // Executed in build->create_links->create_internal_link. @@ -134,7 +134,7 @@ public function test_build_create_internal_link_disable_attachment_true_file_doe 'host' => 'basic.wordpress.test', ], 'get_attached_file' => 'http://basic.wordpress.test/wp-content/uploads/2022/11/WordPress8.jpg', - ] + ], ); // Executed in build->create_links->create_internal_link. @@ -212,7 +212,7 @@ public function test_build_create_internal_link_disable_attachment_true_file_exi ], 'get_attached_file' => 'http://basic.wordpress.test/wp-content/uploads/2022/11/WordPress8.jpg', 'wp_get_attachment_image_src' => [ '55', '200', '300' ], - ] + ], ); // Executed in build->create_links->create_internal_link. @@ -280,7 +280,7 @@ public function test_build_create_internal_link_disable_attachment_true_file_not // Executed in build->create_links->create_internal_link. 'wp_get_attachment_image_src' => [ '55', '200', '300' ], - ] + ], ); // Executed in build->create_links->create_internal_link. @@ -366,7 +366,7 @@ public function test_build_create_internal_link_disable_attachment_true_get_atta // Executed in build->create_links->create_internal_link->WPSEO_Image_Utils::get_attachment_by_url->attachment_url_to_postid. 'wp_cache_get' => 108, - ] + ], ); // Executed in build->create_links->create_internal_link. diff --git a/tests/Unit/Builders/Indexable_Link_Builder/Delete_Test.php b/tests/Unit/Builders/Indexable_Link_Builder/Delete_Test.php index bf7f5b86238..4785e1c3efc 100644 --- a/tests/Unit/Builders/Indexable_Link_Builder/Delete_Test.php +++ b/tests/Unit/Builders/Indexable_Link_Builder/Delete_Test.php @@ -77,7 +77,7 @@ public function test_delete_and_update_incoming_links_for_related_indexables() { 'target_indexable_id' => 3, 'incoming' => 7, ], - ] + ], ); $this->indexable_repository diff --git a/tests/Unit/Builders/Indexable_Link_Builder/Get_Permalink_Test.php b/tests/Unit/Builders/Indexable_Link_Builder/Get_Permalink_Test.php index a20f83f92ce..37af6958b4f 100644 --- a/tests/Unit/Builders/Indexable_Link_Builder/Get_Permalink_Test.php +++ b/tests/Unit/Builders/Indexable_Link_Builder/Get_Permalink_Test.php @@ -27,7 +27,7 @@ protected function set_up() { $this->post_helper, $this->options_helper, $this->indexable_helper, - $this->image_content_extractor + $this->image_content_extractor, ); $this->instance->set_dependencies( $this->indexable_repository, $this->image_helper ); diff --git a/tests/Unit/Builders/Indexable_Link_Builder/Update_Incoming_Links_For_Related_Test.php b/tests/Unit/Builders/Indexable_Link_Builder/Update_Incoming_Links_For_Related_Test.php index 1958d477cf3..bf0eb7c1f57 100644 --- a/tests/Unit/Builders/Indexable_Link_Builder/Update_Incoming_Links_For_Related_Test.php +++ b/tests/Unit/Builders/Indexable_Link_Builder/Update_Incoming_Links_For_Related_Test.php @@ -29,7 +29,7 @@ protected function set_up() { $this->post_helper, $this->options_helper, $this->indexable_helper, - $this->image_content_extractor + $this->image_content_extractor, ); $this->instance->set_dependencies( $this->indexable_repository, $this->image_helper ); diff --git a/tests/Unit/Builders/Indexable_Post_Builder_Test.php b/tests/Unit/Builders/Indexable_Post_Builder_Test.php index 3432faeff31..285b2406234 100644 --- a/tests/Unit/Builders/Indexable_Post_Builder_Test.php +++ b/tests/Unit/Builders/Indexable_Post_Builder_Test.php @@ -120,14 +120,14 @@ protected function set_up() { $this->post_type_helper, new Indexable_Builder_Versions(), new Meta_Helper(), - $this->permalink_helper + $this->permalink_helper, ); $this->instance->set_indexable_repository( $this->indexable_repository ); $this->instance->set_social_image_helpers( $this->image, $this->open_graph_image, - $this->twitter_image + $this->twitter_image, ); } @@ -212,11 +212,11 @@ protected function open_graph_image_set_by_user( $image_meta ) { public function test_constructor() { $this->assertInstanceOf( Post_Type_Helper::class, - $this->getPropertyValue( $this->instance, 'post_type_helper' ) + $this->getPropertyValue( $this->instance, 'post_type_helper' ), ); $this->assertInstanceOf( Post_Helper::class, - $this->getPropertyValue( $this->instance, 'post_helper' ) + $this->getPropertyValue( $this->instance, 'post_helper' ), ); } @@ -232,7 +232,7 @@ public function test_set_indexable_repository() { $this->assertInstanceOf( Indexable_Repository::class, - $this->getPropertyValue( $this->instance, 'indexable_repository' ) + $this->getPropertyValue( $this->instance, 'indexable_repository' ), ); } @@ -270,7 +270,7 @@ public function test_build( $postmeta, $expected_result ) { 'post_parent' => '0', 'post_date_gmt' => '1234-12-12 00:00:00', 'post_modified_gmt' => '1234-12-12 00:00:00', - ] + ], ); $this->post_type_helper @@ -319,7 +319,7 @@ public function test_build( $postmeta, $expected_result ) { 'twitter_image' => null, 'twitter_image_id' => null, 'twitter_image_source' => null, - ] + ], ); $image_meta = [ @@ -330,7 +330,7 @@ public function test_build( $postmeta, $expected_result ) { 'size' => 'full', 'id' => 13, 'alt' => '', - 'pixels' => 307200, + 'pixels' => 307_200, 'type' => 'image/jpeg', ]; @@ -571,7 +571,7 @@ public function test_find_alternative_image_from_gallery() { 'size' => 'full', 'id' => 13, 'alt' => '', - 'pixels' => 307200, + 'pixels' => 307_200, 'type' => 'image/jpeg', ]; @@ -625,7 +625,7 @@ public function test_find_alternative_image_from_post_content() { 'size' => 'full', 'id' => 13, 'alt' => '', - 'pixels' => 307200, + 'pixels' => 307_200, 'type' => 'image/jpeg', ]; @@ -1016,7 +1016,7 @@ public function test_build_post_type_excluded() { ->andReturn( (object) [ 'post_type' => 'excluded_post_type', - ] + ], ); $this->post_type_helper->expects( 'is_excluded' ) diff --git a/tests/Unit/Builders/Indexable_Post_Type_Archive_Builder_Test.php b/tests/Unit/Builders/Indexable_Post_Type_Archive_Builder_Test.php index 2552a0449dc..a1920cb73f3 100644 --- a/tests/Unit/Builders/Indexable_Post_Type_Archive_Builder_Test.php +++ b/tests/Unit/Builders/Indexable_Post_Type_Archive_Builder_Test.php @@ -79,13 +79,13 @@ public function test_build() { AND p.%i = '' AND p.%i = %s ", - [ 'post_modified_gmt', 'post_date_gmt', $wpdb->posts, 'post_status', 'publish', 'post_password', 'post_type', 'my-post-type' ] + [ 'post_modified_gmt', 'post_date_gmt', $wpdb->posts, 'post_status', 'publish', 'post_password', 'post_type', 'my-post-type' ], )->andReturn( 'PREPARED_QUERY' ); $wpdb->expects( 'get_row' )->once()->with( 'PREPARED_QUERY' )->andReturn( (object) [ 'last_modified' => '1234-12-12 00:00:00', 'published_at' => '1234-12-12 00:00:00', - ] + ], ); $indexable_mock = Mockery::mock( Indexable::class ); diff --git a/tests/Unit/Builders/Indexable_Social_Image_Trait_Test.php b/tests/Unit/Builders/Indexable_Social_Image_Trait_Test.php index 20ed3784768..ee43d8b5746 100644 --- a/tests/Unit/Builders/Indexable_Social_Image_Trait_Test.php +++ b/tests/Unit/Builders/Indexable_Social_Image_Trait_Test.php @@ -86,15 +86,15 @@ public function test_set_social_image_helpers() { self::assertInstanceOf( Twitter\Image_Helper::class, - $this->getPropertyValue( $this->instance, 'twitter_image' ) + $this->getPropertyValue( $this->instance, 'twitter_image' ), ); self::assertInstanceOf( Open_Graph\Image_Helper::class, - $this->getPropertyValue( $this->instance, 'open_graph_image' ) + $this->getPropertyValue( $this->instance, 'open_graph_image' ), ); self::assertInstanceOf( Image_Helper::class, - $this->getPropertyValue( $this->instance, 'image' ) + $this->getPropertyValue( $this->instance, 'image' ), ); } @@ -142,7 +142,7 @@ public function test_handle_social_images_when_images_are_set_by_user() { 'size' => 'full', 'id' => 13, 'alt' => '', - 'pixels' => 307200, + 'pixels' => 307_200, 'type' => 'image/jpeg', ]; @@ -194,7 +194,7 @@ public function test_handle_social_images_when_twitter_image_is_not_set_by_user( 'size' => 'full', 'id' => 13, 'alt' => '', - 'pixels' => 307200, + 'pixels' => 307_200, 'type' => 'image/jpeg', ]; @@ -313,7 +313,7 @@ public function test_handle_social_images_when_twitter_image_id_is_not_set_by_us 'size' => 'full', 'id' => 13, 'alt' => '', - 'pixels' => 307200, + 'pixels' => 307_200, 'type' => 'image/jpeg', ]; diff --git a/tests/Unit/Builders/Indexable_Term_Builder_Test.php b/tests/Unit/Builders/Indexable_Term_Builder_Test.php index 49550b15b00..faaf8b9e0e1 100644 --- a/tests/Unit/Builders/Indexable_Term_Builder_Test.php +++ b/tests/Unit/Builders/Indexable_Term_Builder_Test.php @@ -120,7 +120,7 @@ protected function set_up() { $this->instance = new Indexable_Term_Builder_Double( $this->taxonomy, $this->versions, - $this->post_helper + $this->post_helper, ); $this->image = Mockery::mock( Image_Helper::class ); @@ -130,7 +130,7 @@ protected function set_up() { $this->instance->set_social_image_helpers( $this->image, $this->open_graph_image, - $this->twitter_image + $this->twitter_image, ); } @@ -210,7 +210,7 @@ protected function open_graph_image_set_by_user( $indexable_mock, $image_meta ) public function test_constructor() { $this->assertInstanceOf( Indexable_Term_Builder::class, - $this->instance + $this->instance, ); } @@ -260,7 +260,7 @@ public function test_build() { 'wpseo_twitter-image' => 'twitter_image', 'wpseo_twitter-image-id' => 'twitter_image_id', 'wpseo_twitter-description' => 'twitter_description', - ] + ], ); $this->post_helper->expects( 'get_public_post_statuses' )->once()->andReturn( [ 'publish' ] ); @@ -279,14 +279,14 @@ public function test_build() { WHERE p.%i IN (%s) AND p.%i = '' ", - [ 'post_modified_gmt', 'post_date_gmt', $this->wpdb->posts, $this->wpdb->term_relationships, 'object_id', 'ID', $this->wpdb->term_taxonomy, 'term_taxonomy_id', 'term_taxonomy_id', 'taxonomy', 'category', 'term_id', 1, 'post_status', 'publish', 'post_password' ] + [ 'post_modified_gmt', 'post_date_gmt', $this->wpdb->posts, $this->wpdb->term_relationships, 'object_id', 'ID', $this->wpdb->term_taxonomy, 'term_taxonomy_id', 'term_taxonomy_id', 'taxonomy', 'category', 'term_id', 1, 'post_status', 'publish', 'post_password' ], )->andReturn( 'PREPARED_QUERY' ); $this->wpdb->expects( 'get_row' )->once()->with( 'PREPARED_QUERY' )->andReturn( (object) [ 'last_modified' => '1234-12-12 00:00:00', 'published_at' => '1234-12-12 00:00:00', - ] + ], ); $indexable_mock = Mockery::mock( Indexable::class ); @@ -335,7 +335,7 @@ public function test_build() { 'twitter_image' => null, 'twitter_image_id' => null, 'twitter_image_source' => null, - ] + ], ); $image_meta = [ @@ -346,7 +346,7 @@ public function test_build() { 'size' => 'full', 'id' => 13, 'alt' => '', - 'pixels' => 307200, + 'pixels' => 307_200, 'type' => 'image/jpeg', ]; diff --git a/tests/Unit/Builders/Primary_Term_Builder_Test.php b/tests/Unit/Builders/Primary_Term_Builder_Test.php index fb11f359791..b5764e48816 100644 --- a/tests/Unit/Builders/Primary_Term_Builder_Test.php +++ b/tests/Unit/Builders/Primary_Term_Builder_Test.php @@ -78,7 +78,7 @@ protected function set_up() { $this->indexable_helper, $this->primary_term, $this->meta, - ] + ], ) ->shouldAllowMockingProtectedMethods() ->makePartial(); @@ -96,27 +96,27 @@ public function test_successfully_creates_primary_term_builder() { $this->repository, $this->indexable_helper, $this->primary_term, - $this->meta + $this->meta, ); $this->assertInstanceOf( Primary_Term_Repository::class, - $this->getPropertyValue( $primary_term_builder, 'repository' ) + $this->getPropertyValue( $primary_term_builder, 'repository' ), ); $this->assertInstanceOf( Indexable_Helper::class, - $this->getPropertyValue( $primary_term_builder, 'indexable_helper' ) + $this->getPropertyValue( $primary_term_builder, 'indexable_helper' ), ); $this->assertInstanceOf( Primary_Term_Helper::class, - $this->getPropertyValue( $primary_term_builder, 'primary_term' ) + $this->getPropertyValue( $primary_term_builder, 'primary_term' ), ); $this->assertInstanceOf( Meta_Helper::class, - $this->getPropertyValue( $primary_term_builder, 'meta' ) + $this->getPropertyValue( $primary_term_builder, 'meta' ), ); } @@ -143,7 +143,7 @@ public function test_build() { 'name' => 'tag', 'hierarchical' => true, ], - ] + ], ); $this->instance diff --git a/tests/Unit/Commands/Index_Command_Test.php b/tests/Unit/Commands/Index_Command_Test.php index 55389176df2..87b7ae4b501 100644 --- a/tests/Unit/Commands/Index_Command_Test.php +++ b/tests/Unit/Commands/Index_Command_Test.php @@ -127,7 +127,7 @@ protected function set_up() { $this->prepare_indexing_action, $this->post_link_indexation_action, $this->term_link_indexation_action, - $this->indexable_helper + $this->indexable_helper, ); $this->stubTranslationFunctions(); @@ -143,23 +143,23 @@ protected function set_up() { public function test_construct() { self::assertInstanceOf( Indexable_Post_Indexation_Action::class, - self::getPropertyValue( $this->instance, 'post_indexation_action' ) + self::getPropertyValue( $this->instance, 'post_indexation_action' ), ); self::assertInstanceOf( Indexable_Term_Indexation_Action::class, - self::getPropertyValue( $this->instance, 'term_indexation_action' ) + self::getPropertyValue( $this->instance, 'term_indexation_action' ), ); self::assertInstanceOf( Indexable_Post_Type_Archive_Indexation_Action::class, - self::getPropertyValue( $this->instance, 'post_type_archive_indexation_action' ) + self::getPropertyValue( $this->instance, 'post_type_archive_indexation_action' ), ); self::assertInstanceOf( Indexable_General_Indexation_Action::class, - self::getPropertyValue( $this->instance, 'general_indexation_action' ) + self::getPropertyValue( $this->instance, 'general_indexation_action' ), ); self::assertInstanceOf( Indexing_Prepare_Action::class, - self::getPropertyValue( $this->instance, 'prepare_indexing_action' ) + self::getPropertyValue( $this->instance, 'prepare_indexing_action' ), ); } @@ -345,7 +345,7 @@ public function test_execute_with_reindexing() { [ 'reindex' => true, 'interval' => 500, - ] + ], ); } @@ -366,7 +366,7 @@ public function test_execute_multisite() { 'spam' => 0, 'deleted' => 0, 'archived' => 0, - ] + ], ) ->andReturn( [ 1, 2 ] ); @@ -393,7 +393,7 @@ public function test_execute_multisite() { \array_fill( 0, 25, true ), \array_fill( 0, 5, true ), \array_fill( 0, 25, true ), - \array_fill( 0, 5, true ) + \array_fill( 0, 5, true ), ); } @@ -419,7 +419,7 @@ public function test_execute_multisite() { [ 'network' => true, 'interval' => 500, - ] + ], ); } diff --git a/tests/Unit/Conditionals/Admin/Estimated_Reading_Time_Conditional_Test.php b/tests/Unit/Conditionals/Admin/Estimated_Reading_Time_Conditional_Test.php index 8ff0b3683cb..5352d28868d 100644 --- a/tests/Unit/Conditionals/Admin/Estimated_Reading_Time_Conditional_Test.php +++ b/tests/Unit/Conditionals/Admin/Estimated_Reading_Time_Conditional_Test.php @@ -43,7 +43,7 @@ public function set_up() { $this->post_conditional = Mockery::mock( Post_Conditional::class ); $this->instance = new Estimated_Reading_Time_Conditional( - $this->post_conditional + $this->post_conditional, ); } diff --git a/tests/Unit/Conditionals/Admin/Yoast_Admin_Conditional_Test.php b/tests/Unit/Conditionals/Admin/Yoast_Admin_Conditional_Test.php index 4a1c4902403..420f5c856d3 100644 --- a/tests/Unit/Conditionals/Admin/Yoast_Admin_Conditional_Test.php +++ b/tests/Unit/Conditionals/Admin/Yoast_Admin_Conditional_Test.php @@ -53,7 +53,7 @@ public function set_up() { public function test_constructor() { $this->assertInstanceOf( Current_Page_Helper::class, - $this->getPropertyValue( $this->instance, 'current_page_helper' ) + $this->getPropertyValue( $this->instance, 'current_page_helper' ), ); } diff --git a/tests/Unit/Conditionals/Attachment_Redirections_Enabled_Conditional_Test.php b/tests/Unit/Conditionals/Attachment_Redirections_Enabled_Conditional_Test.php index 59432b45bcf..c328b7fad46 100644 --- a/tests/Unit/Conditionals/Attachment_Redirections_Enabled_Conditional_Test.php +++ b/tests/Unit/Conditionals/Attachment_Redirections_Enabled_Conditional_Test.php @@ -52,7 +52,7 @@ protected function set_up() { public function test_construct() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options' ) + $this->getPropertyValue( $this->instance, 'options' ), ); } diff --git a/tests/Unit/Conditionals/Headless_Rest_Endpoints_Enabled_Conditional_Test.php b/tests/Unit/Conditionals/Headless_Rest_Endpoints_Enabled_Conditional_Test.php index a13a734955d..83ccfc11a66 100644 --- a/tests/Unit/Conditionals/Headless_Rest_Endpoints_Enabled_Conditional_Test.php +++ b/tests/Unit/Conditionals/Headless_Rest_Endpoints_Enabled_Conditional_Test.php @@ -52,7 +52,7 @@ protected function set_up() { public function test_construct() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options' ) + $this->getPropertyValue( $this->instance, 'options' ), ); } diff --git a/tests/Unit/Conditionals/Non_Multisite_Conditional_Test.php b/tests/Unit/Conditionals/Non_Multisite_Conditional_Test.php index ea2e91b1d83..943b76d34ed 100644 --- a/tests/Unit/Conditionals/Non_Multisite_Conditional_Test.php +++ b/tests/Unit/Conditionals/Non_Multisite_Conditional_Test.php @@ -43,7 +43,7 @@ public function test_is_not_met() { Monkey\Functions\stubs( [ 'is_multisite' => true, - ] + ], ); self::assertFalse( $this->instance->is_met() ); } @@ -59,7 +59,7 @@ public function test_is_met() { Monkey\Functions\stubs( [ 'is_multisite' => false, - ] + ], ); self::assertTrue( $this->instance->is_met() ); diff --git a/tests/Unit/Conditionals/Robots_Txt_Conditional_Test.php b/tests/Unit/Conditionals/Robots_Txt_Conditional_Test.php index 3dc5a389acb..56dec8b4283 100644 --- a/tests/Unit/Conditionals/Robots_Txt_Conditional_Test.php +++ b/tests/Unit/Conditionals/Robots_Txt_Conditional_Test.php @@ -55,7 +55,7 @@ public function test_construct() { $this->assertInstanceOf( Robots_Txt_Conditional::class, $this->instance ); $this->assertInstanceOf( Front_End_Conditional::class, - $this->getPropertyValue( $this->instance, 'front_end_conditional' ) + $this->getPropertyValue( $this->instance, 'front_end_conditional' ), ); } @@ -120,7 +120,7 @@ public function test_is_met_subdomain_network_admin() { Monkey\Functions\stubs( [ 'is_multisite' => true, - ] + ], ); Monkey\Functions\expect( 'is_network_admin' ) @@ -218,7 +218,7 @@ public function test_is_not_met_subdomain_non_network_admin() { Monkey\Functions\stubs( [ 'is_multisite' => true, - ] + ], ); Monkey\Functions\expect( 'is_network_admin' ) diff --git a/tests/Unit/Conditionals/Should_Index_Links_Conditional_Test.php b/tests/Unit/Conditionals/Should_Index_Links_Conditional_Test.php index 84d578bb591..e17817071d3 100644 --- a/tests/Unit/Conditionals/Should_Index_Links_Conditional_Test.php +++ b/tests/Unit/Conditionals/Should_Index_Links_Conditional_Test.php @@ -53,7 +53,7 @@ protected function set_up() { public function test_construct() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); } diff --git a/tests/Unit/Conditionals/Wincher_Automatically_Track_Conditional_Test.php b/tests/Unit/Conditionals/Wincher_Automatically_Track_Conditional_Test.php index 13a29e8da46..d06da6607f9 100644 --- a/tests/Unit/Conditionals/Wincher_Automatically_Track_Conditional_Test.php +++ b/tests/Unit/Conditionals/Wincher_Automatically_Track_Conditional_Test.php @@ -52,7 +52,7 @@ protected function set_up() { public function test_construct() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options' ) + $this->getPropertyValue( $this->instance, 'options' ), ); } diff --git a/tests/Unit/Conditionals/Wincher_Conditional_Test.php b/tests/Unit/Conditionals/Wincher_Conditional_Test.php index 661d6bf19e0..ed68cfe10a5 100644 --- a/tests/Unit/Conditionals/Wincher_Conditional_Test.php +++ b/tests/Unit/Conditionals/Wincher_Conditional_Test.php @@ -43,7 +43,7 @@ public function test_is_not_met() { Monkey\Functions\stubs( [ 'is_multisite' => true, - ] + ], ); self::assertFalse( $this->instance->is_met() ); } @@ -59,7 +59,7 @@ public function test_is_met() { Monkey\Functions\stubs( [ 'is_multisite' => false, - ] + ], ); self::assertTrue( $this->instance->is_met() ); diff --git a/tests/Unit/Conditionals/Wincher_Enabled_Conditional_Test.php b/tests/Unit/Conditionals/Wincher_Enabled_Conditional_Test.php index 59e2fa39baf..11ac4d4a2b1 100644 --- a/tests/Unit/Conditionals/Wincher_Enabled_Conditional_Test.php +++ b/tests/Unit/Conditionals/Wincher_Enabled_Conditional_Test.php @@ -52,7 +52,7 @@ protected function set_up() { public function test_construct() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options' ) + $this->getPropertyValue( $this->instance, 'options' ), ); } diff --git a/tests/Unit/Conditionals/Wincher_Token_Conditional_Test.php b/tests/Unit/Conditionals/Wincher_Token_Conditional_Test.php index a4c9635e433..d725a21955a 100644 --- a/tests/Unit/Conditionals/Wincher_Token_Conditional_Test.php +++ b/tests/Unit/Conditionals/Wincher_Token_Conditional_Test.php @@ -52,7 +52,7 @@ protected function set_up() { public function test_construct() { $this->assertInstanceOf( Wincher_Client::class, - $this->getPropertyValue( $this->instance, 'client' ) + $this->getPropertyValue( $this->instance, 'client' ), ); } diff --git a/tests/Unit/Config/Badge_Group_Names_Test.php b/tests/Unit/Config/Badge_Group_Names_Test.php index cd1fa4aa67d..a5623185409 100644 --- a/tests/Unit/Config/Badge_Group_Names_Test.php +++ b/tests/Unit/Config/Badge_Group_Names_Test.php @@ -60,7 +60,7 @@ public function test_unknown_group_is_eligible_for_new_badge() { self::assertFalse( $this->instance->is_still_eligible_for_new_badge( $unknown_group ), - 'Group "' . $unknown_group . '" should not exist and should not be considered "new"' + 'Group "' . $unknown_group . '" should not exist and should not be considered "new"', ); } @@ -76,7 +76,7 @@ public function test_global_templates_group_is_eligible_for_new_badge() { self::assertFalse( $this->instance->is_still_eligible_for_new_badge( self::TESTING_GROUP, $expiry_version ), - \sprintf( 'Group should not be "new" on version %s', $expiry_version ) + \sprintf( 'Group should not be "new" on version %s', $expiry_version ), ); } @@ -92,7 +92,7 @@ public function test_global_templates_group_is_eligible_for_new_badge_release_ca self::assertFalse( $this->instance->is_still_eligible_for_new_badge( self::TESTING_GROUP, $expiry_version ), - \sprintf( 'Group should not be "new" on version %s', $expiry_version ) + \sprintf( 'Group should not be "new" on version %s', $expiry_version ), ); } @@ -108,7 +108,7 @@ public function test_global_templates_group_no_longer_eligible_for_new_badge_on_ self::assertFalse( $this->instance->is_still_eligible_for_new_badge( self::TESTING_GROUP, $expiry_version ), - \sprintf( 'Group should not be "new" on version %s', $expiry_version ) + \sprintf( 'Group should not be "new" on version %s', $expiry_version ), ); } @@ -124,7 +124,7 @@ public function test_global_templates_group_no_longer_eligible_for_new_badge_on_ self::assertFalse( $this->instance->is_still_eligible_for_new_badge( self::TESTING_GROUP, $expiry_version ), - \sprintf( 'Group should not be "new" on version %s', $expiry_version ) + \sprintf( 'Group should not be "new" on version %s', $expiry_version ), ); } @@ -140,7 +140,7 @@ public function test_global_templates_group_no_longer_eligible_for_new_badge_on_ self::assertTrue( $this->instance->is_still_eligible_for_new_badge( self::TESTING_GROUP, $expiry_version ), - \sprintf( 'Group should be "new" on version %s', $expiry_version ) + \sprintf( 'Group should be "new" on version %s', $expiry_version ), ); } } diff --git a/tests/Unit/Config/OAuth_Client_Test.php b/tests/Unit/Config/OAuth_Client_Test.php index c5fda5bc58a..d4428533025 100644 --- a/tests/Unit/Config/OAuth_Client_Test.php +++ b/tests/Unit/Config/OAuth_Client_Test.php @@ -104,22 +104,22 @@ public function test_construct() { 'oauth_token', $this->provider, $this->options_helper, - ] + ], ); $this->assertEquals( 'oauth_token', - $this->getPropertyValue( $instance, 'token_option' ) + $this->getPropertyValue( $instance, 'token_option' ), ); $this->assertInstanceOf( GenericProvider::class, - $this->getPropertyValue( $instance, 'provider' ) + $this->getPropertyValue( $instance, 'provider' ), ); $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $instance, 'options_helper' ) + $this->getPropertyValue( $instance, 'options_helper' ), ); $this->assertNull( $this->getPropertyValue( $instance, 'token' ) ); @@ -143,11 +143,11 @@ public function test_construct_with_existing_token() { [ 'access_token' => '000000', 'refresh_token' => '000001', - 'expires' => 604800, + 'expires' => 604_800, 'has_expired' => true, 'created_at' => $this->time, 'error_count' => 0, - ] + ], ); $instance = Mockery::mock( @@ -156,27 +156,27 @@ public function test_construct_with_existing_token() { 'oauth_token', $this->provider, $this->options_helper, - ] + ], ); $this->assertEquals( 'oauth_token', - $this->getPropertyValue( $instance, 'token_option' ) + $this->getPropertyValue( $instance, 'token_option' ), ); $this->assertInstanceOf( GenericProvider::class, - $this->getPropertyValue( $instance, 'provider' ) + $this->getPropertyValue( $instance, 'provider' ), ); $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $instance, 'options_helper' ) + $this->getPropertyValue( $instance, 'options_helper' ), ); $this->assertInstanceOf( OAuth_Token::class, - $this->getPropertyValue( $instance, 'token' ) + $this->getPropertyValue( $instance, 'token' ), ); } @@ -192,9 +192,9 @@ public function test_valid_request_tokens_when_no_token_is_available() { [ 'getToken' => '000000', 'getRefreshToken' => '000001', - 'getExpires' => 604800, + 'getExpires' => 604_800, 'hasExpired' => false, - ] + ], ); $this->options_helper @@ -219,11 +219,11 @@ public function test_valid_request_tokens_when_no_token_is_available() { [ 'access_token' => '000000', 'refresh_token' => '000001', - 'expires' => 604800, + 'expires' => 604_800, 'has_expired' => true, 'created_at' => $this->time, 'error_count' => 0, - ] + ], ) ->andReturns( $this->token ); @@ -233,7 +233,7 @@ public function test_valid_request_tokens_when_no_token_is_available() { 'oauth_token', $this->provider, $this->options_helper, - ] + ], )->makePartial(); $requested_tokens = $instance->request_tokens( '123456' ); @@ -259,11 +259,11 @@ public function test_invalid_request_tokens_when_no_code_is_set() { [ 'access_token' => '000000', 'refresh_token' => '000001', - 'expires' => 604800, + 'expires' => 604_800, 'has_expired' => true, 'created_at' => $this->time, 'error_count' => 0, - ] + ], ); $this->provider @@ -278,7 +278,7 @@ public function test_invalid_request_tokens_when_no_code_is_set() { 'oauth_token', $this->provider, $this->options_helper, - ] + ], )->makePartial(); $instance->request_tokens( '' ); @@ -304,11 +304,11 @@ public function test_storing_token_success() { [ 'access_token' => '000000', 'refresh_token' => '000001', - 'expires' => 604800, + 'expires' => 604_800, 'has_expired' => true, 'created_at' => $this->time, 'error_count' => 0, - ] + ], ); $this->options_helper @@ -318,11 +318,11 @@ public function test_storing_token_success() { [ 'access_token' => '000000', 'refresh_token' => '000001', - 'expires' => 604800, + 'expires' => 604_800, 'has_expired' => true, 'created_at' => $this->time, 'error_count' => 0, - ] + ], ) ->once() ->andReturnTrue(); @@ -333,7 +333,7 @@ public function test_storing_token_success() { 'oauth_token', $this->provider, $this->options_helper, - ] + ], )->makePartial(); $stored_token = $instance->store_token( $this->token ); @@ -363,11 +363,11 @@ public function test_storing_token_failure() { [ 'access_token' => '000000', 'refresh_token' => '000001', - 'expires' => 604800, + 'expires' => 604_800, 'has_expired' => true, 'created_at' => $this->time, 'error_count' => 0, - ] + ], ); $this->options_helper @@ -377,11 +377,11 @@ public function test_storing_token_failure() { [ 'access_token' => '000000', 'refresh_token' => '000001', - 'expires' => 604800, + 'expires' => 604_800, 'has_expired' => true, 'created_at' => $this->time, 'error_count' => 0, - ] + ], ) ->once() ->andReturnFalse(); @@ -392,7 +392,7 @@ public function test_storing_token_failure() { 'oauth_token', $this->provider, $this->options_helper, - ] + ], )->makePartial(); $instance->store_token( $this->token ); @@ -431,11 +431,11 @@ public function test_get_request() { [ 'access_token' => '000000', 'refresh_token' => '000001', - 'expires' => ( $this->time + 604800 ), + 'expires' => ( $this->time + 604_800 ), 'has_expired' => false, 'created_at' => $this->time, 'error_count' => 0, - ] + ], ); $instance = Mockery::mock( @@ -444,7 +444,7 @@ public function test_get_request() { 'oauth_token', $this->provider, $this->options_helper, - ] + ], ) ->makePartial() ->shouldAllowMockingProtectedMethods(); @@ -474,7 +474,7 @@ public function test_post_request() { 'oauth_token', $this->provider, $this->options_helper, - ] + ], ) ->makePartial() ->shouldAllowMockingProtectedMethods(); @@ -486,7 +486,7 @@ public function test_post_request() { 'https://google.com', [ 'body' => 'request body', - ] + ], ) ->andReturn( [] ); @@ -513,7 +513,7 @@ public function test_delete_request() { 'oauth_token', $this->provider, $this->options_helper, - ] + ], ) ->makePartial() ->shouldAllowMockingProtectedMethods(); @@ -544,11 +544,11 @@ public function test_has_no_valid_token_set() { [ 'access_token' => '000000', 'refresh_token' => '000001', - 'expires' => 604800, + 'expires' => 604_800, 'has_expired' => true, 'created_at' => $this->time, 'error_count' => 0, - ] + ], ); $instance = Mockery::mock( @@ -557,7 +557,7 @@ public function test_has_no_valid_token_set() { 'oauth_token', $this->provider, $this->options_helper, - ] + ], ) ->makePartial(); @@ -584,7 +584,7 @@ public function test_has_no_token_set() { 'oauth_token', $this->provider, $this->options_helper, - ] + ], ) ->makePartial(); @@ -608,11 +608,11 @@ public function test_has_token_set() { [ 'access_token' => '000000', 'refresh_token' => '000001', - 'expires' => ( $this->time + 604800 ), + 'expires' => ( $this->time + 604_800 ), 'has_expired' => false, 'created_at' => $this->time, 'error_count' => 0, - ] + ], ); $instance = Mockery::mock( @@ -621,12 +621,12 @@ public function test_has_token_set() { 'oauth_token', $this->provider, $this->options_helper, - ] + ], ) ->makePartial(); $this->assertNotEmpty( - $this->getPropertyValue( $instance, 'token' ) + $this->getPropertyValue( $instance, 'token' ), ); $this->assertTrue( $instance->has_valid_tokens() ); @@ -654,7 +654,7 @@ public function test_get_tokens_when_not_set() { 'oauth_token', $this->provider, $this->options_helper, - ] + ], ) ->makePartial(); @@ -673,9 +673,9 @@ public function test_get_tokens_with_expired_token() { [ 'getToken' => '000000', 'getRefreshToken' => '000001', - 'getExpires' => 604800, + 'getExpires' => 604_800, 'hasExpired' => false, - ] + ], ); $this->time = \time(); @@ -688,11 +688,11 @@ public function test_get_tokens_with_expired_token() { [ 'access_token' => '000000', 'refresh_token' => '000001', - 'expires' => 604800, + 'expires' => 604_800, 'has_expired' => true, 'created_at' => $this->time, 'error_count' => 0, - ] + ], ); $this->options_helper @@ -705,7 +705,7 @@ public function test_get_tokens_with_expired_token() { 'oauth_token', $this->provider, $this->options_helper, - ] + ], )->makePartial() ->shouldAllowMockingProtectedMethods(); @@ -742,11 +742,11 @@ public function test_get_tokens() { [ 'access_token' => '000000', 'refresh_token' => '000001', - 'expires' => ( $this->time + 604800 ), + 'expires' => ( $this->time + 604_800 ), 'has_expired' => false, 'created_at' => $this->time, 'error_count' => 0, - ] + ], ); $instance = Mockery::mock( @@ -755,7 +755,7 @@ public function test_get_tokens() { 'oauth_token', $this->provider, $this->options_helper, - ] + ], )->makePartial(); $this->assertInstanceOf( OAuth_Token::class, $instance->get_tokens() ); @@ -779,20 +779,20 @@ public function test_refresh_tokens() { [ 'access_token' => '000000', 'refresh_token' => '000001', - 'expires' => 604800, + 'expires' => 604_800, 'has_expired' => true, 'created_at' => $this->time, 'error_count' => 0, - ] + ], ); $this->response->allows( [ 'getToken' => '000000', 'getRefreshToken' => '000001', - 'getExpires' => ( $this->time + 604800 ), + 'getExpires' => ( $this->time + 604_800 ), 'hasExpired' => false, - ] + ], ); $this->provider @@ -807,7 +807,7 @@ public function test_refresh_tokens() { 'oauth_token', $this->provider, $this->options_helper, - ] + ], )->makePartial() ->shouldAllowMockingProtectedMethods(); @@ -825,7 +825,7 @@ public function test_refresh_tokens() { $this->assertInstanceOf( OAuth_Token::class, - $this->getPropertyValue( $instance, 'token' ) + $this->getPropertyValue( $instance, 'token' ), ); } @@ -849,11 +849,11 @@ public function test_refresh_tokens_fails() { [ 'access_token' => '000000', 'refresh_token' => '000001', - 'expires' => 604800, + 'expires' => 604_800, 'has_expired' => true, 'created_at' => $this->time, 'error_count' => 0, - ] + ], ); $this->provider @@ -868,7 +868,7 @@ public function test_refresh_tokens_fails() { 'oauth_token', $this->provider, $this->options_helper, - ] + ], ) ->makePartial() ->shouldAllowMockingProtectedMethods(); @@ -915,11 +915,11 @@ public function test_refresh_tokens_fails_with_invalid_grant() { [ 'access_token' => '000000', 'refresh_token' => '000001', - 'expires' => 604800, + 'expires' => 604_800, 'has_expired' => true, 'created_at' => $this->time, 'error_count' => 0, - ] + ], ); $this->provider @@ -934,7 +934,7 @@ public function test_refresh_tokens_fails_with_invalid_grant() { 'oauth_token', $this->provider, $this->options_helper, - ] + ], ) ->makePartial() ->shouldAllowMockingProtectedMethods(); diff --git a/tests/Unit/Config/SEMrush_Client_Test.php b/tests/Unit/Config/SEMrush_Client_Test.php index a56254fd7bd..8361174e049 100644 --- a/tests/Unit/Config/SEMrush_Client_Test.php +++ b/tests/Unit/Config/SEMrush_Client_Test.php @@ -97,16 +97,16 @@ public function test_construct() { [ $this->options_helper, Mockery::mock( WP_Remote_Handler::class ), - ] + ], )->makePartial(); $this->assertInstanceOf( GenericProvider::class, - $this->getPropertyValue( $instance, 'provider' ) + $this->getPropertyValue( $instance, 'provider' ), ); $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $instance, 'options_helper' ) + $this->getPropertyValue( $instance, 'options_helper' ), ); } @@ -125,10 +125,10 @@ public function test_construct_with_pre_existing_token() { [ 'access_token' => '000000', 'refresh_token' => '000001', - 'expires' => 604800, + 'expires' => 604_800, 'has_expired' => true, - 'created_at' => 1234890, - ] + 'created_at' => 1_234_890, + ], ); $instance = Mockery::mock( @@ -136,20 +136,20 @@ public function test_construct_with_pre_existing_token() { [ $this->options_helper, Mockery::mock( WP_Remote_Handler::class ), - ] + ], )->makePartial(); $this->assertInstanceOf( GenericProvider::class, - $this->getPropertyValue( $instance, 'provider' ) + $this->getPropertyValue( $instance, 'provider' ), ); $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $instance, 'options_helper' ) + $this->getPropertyValue( $instance, 'options_helper' ), ); $this->assertInstanceOf( OAuth_Token::class, - $this->getPropertyValue( $instance, 'token' ) + $this->getPropertyValue( $instance, 'token' ), ); } } diff --git a/tests/Unit/Config/Wincher_Client_Test.php b/tests/Unit/Config/Wincher_Client_Test.php index ac8225468bd..84a2d7f8a74 100644 --- a/tests/Unit/Config/Wincher_Client_Test.php +++ b/tests/Unit/Config/Wincher_Client_Test.php @@ -67,10 +67,10 @@ public function test_construct() { [ 'access_token' => '000000', 'refresh_token' => '000001', - 'expires' => ( $this->time + 604800 ), + 'expires' => ( $this->time + 604_800 ), 'has_expired' => false, - 'created_at' => 1234890, - ] + 'created_at' => 1_234_890, + ], ); $instance = Mockery::mock( @@ -78,17 +78,17 @@ public function test_construct() { [ $this->options_helper, Mockery::mock( WP_Remote_Handler::class ), - ] + ], )->makePartial(); $this->assertInstanceOf( Wincher_PKCE_Provider::class, - $this->getPropertyValue( $instance, 'provider' ) + $this->getPropertyValue( $instance, 'provider' ), ); $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $instance, 'options_helper' ) + $this->getPropertyValue( $instance, 'options_helper' ), ); } } diff --git a/tests/Unit/Content_Type_Visibility/Application/Content_Type_Visibility_Dismiss_Notifications_Test.php b/tests/Unit/Content_Type_Visibility/Application/Content_Type_Visibility_Dismiss_Notifications_Test.php index 2152afb6367..ce22a9da3d2 100644 --- a/tests/Unit/Content_Type_Visibility/Application/Content_Type_Visibility_Dismiss_Notifications_Test.php +++ b/tests/Unit/Content_Type_Visibility/Application/Content_Type_Visibility_Dismiss_Notifications_Test.php @@ -56,7 +56,7 @@ public function test_construct() { $this->assertInstanceOf( Options_Helper::class, $this->getPropertyValue( $this->instance, 'options' ), - 'Options helper is not set correctly.' + 'Options helper is not set correctly.', ); } diff --git a/tests/Unit/Content_Type_Visibility/Application/Content_Type_Visibility_Watcher_Actions_Test.php b/tests/Unit/Content_Type_Visibility/Application/Content_Type_Visibility_Watcher_Actions_Test.php index 6decf0dbad6..7c7e9964857 100644 --- a/tests/Unit/Content_Type_Visibility/Application/Content_Type_Visibility_Watcher_Actions_Test.php +++ b/tests/Unit/Content_Type_Visibility/Application/Content_Type_Visibility_Watcher_Actions_Test.php @@ -76,7 +76,7 @@ protected function set_up() { $this->instance = new Content_Type_Visibility_Watcher_Actions( $this->options, $this->notification_center, - $this->content_type_dismiss_notifications + $this->content_type_dismiss_notifications, ); } @@ -91,19 +91,19 @@ public function test_construct() { $this->assertInstanceOf( Options_Helper::class, $this->getPropertyValue( $this->instance, 'options' ), - 'Options helper is set correctly.' + 'Options helper is set correctly.', ); $this->assertInstanceOf( Yoast_Notification_Center::class, $this->getPropertyValue( $this->instance, 'notification_center' ), - 'Notification center is set correctly.' + 'Notification center is set correctly.', ); $this->assertInstanceOf( Content_Type_Visibility_Dismiss_Notifications::class, $this->getPropertyValue( $this->instance, 'content_type_dismiss_notifications' ), - 'Content type dismiss notifications is set correctly.' + 'Content type dismiss notifications is set correctly.', ); } @@ -338,7 +338,7 @@ public function test_maybe_add_notification() { [ 'esc_url' => 'https://yoa.st/3.0-content-types', 'admin_url' => 'admin.php?page=wpseo_page_settings', - ] + ], ); Monkey\Functions\expect( 'get_current_user_id' ) diff --git a/tests/Unit/Content_Type_Visibility/User_Interface/Content_Type_Visibility_Dismiss_New_Route_Test.php b/tests/Unit/Content_Type_Visibility/User_Interface/Content_Type_Visibility_Dismiss_New_Route_Test.php index ec604002811..c4c7c7f9bbe 100644 --- a/tests/Unit/Content_Type_Visibility/User_Interface/Content_Type_Visibility_Dismiss_New_Route_Test.php +++ b/tests/Unit/Content_Type_Visibility/User_Interface/Content_Type_Visibility_Dismiss_New_Route_Test.php @@ -58,7 +58,7 @@ public function test_construct() { $this->assertInstanceOf( Content_Type_Visibility_Dismiss_Notifications::class, $this->getPropertyValue( $this->instance, 'dismiss_notifications' ), - 'Content_Type_Visibility_Dismiss_Notifications is set correctly.' + 'Content_Type_Visibility_Dismiss_Notifications is set correctly.', ); } @@ -85,7 +85,7 @@ public function test_register_routes() { }, ], ], - ] + ], ) ->once(); @@ -104,7 +104,7 @@ public function test_register_routes() { }, ], ], - ] + ], ) ->once(); @@ -187,7 +187,7 @@ public function test_post_type_dismiss_callback() { 'message' => 'Post type is no longer new.', 'success' => true, 'status' => 200, - ] + ], ); Mockery::mock( 'overload:' . WP_REST_Response::class ); @@ -221,7 +221,7 @@ public function test_taxonomy_dismiss_callback() { 'message' => 'Taxonomy is no longer new.', 'success' => true, 'status' => 200, - ] + ], ); Mockery::mock( 'overload:' . WP_REST_Response::class ); diff --git a/tests/Unit/Context/Meta_Tags_Context_Test.php b/tests/Unit/Context/Meta_Tags_Context_Test.php index ac6e0ab27a1..e256755edca 100644 --- a/tests/Unit/Context/Meta_Tags_Context_Test.php +++ b/tests/Unit/Context/Meta_Tags_Context_Test.php @@ -134,7 +134,7 @@ protected function set_up() { $this->user, $this->permalink_helper, $this->indexable_helper, - $this->indexable_repository + $this->indexable_repository, ); } @@ -512,7 +512,7 @@ public function test_generate_site_represents_company_with_name_and_logo() { 'size' => 'full', 'id' => 12, 'alt' => 'Alt. Text', - 'pixels' => 307200, + 'pixels' => 307_200, 'type' => 'image/jpeg', ]; diff --git a/tests/Unit/Dashboard/Application/Configuration/Abstract_Dashboard_Configuration_Test.php b/tests/Unit/Dashboard/Application/Configuration/Abstract_Dashboard_Configuration_Test.php index 9794ac25d35..27578d91d1a 100644 --- a/tests/Unit/Dashboard/Application/Configuration/Abstract_Dashboard_Configuration_Test.php +++ b/tests/Unit/Dashboard/Application/Configuration/Abstract_Dashboard_Configuration_Test.php @@ -120,7 +120,7 @@ protected function set_up() { $this->nonce_repository, $this->site_kit_integration_data, $this->setup_steps_tracking, - $this->browser_cache_configuration + $this->browser_cache_configuration, ); } } diff --git a/tests/Unit/Dashboard/Application/Configuration/Dashboard_Configuration_Constructor_Test.php b/tests/Unit/Dashboard/Application/Configuration/Dashboard_Configuration_Constructor_Test.php index 411e17e1f1a..0eb7c573c68 100644 --- a/tests/Unit/Dashboard/Application/Configuration/Dashboard_Configuration_Constructor_Test.php +++ b/tests/Unit/Dashboard/Application/Configuration/Dashboard_Configuration_Constructor_Test.php @@ -32,40 +32,40 @@ final class Dashboard_Configuration_Constructor_Test extends Abstract_Dashboard_ public function test_constructor() { $this->assertInstanceOf( Content_Types_Repository::class, - $this->getPropertyValue( $this->instance, 'content_types_repository' ) + $this->getPropertyValue( $this->instance, 'content_types_repository' ), ); $this->assertInstanceOf( Indexable_Helper::class, - $this->getPropertyValue( $this->instance, 'indexable_helper' ) + $this->getPropertyValue( $this->instance, 'indexable_helper' ), ); $this->assertInstanceOf( User_Helper::class, - $this->getPropertyValue( $this->instance, 'user_helper' ) + $this->getPropertyValue( $this->instance, 'user_helper' ), ); $this->assertInstanceOf( Enabled_Analysis_Features_Repository::class, - $this->getPropertyValue( $this->instance, 'enabled_analysis_features_repository' ) + $this->getPropertyValue( $this->instance, 'enabled_analysis_features_repository' ), ); $this->assertInstanceOf( Endpoints_Repository::class, - $this->getPropertyValue( $this->instance, 'endpoints_repository' ) + $this->getPropertyValue( $this->instance, 'endpoints_repository' ), ); $this->assertInstanceOf( Nonce_Repository::class, - $this->getPropertyValue( $this->instance, 'nonce_repository' ) + $this->getPropertyValue( $this->instance, 'nonce_repository' ), ); $this->assertInstanceOf( Site_Kit::class, - $this->getPropertyValue( $this->instance, 'site_kit_integration_data' ) + $this->getPropertyValue( $this->instance, 'site_kit_integration_data' ), ); $this->assertInstanceOf( Setup_Steps_Tracking::class, - $this->getPropertyValue( $this->instance, 'setup_steps_tracking' ) + $this->getPropertyValue( $this->instance, 'setup_steps_tracking' ), ); $this->assertInstanceOf( Browser_Cache_Configuration::class, - $this->getPropertyValue( $this->instance, 'browser_cache_configuration' ) + $this->getPropertyValue( $this->instance, 'browser_cache_configuration' ), ); } } diff --git a/tests/Unit/Dashboard/Application/Configuration/Dashboard_Configuration_Get_Configuration_Test.php b/tests/Unit/Dashboard/Application/Configuration/Dashboard_Configuration_Get_Configuration_Test.php index d943af34507..7837bc52bc8 100644 --- a/tests/Unit/Dashboard/Application/Configuration/Dashboard_Configuration_Get_Configuration_Test.php +++ b/tests/Unit/Dashboard/Application/Configuration/Dashboard_Configuration_Get_Configuration_Test.php @@ -62,7 +62,7 @@ public function test_get_configuration( $content_types, $indexables_enabled, $di 'setupStepsTracking' => $setup_steps_tracking, 'browserCache' => $cache_configuration, ], - $this->instance->get_configuration() + $this->instance->get_configuration(), ); } diff --git a/tests/Unit/Dashboard/Application/Tracking/Abstract_Setup_Steps_Tracking_Test.php b/tests/Unit/Dashboard/Application/Tracking/Abstract_Setup_Steps_Tracking_Test.php index 24345b18270..197fb043578 100644 --- a/tests/Unit/Dashboard/Application/Tracking/Abstract_Setup_Steps_Tracking_Test.php +++ b/tests/Unit/Dashboard/Application/Tracking/Abstract_Setup_Steps_Tracking_Test.php @@ -34,7 +34,7 @@ protected function set_up() { Mockery::mock( WP_Error::class ); $this->instance = new Setup_Steps_Tracking( - new Setup_Steps_Tracking_Repository_Fake() + new Setup_Steps_Tracking_Repository_Fake(), ); } } diff --git a/tests/Unit/Dashboard/Application/Tracking/Setup_Steps_Tracking_Constructor_Test.php b/tests/Unit/Dashboard/Application/Tracking/Setup_Steps_Tracking_Constructor_Test.php index 24a50cbfc1f..86f8d415208 100644 --- a/tests/Unit/Dashboard/Application/Tracking/Setup_Steps_Tracking_Constructor_Test.php +++ b/tests/Unit/Dashboard/Application/Tracking/Setup_Steps_Tracking_Constructor_Test.php @@ -24,7 +24,7 @@ final class Setup_Steps_Tracking_Constructor_Test extends Abstract_Setup_Steps_T public function test_construct() { $this->assertInstanceOf( Setup_Steps_Tracking_Repository_Interface::class, - $this->getPropertyValue( $this->instance, 'setup_steps_tracking_repository' ) + $this->getPropertyValue( $this->instance, 'setup_steps_tracking_repository' ), ); } } diff --git a/tests/Unit/Dashboard/Infrastructure/Browser_Cache/Browser_Cache_Configuration_Get_Configuration_Test.php b/tests/Unit/Dashboard/Infrastructure/Browser_Cache/Browser_Cache_Configuration_Get_Configuration_Test.php index 82bd6bd986d..3a233ba3b6d 100644 --- a/tests/Unit/Dashboard/Infrastructure/Browser_Cache/Browser_Cache_Configuration_Get_Configuration_Test.php +++ b/tests/Unit/Dashboard/Infrastructure/Browser_Cache/Browser_Cache_Configuration_Get_Configuration_Test.php @@ -60,7 +60,7 @@ public function test_get_configuration( Functions\expect( 'wp_hash' ) ->once() - ->with( $to_hash, ) + ->with( $to_hash ) ->andReturn( $hash ); $this->assertEquals( $expected, $this->instance->get_configuration() ); diff --git a/tests/Unit/Dashboard/Infrastructure/Configuration/Permanently_Dismissed_Site_Kit_Configuration_Repository_Constructor_Test.php b/tests/Unit/Dashboard/Infrastructure/Configuration/Permanently_Dismissed_Site_Kit_Configuration_Repository_Constructor_Test.php index 131f879162f..459ee7b014c 100644 --- a/tests/Unit/Dashboard/Infrastructure/Configuration/Permanently_Dismissed_Site_Kit_Configuration_Repository_Constructor_Test.php +++ b/tests/Unit/Dashboard/Infrastructure/Configuration/Permanently_Dismissed_Site_Kit_Configuration_Repository_Constructor_Test.php @@ -24,7 +24,7 @@ final class Permanently_Dismissed_Site_Kit_Configuration_Repository_Constructor_ public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); } } diff --git a/tests/Unit/Dashboard/Infrastructure/Configuration/Site_Kit_Consent_Repository_Constructor_Test.php b/tests/Unit/Dashboard/Infrastructure/Configuration/Site_Kit_Consent_Repository_Constructor_Test.php index 20201e30d00..11f5ba843ec 100644 --- a/tests/Unit/Dashboard/Infrastructure/Configuration/Site_Kit_Consent_Repository_Constructor_Test.php +++ b/tests/Unit/Dashboard/Infrastructure/Configuration/Site_Kit_Consent_Repository_Constructor_Test.php @@ -24,7 +24,7 @@ final class Site_Kit_Consent_Repository_Constructor_Test extends Abstract_Site_K public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); } } diff --git a/tests/Unit/Dashboard/Infrastructure/Endpoints/Readability_Scores_Endpoint_Test.php b/tests/Unit/Dashboard/Infrastructure/Endpoints/Readability_Scores_Endpoint_Test.php index 74ab7dca24f..e792a635831 100644 --- a/tests/Unit/Dashboard/Infrastructure/Endpoints/Readability_Scores_Endpoint_Test.php +++ b/tests/Unit/Dashboard/Infrastructure/Endpoints/Readability_Scores_Endpoint_Test.php @@ -74,7 +74,7 @@ public function test_get_url() { Functions\expect( 'rest_url' ) ->once() ->with( - 'yoast/v1/readability_scores' + 'yoast/v1/readability_scores', )->andReturnFirstArg(); $this->assertSame( 'yoast/v1/readability_scores', $this->instance->get_url() ); } diff --git a/tests/Unit/Dashboard/Infrastructure/Endpoints/SEO_Scores_Endpoint_Test.php b/tests/Unit/Dashboard/Infrastructure/Endpoints/SEO_Scores_Endpoint_Test.php index 64421c30fee..24e3b4dec4f 100644 --- a/tests/Unit/Dashboard/Infrastructure/Endpoints/SEO_Scores_Endpoint_Test.php +++ b/tests/Unit/Dashboard/Infrastructure/Endpoints/SEO_Scores_Endpoint_Test.php @@ -74,7 +74,7 @@ public function test_get_url() { Functions\expect( 'rest_url' ) ->once() ->with( - 'yoast/v1/seo_scores' + 'yoast/v1/seo_scores', )->andReturnFirstArg(); $this->assertSame( 'yoast/v1/seo_scores', $this->instance->get_url() ); } diff --git a/tests/Unit/Dashboard/Infrastructure/Endpoints/Site_Kit_Configuration_Dismissal_Endpoint_Test.php b/tests/Unit/Dashboard/Infrastructure/Endpoints/Site_Kit_Configuration_Dismissal_Endpoint_Test.php index 17708ac59c5..403d58254e6 100644 --- a/tests/Unit/Dashboard/Infrastructure/Endpoints/Site_Kit_Configuration_Dismissal_Endpoint_Test.php +++ b/tests/Unit/Dashboard/Infrastructure/Endpoints/Site_Kit_Configuration_Dismissal_Endpoint_Test.php @@ -74,7 +74,7 @@ public function test_get_url() { Functions\expect( 'rest_url' ) ->once() ->with( - 'yoast/v1/site_kit_configuration_permanent_dismissal' + 'yoast/v1/site_kit_configuration_permanent_dismissal', )->andReturnFirstArg(); $this->assertSame( 'yoast/v1/site_kit_configuration_permanent_dismissal', $this->instance->get_url() ); } diff --git a/tests/Unit/Dashboard/Infrastructure/Endpoints/Site_Kit_Consent_Management_Endpoint_Test.php b/tests/Unit/Dashboard/Infrastructure/Endpoints/Site_Kit_Consent_Management_Endpoint_Test.php index 9d58b8c181f..4fd2f222c70 100644 --- a/tests/Unit/Dashboard/Infrastructure/Endpoints/Site_Kit_Consent_Management_Endpoint_Test.php +++ b/tests/Unit/Dashboard/Infrastructure/Endpoints/Site_Kit_Consent_Management_Endpoint_Test.php @@ -74,7 +74,7 @@ public function test_get_url() { Functions\expect( 'rest_url' ) ->once() ->with( - 'yoast/v1/site_kit_manage_consent' + 'yoast/v1/site_kit_manage_consent', )->andReturnFirstArg(); $this->assertSame( 'yoast/v1/site_kit_manage_consent', $this->instance->get_url() ); } diff --git a/tests/Unit/Dashboard/Infrastructure/Endpoints/Time_Based_SEO_Metrics_Endpoint_Test.php b/tests/Unit/Dashboard/Infrastructure/Endpoints/Time_Based_SEO_Metrics_Endpoint_Test.php index 610a3ad9e59..73ab5697bd1 100644 --- a/tests/Unit/Dashboard/Infrastructure/Endpoints/Time_Based_SEO_Metrics_Endpoint_Test.php +++ b/tests/Unit/Dashboard/Infrastructure/Endpoints/Time_Based_SEO_Metrics_Endpoint_Test.php @@ -74,7 +74,7 @@ public function test_get_url() { Functions\expect( 'rest_url' ) ->once() ->with( - 'yoast/v1/time_based_seo_metrics' + 'yoast/v1/time_based_seo_metrics', )->andReturnFirstArg(); $this->assertSame( 'yoast/v1/time_based_seo_metrics', $this->instance->get_url() ); } diff --git a/tests/Unit/Dashboard/Infrastructure/Integrations/Site_Kit_To_Array_Test.php b/tests/Unit/Dashboard/Infrastructure/Integrations/Site_Kit_To_Array_Test.php index b481af53e25..5ff3a58da75 100644 --- a/tests/Unit/Dashboard/Infrastructure/Integrations/Site_Kit_To_Array_Test.php +++ b/tests/Unit/Dashboard/Infrastructure/Integrations/Site_Kit_To_Array_Test.php @@ -81,7 +81,7 @@ public function test_to_array( '//core/modules/data/list', '//core/user/data/permissions', '//core/site/data/connection', - ] + ], ); Functions\expect( 'rest_preload_api_request' )->andReturn( [ @@ -91,7 +91,7 @@ public function test_to_array( '//core/modules/data/list' => [ 'body' => $data_list, ], - ] + ], ); } diff --git a/tests/Unit/Dashboard/Infrastructure/Score_Groups/Get_View_Link_Score_Group_Link_Collector_Test.php b/tests/Unit/Dashboard/Infrastructure/Score_Groups/Get_View_Link_Score_Group_Link_Collector_Test.php index 6ee97844fca..323d94a3d2e 100644 --- a/tests/Unit/Dashboard/Infrastructure/Score_Groups/Get_View_Link_Score_Group_Link_Collector_Test.php +++ b/tests/Unit/Dashboard/Infrastructure/Score_Groups/Get_View_Link_Score_Group_Link_Collector_Test.php @@ -61,7 +61,7 @@ public function test_get_view_link_without_taxonomy() { 'post_status' => 'publish', 'post_type' => $content_type->get_name(), $score_group->get_filter_key() => $score_group->get_filter_value(), - ] + ], ) ->andReturn( 'edit.php?post_status=publish&page_type=' . $content_type->get_name() . '&' . $score_group->get_filter_key() . '=' . $score_group->get_filter_value() ); @@ -102,7 +102,7 @@ public function test_get_view_link_with_taxonomy() { 'post_status' => 'publish', 'post_type' => $content_type->get_name(), $score_group->get_filter_key() => $score_group->get_filter_value(), - ] + ], ) ->andReturn( 'edit.php?post_status=publish&page_type=' . $content_type->get_name() . '&' . $score_group->get_filter_key() . '=' . $score_group->get_filter_value() . '&query=slug' ); @@ -178,7 +178,7 @@ public function test_get_view_link_with_taxonomy_but_no_query_var( 'post_status' => 'publish', 'post_type' => $content_type->get_name(), $score_group->get_filter_key() => $score_group->get_filter_value(), - ] + ], ) ->andReturn( 'edit.php?post_status=publish&page_type=' . $content_type->get_name() . '&' . $score_group->get_filter_key() . '=' . $score_group->get_filter_value() . '&' . $taxonomy_query_var . '=slug' ); diff --git a/tests/Unit/Dashboard/Infrastructure/Tracking/Setup_Steps_Tracking_Repository_Constructor_Test.php b/tests/Unit/Dashboard/Infrastructure/Tracking/Setup_Steps_Tracking_Repository_Constructor_Test.php index dcd7f3d37b4..147015841bd 100644 --- a/tests/Unit/Dashboard/Infrastructure/Tracking/Setup_Steps_Tracking_Repository_Constructor_Test.php +++ b/tests/Unit/Dashboard/Infrastructure/Tracking/Setup_Steps_Tracking_Repository_Constructor_Test.php @@ -24,7 +24,7 @@ final class Setup_Steps_Tracking_Repository_Constructor_Test extends Abstract_Se public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); } } diff --git a/tests/Unit/Dashboard/User_Interface/Configuration/Abstract_Site_Kit_Configuration_Permanent_Dismissal_Route_Test.php b/tests/Unit/Dashboard/User_Interface/Configuration/Abstract_Site_Kit_Configuration_Permanent_Dismissal_Route_Test.php index af39a9c26f8..5c997600b35 100644 --- a/tests/Unit/Dashboard/User_Interface/Configuration/Abstract_Site_Kit_Configuration_Permanent_Dismissal_Route_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Configuration/Abstract_Site_Kit_Configuration_Permanent_Dismissal_Route_Test.php @@ -46,7 +46,7 @@ protected function set_up() { $this->instance = new Site_Kit_Configuration_Dismissal_Route( new Permanently_Dismissed_Site_Kit_Configuration_Repository_Fake(), - $this->capability_helper + $this->capability_helper, ); } } diff --git a/tests/Unit/Dashboard/User_Interface/Configuration/Abstract_Site_Kit_Consent_Management_Route_Test.php b/tests/Unit/Dashboard/User_Interface/Configuration/Abstract_Site_Kit_Consent_Management_Route_Test.php index f0ee36cbedf..abf4e2be4e0 100644 --- a/tests/Unit/Dashboard/User_Interface/Configuration/Abstract_Site_Kit_Consent_Management_Route_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Configuration/Abstract_Site_Kit_Consent_Management_Route_Test.php @@ -46,7 +46,7 @@ protected function set_up() { $this->instance = new Site_Kit_Consent_Management_Route( new Site_Kit_Consent_Repository_Fake(), - $this->capability_helper + $this->capability_helper, ); } } diff --git a/tests/Unit/Dashboard/User_Interface/Configuration/Set_Site_Kit_Consent_Test.php b/tests/Unit/Dashboard/User_Interface/Configuration/Set_Site_Kit_Consent_Test.php index 83ee149d41f..fafac9a9a05 100644 --- a/tests/Unit/Dashboard/User_Interface/Configuration/Set_Site_Kit_Consent_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Configuration/Set_Site_Kit_Consent_Test.php @@ -37,7 +37,7 @@ public function test_set_site_kit_consent( $consent, $expected_status ) { [ 'success' => $consent, ], - $expected_status + $expected_status, ) ->once(); @@ -49,7 +49,7 @@ public function test_set_site_kit_consent( $consent, $expected_status ) { $this->assertInstanceOf( 'WP_REST_Response', - $this->instance->set_site_kit_consent( $wp_rest_request ) + $this->instance->set_site_kit_consent( $wp_rest_request ), ); } diff --git a/tests/Unit/Dashboard/User_Interface/Configuration/Set_Site_Kit_Permanent_Dismissal_Test.php b/tests/Unit/Dashboard/User_Interface/Configuration/Set_Site_Kit_Permanent_Dismissal_Test.php index 0e216450b0d..bf1397b70a4 100644 --- a/tests/Unit/Dashboard/User_Interface/Configuration/Set_Site_Kit_Permanent_Dismissal_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Configuration/Set_Site_Kit_Permanent_Dismissal_Test.php @@ -37,7 +37,7 @@ public function test_set_site_kit_configuration_permanent_dismissal( $is_dismiss [ 'success' => $is_dismissed, ], - $expected_status + $expected_status, ) ->once(); @@ -49,7 +49,7 @@ public function test_set_site_kit_configuration_permanent_dismissal( $is_dismiss $this->assertInstanceOf( 'WP_REST_Response', - $this->instance->set_site_kit_configuration_permanent_dismissal( $wp_rest_request ) + $this->instance->set_site_kit_configuration_permanent_dismissal( $wp_rest_request ), ); } diff --git a/tests/Unit/Dashboard/User_Interface/Configuration/Site_Kit_Configuration_Permanent_Dismissal_Route_Constructor_Test.php b/tests/Unit/Dashboard/User_Interface/Configuration/Site_Kit_Configuration_Permanent_Dismissal_Route_Constructor_Test.php index 171be301903..cc9ea0b974f 100644 --- a/tests/Unit/Dashboard/User_Interface/Configuration/Site_Kit_Configuration_Permanent_Dismissal_Route_Constructor_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Configuration/Site_Kit_Configuration_Permanent_Dismissal_Route_Constructor_Test.php @@ -24,7 +24,7 @@ final class Site_Kit_Configuration_Permanent_Dismissal_Route_Constructor_Test ex public function test_construct() { $this->assertInstanceOf( Permanently_Dismissed_Site_Kit_Configuration_Repository_Interface::class, - $this->getPropertyValue( $this->instance, 'permanently_dismissed_site_kit_configuration_repository' ) + $this->getPropertyValue( $this->instance, 'permanently_dismissed_site_kit_configuration_repository' ), ); } } diff --git a/tests/Unit/Dashboard/User_Interface/Configuration/Site_Kit_Configuration_Permanent_Dismissal_Route_Register_Routes_Test.php b/tests/Unit/Dashboard/User_Interface/Configuration/Site_Kit_Configuration_Permanent_Dismissal_Route_Register_Routes_Test.php index e9b62e93131..675b4ef29c3 100644 --- a/tests/Unit/Dashboard/User_Interface/Configuration/Site_Kit_Configuration_Permanent_Dismissal_Route_Register_Routes_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Configuration/Site_Kit_Configuration_Permanent_Dismissal_Route_Register_Routes_Test.php @@ -40,7 +40,7 @@ public function test_register_routes() { ], ], ], - ] + ], ); $this->instance->register_routes(); diff --git a/tests/Unit/Dashboard/User_Interface/Configuration/Site_Kit_Consent_Management_Route_Constructor_Test.php b/tests/Unit/Dashboard/User_Interface/Configuration/Site_Kit_Consent_Management_Route_Constructor_Test.php index 2a62404c013..54de5a472a7 100644 --- a/tests/Unit/Dashboard/User_Interface/Configuration/Site_Kit_Consent_Management_Route_Constructor_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Configuration/Site_Kit_Consent_Management_Route_Constructor_Test.php @@ -24,7 +24,7 @@ final class Site_Kit_Consent_Management_Route_Constructor_Test extends Abstract_ public function test_construct() { $this->assertInstanceOf( Site_Kit_Consent_Repository_Interface::class, - $this->getPropertyValue( $this->instance, 'site_kit_consent_repository' ) + $this->getPropertyValue( $this->instance, 'site_kit_consent_repository' ), ); } } diff --git a/tests/Unit/Dashboard/User_Interface/Configuration/Site_Kit_Consent_Management_Route_Register_Routes_Test.php b/tests/Unit/Dashboard/User_Interface/Configuration/Site_Kit_Consent_Management_Route_Register_Routes_Test.php index 1a9a3345965..374d1478c87 100644 --- a/tests/Unit/Dashboard/User_Interface/Configuration/Site_Kit_Consent_Management_Route_Register_Routes_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Configuration/Site_Kit_Consent_Management_Route_Register_Routes_Test.php @@ -40,7 +40,7 @@ public function test_register_routes() { ], ], ], - ] + ], ); $this->instance->register_routes(); diff --git a/tests/Unit/Dashboard/User_Interface/Setup/Abstract_Setup_Url_Interceptor_Test.php b/tests/Unit/Dashboard/User_Interface/Setup/Abstract_Setup_Url_Interceptor_Test.php index b9cdc0621bd..376cab6b2c4 100644 --- a/tests/Unit/Dashboard/User_Interface/Setup/Abstract_Setup_Url_Interceptor_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Setup/Abstract_Setup_Url_Interceptor_Test.php @@ -64,7 +64,7 @@ protected function set_up() { $this->instance = new Setup_Url_Interceptor( $this->current_page_helper, $this->site_kit, - $this->redirect_helper + $this->redirect_helper, ); } } diff --git a/tests/Unit/Dashboard/User_Interface/Setup/Setup_Flow_Interceptor_Constructor_Test.php b/tests/Unit/Dashboard/User_Interface/Setup/Setup_Flow_Interceptor_Constructor_Test.php index de361e858f6..ef08d9154d6 100644 --- a/tests/Unit/Dashboard/User_Interface/Setup/Setup_Flow_Interceptor_Constructor_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Setup/Setup_Flow_Interceptor_Constructor_Test.php @@ -25,11 +25,11 @@ final class Setup_Flow_Interceptor_Constructor_Test extends Abstract_Setup_Flow_ public function test_construct() { $this->assertInstanceOf( Current_Page_Helper::class, - $this->getPropertyValue( $this->instance, 'current_page_helper' ) + $this->getPropertyValue( $this->instance, 'current_page_helper' ), ); $this->assertInstanceOf( Redirect_Helper::class, - $this->getPropertyValue( $this->instance, 'redirect_helper' ) + $this->getPropertyValue( $this->instance, 'redirect_helper' ), ); } } diff --git a/tests/Unit/Dashboard/User_Interface/Setup/Setup_Flow_Interceptor_Register_Hooks_Test.php b/tests/Unit/Dashboard/User_Interface/Setup/Setup_Flow_Interceptor_Register_Hooks_Test.php index 9f36e5350a0..fc39e9b00c3 100644 --- a/tests/Unit/Dashboard/User_Interface/Setup/Setup_Flow_Interceptor_Register_Hooks_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Setup/Setup_Flow_Interceptor_Register_Hooks_Test.php @@ -26,8 +26,8 @@ public function test_register_hooks() { 999, \has_action( 'admin_init', - [ $this->instance, 'intercept_site_kit_setup_flow' ] - ) + [ $this->instance, 'intercept_site_kit_setup_flow' ], + ), ); } } diff --git a/tests/Unit/Dashboard/User_Interface/Setup/Setup_Url_Interceptor_Add_Redirect_Page_Test.php b/tests/Unit/Dashboard/User_Interface/Setup/Setup_Url_Interceptor_Add_Redirect_Page_Test.php index caef44a8ad3..c0847803ecd 100644 --- a/tests/Unit/Dashboard/User_Interface/Setup/Setup_Url_Interceptor_Add_Redirect_Page_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Setup/Setup_Url_Interceptor_Add_Redirect_Page_Test.php @@ -29,7 +29,7 @@ public function test_add_redirect_page() { '', '', 'wpseo_manage_options', - 'wpseo_page_site_kit_set_up' + 'wpseo_page_site_kit_set_up', ); $this->assertEquals( [], $this->instance->add_redirect_page( [] ) ); diff --git a/tests/Unit/Dashboard/User_Interface/Setup/Setup_Url_Interceptor_Constructor_Test.php b/tests/Unit/Dashboard/User_Interface/Setup/Setup_Url_Interceptor_Constructor_Test.php index 37a6c5863f2..67f92e62094 100644 --- a/tests/Unit/Dashboard/User_Interface/Setup/Setup_Url_Interceptor_Constructor_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Setup/Setup_Url_Interceptor_Constructor_Test.php @@ -26,15 +26,15 @@ final class Setup_Url_Interceptor_Constructor_Test extends Abstract_Setup_Url_In public function test_construct() { $this->assertInstanceOf( Current_Page_Helper::class, - $this->getPropertyValue( $this->instance, 'current_page_helper' ) + $this->getPropertyValue( $this->instance, 'current_page_helper' ), ); $this->assertInstanceOf( Site_Kit::class, - $this->getPropertyValue( $this->instance, 'site_kit_configuration' ) + $this->getPropertyValue( $this->instance, 'site_kit_configuration' ), ); $this->assertInstanceOf( Redirect_Helper::class, - $this->getPropertyValue( $this->instance, 'redirect_helper' ) + $this->getPropertyValue( $this->instance, 'redirect_helper' ), ); } } diff --git a/tests/Unit/Dashboard/User_Interface/Setup/Setup_Url_Interceptor_Register_Hooks_Test.php b/tests/Unit/Dashboard/User_Interface/Setup/Setup_Url_Interceptor_Register_Hooks_Test.php index b484990ba20..f363e68e296 100644 --- a/tests/Unit/Dashboard/User_Interface/Setup/Setup_Url_Interceptor_Register_Hooks_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Setup/Setup_Url_Interceptor_Register_Hooks_Test.php @@ -26,15 +26,15 @@ public function test_register_hooks() { 10, \has_filter( 'admin_menu', - [ $this->instance, 'add_redirect_page' ] - ) + [ $this->instance, 'add_redirect_page' ], + ), ); $this->assertEquals( 1, \has_action( 'admin_init', - [ $this->instance, 'intercept_site_kit_setup_url_redirect' ] - ) + [ $this->instance, 'intercept_site_kit_setup_url_redirect' ], + ), ); } } diff --git a/tests/Unit/Dashboard/User_Interface/Time_Based_SEO_Metrics/Abstract_Time_Based_SEO_Metrics_Route_Test.php b/tests/Unit/Dashboard/User_Interface/Time_Based_SEO_Metrics/Abstract_Time_Based_SEO_Metrics_Route_Test.php index 9c752ab48d9..21a6e2aee52 100644 --- a/tests/Unit/Dashboard/User_Interface/Time_Based_SEO_Metrics/Abstract_Time_Based_SEO_Metrics_Route_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Time_Based_SEO_Metrics/Abstract_Time_Based_SEO_Metrics_Route_Test.php @@ -92,7 +92,7 @@ protected function set_up() { $this->organic_sessions_compare_repository, $this->organic_sessions_daily_repository, $this->search_ranking_compare_repository, - $this->capability_helper + $this->capability_helper, ); } } diff --git a/tests/Unit/Dashboard/User_Interface/Time_Based_SEO_Metrics/Time_Based_SEO_Metrics_Route_Constructor_Test.php b/tests/Unit/Dashboard/User_Interface/Time_Based_SEO_Metrics/Time_Based_SEO_Metrics_Route_Constructor_Test.php index 7f5f4f9bb65..3ad93a02fa8 100644 --- a/tests/Unit/Dashboard/User_Interface/Time_Based_SEO_Metrics/Time_Based_SEO_Metrics_Route_Constructor_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Time_Based_SEO_Metrics/Time_Based_SEO_Metrics_Route_Constructor_Test.php @@ -28,27 +28,27 @@ final class Time_Based_SEO_Metrics_Route_Constructor_Test extends Abstract_Time_ public function test_construct() { $this->assertInstanceOf( Top_Page_Repository::class, - $this->getPropertyValue( $this->instance, 'top_page_repository' ) + $this->getPropertyValue( $this->instance, 'top_page_repository' ), ); $this->assertInstanceOf( Top_Query_Repository::class, - $this->getPropertyValue( $this->instance, 'top_query_repository' ) + $this->getPropertyValue( $this->instance, 'top_query_repository' ), ); $this->assertInstanceOf( Organic_Sessions_Compare_Repository::class, - $this->getPropertyValue( $this->instance, 'organic_sessions_compare_repository' ) + $this->getPropertyValue( $this->instance, 'organic_sessions_compare_repository' ), ); $this->assertInstanceOf( Organic_Sessions_Daily_Repository::class, - $this->getPropertyValue( $this->instance, 'organic_sessions_daily_repository' ) + $this->getPropertyValue( $this->instance, 'organic_sessions_daily_repository' ), ); $this->assertInstanceOf( Search_Ranking_Compare_Repository::class, - $this->getPropertyValue( $this->instance, 'search_ranking_compare_repository' ) + $this->getPropertyValue( $this->instance, 'search_ranking_compare_repository' ), ); } } diff --git a/tests/Unit/Dashboard/User_Interface/Time_Based_SEO_Metrics/Time_Based_SEO_Metrics_Route_Get_Metrics_Test.php b/tests/Unit/Dashboard/User_Interface/Time_Based_SEO_Metrics/Time_Based_SEO_Metrics_Route_Get_Metrics_Test.php index 04104b69f49..ca7b45c336e 100644 --- a/tests/Unit/Dashboard/User_Interface/Time_Based_SEO_Metrics/Time_Based_SEO_Metrics_Route_Get_Metrics_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Time_Based_SEO_Metrics/Time_Based_SEO_Metrics_Route_Get_Metrics_Test.php @@ -66,7 +66,7 @@ public function test_get_time_based_seo_metrics( ->expects( '__construct' ) ->with( [], - 200 + 200, ) ->once(); @@ -87,8 +87,8 @@ static function ( $request_parameters ) { && $request_parameters->get_limit() === 5 && $request_parameters->get_dimensions() === [ 'page' ] && self::has_27_days_interval( $request_parameters ); - } - ) + }, + ), ) ->times( $top_pages_count ) ->andReturn( $data_container_mock ); @@ -103,8 +103,8 @@ static function ( $request_parameters ) { && $request_parameters->get_limit() === 5 && $request_parameters->get_dimensions() === [ 'query' ] && self::has_27_days_interval( $request_parameters ); - } - ) + }, + ), ) ->times( $top_queries_count ) ->andReturn( $data_container_mock ); @@ -120,8 +120,8 @@ static function ( $request_parameters ) { && $request_parameters->get_dimension_filters() === [ 'sessionDefaultChannelGrouping' => [ 'Organic Search' ] ] && self::has_27_days_interval( $request_parameters ) && self::has_27_days_compare_interval( $request_parameters ); - } - ) + }, + ), ) ->times( $organic_sessions_compare_count ) ->andReturn( $data_container_mock ); @@ -141,8 +141,8 @@ static function ( $request_parameters ) { && $request_parameters->get_dimension_filters() === [ 'sessionDefaultChannelGrouping' => [ 'Organic Search' ] ] && $request_parameters->get_order_by() === $order_by && self::has_27_days_interval( $request_parameters ); - } - ) + }, + ), ) ->times( $organic_sessions_daily_count ) ->andReturn( $data_container_mock ); @@ -157,8 +157,8 @@ static function ( $request_parameters ) { && $request_parameters->get_dimensions() === [ 'date' ] && self::has_27_days_interval( $request_parameters ) && self::has_27_days_compare_interval( $request_parameters ); - } - ) + }, + ), ) ->times( $search_ranking_compare_count ) ->andReturn( $data_container_mock ); @@ -176,7 +176,7 @@ static function ( $request_parameters ) { $this->assertInstanceOf( 'WP_REST_Response', - $this->instance->get_time_based_seo_metrics( $wp_rest_request ) + $this->instance->get_time_based_seo_metrics( $wp_rest_request ), ); } diff --git a/tests/Unit/Dashboard/User_Interface/Time_Based_SEO_Metrics/Time_Based_SEO_Metrics_Route_Register_Routes_Test.php b/tests/Unit/Dashboard/User_Interface/Time_Based_SEO_Metrics/Time_Based_SEO_Metrics_Route_Register_Routes_Test.php index 3868165b0a9..28fec4944f4 100644 --- a/tests/Unit/Dashboard/User_Interface/Time_Based_SEO_Metrics/Time_Based_SEO_Metrics_Route_Register_Routes_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Time_Based_SEO_Metrics/Time_Based_SEO_Metrics_Route_Register_Routes_Test.php @@ -51,7 +51,7 @@ public function test_register_routes() { ], ], ], - ] + ], ); $this->instance->register_routes(); diff --git a/tests/Unit/Dashboard/User_Interface/Tracking/Abstract_Setup_Steps_Tracking_Route_Test.php b/tests/Unit/Dashboard/User_Interface/Tracking/Abstract_Setup_Steps_Tracking_Route_Test.php index ea1c0c32fad..e502e7c755a 100644 --- a/tests/Unit/Dashboard/User_Interface/Tracking/Abstract_Setup_Steps_Tracking_Route_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Tracking/Abstract_Setup_Steps_Tracking_Route_Test.php @@ -48,7 +48,7 @@ protected function set_up() { $this->instance = new Setup_Steps_Tracking_Route( new Setup_Steps_Tracking_Repository_Fake(), - $this->capability_helper + $this->capability_helper, ); } } diff --git a/tests/Unit/Dashboard/User_Interface/Tracking/Setup_Steps_Tracking_Route_Constructor_Test.php b/tests/Unit/Dashboard/User_Interface/Tracking/Setup_Steps_Tracking_Route_Constructor_Test.php index ecba9bd6998..9811cf24df5 100644 --- a/tests/Unit/Dashboard/User_Interface/Tracking/Setup_Steps_Tracking_Route_Constructor_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Tracking/Setup_Steps_Tracking_Route_Constructor_Test.php @@ -24,7 +24,7 @@ final class Setup_Steps_Tracking_Route_Constructor_Test extends Abstract_Setup_S public function test_construct() { $this->assertInstanceOf( Setup_Steps_Tracking_Repository_Interface::class, - $this->getPropertyValue( $this->instance, 'setup_steps_tracking_repository' ) + $this->getPropertyValue( $this->instance, 'setup_steps_tracking_repository' ), ); } } diff --git a/tests/Unit/Dashboard/User_Interface/Tracking/Setup_Steps_Tracking_Route_Register_Routes_Test.php b/tests/Unit/Dashboard/User_Interface/Tracking/Setup_Steps_Tracking_Route_Register_Routes_Test.php index d302bafd5f4..923638c2031 100644 --- a/tests/Unit/Dashboard/User_Interface/Tracking/Setup_Steps_Tracking_Route_Register_Routes_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Tracking/Setup_Steps_Tracking_Route_Register_Routes_Test.php @@ -60,7 +60,7 @@ public function test_register_routes() { ], ], ], - ] + ], ); $this->instance->register_routes(); diff --git a/tests/Unit/Dashboard/User_Interface/Tracking/Track_Setup_Steps_No_Valid_Params_Test.php b/tests/Unit/Dashboard/User_Interface/Tracking/Track_Setup_Steps_No_Valid_Params_Test.php index 9ecd6e0f598..c51475eb51e 100644 --- a/tests/Unit/Dashboard/User_Interface/Tracking/Track_Setup_Steps_No_Valid_Params_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Tracking/Track_Setup_Steps_No_Valid_Params_Test.php @@ -52,7 +52,7 @@ public function test_track_setup_steps() { $this->assertInstanceOf( 'WP_Error', - $this->instance->track_setup_steps( $wp_rest_request ) + $this->instance->track_setup_steps( $wp_rest_request ), ); } } diff --git a/tests/Unit/Dashboard/User_Interface/Tracking/Track_Setup_Steps_Set_Data_Fails_Test.php b/tests/Unit/Dashboard/User_Interface/Tracking/Track_Setup_Steps_Set_Data_Fails_Test.php index 99629674f52..74e3e45396e 100644 --- a/tests/Unit/Dashboard/User_Interface/Tracking/Track_Setup_Steps_Set_Data_Fails_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Tracking/Track_Setup_Steps_Set_Data_Fails_Test.php @@ -52,7 +52,7 @@ protected function set_up() { $this->instance = new Setup_Steps_Tracking_Route( new Setup_Steps_Tracking_Repository_Fake( true, false ), - $this->capability_helper + $this->capability_helper, ); } @@ -70,7 +70,7 @@ public function test_track_setup_steps() { [ 'success' => false, ], - 400 + 400, ) ->once(); @@ -102,7 +102,7 @@ public function test_track_setup_steps() { $this->assertInstanceOf( 'WP_REST_Response', - $this->instance->track_setup_steps( $wp_rest_request ) + $this->instance->track_setup_steps( $wp_rest_request ), ); } } diff --git a/tests/Unit/Dashboard/User_Interface/Tracking/Track_Setup_Steps_Set_Data_Throws_Exception_Test.php b/tests/Unit/Dashboard/User_Interface/Tracking/Track_Setup_Steps_Set_Data_Throws_Exception_Test.php index ccac93808b4..7703da57fa4 100644 --- a/tests/Unit/Dashboard/User_Interface/Tracking/Track_Setup_Steps_Set_Data_Throws_Exception_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Tracking/Track_Setup_Steps_Set_Data_Throws_Exception_Test.php @@ -51,7 +51,7 @@ protected function set_up() { $this->instance = new Setup_Steps_Tracking_Route( new Setup_Steps_Tracking_Repository_Fake( false, true ), - $this->capability_helper + $this->capability_helper, ); } @@ -89,7 +89,7 @@ public function test_track_setup_steps() { $this->assertInstanceOf( 'WP_Error', - $this->instance->track_setup_steps( $wp_rest_request ) + $this->instance->track_setup_steps( $wp_rest_request ), ); } } diff --git a/tests/Unit/Dashboard/User_Interface/Tracking/Track_Setup_Steps_Test.php b/tests/Unit/Dashboard/User_Interface/Tracking/Track_Setup_Steps_Test.php index 0c9298a4ae0..84f4aa3140a 100644 --- a/tests/Unit/Dashboard/User_Interface/Tracking/Track_Setup_Steps_Test.php +++ b/tests/Unit/Dashboard/User_Interface/Tracking/Track_Setup_Steps_Test.php @@ -42,7 +42,7 @@ public function test_track_setup_steps( $expected_success, $expected_status, $se [ 'success' => $expected_success, ], - $expected_status + $expected_status, ) ->once(); @@ -74,7 +74,7 @@ public function test_track_setup_steps( $expected_success, $expected_status, $se $this->assertInstanceOf( 'WP_REST_Response', - $this->instance->track_setup_steps( $wp_rest_request ) + $this->instance->track_setup_steps( $wp_rest_request ), ); } diff --git a/tests/Unit/Database/Migration_Runner_Test.php b/tests/Unit/Database/Migration_Runner_Test.php index d2097f1c136..8edfa92fa6c 100644 --- a/tests/Unit/Database/Migration_Runner_Test.php +++ b/tests/Unit/Database/Migration_Runner_Test.php @@ -44,7 +44,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [], - Migration_Runner::get_conditionals() + Migration_Runner::get_conditionals(), ); } diff --git a/tests/Unit/Database/Migration_Status_Test.php b/tests/Unit/Database/Migration_Status_Test.php index c8036bf9f28..daad9a533b2 100644 --- a/tests/Unit/Database/Migration_Status_Test.php +++ b/tests/Unit/Database/Migration_Status_Test.php @@ -86,7 +86,7 @@ public function test_should_run_migration_with_old_lock() { [ 'version' => '1.0', 'lock' => \strtotime( '-20 minutes' ), - ] + ], ); $instance = new Migration_Status(); @@ -129,7 +129,7 @@ public function test_should_not_run_migration_with_lock() { [ 'version' => '1.0', 'lock' => \strtotime( 'now' ), - ] + ], ); $instance = new Migration_Status(); @@ -254,7 +254,7 @@ public function test_get_error() { [ 'version' => '1.0', 'error' => $error, - ] + ], ); $instance = new Migration_Status(); diff --git a/tests/Unit/Editors/Domain/Analysis_Features/Analysis_Features_List_Test.php b/tests/Unit/Editors/Domain/Analysis_Features/Analysis_Features_List_Test.php index 6d4c599ba9a..7fd1c7bf98b 100644 --- a/tests/Unit/Editors/Domain/Analysis_Features/Analysis_Features_List_Test.php +++ b/tests/Unit/Editors/Domain/Analysis_Features/Analysis_Features_List_Test.php @@ -39,7 +39,7 @@ public function test_parse_to_legacy_array(): void { 'legacy-key-false' => false, 'legacy-key-true' => true, ], - $this->instance->parse_to_legacy_array() + $this->instance->parse_to_legacy_array(), ); } @@ -59,7 +59,7 @@ public function test_parse_to_array(): void { 'name-false' => false, 'name-true' => true, ], - $this->instance->to_array() + $this->instance->to_array(), ); } diff --git a/tests/Unit/Editors/Domain/Seo/Description_Test.php b/tests/Unit/Editors/Domain/Seo/Description_Test.php index 718e7df7ae4..bdf459596aa 100644 --- a/tests/Unit/Editors/Domain/Seo/Description_Test.php +++ b/tests/Unit/Editors/Domain/Seo/Description_Test.php @@ -45,7 +45,7 @@ public function test_to_array(): void { 'description_template' => 'a-template', 'description_date' => '01-01-1970', ], - $this->instance->to_array() + $this->instance->to_array(), ); } @@ -62,7 +62,7 @@ public function test_to_legacy_array(): void { 'metadesc_template' => 'a-template', 'metaDescriptionDate' => '01-01-1970', ], - $this->instance->to_legacy_array() + $this->instance->to_legacy_array(), ); } } diff --git a/tests/Unit/Editors/Domain/Seo/Keyphrase_Test.php b/tests/Unit/Editors/Domain/Seo/Keyphrase_Test.php index 396fe1d85f7..1baaaceb20c 100644 --- a/tests/Unit/Editors/Domain/Seo/Keyphrase_Test.php +++ b/tests/Unit/Editors/Domain/Seo/Keyphrase_Test.php @@ -45,7 +45,7 @@ public function test_to_array(): void { 'keyphrase_usage' => [ 'post' => 1 ], 'keyphrase_usage_per_type' => [ 'post' => 2 ], ], - $this->instance->to_array() + $this->instance->to_array(), ); } @@ -62,7 +62,7 @@ public function test_to_legacy_array(): void { 'keyword_usage' => [ 'post' => 1 ], 'keyword_usage_post_types' => [ 'post' => 2 ], ], - $this->instance->to_legacy_array() + $this->instance->to_legacy_array(), ); } } diff --git a/tests/Unit/Editors/Domain/Seo/Social_Test.php b/tests/Unit/Editors/Domain/Seo/Social_Test.php index c2bf3d3a3cd..93c765934b2 100644 --- a/tests/Unit/Editors/Domain/Seo/Social_Test.php +++ b/tests/Unit/Editors/Domain/Seo/Social_Test.php @@ -47,7 +47,7 @@ public function test_to_array(): void { 'social_image_template' => 'social-image-template', 'first_content_image_social_preview' => 'https://wordpress.test/image.png', ], - $this->instance->to_array() + $this->instance->to_array(), ); } @@ -66,7 +66,7 @@ public function test_to_legacy_array(): void { 'social_image_template' => 'social-image-template', 'first_content_image' => 'https://wordpress.test/image.png', ], - $this->instance->to_legacy_array() + $this->instance->to_legacy_array(), ); } } diff --git a/tests/Unit/Editors/Domain/Seo/Title_Test.php b/tests/Unit/Editors/Domain/Seo/Title_Test.php index 2d3f6e4c2ae..432f8e47f26 100644 --- a/tests/Unit/Editors/Domain/Seo/Title_Test.php +++ b/tests/Unit/Editors/Domain/Seo/Title_Test.php @@ -45,7 +45,7 @@ public function test_to_array(): void { 'title_template' => 'a-title', 'title_template_no_fallback' => 'a-fb-title', ], - $this->instance->to_array() + $this->instance->to_array(), ); } @@ -62,7 +62,7 @@ public function test_to_legacy_array(): void { 'title_template' => 'a-title', 'title_template_no_fallback' => 'a-fb-title', ], - $this->instance->to_legacy_array() + $this->instance->to_legacy_array(), ); } } diff --git a/tests/Unit/Editors/Framework/Integrations/Semrush_Test.php b/tests/Unit/Editors/Framework/Integrations/Semrush_Test.php index dbae19ecc30..8bcccd31b4b 100644 --- a/tests/Unit/Editors/Framework/Integrations/Semrush_Test.php +++ b/tests/Unit/Editors/Framework/Integrations/Semrush_Test.php @@ -89,7 +89,7 @@ public function test_to_legacy_array() { ->andReturn( (object) [ 'classes' => $this->classes, - ] + ], ); $this->options ->expects( 'get' ) @@ -108,7 +108,7 @@ public function test_to_legacy_array() { 'countryCode' => true, 'SEMrushLoginStatus' => true, ], - $this->instance->to_legacy_array() + $this->instance->to_legacy_array(), ); } diff --git a/tests/Unit/Editors/Framework/Integrations/Wincher_Test.php b/tests/Unit/Editors/Framework/Integrations/Wincher_Test.php index 34cfafc6c09..4984c5b7629 100644 --- a/tests/Unit/Editors/Framework/Integrations/Wincher_Test.php +++ b/tests/Unit/Editors/Framework/Integrations/Wincher_Test.php @@ -102,7 +102,7 @@ public function test_to_legacy_array() { 'wincherWebsiteId' => 'some-id', 'wincherAutoAddKeyphrases' => true, ], - $this->instance->to_legacy_array() + $this->instance->to_legacy_array(), ); } diff --git a/tests/Unit/Elementor/Infrastructure/Request_Post_Test.php b/tests/Unit/Elementor/Infrastructure/Request_Post_Test.php index 5bc7961c693..4217197604b 100644 --- a/tests/Unit/Elementor/Infrastructure/Request_Post_Test.php +++ b/tests/Unit/Elementor/Infrastructure/Request_Post_Test.php @@ -249,7 +249,7 @@ public static function get_post_id_data_provider(): array { 'id' => 123, ], ], - ] + ], ), 'return_value' => 123, ], @@ -298,7 +298,7 @@ public static function get_post_id_data_provider(): array { 'id' => 123, ], ], - ] + ], ), 'return_value' => null, ], @@ -317,7 +317,7 @@ public static function get_post_id_data_provider(): array { 'id' => '123', ], ], - ] + ], ), 'return_value' => 123, ], @@ -336,7 +336,7 @@ public static function get_post_id_data_provider(): array { 'id' => '2e2', ], ], - ] + ], ), 'return_value' => 200, ], @@ -355,7 +355,7 @@ public static function get_post_id_data_provider(): array { 'id' => '123.456', ], ], - ] + ], ), 'return_value' => 123, ], @@ -372,7 +372,7 @@ public static function get_post_id_data_provider(): array { 'action' => 'get_document_config', 'data' => [], ], - ] + ], ), 'return_value' => null, ], @@ -388,7 +388,7 @@ public static function get_post_id_data_provider(): array { 'document-1' => [ 'action' => 'get_document_config', ], - ] + ], ), 'return_value' => null, ], @@ -407,7 +407,7 @@ public static function get_post_id_data_provider(): array { 'id' => 123, ], ], - ] + ], ), 'return_value' => null, ], @@ -426,7 +426,7 @@ public static function get_post_id_data_provider(): array { 'id' => 123, ], ], - ] + ], ), 'return_value' => null, ], @@ -445,7 +445,7 @@ public static function get_post_id_data_provider(): array { 'id' => 123, ], ], - ] + ], ), 'return_value' => null, ], diff --git a/tests/Unit/Exceptions/Importing/Aioseo_Validation_Exception_Test.php b/tests/Unit/Exceptions/Importing/Aioseo_Validation_Exception_Test.php index b33b6024945..dd043f4e71f 100644 --- a/tests/Unit/Exceptions/Importing/Aioseo_Validation_Exception_Test.php +++ b/tests/Unit/Exceptions/Importing/Aioseo_Validation_Exception_Test.php @@ -28,7 +28,7 @@ public function test_constructor() { self::assertEquals( 'The validation of the AIOSEO data structure has failed.', - $instance->getMessage() + $instance->getMessage(), ); } } diff --git a/tests/Unit/Exceptions/Indexable/Invalid_Term_Exception_Test.php b/tests/Unit/Exceptions/Indexable/Invalid_Term_Exception_Test.php index cd3acb2fa17..8c40b840b78 100644 --- a/tests/Unit/Exceptions/Indexable/Invalid_Term_Exception_Test.php +++ b/tests/Unit/Exceptions/Indexable/Invalid_Term_Exception_Test.php @@ -28,7 +28,7 @@ public function test_constructor() { self::assertEquals( 'The term is considered invalid. The following reason was given by WordPress: A WordPress reason.', - $instance->getMessage() + $instance->getMessage(), ); } } diff --git a/tests/Unit/Exceptions/Indexable/Post_Not_Found_Exception_Test.php b/tests/Unit/Exceptions/Indexable/Post_Not_Found_Exception_Test.php index 42cad1b3496..673d8007e94 100644 --- a/tests/Unit/Exceptions/Indexable/Post_Not_Found_Exception_Test.php +++ b/tests/Unit/Exceptions/Indexable/Post_Not_Found_Exception_Test.php @@ -28,7 +28,7 @@ public function test_constructor() { self::assertEquals( 'The post could not be found.', - $instance->getMessage() + $instance->getMessage(), ); } } diff --git a/tests/Unit/Exceptions/Indexable/Term_Not_Found_Exception_Test.php b/tests/Unit/Exceptions/Indexable/Term_Not_Found_Exception_Test.php index 3b1a39a216a..cddee4bdcdc 100644 --- a/tests/Unit/Exceptions/Indexable/Term_Not_Found_Exception_Test.php +++ b/tests/Unit/Exceptions/Indexable/Term_Not_Found_Exception_Test.php @@ -28,7 +28,7 @@ public function test_constructor() { self::assertEquals( 'The term could not be found.', - $instance->getMessage() + $instance->getMessage(), ); } } diff --git a/tests/Unit/General/User_Interface/General_Page_Integration_Test.php b/tests/Unit/General/User_Interface/General_Page_Integration_Test.php index da40fbe2d43..c2b9aeaa4b9 100644 --- a/tests/Unit/General/User_Interface/General_Page_Integration_Test.php +++ b/tests/Unit/General/User_Interface/General_Page_Integration_Test.php @@ -164,7 +164,7 @@ public function set_up() { $this->options_helper, $this->woocommerce_conditional, $this->addon_manager, - $this->task_list_configuration + $this->task_list_configuration, ); } @@ -191,8 +191,8 @@ public function test_construct() { $this->options_helper, $this->woocommerce_conditional, $this->addon_manager, - $this->task_list_configuration - ) + $this->task_list_configuration, + ), ); } @@ -209,7 +209,7 @@ public function test_get_conditionals() { Admin_Conditional::class, Non_Network_Admin_Conditional::class, ], - General_Page_Integration::get_conditionals() + General_Page_Integration::get_conditionals(), ); } @@ -274,7 +274,7 @@ public function test_add_page() { [ 'page1', '', 'Page 1', 'manage_options', 'page1', [ 'custom_display_page' ] ], [ 'page2', '', 'Page 2', 'manage_options', 'page2', [ 'custom_display_page' ] ], [ 'page3', '', 'Page 3', 'manage_options', 'page3', [ 'custom_display_page' ] ], - ] + ], ); // Assert that the new page was added at index 0. @@ -374,7 +374,7 @@ public function test_enqueue_assets() { [ 'enabled' => true, 'tasksConfiguration' => [], - ] + ], ); $this->expect_get_script_data(); diff --git a/tests/Unit/General/User_Interface/Opt_In_Route/Constructor_Test.php b/tests/Unit/General/User_Interface/Opt_In_Route/Constructor_Test.php index bc64bf88b31..abbd834bb0b 100644 --- a/tests/Unit/General/User_Interface/Opt_In_Route/Constructor_Test.php +++ b/tests/Unit/General/User_Interface/Opt_In_Route/Constructor_Test.php @@ -24,12 +24,12 @@ final class Constructor_Test extends Abstract_Opt_In_Route_Test { public function test_constructor() { $this->assertInstanceOf( User_Helper::class, - $this->getPropertyValue( $this->instance, 'user_helper' ) + $this->getPropertyValue( $this->instance, 'user_helper' ), ); $this->assertInstanceOf( Capability_Helper::class, - $this->getPropertyValue( $this->instance, 'capability_helper' ) + $this->getPropertyValue( $this->instance, 'capability_helper' ), ); } } diff --git a/tests/Unit/General/User_Interface/Opt_In_Route/Get_Conditional_Test.php b/tests/Unit/General/User_Interface/Opt_In_Route/Get_Conditional_Test.php index ece9fdcd79e..541ebf640dd 100644 --- a/tests/Unit/General/User_Interface/Opt_In_Route/Get_Conditional_Test.php +++ b/tests/Unit/General/User_Interface/Opt_In_Route/Get_Conditional_Test.php @@ -23,7 +23,7 @@ final class Get_Conditional_Test extends Abstract_Opt_In_Route_Test { public function test_get_conditionals() { $this->assertEquals( [ User_Can_Manage_Wpseo_Options_Conditional::class ], - $this->instance::get_conditionals() + $this->instance::get_conditionals(), ); } } diff --git a/tests/Unit/General/User_Interface/Opt_In_Route/Register_Routes_Test.php b/tests/Unit/General/User_Interface/Opt_In_Route/Register_Routes_Test.php index 0b5cd44a266..b426c9599dc 100644 --- a/tests/Unit/General/User_Interface/Opt_In_Route/Register_Routes_Test.php +++ b/tests/Unit/General/User_Interface/Opt_In_Route/Register_Routes_Test.php @@ -38,7 +38,7 @@ public function test_register_routes() { 'validate_callback' => [ $this->instance, 'validate_key' ], ], ], - ] + ], ) ->once(); diff --git a/tests/Unit/Generators/Breadcrumbs_Generator_Test.php b/tests/Unit/Generators/Breadcrumbs_Generator_Test.php index c3d7d1b6ca9..f327c38e990 100644 --- a/tests/Unit/Generators/Breadcrumbs_Generator_Test.php +++ b/tests/Unit/Generators/Breadcrumbs_Generator_Test.php @@ -244,7 +244,7 @@ public function test_generate( $scenario, $page_for_posts, $breadcrumb_home, $fr $this->assertEquals( $expected, \array_slice( $this->instance->generate( $this->context ), -2 ), - $message + $message, ); } @@ -344,7 +344,7 @@ public function test_with_date_archive( $scenario, $is_paged, $current_page, $ex $this->assertEquals( $expected, - \array_slice( $this->instance->generate( $this->context ), -2 ) + \array_slice( $this->instance->generate( $this->context ), -2 ), ); } diff --git a/tests/Unit/Generators/Open_Graph_Image_Generator_Test.php b/tests/Unit/Generators/Open_Graph_Image_Generator_Test.php index a55d60c646a..7f7e647db0e 100644 --- a/tests/Unit/Generators/Open_Graph_Image_Generator_Test.php +++ b/tests/Unit/Generators/Open_Graph_Image_Generator_Test.php @@ -104,13 +104,13 @@ protected function set_up() { $this->options = Mockery::mock( Options_Helper::class ); $this->open_graph_image = Mockery::mock( Open_Graph_Image_Helper::class, - [ $this->url, $this->image ] + [ $this->url, $this->image ], ); $this->image_container = Mockery::mock( Images::class, [ $this->image, $this->url ] )->makePartial(); $this->instance = Mockery::mock( Open_Graph_Image_Generator::class, - [ $this->open_graph_image, $this->image, $this->options, $this->url ] + [ $this->open_graph_image, $this->image, $this->options, $this->url ], )->shouldAllowMockingProtectedMethods()->makePartial(); $this->instance @@ -235,7 +235,7 @@ public function test_generate_with_image_url_from_indexable_with_open_graph_imag 'height' => 1024, 'width' => 2048, 'url' => 'image.jpg', - ] + ], ); $this->instance->expects( 'add_from_templates' )->andReturnNull(); diff --git a/tests/Unit/Generators/Schema/Article_Test.php b/tests/Unit/Generators/Schema/Article_Test.php index 6eb53063e0e..6d04e681abd 100644 --- a/tests/Unit/Generators/Schema/Article_Test.php +++ b/tests/Unit/Generators/Schema/Article_Test.php @@ -300,7 +300,7 @@ static function ( $data ) { $data['inLanguage'] = 'language'; return $data; - } + }, ); Monkey\Functions\expect( 'post_type_supports' ) diff --git a/tests/Unit/Generators/Schema/Author_Test.php b/tests/Unit/Generators/Schema/Author_Test.php index cb9b6d0e3d8..bc0a4b0db13 100644 --- a/tests/Unit/Generators/Schema/Author_Test.php +++ b/tests/Unit/Generators/Schema/Author_Test.php @@ -289,7 +289,7 @@ public function test_generate_on_posts_when_site_does_not_represent_author() { 'facebook' => 'https://facebook.example.org/admin', 'instagram' => 'https://instagram.example.org/admin', 'linkedin' => 'https://linkedin.example.org/admin', - ] + ], ); $this->set_pronouns_expectations( $user_id ); @@ -464,7 +464,7 @@ private function set_helpers_expectations( $user_data ) { 'url' => 'http://example.com/image.png', ], $user_data->display_name, - false + false, ) ->andReturn( 'our_image_schema' ); } diff --git a/tests/Unit/Generators/Schema/HowTo_Test.php b/tests/Unit/Generators/Schema/HowTo_Test.php index 4f82c1f5898..556f5304d26 100644 --- a/tests/Unit/Generators/Schema/HowTo_Test.php +++ b/tests/Unit/Generators/Schema/HowTo_Test.php @@ -172,7 +172,7 @@ static function ( $data ) { $data['inLanguage'] = 'language'; return $data; - } + }, ); $this->post @@ -271,7 +271,7 @@ public function test_empty_step() { // Remove JSON text and -name attributes. unset( $blocks['yoast/how-to-block'][0]['attrs']['steps'][0]['jsonText'], - $blocks['yoast/how-to-block'][0]['attrs']['steps'][0]['jsonName'] + $blocks['yoast/how-to-block'][0]['attrs']['steps'][0]['jsonName'], ); $schema = $this->base_schema; @@ -293,7 +293,7 @@ public function test_empty_steps() { $blocks = $this->base_blocks; // Remove the steps attribute. unset( - $blocks['yoast/how-to-block'][0]['attrs']['steps'] + $blocks['yoast/how-to-block'][0]['attrs']['steps'], ); $schema = $this->base_schema; @@ -335,7 +335,7 @@ public function test_generate_step_with_image() { ->expects( 'generate_from_url' ) ->with( '#schema-image-94025919e8fe3836562573a84a14a305', - 'https://example.com/wp-content/uploads/2020/02/download.jpeg' + 'https://example.com/wp-content/uploads/2020/02/download.jpeg', ) ->andReturn( [ @@ -345,7 +345,7 @@ public function test_generate_step_with_image() { 'url' => 'https://example.com/wp-content/uploads/2020/02/download.jpeg', 'width' => 474, 'height' => 474, - ] + ], ); $schema = $this->base_schema; diff --git a/tests/Unit/Generators/Schema/Organization_Test.php b/tests/Unit/Generators/Schema/Organization_Test.php index 1aa61c6c8c3..a9141ff1c3f 100644 --- a/tests/Unit/Generators/Schema/Organization_Test.php +++ b/tests/Unit/Generators/Schema/Organization_Test.php @@ -90,7 +90,7 @@ protected function set_up() { $this->instance = new Organization( $this->image, $this->options, - $this->html + $this->html, ); $this->instance->context = $this->context; diff --git a/tests/Unit/Generators/Schema/Person_Test.php b/tests/Unit/Generators/Schema/Person_Test.php index cb078c033a7..fe8d59f32c4 100644 --- a/tests/Unit/Generators/Schema/Person_Test.php +++ b/tests/Unit/Generators/Schema/Person_Test.php @@ -408,7 +408,7 @@ public function test_generate_social_profiles_non_string_or_falsy_values() { 'instagram' => 1234, 'youtube' => false, 'wikipedia' => 'wiki', - ] + ], ); $this->expects_for_pronouns( $this->instance->context->site_user_id, '' ); diff --git a/tests/Unit/Generators/Schema/WebPage_Test.php b/tests/Unit/Generators/Schema/WebPage_Test.php index 5642b010fb1..79d74a4d106 100644 --- a/tests/Unit/Generators/Schema/WebPage_Test.php +++ b/tests/Unit/Generators/Schema/WebPage_Test.php @@ -171,7 +171,7 @@ static function ( $data ) { $data['inLanguage'] = 'the-language'; return $data; - } + }, ); Monkey\Filters\expectApplied( 'wpseo_schema_webpage_potential_action_target' ) @@ -208,7 +208,7 @@ public function test_generate_with_provider( $values_to_test, $expected, $messag [ 'WebPage' ], 1, 1, - 1 + 1, ); $this->assertEquals( $expected, $this->instance->generate(), $message ); @@ -229,7 +229,7 @@ public function test_generate_on_front_page_site_does_not_represents_reference() [ 'WebPage' ], 1, 1, - 1 + 1, ); $expected = [ @@ -272,7 +272,7 @@ public function test_generate_on_front_page_site_represents_reference() { [ 'WebPage' ], 1, 1, - 1 + 1, ); $expected = [ @@ -322,7 +322,7 @@ public function test_generate_object_post_site_represents_true() { [ 'WebPage' ], 1, 1, - 1 + 1, ); $expected = [ @@ -371,7 +371,7 @@ public function test_generate_object_post_site_represents_false() { [ 'WebPage' ], 1, 1, - 1 + 1, ); $this->id @@ -421,7 +421,7 @@ public function test_generate_description_not_empty() { [ 'WebPage' ], 1, 1, - 1 + 1, ); $this->html @@ -474,7 +474,7 @@ public function test_generate_object_type_home_page() { 'CollectionPage', 0, 0, - 0 + 0, ); $expected = [ @@ -509,7 +509,7 @@ public function test_generate_home_static_page() { 'CollectionPage', 1, 1, - 0 + 0, ); $expected = [ diff --git a/tests/Unit/Generators/Schema/Website_Test.php b/tests/Unit/Generators/Schema/Website_Test.php index f0aaac2bb14..40316438b98 100644 --- a/tests/Unit/Generators/Schema/Website_Test.php +++ b/tests/Unit/Generators/Schema/Website_Test.php @@ -111,7 +111,7 @@ static function ( $data ) { $data['inLanguage'] = 'language'; return $data; - } + }, ); $expected = [ @@ -173,7 +173,7 @@ static function ( $data ) { $data['inLanguage'] = 'language'; return $data; - } + }, ); $expected = [ diff --git a/tests/Unit/Generators/Schema_Generator_Test.php b/tests/Unit/Generators/Schema_Generator_Test.php index e4e8fd160eb..1a25c7a5a93 100644 --- a/tests/Unit/Generators/Schema_Generator_Test.php +++ b/tests/Unit/Generators/Schema_Generator_Test.php @@ -120,13 +120,13 @@ protected function set_up() { Article_Helper::class => $this->article, Date_Helper::class => $this->date, Language_Helper::class => new Language_Helper(), - ] + ], ); $helpers = $this->create_helper_surface( $container ); $this->instance = Mockery::mock( Schema_Generator::class, - [ $helpers, $this->replace_vars_helper ] + [ $helpers, $this->replace_vars_helper ], )->shouldAllowMockingProtectedMethods()->makePartial(); $this->context = Mockery::mock( @@ -139,7 +139,7 @@ protected function set_up() { Mockery::mock( WPSEO_Replace_Vars::class ), Mockery::mock( Site_Helper::class ), Mockery::mock( User_Helper::class ), - ] + ], )->shouldAllowMockingProtectedMethods(); $this->context->blocks = [ @@ -317,7 +317,7 @@ public function test_generate_with_no_blocks() { ], ], ], - $this->instance->generate( $this->context ) + $this->instance->generate( $this->context ), ); } @@ -409,7 +409,7 @@ public function test_generate_with_empty_breadcrumb() { ], ], ], - $this->instance->generate( $this->context ) + $this->instance->generate( $this->context ), ); } @@ -485,7 +485,7 @@ public function test_generate_with_blocks() { $this->assertEquals( $this->get_expected_schema(), - $this->instance->generate( $this->context ) + $this->instance->generate( $this->context ), ); } @@ -684,7 +684,7 @@ public function test_generate_with_block_not_having_generated_output() { $this->assertEquals( $this->get_expected_schema(), - $this->instance->generate( $this->context ) + $this->instance->generate( $this->context ), ); } @@ -769,7 +769,7 @@ public function test_validate_type_singular_array() { ], ], 'inLanguage' => 'English', - ] + ], ); $this->current_page->expects( 'is_home_static_page' )->andReturns( false ); @@ -798,7 +798,7 @@ public function test_validate_type_singular_array() { ], 'inLanguage' => 'English', ], - $this->instance->generate( $this->context )['@graph'][1] + $this->instance->generate( $this->context )['@graph'][1], ); } @@ -886,7 +886,7 @@ public function test_validate_type_unique_array() { ], ], 'inLanguage' => 'English', - ] + ], ); $this->assertEquals( @@ -912,7 +912,7 @@ public function test_validate_type_unique_array() { ], 'inLanguage' => 'English', ], - $this->instance->generate( $this->context )['@graph'][1] + $this->instance->generate( $this->context )['@graph'][1], ); } @@ -1009,7 +1009,7 @@ public function test_get_graph_pieces_on_single_post_with_password_required() { ], ], ], - $this->instance->generate( $this->context ) + $this->instance->generate( $this->context ), ); } @@ -1126,7 +1126,7 @@ public function test_generate_with_search_page() { ], ], ], - $this->instance->generate( $this->context ) + $this->instance->generate( $this->context ), ); } @@ -1199,7 +1199,7 @@ public function test_get_graph_pieces_on_scheduled_post() { $this->assertEquals( $expected_schema, - $this->instance->generate( $this->context ) + $this->instance->generate( $this->context ), ); } diff --git a/tests/Unit/Generators/Twitter_Image_Generator_Test.php b/tests/Unit/Generators/Twitter_Image_Generator_Test.php index 8c9d87f857b..b8b9266b6a8 100644 --- a/tests/Unit/Generators/Twitter_Image_Generator_Test.php +++ b/tests/Unit/Generators/Twitter_Image_Generator_Test.php @@ -87,7 +87,7 @@ protected function set_up() { $this->instance = Mockery::mock( Twitter_Image_Generator::class, - [ $this->image, $this->url, $this->twitter_image ] + [ $this->image, $this->url, $this->twitter_image ], )->shouldAllowMockingProtectedMethods()->makePartial(); $this->instance diff --git a/tests/Unit/Helpers/Aioseo_Helper_Test.php b/tests/Unit/Helpers/Aioseo_Helper_Test.php index a5b08fa5687..a6f6c557144 100644 --- a/tests/Unit/Helpers/Aioseo_Helper_Test.php +++ b/tests/Unit/Helpers/Aioseo_Helper_Test.php @@ -51,7 +51,7 @@ public function set_up() { $this->wpdb_helper = Mockery::mock( Wpdb_Helper::class ); $this->instance = new Aioseo_Helper( $this->wpdb, - $this->wpdb_helper + $this->wpdb_helper, ); $this->wpdb->prefix = 'wp_'; diff --git a/tests/Unit/Helpers/Blocks_Helper_Test.php b/tests/Unit/Helpers/Blocks_Helper_Test.php index c79761de125..45dd78d540a 100644 --- a/tests/Unit/Helpers/Blocks_Helper_Test.php +++ b/tests/Unit/Helpers/Blocks_Helper_Test.php @@ -116,7 +116,7 @@ public function test_get_all_blocks_from_content() { ], ], ], - ] + ], ); $this->instance @@ -145,7 +145,7 @@ public function test_get_all_blocks_from_content() { ], ], ], - $this->instance->get_all_blocks_from_content( 'post content' ) + $this->instance->get_all_blocks_from_content( 'post content' ), ); } diff --git a/tests/Unit/Helpers/Capability_Helper_Test.php b/tests/Unit/Helpers/Capability_Helper_Test.php index 6e9dc1a7635..a3ef13045ca 100644 --- a/tests/Unit/Helpers/Capability_Helper_Test.php +++ b/tests/Unit/Helpers/Capability_Helper_Test.php @@ -184,7 +184,7 @@ public function test_get_applicable_roles_no_role() { (object) [ 'name' => 'administrator', 'capabilities' => $capabilities['administrator'], - ] + ], ); $wp_roles->expects( 'get_role' ) @@ -279,7 +279,7 @@ private function mock_wp_roles( $roles, $capabilities ) { (object) [ 'name' => $id, 'capabilities' => $capabilities[ $id ], - ] + ], ); } diff --git a/tests/Unit/Helpers/Crawl_Cleanup_Helper_Test.php b/tests/Unit/Helpers/Crawl_Cleanup_Helper_Test.php index 9fc2255286d..d7caefbd929 100644 --- a/tests/Unit/Helpers/Crawl_Cleanup_Helper_Test.php +++ b/tests/Unit/Helpers/Crawl_Cleanup_Helper_Test.php @@ -75,7 +75,7 @@ protected function set_up() { $this->current_page_helper, $this->options_helper, $this->url_helper, - $this->redirect_helper + $this->redirect_helper, ); } @@ -106,7 +106,7 @@ public function test_should_avoid_redirect( $is_robots, $sitemap, $get_response, [ 'is_robots' => $is_robots, 'is_user_logged_in' => $is_user_logged_in, - ] + ], ); $this->assertSame( $expected, $this->instance->should_avoid_redirect() ); @@ -261,7 +261,7 @@ public function test_page_not_found_url( $is_multisite, $is_subdomain_install, $ 'is_multisite' => $is_multisite, 'is_subdomain_install' => $is_subdomain_install, 'is_main_site' => $is_main_site, - ] + ], ); Monkey\Functions\expect( 'home_url' ) @@ -330,7 +330,7 @@ public function test_taxonomy_url( $is_feed, $get_term_feed_link_times, $get_ter (object) [ 'term_id' => 108, 'taxonomy' => 'products', - ] + ], ); Monkey\Functions\expect( 'is_feed' ) @@ -523,7 +523,7 @@ public function test_get_url_type( $singular, $front, $category, $tag, $tax, $se 'is_tax' => $tax, 'is_search' => $search, 'is_404' => $is404, - ] + ], ); $this->current_page_helper @@ -585,7 +585,7 @@ public function test_do_clean_redirect() { /* translators: %1$s: Yoast SEO */ \__( '%1$s: unregistered URL parameter removed. See %2$s', 'wordpress-seo' ), 'Yoast SEO', - 'https://yoa.st/advanced-crawl-settings' + 'https://yoa.st/advanced-crawl-settings', ); $this->redirect_helper diff --git a/tests/Unit/Helpers/Current_Page_Helper_Test.php b/tests/Unit/Helpers/Current_Page_Helper_Test.php index d0a90a61a1f..0b4315c119f 100644 --- a/tests/Unit/Helpers/Current_Page_Helper_Test.php +++ b/tests/Unit/Helpers/Current_Page_Helper_Test.php @@ -623,7 +623,7 @@ static function ( $option ) { } return null; - } + }, ); $this->assertTrue( $this->instance->is_home_static_page() ); diff --git a/tests/Unit/Helpers/Date_Helper_Test.php b/tests/Unit/Helpers/Date_Helper_Test.php index 32336d57fa7..5b3791944fd 100644 --- a/tests/Unit/Helpers/Date_Helper_Test.php +++ b/tests/Unit/Helpers/Date_Helper_Test.php @@ -87,9 +87,9 @@ public static function format_provider() { 'expected' => true, ], 'Test formatting the date with an integer as date' => [ - 'date' => 123456789, + 'date' => 123_456_789, 'format' => \DATE_W3C, - 'expected' => 123456789, + 'expected' => 123_456_789, ], 'Test formatting the date with a string as date' => [ 'date' => 'this is a date', @@ -133,7 +133,7 @@ public static function format_timestamp_provider() { 'expected' => '1973-11-29 21:33:09', ], 'Test formatting an integer timestamp to a date' => [ - 'timestamp' => 123456789, + 'timestamp' => 123_456_789, 'format' => \DATE_W3C, 'expected' => '1973-11-29T21:33:09+00:00', ], @@ -165,7 +165,7 @@ public function test_format_translated() { $this->assertSame( '2020-12-31', - $this->instance->format_translated( '2020-12-31 13:37:00' ) + $this->instance->format_translated( '2020-12-31 13:37:00' ), ); } @@ -208,7 +208,7 @@ public static function data_is_valid_datetime() { 'expected' => true, ], 'Other non-string' => [ - 'input' => 123456789, + 'input' => 123_456_789, 'expected' => false, ], ]; diff --git a/tests/Unit/Helpers/Home_Url_Helper_Test.php b/tests/Unit/Helpers/Home_Url_Helper_Test.php index c7bd0a0d8e5..f06253239d3 100644 --- a/tests/Unit/Helpers/Home_Url_Helper_Test.php +++ b/tests/Unit/Helpers/Home_Url_Helper_Test.php @@ -77,7 +77,7 @@ public function test_get_parsed() { [ 'scheme' => 'https', 'host' => 'example.com', - ] + ], ); $this->assertEquals( @@ -85,7 +85,7 @@ public function test_get_parsed() { 'scheme' => 'https', 'host' => 'example.com', ], - $this->instance->get_parsed() + $this->instance->get_parsed(), ); } @@ -105,7 +105,7 @@ public function test_get_parsed_cached() { 'scheme' => 'https', 'host' => 'example.com', ], - $this->instance->get_parsed() + $this->instance->get_parsed(), ); } } diff --git a/tests/Unit/Helpers/Image_Helper_Test.php b/tests/Unit/Helpers/Image_Helper_Test.php index 1a31b936062..e0a5f868a7f 100644 --- a/tests/Unit/Helpers/Image_Helper_Test.php +++ b/tests/Unit/Helpers/Image_Helper_Test.php @@ -143,7 +143,7 @@ public function test_get_gallery_image_when_gallery_is_present() { [ 'https://example.com/media/image.jpg', 'https://example.com/media/image2.jpg', - ] + ], ); $this->assertEquals( 'https://example.com/media/image.jpg', $this->instance->get_gallery_image( 100 ) ); @@ -354,7 +354,7 @@ public function test_get_term_content_image() { $this->assertEquals( 'https://example.com/media/content_image.jpg', - $this->instance->get_term_content_image( 1337 ) + $this->instance->get_term_content_image( 1337 ), ); } @@ -448,7 +448,7 @@ public function test_get_metadata() { [ 'meta' => 'data', ], - $this->instance->get_metadata( 1337 ) + $this->instance->get_metadata( 1337 ), ); } @@ -500,7 +500,7 @@ public function test_get_attachment_image_url() { $this->assertEquals( 'https://example.org/image.jpg', - $this->instance->get_attachment_image_url( 1337, 'full' ) + $this->instance->get_attachment_image_url( 1337, 'full' ), ); } @@ -535,7 +535,7 @@ public function test_get_attachment_by_url_with_external_url_image() { [ 'scheme' => 'https', 'host' => 'example.com', - ] + ], ); $this->url_helper->expects( 'get_link_type' )->andReturn( SEO_Links::TYPE_EXTERNAL ); $this->assertEquals( 0, $this->actual_instance->get_attachment_by_url( 'https://example.com/image.jpg' ) ); @@ -555,7 +555,7 @@ public function test_get_attachment_by_url_with_external_image() { [ 'scheme' => 'https', 'host' => 'example.com', - ] + ], ); $this->url_helper->expects( 'get_link_type' )->andReturn( SEO_Links::TYPE_EXTERNAL ); $this->assertEquals( 0, $this->actual_instance->get_attachment_by_url( '' ) ); @@ -575,7 +575,7 @@ public function test_get_attachment_by_url_with_existing_indexable() { [ 'scheme' => 'https', 'host' => 'example.com', - ] + ], ); $indexable = new Indexable_Mock(); $indexable->object_type = 'post'; @@ -601,7 +601,7 @@ public function test_get_attachment_by_url_with_existing_link() { [ 'scheme' => 'https', 'host' => 'example.com', - ] + ], ); $url = \md5( 'a_dir/something' ); diff --git a/tests/Unit/Helpers/Import_Cursor_Helper_Test.php b/tests/Unit/Helpers/Import_Cursor_Helper_Test.php index cf107b47492..d68174251e9 100644 --- a/tests/Unit/Helpers/Import_Cursor_Helper_Test.php +++ b/tests/Unit/Helpers/Import_Cursor_Helper_Test.php @@ -128,7 +128,7 @@ public static function not_set_cursor_values() { [ -1 ], [ 1336 ], [ 1337 ], - [ -9223372036854775808 ], + [ -9_223_372_036_854_775_808 ], [ 1336.3 ], [ null ], ]; @@ -171,7 +171,7 @@ public static function set_cursor_values() { return [ [ 1338 ], [ 1337.5 ], - [ 9223372036854775807 ], + [ 9_223_372_036_854_775_808 ], ]; } } diff --git a/tests/Unit/Helpers/Indexable_Helper_Test.php b/tests/Unit/Helpers/Indexable_Helper_Test.php index 37eaa4655f4..3616b87c656 100644 --- a/tests/Unit/Helpers/Indexable_Helper_Test.php +++ b/tests/Unit/Helpers/Indexable_Helper_Test.php @@ -83,15 +83,15 @@ protected function set_up() { public function test_construct() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); $this->assertInstanceOf( Environment_Helper::class, - $this->getPropertyValue( $this->instance, 'environment_helper' ) + $this->getPropertyValue( $this->instance, 'environment_helper' ), ); $this->assertInstanceOf( Indexing_Helper::class, - $this->getPropertyValue( $this->instance, 'indexing_helper' ) + $this->getPropertyValue( $this->instance, 'indexing_helper' ), ); } @@ -360,18 +360,14 @@ public function test_should_index_indexable( $is_production_mode, $should_index_ ->andReturn( $is_production_mode ); // In order to test not having an overriding "Yoast\WP\SEO\should_index_indexables" filter. - if ( $should_index_indexables === null ) { - $should_index_indexables = $is_production_mode; - } + $should_index_indexables ??= $is_production_mode; Monkey\Filters\expectApplied( 'Yoast\WP\SEO\should_index_indexables' ) ->once() ->with( $is_production_mode ) ->andReturn( $should_index_indexables ); // In order to test not having an overriding "wpseo_should_save_indexable" filter. - if ( $should_save_indexable === null ) { - $should_save_indexable = $should_index_indexables; - } + $should_save_indexable ??= $should_index_indexables; Monkey\Filters\expectApplied( 'wpseo_should_save_indexable' ) ->once() ->with( $should_index_indexables, $indexable ) diff --git a/tests/Unit/Helpers/Indexing_Helper_Test.php b/tests/Unit/Helpers/Indexing_Helper_Test.php index 1830d395f33..6b3ad1f01f6 100644 --- a/tests/Unit/Helpers/Indexing_Helper_Test.php +++ b/tests/Unit/Helpers/Indexing_Helper_Test.php @@ -113,7 +113,7 @@ protected function set_up() { $this->instance = new Indexing_Helper( $this->options_helper, $this->date_helper, - $this->notification_center + $this->notification_center, ); $this->post_indexation = Mockery::mock( Indexable_Post_Indexation_Action::class ); @@ -128,7 +128,7 @@ protected function set_up() { $this->post_type_archive_indexation, $this->general_indexation, $this->post_link_indexing_action, - $this->term_link_indexing_action + $this->term_link_indexing_action, ); } @@ -142,11 +142,11 @@ protected function set_up() { public function test_construct() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); $this->assertInstanceOf( Date_Helper::class, - $this->getPropertyValue( $this->instance, 'date_helper' ) + $this->getPropertyValue( $this->instance, 'date_helper' ), ); } @@ -160,27 +160,27 @@ public function test_construct() { public function test_set_indexing_actions() { $this->assertInstanceOf( Indexable_Post_Indexation_Action::class, - $this->getPropertyValue( $this->instance, 'indexing_actions' )[0] + $this->getPropertyValue( $this->instance, 'indexing_actions' )[0], ); $this->assertInstanceOf( Indexable_Term_Indexation_Action::class, - $this->getPropertyValue( $this->instance, 'indexing_actions' )[1] + $this->getPropertyValue( $this->instance, 'indexing_actions' )[1], ); $this->assertInstanceOf( Indexable_Post_Type_Archive_Indexation_Action::class, - $this->getPropertyValue( $this->instance, 'indexing_actions' )[2] + $this->getPropertyValue( $this->instance, 'indexing_actions' )[2], ); $this->assertInstanceOf( Indexable_General_Indexation_Action::class, - $this->getPropertyValue( $this->instance, 'indexing_actions' )[3] + $this->getPropertyValue( $this->instance, 'indexing_actions' )[3], ); $this->assertInstanceOf( Post_Link_Indexing_Action::class, - $this->getPropertyValue( $this->instance, 'indexing_actions' )[4] + $this->getPropertyValue( $this->instance, 'indexing_actions' )[4], ); $this->assertInstanceOf( Term_Link_Indexing_Action::class, - $this->getPropertyValue( $this->instance, 'indexing_actions' )[5] + $this->getPropertyValue( $this->instance, 'indexing_actions' )[5], ); } @@ -199,7 +199,7 @@ public function test_prepare() { ->once() ->with( 'indexing_first_time', false ); - $start_time = 160934509; + $start_time = 160_934_509; $this->date_helper ->expects( 'current_time' ) @@ -312,7 +312,7 @@ public function test_get_reason() { * @return void */ public function test_get_started() { - $start_time = 160934509; + $start_time = 160_934_509; $this->options_helper ->expects( 'get' ) ->once() diff --git a/tests/Unit/Helpers/Options_Helper_Test.php b/tests/Unit/Helpers/Options_Helper_Test.php index 27b9dbcc0f8..11ab9ebd466 100644 --- a/tests/Unit/Helpers/Options_Helper_Test.php +++ b/tests/Unit/Helpers/Options_Helper_Test.php @@ -49,7 +49,7 @@ public function test_get_title_default() { ->andReturn( [ 'my-title' => 'This is a title', - ] + ], ); $this->assertEquals( 'This is a title', $this->instance->get_title_default( 'my-title' ) ); diff --git a/tests/Unit/Helpers/Pagination_Helper_Test.php b/tests/Unit/Helpers/Pagination_Helper_Test.php index 629d4b6bde6..6275a23c8ef 100644 --- a/tests/Unit/Helpers/Pagination_Helper_Test.php +++ b/tests/Unit/Helpers/Pagination_Helper_Test.php @@ -76,11 +76,11 @@ protected function tear_down() { public function test_constructor() { $this->assertInstanceOf( WP_Rewrite_Wrapper::class, - $this->getPropertyValue( $this->instance, 'wp_rewrite_wrapper' ) + $this->getPropertyValue( $this->instance, 'wp_rewrite_wrapper' ), ); $this->assertInstanceOf( WP_Query_Wrapper::class, - $this->getPropertyValue( $this->instance, 'wp_query_wrapper' ) + $this->getPropertyValue( $this->instance, 'wp_query_wrapper' ), ); } @@ -475,7 +475,7 @@ static function ( $query_var, $default_response ) { } return $default_response; - } + }, ); $this->assertSame( 2, $this->instance->get_current_page_number() ); diff --git a/tests/Unit/Helpers/Permalink_Helper_Test.php b/tests/Unit/Helpers/Permalink_Helper_Test.php index 7bb31ec5ef1..50239d6bb01 100644 --- a/tests/Unit/Helpers/Permalink_Helper_Test.php +++ b/tests/Unit/Helpers/Permalink_Helper_Test.php @@ -51,7 +51,7 @@ public function test_get_permalink_for_post_indexable() { $this->assertEquals( 'https://example.org/permalink', - $this->instance->get_permalink_for_indexable( $indexable ) + $this->instance->get_permalink_for_indexable( $indexable ), ); } @@ -72,7 +72,7 @@ public function test_get_permalink_for_attachment_indexable() { $this->assertEquals( 'https://example.org/attachment', - $this->instance->get_permalink_for_indexable( $indexable ) + $this->instance->get_permalink_for_indexable( $indexable ), ); } @@ -92,7 +92,7 @@ public function test_get_permalink_for_homepage_indexable() { $this->assertEquals( 'https://example.org/homepage', - $this->instance->get_permalink_for_indexable( $indexable ) + $this->instance->get_permalink_for_indexable( $indexable ), ); } @@ -126,7 +126,7 @@ public function test_get_permalink_for_term_indexable() { $this->assertEquals( 'https://example.org/term', - $this->instance->get_permalink_for_indexable( $indexable ) + $this->instance->get_permalink_for_indexable( $indexable ), ); } @@ -147,7 +147,7 @@ public function test_get_permalink_for_term_indexable_term_not_found() { ->andReturn( null ); $this->assertNull( - $this->instance->get_permalink_for_indexable( $indexable ) + $this->instance->get_permalink_for_indexable( $indexable ), ); } @@ -176,7 +176,7 @@ public function test_get_permalink_for_term_indexable_term_is_wp_error() { ->andReturn( true ); $this->assertNull( - $this->instance->get_permalink_for_indexable( $indexable ) + $this->instance->get_permalink_for_indexable( $indexable ), ); } @@ -197,7 +197,7 @@ public function test_get_permalink_for_search_page_indexable() { $this->assertEquals( 'https://example.org/search', - $this->instance->get_permalink_for_indexable( $indexable ) + $this->instance->get_permalink_for_indexable( $indexable ), ); } @@ -219,7 +219,7 @@ public function test_get_permalink_for_post_type_archive_indexable() { $this->assertEquals( 'https://example.org/post-type', - $this->instance->get_permalink_for_indexable( $indexable ) + $this->instance->get_permalink_for_indexable( $indexable ), ); } @@ -241,7 +241,7 @@ public function test_get_permalink_for_user_indexable() { $this->assertEquals( 'https://example.org/user/1', - $this->instance->get_permalink_for_indexable( $indexable ) + $this->instance->get_permalink_for_indexable( $indexable ), ); } @@ -257,7 +257,7 @@ public function test_get_permalink_for_unknown_type_indexable() { $indexable->object_type = 'unknown'; $this->assertNull( - $this->instance->get_permalink_for_indexable( $indexable ) + $this->instance->get_permalink_for_indexable( $indexable ), ); } diff --git a/tests/Unit/Helpers/Primary_Term_Helper_Test.php b/tests/Unit/Helpers/Primary_Term_Helper_Test.php index 05416434ba2..f8a6b80dd21 100644 --- a/tests/Unit/Helpers/Primary_Term_Helper_Test.php +++ b/tests/Unit/Helpers/Primary_Term_Helper_Test.php @@ -65,7 +65,7 @@ public function test_get_primary_term_taxonomies() { 'name' => 'tag', 'hierarchical' => false, ], - ] + ], ); Monkey\Functions\expect( 'get_post_type' ) @@ -102,7 +102,7 @@ public function test_get_primary_term_taxonomies_no_hierarchical() { 'name' => 'tag', 'hierarchical' => false, ], - ] + ], ); Monkey\Functions\expect( 'get_post_type' ) diff --git a/tests/Unit/Helpers/Robots_Helper_Test.php b/tests/Unit/Helpers/Robots_Helper_Test.php index c64b863bd6b..1be477b97cf 100644 --- a/tests/Unit/Helpers/Robots_Helper_Test.php +++ b/tests/Unit/Helpers/Robots_Helper_Test.php @@ -64,11 +64,11 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( Post_Type_Helper::class, - $this->getPropertyValue( $this->instance, 'post_type_helper' ) + $this->getPropertyValue( $this->instance, 'post_type_helper' ), ); $this->assertInstanceOf( Taxonomy_Helper::class, - $this->getPropertyValue( $this->instance, 'taxonomy_helper' ) + $this->getPropertyValue( $this->instance, 'taxonomy_helper' ), ); } @@ -153,8 +153,8 @@ public function test_set_robots_no_index() { [ 'index' => 'index', 'follow' => 'follow', - ] - ) + ], + ), ); } @@ -170,12 +170,12 @@ public function test_set_robots_no_index_string_given() { ->with( Robots_Helper::class . '::set_robots_no_index', '14.1', - '$robots has to be a key-value paired array.' + '$robots has to be a key-value paired array.', ); $this->assertEquals( 'noindex,follow', - $this->instance->set_robots_no_index( 'noindex,follow' ) + $this->instance->set_robots_no_index( 'noindex,follow' ), ); } } diff --git a/tests/Unit/Helpers/Robots_Txt_Helper_Test.php b/tests/Unit/Helpers/Robots_Txt_Helper_Test.php index 484aca79881..ed6cdc7abef 100644 --- a/tests/Unit/Helpers/Robots_Txt_Helper_Test.php +++ b/tests/Unit/Helpers/Robots_Txt_Helper_Test.php @@ -41,10 +41,10 @@ public function set_up() { */ public function test_construct() { $this->assertIsObject( - $this->getPropertyValue( $this->instance, 'robots_txt_user_agents' ) + $this->getPropertyValue( $this->instance, 'robots_txt_user_agents' ), ); $this->assertIsArray( - $this->getPropertyValue( $this->instance, 'robots_txt_sitemaps' ) + $this->getPropertyValue( $this->instance, 'robots_txt_sitemaps' ), ); } diff --git a/tests/Unit/Helpers/Schema/ID_Helper_Test.php b/tests/Unit/Helpers/Schema/ID_Helper_Test.php index 7a66e9d344f..9dc100063a6 100644 --- a/tests/Unit/Helpers/Schema/ID_Helper_Test.php +++ b/tests/Unit/Helpers/Schema/ID_Helper_Test.php @@ -63,7 +63,7 @@ public function test_get_user_schema_id() { $this->assertEquals( 'https://example.org/#/schema/person/1234567890', - $this->instance->get_user_schema_id( 1337, $context ) + $this->instance->get_user_schema_id( 1337, $context ), ); } @@ -85,7 +85,7 @@ public function test_get_user_schema_id_no_user_found() { $this->assertEquals( '', - $this->instance->get_user_schema_id( 1337, $context ) + $this->instance->get_user_schema_id( 1337, $context ), ); } } diff --git a/tests/Unit/Helpers/Schema/Image_Helper_Test.php b/tests/Unit/Helpers/Schema/Image_Helper_Test.php index a7f060f4317..50dcb04886c 100644 --- a/tests/Unit/Helpers/Schema/Image_Helper_Test.php +++ b/tests/Unit/Helpers/Schema/Image_Helper_Test.php @@ -84,7 +84,7 @@ public function test_generate_from_url_with_found_attachment_id() { $this->assertEquals( [], - $this->instance->generate_from_url( '#schema-image-ABC', 'https://example.org/image.jpg', 'caption' ) + $this->instance->generate_from_url( '#schema-image-ABC', 'https://example.org/image.jpg', 'caption' ), ); } @@ -110,7 +110,7 @@ public function test_generate_from_url_with_no_found_attachment_id() { $this->assertEquals( [], - $this->instance->generate_from_url( '#schema-image-ABC', 'https://example.org/image.jpg', 'caption', false, false ) + $this->instance->generate_from_url( '#schema-image-ABC', 'https://example.org/image.jpg', 'caption', false, false ), ); } @@ -139,7 +139,7 @@ public function test_generate_from_attachment_id_with_caption_and_image_dimensio [ 'width' => 256, 'height' => 512, - ] + ], ); $this->language @@ -163,8 +163,8 @@ public function test_generate_from_attachment_id_with_caption_and_image_dimensio $this->instance->generate_from_attachment_id( 'https://example.com/#/schema/logo/image/', 1337, - 'Company name' - ) + 'Company name', + ), ); } @@ -209,8 +209,8 @@ public function test_generate_from_attachment_id_with_caption_given() { $this->instance->generate_from_attachment_id( 'https://example.com/#/schema/logo/image/', 1337, - 'Company name' - ) + 'Company name', + ), ); } @@ -267,7 +267,7 @@ public function test_generate_from_attachment_id_with_no_caption_given() { $actual = $this->instance->generate_from_attachment_id( 'https://example.com/#/schema/logo/image/', 1337, - '' + '', ); $this->assertEquals( $expected, $actual ); @@ -319,7 +319,7 @@ public function test_generate_from_attachment_id_with_no_caption_given_and_no_al $actual = $this->instance->generate_from_attachment_id( 'https://example.com/#/schema/logo/image/', 1337, - '' + '', ); $this->assertEquals( $expected, $actual ); @@ -360,7 +360,7 @@ public function test_simple_image_object() { $actual = $this->instance->simple_image_object( 'https://example.com/#/schema/logo/image/', 'https://example.com/logo.jpg', - 'Image caption' + 'Image caption', ); $this->assertEquals( $expected, $actual ); diff --git a/tests/Unit/Helpers/Schema/Language_Helper_Test.php b/tests/Unit/Helpers/Schema/Language_Helper_Test.php index 39c814f90a4..13a2720b37e 100644 --- a/tests/Unit/Helpers/Schema/Language_Helper_Test.php +++ b/tests/Unit/Helpers/Schema/Language_Helper_Test.php @@ -35,7 +35,7 @@ public function test_add_piece_language() { [ 'inLanguage' => 'English', ], - $instance->add_piece_language( [] ) + $instance->add_piece_language( [] ), ); } } diff --git a/tests/Unit/Helpers/Schema/Replace_Vars_Helper_Test.php b/tests/Unit/Helpers/Schema/Replace_Vars_Helper_Test.php index 2f19c171e94..2cf212b332a 100644 --- a/tests/Unit/Helpers/Schema/Replace_Vars_Helper_Test.php +++ b/tests/Unit/Helpers/Schema/Replace_Vars_Helper_Test.php @@ -75,7 +75,7 @@ public function set_up() { $this->instance = new Replace_Vars_Helper( $this->replace_vars, $this->id_helper, - $this->date_helper + $this->date_helper, ); } @@ -168,7 +168,7 @@ public function test_registers_the_right_replace_vars() { $this->replace_vars, $this->id_helper, $this->date_helper, - ] + ], ) ->shouldAllowMockingProtectedMethods() ->makePartial(); @@ -223,7 +223,7 @@ public function test_registers_the_right_replace_vars_on_non_post() { $this->replace_vars, $this->id_helper, $this->date_helper, - ] + ], ) ->shouldAllowMockingProtectedMethods() ->makePartial(); @@ -289,7 +289,7 @@ public function test_get_identity_function() { $instance = new Replace_Vars_Helper_Double( $this->replace_vars, $this->id_helper, - $this->date_helper + $this->date_helper, ); $value = 'a_value'; $closure = $instance->get_identity_function( $value ); diff --git a/tests/Unit/Helpers/Score_Icon_Helper_Test.php b/tests/Unit/Helpers/Score_Icon_Helper_Test.php index 92e9c829108..17fe5c21a4c 100644 --- a/tests/Unit/Helpers/Score_Icon_Helper_Test.php +++ b/tests/Unit/Helpers/Score_Icon_Helper_Test.php @@ -57,7 +57,7 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( Robots_Helper::class, - $this->getPropertyValue( $this->instance, 'robots_helper' ) + $this->getPropertyValue( $this->instance, 'robots_helper' ), ); } diff --git a/tests/Unit/Helpers/Short_Link_Helper_Test.php b/tests/Unit/Helpers/Short_Link_Helper_Test.php index b3553a51d16..dfb33560110 100644 --- a/tests/Unit/Helpers/Short_Link_Helper_Test.php +++ b/tests/Unit/Helpers/Short_Link_Helper_Test.php @@ -54,7 +54,7 @@ protected function set_up() { $this->instance = new Short_Link_Helper( $this->options_helper, - $this->product_helper + $this->product_helper, ); } diff --git a/tests/Unit/Helpers/Site_Helper_Test.php b/tests/Unit/Helpers/Site_Helper_Test.php index c94853808fd..c8e85cdcbd7 100644 --- a/tests/Unit/Helpers/Site_Helper_Test.php +++ b/tests/Unit/Helpers/Site_Helper_Test.php @@ -66,7 +66,7 @@ public function test_is_multisite_and_switched() { [ 'is_multisite' => true, 'ms_is_switched' => true, - ] + ], ); self::assertTrue( $this->instance->is_multisite_and_switched() ); diff --git a/tests/Unit/Helpers/Social_Profiles_Helper_Test.php b/tests/Unit/Helpers/Social_Profiles_Helper_Test.php index af0d922a36e..f7111c4c0c0 100644 --- a/tests/Unit/Helpers/Social_Profiles_Helper_Test.php +++ b/tests/Unit/Helpers/Social_Profiles_Helper_Test.php @@ -236,7 +236,7 @@ public function test_set_organization_social_profiles( $social_profiles, $valida $social_profiles[ $field ], static function ( $other_social_url ) { return $other_social_url !== ''; - } + }, ); } diff --git a/tests/Unit/Helpers/Url_Helper_Test.php b/tests/Unit/Helpers/Url_Helper_Test.php index 7cb46eae92b..c75fb7f235a 100644 --- a/tests/Unit/Helpers/Url_Helper_Test.php +++ b/tests/Unit/Helpers/Url_Helper_Test.php @@ -58,7 +58,7 @@ public function test_build_absolute_url() { [ 'scheme' => 'https', 'host' => 'example.com', - ] + ], ); $expected = 'https://example.com/my-page'; @@ -88,7 +88,7 @@ public function test_build_absolute_url_relative_url() { [ 'scheme' => 'https', 'host' => 'example.com', - ] + ], ); $expected = 'https://example.com/my-page'; @@ -116,7 +116,7 @@ public function test_get_url_path( $url_input, $expected ) { // phpcs:ignore WordPress.WP.AlternativeFunctions.parse_url_parse_url -- Mocking wp_parse_url(), this is fine. return \parse_url( $url, $component ); }, - ] + ], ); $this->assertSame( $expected, $this->instance->get_url_path( $url_input ) ); @@ -195,7 +195,7 @@ public function test_get_url_host( $url_input, $expected ) { // phpcs:ignore WordPress.WP.AlternativeFunctions.parse_url_parse_url -- Mocking wp_parse_url(), this is fine. return \parse_url( $url, $component ); }, - ] + ], ); $this->assertSame( $expected, $this->instance->get_url_host( $url_input ) ); @@ -353,7 +353,7 @@ public function test_ensure_absolute_url_with_relative_url_given() { [ 'scheme' => 'https', 'host' => 'example.com', - ] + ], ); $this->assertEquals( 'https://example.com/page', $this->instance->ensure_absolute_url( 'page' ) ); @@ -528,7 +528,7 @@ public function test_get_link_type( $url, $home_url, $is_image, $link_type, $mes $this->assertEquals( $link_type, $this->instance->get_link_type( $url, $home_url, $is_image ), - $message + $message, ); } @@ -657,7 +657,7 @@ public function test_recreate_current_url( $params, $expected ) { $this->assertSame( $expected, - $this->instance->recreate_current_url( $params['with_request_uri'] ) + $this->instance->recreate_current_url( $params['with_request_uri'] ), ); if ( ! empty( $params['HTTPS'] ) ) { diff --git a/tests/Unit/Helpers/Wincher_Helper_Test.php b/tests/Unit/Helpers/Wincher_Helper_Test.php index a40e0e1792b..ada6b247485 100644 --- a/tests/Unit/Helpers/Wincher_Helper_Test.php +++ b/tests/Unit/Helpers/Wincher_Helper_Test.php @@ -74,7 +74,7 @@ public function test_constructor() { $this->assertInstanceOf( Wincher_Helper::class, $this->instance ); $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options' ) + $this->getPropertyValue( $this->instance, 'options' ), ); } @@ -104,7 +104,7 @@ public function test_is_active_unmet() { Monkey\Functions\stubs( [ 'is_multisite' => true, - ] + ], ); $this->assertFalse( $this->instance->is_active() ); diff --git a/tests/Unit/Inc/Addon_Manager_Test.php b/tests/Unit/Inc/Addon_Manager_Test.php index a1ed38051ff..60032e9ac18 100644 --- a/tests/Unit/Inc/Addon_Manager_Test.php +++ b/tests/Unit/Inc/Addon_Manager_Test.php @@ -76,7 +76,7 @@ public function test_get_subscriptions_with_no_installed_addons() { ->andReturn( (object) [ 'subscriptions' => [], - ] + ], ); $this->assertEquals( [], $this->instance->get_subscriptions() ); @@ -102,7 +102,7 @@ public function test_get_subscriptions_with_site_transient() { ->andReturn( (object) [ 'subscriptions' => [], - ] + ], ); $this->assertEquals( [], $this->instance->get_subscriptions() ); @@ -195,7 +195,7 @@ public function test_get_subscriptions_with_no_current_sites_found() { ->andReturn( (object) [ 'subscriptions' => [], - ] + ], ); $this->assertEquals( [], $this->instance->get_subscriptions() ); @@ -222,7 +222,7 @@ public function test_get_subscription() { $this->assertEquals( $subscription, - $this->instance->get_subscription( 'wordpress-seo' ) + $this->instance->get_subscription( 'wordpress-seo' ), ); } @@ -264,7 +264,7 @@ public function test_get_subscriptions_for_active_addons() { 'wp-seo-premium.php' => [ 'Version' => '10.0', ], - ] + ], ); $this->instance @@ -278,7 +278,7 @@ public function test_get_subscriptions_for_active_addons() { $container = $this->create_container_with( [ Product_Helper::class => $product_helper_mock, - ] + ], ); Monkey\Functions\expect( 'YoastSEO' ) @@ -300,7 +300,7 @@ public function test_get_subscriptions_for_active_addons() { ], ], ], - $this->instance->get_subscriptions_for_active_addons() + $this->instance->get_subscriptions_for_active_addons(), ); } @@ -322,7 +322,7 @@ public function test_get_addon_filenames() { 'wpseo-woocommerce.php' => 'yoast-seo-woocommerce', 'local-seo.php' => 'yoast-seo-local', ], - $actual + $actual, ); } @@ -342,7 +342,7 @@ public function test_get_plugin_file() { 'wp-seo-premium.php' => [ 'Version' => '10.0' ], 'no-yoast-seo-extension-php' => [ 'Version' => '10.0' ], 'wpseo-news.php' => [ 'Version' => '9.5' ], - ] + ], ); $actual = $this->instance->get_plugin_file( 'yoast-seo-news' ); @@ -366,7 +366,7 @@ public function test_get_plugin_file_nonexistent_plugin() { 'wp-seo-premium.php' => [ 'Version' => '10.0' ], 'no-yoast-seo-extension-php' => [ 'Version' => '10.0' ], 'wpseo-news.php' => [ 'Version' => '9.5' ], - ] + ], ); $actual = $this->instance->get_plugin_file( 'some-other-plugin-slug' ); @@ -390,7 +390,7 @@ public function test_get_installed_addons_versions() { 'wp-seo-premium.php' => [ 'Version' => '10.0', ], - ] + ], ); $product_helper_mock = Mockery::mock( Product_Helper::class ); @@ -399,7 +399,7 @@ public function test_get_installed_addons_versions() { $container = $this->create_container_with( [ Product_Helper::class => $product_helper_mock, - ] + ], ); Monkey\Functions\expect( 'YoastSEO' ) @@ -410,7 +410,7 @@ public function test_get_installed_addons_versions() { [ 'yoast-seo-wordpress-premium' => '10.0', ], - $this->instance->get_installed_addons_versions() + $this->instance->get_installed_addons_versions(), ); } @@ -447,13 +447,13 @@ public function test_get_plugin_information( $action, $args, $expected, $message 'requires' => \YOAST_SEO_WP_REQUIRED, ], ], - ] + ], ); $this->assertEquals( $expected, $this->instance->get_plugin_information( false, $action, (object) $args ), - $message + $message, ); } @@ -472,7 +472,7 @@ public function test_has_valid_subscription() { $this->assertEquals( true, - $this->instance->has_valid_subscription( 'yoast-seo-wordpress-premium' ) + $this->instance->has_valid_subscription( 'yoast-seo-wordpress-premium' ), ); } @@ -491,7 +491,7 @@ public function test_has_valid_subscription_with_an_expired_subscription() { $this->assertEquals( false, - $this->instance->has_valid_subscription( 'yoast-seo-news' ) + $this->instance->has_valid_subscription( 'yoast-seo-news' ), ); } @@ -510,7 +510,7 @@ public function test_has_valid_subscription_with_an_unknown_subscription() { $this->assertEquals( false, - $this->instance->has_valid_subscription( 'unknown-slug' ) + $this->instance->has_valid_subscription( 'unknown-slug' ), ); } @@ -547,7 +547,7 @@ public function test_check_for_updates( $addons, $data, $expected, $message ) { ->andReturn( (object) [ 'requires' => \YOAST_SEO_WP_REQUIRED, - ] + ], ); if ( ! empty( $addons ) ) { @@ -557,7 +557,7 @@ public function test_check_for_updates( $addons, $data, $expected, $message ) { $container = $this->create_container_with( [ Product_Helper::class => $product_helper_mock, - ] + ], ); Monkey\Functions\expect( 'YoastSEO' ) @@ -574,7 +574,7 @@ public function test_check_for_updates( $addons, $data, $expected, $message ) { 'requires_php' => '7.4', ], ], - ] + ], ); global $wp_version; @@ -604,7 +604,7 @@ public function test_is_yoast_addon() { $container = $this->create_container_with( [ Product_Helper::class => $product_helper_mock, - ] + ], ); Monkey\Functions\expect( 'YoastSEO' ) @@ -629,7 +629,7 @@ public function test_get_slug_by_plugin_file() { $container = $this->create_container_with( [ Product_Helper::class => $product_helper_mock, - ] + ], ); Monkey\Functions\expect( 'YoastSEO' ) @@ -740,7 +740,7 @@ public function test_get_installed_addons_with_no_yoast_addons_installed() { 'no-yoast-seo-extension-php' => [ 'Version' => '10.0', ], - ] + ], ); $product_helper_mock = Mockery::mock( Product_Helper::class ); @@ -749,7 +749,7 @@ public function test_get_installed_addons_with_no_yoast_addons_installed() { $container = $this->create_container_with( [ Product_Helper::class => $product_helper_mock, - ] + ], ); Monkey\Functions\expect( 'YoastSEO' ) @@ -758,7 +758,7 @@ public function test_get_installed_addons_with_no_yoast_addons_installed() { $this->assertEquals( [], - $this->instance->get_installed_addons() + $this->instance->get_installed_addons(), ); } @@ -778,7 +778,7 @@ public function test_has_installed_addons() { 'wp-seo-premium.php' => [ 'Version' => '10.0', ], - ] + ], ); $this->assertTrue( $this->instance->has_installed_addons() ); @@ -800,7 +800,7 @@ public function test_get_installed_addons_with_yoast_addon_installed() { 'wp-seo-premium.php' => [ 'Version' => '10.0', ], - ] + ], ); $product_helper_mock = Mockery::mock( Product_Helper::class ); @@ -809,7 +809,7 @@ public function test_get_installed_addons_with_yoast_addon_installed() { $container = $this->create_container_with( [ Product_Helper::class => $product_helper_mock, - ] + ], ); Monkey\Functions\expect( 'YoastSEO' ) @@ -822,7 +822,7 @@ public function test_get_installed_addons_with_yoast_addon_installed() { 'Version' => '10.0', ], ], - $this->instance->get_installed_addons() + $this->instance->get_installed_addons(), ); } @@ -842,7 +842,7 @@ public function test_get_active_addons() { 'wp-seo-premium.php' => [ 'Version' => '10.0' ], 'no-yoast-seo-extension-php' => [ 'Version' => '10.0' ], 'wpseo-news.php' => [ 'Version' => '9.5' ], - ] + ], ); $this->instance @@ -856,7 +856,7 @@ public function test_get_active_addons() { $container = $this->create_container_with( [ Product_Helper::class => $product_helper_mock, - ] + ], ); Monkey\Functions\expect( 'YoastSEO' ) @@ -869,7 +869,7 @@ public function test_get_active_addons() { 'Version' => '10.0', ], ], - $this->instance->get_active_addons() + $this->instance->get_active_addons(), ); } @@ -1066,9 +1066,9 @@ protected function get_subscriptions() { 'changelog' => 'changelog', ], ], - ] + ], ), - false + false, ); } @@ -1078,9 +1078,7 @@ protected function get_subscriptions() { * @return string Future date. */ protected function get_future_date() { - if ( $this->future_date === null ) { - $this->future_date = \gmdate( 'Y-m-d\TH:i:s\Z', ( \time() + \DAY_IN_SECONDS ) ); - } + $this->future_date ??= \gmdate( 'Y-m-d\TH:i:s\Z', ( \time() + \DAY_IN_SECONDS ) ); return $this->future_date; } @@ -1091,9 +1089,7 @@ protected function get_future_date() { * @return string Past date. */ protected function get_past_date() { - if ( $this->past_date === null ) { - $this->past_date = \gmdate( 'Y-m-d\TH:i:s\Z', ( \time() - \DAY_IN_SECONDS ) ); - } + $this->past_date ??= \gmdate( 'Y-m-d\TH:i:s\Z', ( \time() - \DAY_IN_SECONDS ) ); return $this->past_date; } @@ -1236,7 +1232,7 @@ public function test_create_notification( $product_name, $short_link ) { $container = $this->create_container_with( [ Short_Link_Helper::class => $short_link_mock, - ] + ], ); $admin_user = Mockery::mock( WP_User::class ); @@ -1260,7 +1256,7 @@ public function test_create_notification( $product_name, $short_link ) { $expected = new Yoast_Notification( ' ' . $product_name . ' isn\'t working as expected and you are not receiving updates or support! Make sure to activate your product subscription in MyYoast to unlock all the features of ' . $product_name . '.', - $notification_options + $notification_options, ); $this->assertEquals( $expected, $notification ); } diff --git a/tests/Unit/Inc/Options/Option_Social_Test.php b/tests/Unit/Inc/Options/Option_Social_Test.php index 51858013a2e..69c6394c24f 100644 --- a/tests/Unit/Inc/Options/Option_Social_Test.php +++ b/tests/Unit/Inc/Options/Option_Social_Test.php @@ -45,14 +45,14 @@ public function test_validate_option_with_valid_data( $expected, $dirty, $clean, 'wp_parse_url' => static function ( $url ) { return \parse_url( $url ); }, - ] + ], ); $instance = new Option_Social_Double(); $this->assertEquals( $expected, - $instance->validate_option( $dirty, $clean, $old ) + $instance->validate_option( $dirty, $clean, $old ), ); } @@ -78,7 +78,7 @@ public function test_validate_option_with_invalid_data( $expected, $dirty, $clea 'wp_parse_url' => static function ( $url ) { return \parse_url( $url ); }, - ] + ], ); $instance = new Option_Social_Double(); @@ -96,7 +96,7 @@ public function test_validate_option_with_invalid_data( $expected, $dirty, $clea $this->assertEquals( $expected, - $instance->validate_option( $dirty, $clean, $old ) + $instance->validate_option( $dirty, $clean, $old ), ); unset( $GLOBALS['wp_settings_errors'] ); @@ -121,7 +121,7 @@ public function test_validate_option_with_invalid_array_data( $expected, $dirty, $this->assertEquals( $expected, - $instance->validate_option( $dirty, $clean, $old ) + $instance->validate_option( $dirty, $clean, $old ), ); } diff --git a/tests/Unit/Inc/Sitemaps/Sitemaps_Admin_Test.php b/tests/Unit/Inc/Sitemaps/Sitemaps_Admin_Test.php index a9ff922b1de..ee3dbf390fc 100644 --- a/tests/Unit/Inc/Sitemaps/Sitemaps_Admin_Test.php +++ b/tests/Unit/Inc/Sitemaps/Sitemaps_Admin_Test.php @@ -64,7 +64,7 @@ public function test_status_transition_on_development() { Monkey\Functions\stubs( [ 'wp_get_environment_type' => 'development', - ] + ], ); Monkey\Functions\expect( 'get_post_type' ) @@ -102,7 +102,7 @@ public function test_status_transition_on_production() { Monkey\Functions\stubs( [ 'wp_get_environment_type' => 'production', - ] + ], ); Monkey\Functions\expect( 'get_post_type' ) diff --git a/tests/Unit/Inc/Sitemaps/Sitemaps_Router_Test.php b/tests/Unit/Inc/Sitemaps/Sitemaps_Router_Test.php index d4f9fbe1e3e..304e576fe20 100644 --- a/tests/Unit/Inc/Sitemaps/Sitemaps_Router_Test.php +++ b/tests/Unit/Inc/Sitemaps/Sitemaps_Router_Test.php @@ -58,7 +58,7 @@ protected function set_up() { $this->container = $this->create_container_with( [ Deactivating_Yoast_Seo_Conditional::class => $this->deactivating_yoast_conditional, - ] + ], ); $this->deactivating_yoast_conditional->expects( 'is_met' ) ->once() diff --git a/tests/Unit/Initializers/Crawl_Cleanup_Permalinks_Test.php b/tests/Unit/Initializers/Crawl_Cleanup_Permalinks_Test.php index d2dea95f916..68ae1711b8c 100644 --- a/tests/Unit/Initializers/Crawl_Cleanup_Permalinks_Test.php +++ b/tests/Unit/Initializers/Crawl_Cleanup_Permalinks_Test.php @@ -75,7 +75,7 @@ protected function set_up() { $this->options_helper, $this->url_helper, $this->redirect_helper, - $this->crawl_cleanup_helper + $this->crawl_cleanup_helper, ); } diff --git a/tests/Unit/Integrations/Academy_Integration_Test.php b/tests/Unit/Integrations/Academy_Integration_Test.php index bb2c8ae14ba..4668fe633e3 100644 --- a/tests/Unit/Integrations/Academy_Integration_Test.php +++ b/tests/Unit/Integrations/Academy_Integration_Test.php @@ -75,7 +75,7 @@ public function set_up() { $this->asset_manager, $this->current_page_helper, $this->product_helper, - $this->shortlink_helper + $this->shortlink_helper, ); } @@ -93,8 +93,8 @@ public function test_construct() { $this->asset_manager, $this->current_page_helper, $this->product_helper, - $this->shortlink_helper - ) + $this->shortlink_helper, + ), ); } @@ -111,7 +111,7 @@ public function test_get_conditionals() { Admin_Conditional::class, User_Can_Manage_Wpseo_Options_Conditional::class, ], - Academy_Integration::get_conditionals() + Academy_Integration::get_conditionals(), ); } @@ -180,7 +180,7 @@ public function test_add_page() { [ 'page1', '', 'Page 1', 'manage_options', 'page1', [ $this, 'display_page' ] ], [ 'page2', '', 'Page 2', 'manage_options', 'page2', [ $this, 'display_page' ] ], [ 'page3', '', 'Page 3', 'manage_options', 'page3', [ $this, 'display_page' ] ], - ] + ], ); // Assert that the new page was added at index 3. diff --git a/tests/Unit/Integrations/Admin/Activation_Cleanup_Integration_Test.php b/tests/Unit/Integrations/Admin/Activation_Cleanup_Integration_Test.php index d20154f567a..8c6241ba17e 100644 --- a/tests/Unit/Integrations/Admin/Activation_Cleanup_Integration_Test.php +++ b/tests/Unit/Integrations/Admin/Activation_Cleanup_Integration_Test.php @@ -64,7 +64,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [], - Activation_Cleanup_Integration::get_conditionals() + Activation_Cleanup_Integration::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Admin/Background_Indexing_Integration_Test.php b/tests/Unit/Integrations/Admin/Background_Indexing_Integration_Test.php index 5ef22016158..9fc8f74b40c 100644 --- a/tests/Unit/Integrations/Admin/Background_Indexing_Integration_Test.php +++ b/tests/Unit/Integrations/Admin/Background_Indexing_Integration_Test.php @@ -158,7 +158,7 @@ protected function set_up() { $this->general_indexation, $this->post_link_indexing_action, $this->term_link_indexing_action, - ] + ], )->makePartial()->shouldAllowMockingProtectedMethods(); $this->stubTranslationFunctions(); @@ -176,7 +176,7 @@ public function test_get_conditionals() { [ Migrations_Conditional::class, ], - Background_Indexing_Integration::get_conditionals() + Background_Indexing_Integration::get_conditionals(), ); } @@ -191,15 +191,15 @@ public function test_constructor() { $this->assertInstanceOf( Indexable_Indexing_Complete_Action::class, - $this->getPropertyValue( $this->instance, 'complete_indexation_action' ) + $this->getPropertyValue( $this->instance, 'complete_indexation_action' ), ); $this->assertInstanceOf( Indexing_Helper::class, - $this->getPropertyValue( $this->instance, 'indexing_helper' ) + $this->getPropertyValue( $this->instance, 'indexing_helper' ), ); $this->assertInstanceOf( Yoast_Admin_And_Dashboard_Conditional::class, - $this->getPropertyValue( $this->instance, 'yoast_admin_and_dashboard_conditional' ) + $this->getPropertyValue( $this->instance, 'yoast_admin_and_dashboard_conditional' ), ); } @@ -578,8 +578,8 @@ public function test_index_with_wp_cron_with_cron_indexing_disabled() { ->with( true ) ->andReturn( false ); - Monkey\Functions\expect( 'wp_next_scheduled' )->once()->with( 'wpseo_indexable_index_batch' )->andReturn( 12345 ); - Monkey\Functions\expect( 'wp_unschedule_event' )->once()->with( 12345, 'wpseo_indexable_index_batch' ); + Monkey\Functions\expect( 'wp_next_scheduled' )->once()->with( 'wpseo_indexable_index_batch' )->andReturn( 12_345 ); + Monkey\Functions\expect( 'wp_unschedule_event' )->once()->with( 12_345, 'wpseo_indexable_index_batch' ); $this->instance->index(); } @@ -604,8 +604,8 @@ public function test_index_with_wp_cron_with_indexing_disabled() { ->once() ->andReturn( false ); - Monkey\Functions\expect( 'wp_next_scheduled' )->once()->with( 'wpseo_indexable_index_batch' )->andReturn( 12345 ); - Monkey\Functions\expect( 'wp_unschedule_event' )->once()->with( 12345, 'wpseo_indexable_index_batch' ); + Monkey\Functions\expect( 'wp_next_scheduled' )->once()->with( 'wpseo_indexable_index_batch' )->andReturn( 12_345 ); + Monkey\Functions\expect( 'wp_unschedule_event' )->once()->with( 12_345, 'wpseo_indexable_index_batch' ); $this->instance->index(); } @@ -636,8 +636,8 @@ public function test_index_with_wp_cron_with_complete_index() { ->once() ->andReturn( true ); - Monkey\Functions\expect( 'wp_next_scheduled' )->once()->with( 'wpseo_indexable_index_batch' )->andReturn( 12345 ); - Monkey\Functions\expect( 'wp_unschedule_event' )->once()->with( 12345, 'wpseo_indexable_index_batch' ); + Monkey\Functions\expect( 'wp_next_scheduled' )->once()->with( 'wpseo_indexable_index_batch' )->andReturn( 12_345 ); + Monkey\Functions\expect( 'wp_unschedule_event' )->once()->with( 12_345, 'wpseo_indexable_index_batch' ); $this->instance->index(); } diff --git a/tests/Unit/Integrations/Admin/Crawl_Settings_Integration_Test.php b/tests/Unit/Integrations/Admin/Crawl_Settings_Integration_Test.php index c6496379a46..ab902b848cf 100644 --- a/tests/Unit/Integrations/Admin/Crawl_Settings_Integration_Test.php +++ b/tests/Unit/Integrations/Admin/Crawl_Settings_Integration_Test.php @@ -65,7 +65,7 @@ public function test_get_conditionals() { [ Admin_Conditional::class, ], - Crawl_Settings_Integration::get_conditionals() + Crawl_Settings_Integration::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Admin/Cron_Integration_Test.php b/tests/Unit/Integrations/Admin/Cron_Integration_Test.php index 4780990974f..73bea32fede 100644 --- a/tests/Unit/Integrations/Admin/Cron_Integration_Test.php +++ b/tests/Unit/Integrations/Admin/Cron_Integration_Test.php @@ -58,7 +58,7 @@ public function test_get_conditionals() { [ Admin_Conditional::class, ], - Cron_Integration::get_conditionals() + Cron_Integration::get_conditionals(), ); } @@ -72,7 +72,7 @@ public function test_get_conditionals() { public function test_constructor() { $this->assertInstanceOf( Date_Helper::class, - $this->getPropertyValue( $this->instance, 'date_helper' ) + $this->getPropertyValue( $this->instance, 'date_helper' ), ); } @@ -87,7 +87,7 @@ public function test_register_hooks() { $this->date_helper ->expects( 'current_time' ) ->once() - ->andReturn( 123456 ); + ->andReturn( 123_456 ); Monkey\Functions\expect( 'wp_next_scheduled' ) ->once() @@ -96,7 +96,7 @@ public function test_register_hooks() { Monkey\Functions\expect( 'wp_schedule_event' ) ->once() - ->with( 123456, 'daily', Indexing_Notification_Integration::NOTIFICATION_ID ); + ->with( 123_456, 'daily', Indexing_Notification_Integration::NOTIFICATION_ID ); $this->instance->register_hooks(); } diff --git a/tests/Unit/Integrations/Admin/Deactivated_Premium_Integration_Test.php b/tests/Unit/Integrations/Admin/Deactivated_Premium_Integration_Test.php index 728d335ee10..308a6f69bd3 100644 --- a/tests/Unit/Integrations/Admin/Deactivated_Premium_Integration_Test.php +++ b/tests/Unit/Integrations/Admin/Deactivated_Premium_Integration_Test.php @@ -126,7 +126,7 @@ function dismiss_premium_deactivated_notice(){ dismiss_premium_deactivated_notice(); } ); } ); - " + ", ); $this->instance->premium_deactivated_notice(); diff --git a/tests/Unit/Integrations/Admin/First_Time_Configuration_Notice_Integration_Test.php b/tests/Unit/Integrations/Admin/First_Time_Configuration_Notice_Integration_Test.php index eb7a9f74ba5..4f1439e2dbe 100644 --- a/tests/Unit/Integrations/Admin/First_Time_Configuration_Notice_Integration_Test.php +++ b/tests/Unit/Integrations/Admin/First_Time_Configuration_Notice_Integration_Test.php @@ -75,7 +75,7 @@ protected function set_up() { $this->instance = new First_Time_Configuration_Notice_Integration( $this->options_helper, $this->first_time_configuration_notice_helper, - $this->admin_asset_manager + $this->admin_asset_manager, ); $this->notice_presenter = Mockery::mock( Notice_Presenter::class ); @@ -91,7 +91,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Admin_Conditional::class ], - $this->instance->get_conditionals() + $this->instance->get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Admin/Import_Integration_Test.php b/tests/Unit/Integrations/Admin/Import_Integration_Test.php index 3fc1db0c115..714a55e43f3 100644 --- a/tests/Unit/Integrations/Admin/Import_Integration_Test.php +++ b/tests/Unit/Integrations/Admin/Import_Integration_Test.php @@ -68,7 +68,7 @@ protected function set_up() { $this->instance = new Import_Integration( $this->asset_manager, $this->importable_detector, - $this->importing_route + $this->importing_route, ); } @@ -82,15 +82,15 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( WPSEO_Admin_Asset_Manager::class, - self::getPropertyValue( $this->instance, 'asset_manager' ) + self::getPropertyValue( $this->instance, 'asset_manager' ), ); $this->assertInstanceOf( Importable_Detector_Service::class, - self::getPropertyValue( $this->instance, 'importable_detector' ) + self::getPropertyValue( $this->instance, 'importable_detector' ), ); $this->assertInstanceOf( Importing_Route::class, - self::getPropertyValue( $this->instance, 'importing_route' ) + self::getPropertyValue( $this->instance, 'importing_route' ), ); } diff --git a/tests/Unit/Integrations/Admin/Indexing_Notification_Integration_Test.php b/tests/Unit/Integrations/Admin/Indexing_Notification_Integration_Test.php index 3a92e47c78a..5ae5be94220 100644 --- a/tests/Unit/Integrations/Admin/Indexing_Notification_Integration_Test.php +++ b/tests/Unit/Integrations/Admin/Indexing_Notification_Integration_Test.php @@ -126,7 +126,7 @@ protected function set_up() { $this->notification_helper, $this->indexing_helper, $this->addon_manager, - $this->environment_helper + $this->environment_helper, ); } @@ -140,31 +140,31 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( Yoast_Notification_Center::class, - $this->getPropertyValue( $this->instance, 'notification_center' ) + $this->getPropertyValue( $this->instance, 'notification_center' ), ); $this->assertInstanceOf( Product_Helper::class, - $this->getPropertyValue( $this->instance, 'product_helper' ) + $this->getPropertyValue( $this->instance, 'product_helper' ), ); $this->assertInstanceOf( Current_Page_Helper::class, - $this->getPropertyValue( $this->instance, 'page_helper' ) + $this->getPropertyValue( $this->instance, 'page_helper' ), ); $this->assertInstanceOf( Short_Link_Helper::class, - $this->getPropertyValue( $this->instance, 'short_link_helper' ) + $this->getPropertyValue( $this->instance, 'short_link_helper' ), ); $this->assertInstanceOf( Notification_Helper::class, - $this->getPropertyValue( $this->instance, 'notification_helper' ) + $this->getPropertyValue( $this->instance, 'notification_helper' ), ); $this->assertInstanceOf( Indexing_Helper::class, - $this->getPropertyValue( $this->instance, 'indexing_helper' ) + $this->getPropertyValue( $this->instance, 'indexing_helper' ), ); $this->assertInstanceOf( Environment_Helper::class, - $this->getPropertyValue( $this->instance, 'environment_helper' ) + $this->getPropertyValue( $this->instance, 'environment_helper' ), ); } @@ -260,7 +260,7 @@ public function test_get_conditionals() { Not_Admin_Ajax_Conditional::class, User_Can_Manage_Wpseo_Options_Conditional::class, ], - Indexing_Notification_Integration::get_conditionals() + Indexing_Notification_Integration::get_conditionals(), ); } @@ -310,7 +310,7 @@ public function test_create_notification_with_having_indexing_started() { $this->indexing_helper ->expects( 'get_started' ) - ->andReturn( 123456789 ); + ->andReturn( 123_456_789 ); $this->indexing_helper ->expects( 'get_filtered_unindexed_count' ) @@ -530,7 +530,7 @@ public function test_maybe_cleanup_notification_when_the_user_has_started_indexi $this->indexing_helper ->expects( 'get_started' ) ->once() - ->andReturn( 123456789 ); + ->andReturn( 123_456_789 ); $this->indexing_helper ->expects( 'get_filtered_unindexed_count' ) diff --git a/tests/Unit/Integrations/Admin/Indexing_Tool_Integration_Test.php b/tests/Unit/Integrations/Admin/Indexing_Tool_Integration_Test.php index 23059d9e14e..796be22770a 100644 --- a/tests/Unit/Integrations/Admin/Indexing_Tool_Integration_Test.php +++ b/tests/Unit/Integrations/Admin/Indexing_Tool_Integration_Test.php @@ -119,7 +119,7 @@ protected function set_up() { $this->addon_manager, $this->product_helper, $this->importable_detector, - $this->importing_route + $this->importing_route, ); } @@ -133,35 +133,35 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( WPSEO_Admin_Asset_Manager::class, - self::getPropertyValue( $this->instance, 'asset_manager' ) + self::getPropertyValue( $this->instance, 'asset_manager' ), ); $this->assertInstanceOf( Indexable_Helper::class, - self::getPropertyValue( $this->instance, 'indexable_helper' ) + self::getPropertyValue( $this->instance, 'indexable_helper' ), ); $this->assertInstanceOf( Short_Link_Helper::class, - self::getPropertyValue( $this->instance, 'short_link_helper' ) + self::getPropertyValue( $this->instance, 'short_link_helper' ), ); $this->assertInstanceOf( Indexing_Helper::class, - self::getPropertyValue( $this->instance, 'indexing_helper' ) + self::getPropertyValue( $this->instance, 'indexing_helper' ), ); $this->assertInstanceOf( WPSEO_Addon_Manager::class, - self::getPropertyValue( $this->instance, 'addon_manager' ) + self::getPropertyValue( $this->instance, 'addon_manager' ), ); $this->assertInstanceOf( Product_Helper::class, - self::getPropertyValue( $this->instance, 'product_helper' ) + self::getPropertyValue( $this->instance, 'product_helper' ), ); $this->assertInstanceOf( Importable_Detector_Service::class, - self::getPropertyValue( $this->instance, 'importable_detector' ) + self::getPropertyValue( $this->instance, 'importable_detector' ), ); $this->assertInstanceOf( Importing_Route::class, - self::getPropertyValue( $this->instance, 'importing_route' ) + self::getPropertyValue( $this->instance, 'importing_route' ), ); } @@ -342,7 +342,7 @@ public function test_render_indexing_list_item_is_allowed() { // Assert. $this->expectOutputString( - '
  • Optimize SEO Data
    You can speed up your site and get insight into your internal linking structure by letting us perform a few optimizations to the way SEO data is stored. If you have a lot of content it might take a while, but trust us, it\'s worth it. Learn more about the benefits of optimized SEO data.
  • ' + '
  • Optimize SEO Data
    You can speed up your site and get insight into your internal linking structure by letting us perform a few optimizations to the way SEO data is stored. If you have a lot of content it might take a while, but trust us, it\'s worth it. Learn more about the benefits of optimized SEO data.
  • ', ); } } diff --git a/tests/Unit/Integrations/Admin/Installation_Success_Integration_Test.php b/tests/Unit/Integrations/Admin/Installation_Success_Integration_Test.php index d62332bbf4b..6dee0d8ea38 100644 --- a/tests/Unit/Integrations/Admin/Installation_Success_Integration_Test.php +++ b/tests/Unit/Integrations/Admin/Installation_Success_Integration_Test.php @@ -66,7 +66,7 @@ protected function set_up() { $this->options_helper, $this->product_helper, $this->shortlinker, - ] + ], )->makePartial(); } @@ -82,7 +82,7 @@ public function test_get_conditionals() { [ Admin_Conditional::class, ], - Installation_Success_Integration::get_conditionals() + Installation_Success_Integration::get_conditionals(), ); } @@ -96,12 +96,12 @@ public function test_get_conditionals() { public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); $this->assertInstanceOf( Product_Helper::class, - $this->getPropertyValue( $this->instance, 'product_helper' ) + $this->getPropertyValue( $this->instance, 'product_helper' ), ); } @@ -120,9 +120,9 @@ public function test_register_hooks() { [ $this->instance, 'add_submenu_page', - ] + ], ), - 'Does not have expected admin_menu filter' + 'Does not have expected admin_menu filter', ); $this->assertNotFalse( Monkey\Actions\has( @@ -130,9 +130,9 @@ public function test_register_hooks() { [ $this->instance, 'enqueue_assets', - ] + ], ), - 'Does not have expected admin_enqueue_scripts action' + 'Does not have expected admin_enqueue_scripts action', ); $this->assertNotFalse( Monkey\Actions\has( @@ -140,9 +140,9 @@ public function test_register_hooks() { [ $this->instance, 'maybe_redirect', - ] + ], ), - 'Does not have expected admin_init action' + 'Does not have expected admin_init action', ); } @@ -421,7 +421,7 @@ public function test_add_submenu_page() { [ $this->instance, 'render_page', - ] + ], ); $submenu_pages = [ diff --git a/tests/Unit/Integrations/Admin/Integrations_Page_Integration_Test.php b/tests/Unit/Integrations/Admin/Integrations_Page_Integration_Test.php index 207153d59d4..c6179dca092 100644 --- a/tests/Unit/Integrations/Admin/Integrations_Page_Integration_Test.php +++ b/tests/Unit/Integrations/Admin/Integrations_Page_Integration_Test.php @@ -106,7 +106,7 @@ protected function set_up() { $this->jetpack_conditional, $this->site_kit_configuration, $this->site_kit_consent_management_endpoint, - $this->schema_configuration + $this->schema_configuration, ); } @@ -120,7 +120,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Admin_Conditional::class ], - $this->instance->get_conditionals() + $this->instance->get_conditionals(), ); } @@ -243,7 +243,7 @@ public function test_enqueue_assets() { 'site_kit_configuration' => $site_kit_config, 'site_kit_consent_management_url' => 'https://www.example.com/manage-consent', 'schema_framework_enabled' => true, - ] + ], ); $this->instance->enqueue_assets(); diff --git a/tests/Unit/Integrations/Admin/Migration_Error_Integration_Test.php b/tests/Unit/Integrations/Admin/Migration_Error_Integration_Test.php index 09b5162e9c2..859eeae08f1 100644 --- a/tests/Unit/Integrations/Admin/Migration_Error_Integration_Test.php +++ b/tests/Unit/Integrations/Admin/Migration_Error_Integration_Test.php @@ -60,7 +60,7 @@ protected function set_up() { public function test_construct() { $this->assertInstanceOf( Migration_Status::class, - $this->getPropertyValue( $this->instance, 'migration_status' ) + $this->getPropertyValue( $this->instance, 'migration_status' ), ); } @@ -158,7 +158,7 @@ private function expect_shortlinker() { $container = $this->create_container_with( [ Short_Link_Helper::class => $short_link_mock, - ] + ], ); Monkey\Functions\expect( 'YoastSEO' ) diff --git a/tests/Unit/Integrations/Admin/Old_Configuration_Integration_Test.php b/tests/Unit/Integrations/Admin/Old_Configuration_Integration_Test.php index 82d2f695045..739fc85acf6 100644 --- a/tests/Unit/Integrations/Admin/Old_Configuration_Integration_Test.php +++ b/tests/Unit/Integrations/Admin/Old_Configuration_Integration_Test.php @@ -47,7 +47,7 @@ public function test_get_conditionals() { [ Admin_Conditional::class, ], - Old_Configuration_Integration::get_conditionals() + Old_Configuration_Integration::get_conditionals(), ); } @@ -66,9 +66,9 @@ public function test_register_hooks() { [ $this->instance, 'add_submenu_page', - ] + ], ), - 'Does not have expected admin_menu filter' + 'Does not have expected admin_menu filter', ); $this->assertNotFalse( Monkey\Actions\has( @@ -76,9 +76,9 @@ public function test_register_hooks() { [ $this->instance, 'redirect_to_new_configuration', - ] + ], ), - 'Does not have expected admin_init action' + 'Does not have expected admin_init action', ); } @@ -103,7 +103,7 @@ public function test_add_submenu_page() { [ $this->instance, 'render_page', - ] + ], ); $submenu_pages = [ diff --git a/tests/Unit/Integrations/Admin/Redirect_Integration_Test.php b/tests/Unit/Integrations/Admin/Redirect_Integration_Test.php index 34a2b884fc7..bfa40c901c4 100644 --- a/tests/Unit/Integrations/Admin/Redirect_Integration_Test.php +++ b/tests/Unit/Integrations/Admin/Redirect_Integration_Test.php @@ -77,7 +77,7 @@ public function test_get_conditionals() { [ Admin_Conditional::class, ], - Redirect_Integration::get_conditionals() + Redirect_Integration::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Admin/Redirects_Page_Integration_Test.php b/tests/Unit/Integrations/Admin/Redirects_Page_Integration_Test.php index 03b868daab1..94cd45cd991 100644 --- a/tests/Unit/Integrations/Admin/Redirects_Page_Integration_Test.php +++ b/tests/Unit/Integrations/Admin/Redirects_Page_Integration_Test.php @@ -64,7 +64,7 @@ protected function set_up() { $this->instance = new Redirects_Page_Integration( $this->current_page_helper, $this->user_helper, - $this->wistia_embed_permission_repository + $this->wistia_embed_permission_repository, ); } @@ -81,7 +81,7 @@ public function test_get_conditionals() { Admin_Conditional::class, Premium_Inactive_Conditional::class, ], - Redirects_Page_Integration::get_conditionals() + Redirects_Page_Integration::get_conditionals(), ); } @@ -102,9 +102,9 @@ public function test_register_hooks() { [ $this->instance, 'add_submenu_page', - ] + ], ), - 'Does not have expected wpseo_submenu_pages filter' + 'Does not have expected wpseo_submenu_pages filter', ); } diff --git a/tests/Unit/Integrations/Blocks/Block_Editor_Integration_Test.php b/tests/Unit/Integrations/Blocks/Block_Editor_Integration_Test.php index ab721813c3a..20be6084bdf 100644 --- a/tests/Unit/Integrations/Blocks/Block_Editor_Integration_Test.php +++ b/tests/Unit/Integrations/Blocks/Block_Editor_Integration_Test.php @@ -56,7 +56,7 @@ public function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Post_Conditional::class ], - Block_Editor_Integration::get_conditionals() + Block_Editor_Integration::get_conditionals(), ); } @@ -70,7 +70,7 @@ public function test_get_conditionals() { public function test_constructor() { $this->assertInstanceOf( WPSEO_Admin_Asset_Manager::class, - $this->getPropertyValue( $this->instance, 'asset_manager' ) + $this->getPropertyValue( $this->instance, 'asset_manager' ), ); } diff --git a/tests/Unit/Integrations/Blocks/Structured_Data_Blocks_Test.php b/tests/Unit/Integrations/Blocks/Structured_Data_Blocks_Test.php index d3f90d7b704..8c9584cb636 100644 --- a/tests/Unit/Integrations/Blocks/Structured_Data_Blocks_Test.php +++ b/tests/Unit/Integrations/Blocks/Structured_Data_Blocks_Test.php @@ -54,7 +54,7 @@ protected function set_up() { $this->instance = new Structured_Data_Blocks( $this->asset_manager, - $this->image_helper + $this->image_helper, ); } @@ -70,8 +70,8 @@ public function test_construct() { Structured_Data_Blocks::class, new Structured_Data_Blocks( $this->asset_manager, - $this->image_helper - ) + $this->image_helper, + ), ); } @@ -168,9 +168,9 @@ public function test_present_duration_text( $expected, $attributes, $content, $m $expected, $this->instance->present_duration_text( $attributes, - $content + $content, ), - $message + $message, ); } @@ -234,9 +234,9 @@ public function test_optimize_how_to_images( $expected, $attributes, $content, $ $expected, $this->instance->optimize_how_to_images( $attributes, - $content + $content, ), - $message + $message, ); } } diff --git a/tests/Unit/Integrations/Breadcrumbs_Integration_Test.php b/tests/Unit/Integrations/Breadcrumbs_Integration_Test.php index 34924e0f727..a2482885172 100644 --- a/tests/Unit/Integrations/Breadcrumbs_Integration_Test.php +++ b/tests/Unit/Integrations/Breadcrumbs_Integration_Test.php @@ -53,7 +53,7 @@ protected function set_up() { $this->instance = new Breadcrumbs_Integration( Mockery::mock( Helpers_Surface::class ), Mockery::mock( WPSEO_Replace_Vars::class ), - $this->context_memoizer + $this->context_memoizer, ); } diff --git a/tests/Unit/Integrations/Cleanup_Integration_Test.php b/tests/Unit/Integrations/Cleanup_Integration_Test.php index 274c73a5518..2c7c14acfc8 100644 --- a/tests/Unit/Integrations/Cleanup_Integration_Test.php +++ b/tests/Unit/Integrations/Cleanup_Integration_Test.php @@ -61,7 +61,7 @@ protected function set_up() { $this->instance = new Cleanup_Integration( $this->indexable_repository, - $this->indexable_helper + $this->indexable_helper, ); global $wpdb; diff --git a/tests/Unit/Integrations/Estimated_Reading_Time_Test.php b/tests/Unit/Integrations/Estimated_Reading_Time_Test.php index b9e0147ff1f..e7cdfc9aded 100644 --- a/tests/Unit/Integrations/Estimated_Reading_Time_Test.php +++ b/tests/Unit/Integrations/Estimated_Reading_Time_Test.php @@ -58,7 +58,7 @@ public function test_register_hooks() { public function test_get_conditionals() { $this->assertEquals( [ Estimated_Reading_Time_Conditional::class ], - Estimated_Reading_Time::get_conditionals() + Estimated_Reading_Time::get_conditionals(), ); } @@ -79,7 +79,7 @@ public function test_add_estimated_reading_time_hidden_fields() { 'type' => 'hidden', 'title' => 'estimated-reading-time-minutes', ], - $actual['estimated-reading-time-minutes'] + $actual['estimated-reading-time-minutes'], ); } diff --git a/tests/Unit/Integrations/Feature_Flag_Integration_Test.php b/tests/Unit/Integrations/Feature_Flag_Integration_Test.php index c00e4e1e7f1..e7da0ed7d22 100644 --- a/tests/Unit/Integrations/Feature_Flag_Integration_Test.php +++ b/tests/Unit/Integrations/Feature_Flag_Integration_Test.php @@ -69,14 +69,14 @@ public function set_up() { public function test_constructor() { self::assertInstanceOf( WPSEO_Admin_Asset_Manager::class, - self::getPropertyValue( $this->instance, 'asset_manager' ) + self::getPropertyValue( $this->instance, 'asset_manager' ), ); self::assertIsArray( - self::getPropertyValue( $this->instance, 'feature_flags' ) + self::getPropertyValue( $this->instance, 'feature_flags' ), ); self::assertInstanceOf( Feature_Flag_Conditional::class, - self::getPropertyValue( $this->instance, 'feature_flags' )[0] + self::getPropertyValue( $this->instance, 'feature_flags' )[0], ); } diff --git a/tests/Unit/Integrations/Front_End/Category_Term_Description_Test.php b/tests/Unit/Integrations/Front_End/Category_Term_Description_Test.php index a31caf9e8c7..d83eaa952c4 100644 --- a/tests/Unit/Integrations/Front_End/Category_Term_Description_Test.php +++ b/tests/Unit/Integrations/Front_End/Category_Term_Description_Test.php @@ -45,7 +45,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Front_End_Conditional::class ], - Category_Term_Description::get_conditionals() + Category_Term_Description::get_conditionals(), ); } @@ -76,7 +76,7 @@ public function test_add_shortcode_support() { $this->assertEquals( 'This is a category text', - $this->instance->add_shortcode_support( 'This is a category text' ) + $this->instance->add_shortcode_support( 'This is a category text' ), ); } } diff --git a/tests/Unit/Integrations/Front_End/Comment_Link_Fixer_Test.php b/tests/Unit/Integrations/Front_End/Comment_Link_Fixer_Test.php index 44fc3d5f2ef..b24b4f026dc 100644 --- a/tests/Unit/Integrations/Front_End/Comment_Link_Fixer_Test.php +++ b/tests/Unit/Integrations/Front_End/Comment_Link_Fixer_Test.php @@ -66,7 +66,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Front_End_Conditional::class ], - Comment_Link_Fixer::get_conditionals() + Comment_Link_Fixer::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Front_End/Crawl_Cleanup_Basic_Test.php b/tests/Unit/Integrations/Front_End/Crawl_Cleanup_Basic_Test.php index 1a6da0ffb4d..f8835a4e663 100644 --- a/tests/Unit/Integrations/Front_End/Crawl_Cleanup_Basic_Test.php +++ b/tests/Unit/Integrations/Front_End/Crawl_Cleanup_Basic_Test.php @@ -55,7 +55,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Front_End_Conditional::class ], - Crawl_Cleanup_Basic::get_conditionals() + Crawl_Cleanup_Basic::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Front_End/Crawl_Cleanup_Rss_Test.php b/tests/Unit/Integrations/Front_End/Crawl_Cleanup_Rss_Test.php index 0292e460152..d7b1e36f7ba 100644 --- a/tests/Unit/Integrations/Front_End/Crawl_Cleanup_Rss_Test.php +++ b/tests/Unit/Integrations/Front_End/Crawl_Cleanup_Rss_Test.php @@ -55,7 +55,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Front_End_Conditional::class ], - Crawl_Cleanup_Rss::get_conditionals() + Crawl_Cleanup_Rss::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Front_End/Crawl_Cleanup_Searches_Test.php b/tests/Unit/Integrations/Front_End/Crawl_Cleanup_Searches_Test.php index c6b9d717ec8..5feb539a414 100644 --- a/tests/Unit/Integrations/Front_End/Crawl_Cleanup_Searches_Test.php +++ b/tests/Unit/Integrations/Front_End/Crawl_Cleanup_Searches_Test.php @@ -67,7 +67,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Front_End_Conditional::class ], - Crawl_Cleanup_Searches::get_conditionals() + Crawl_Cleanup_Searches::get_conditionals(), ); } @@ -104,8 +104,8 @@ public function test_register_hooks() { [ $this->instance, 'maybe_redirect_searches', - ] - ) + ], + ), ); } diff --git a/tests/Unit/Integrations/Front_End/Force_Rewrite_Title_Test.php b/tests/Unit/Integrations/Front_End/Force_Rewrite_Title_Test.php index 27c92058494..ad57f503290 100644 --- a/tests/Unit/Integrations/Front_End/Force_Rewrite_Title_Test.php +++ b/tests/Unit/Integrations/Front_End/Force_Rewrite_Title_Test.php @@ -66,7 +66,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Front_End_Conditional::class ], - Force_Rewrite_Title::get_conditionals() + Force_Rewrite_Title::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Front_End/Handle_404_Test.php b/tests/Unit/Integrations/Front_End/Handle_404_Test.php index abae85fe66a..fb9111416b9 100644 --- a/tests/Unit/Integrations/Front_End/Handle_404_Test.php +++ b/tests/Unit/Integrations/Front_End/Handle_404_Test.php @@ -59,7 +59,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Front_End_Conditional::class ], - Handle_404::get_conditionals() + Handle_404::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Front_End/Indexing_Controls_Test.php b/tests/Unit/Integrations/Front_End/Indexing_Controls_Test.php index 82c1521e85b..181ed59c85b 100644 --- a/tests/Unit/Integrations/Front_End/Indexing_Controls_Test.php +++ b/tests/Unit/Integrations/Front_End/Indexing_Controls_Test.php @@ -55,7 +55,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Front_End_Conditional::class ], - Indexing_Controls::get_conditionals() + Indexing_Controls::get_conditionals(), ); } @@ -104,7 +104,7 @@ public function test_no_index_and_is_no_robots() { public function test_nofollow_link() { $this->assertEquals( 'A link', - $this->instance->nofollow_link( 'A link' ) + $this->instance->nofollow_link( 'A link' ), ); } } diff --git a/tests/Unit/Integrations/Front_End/Open_Graph_OEmbed_Test.php b/tests/Unit/Integrations/Front_End/Open_Graph_OEmbed_Test.php index 45e6635aa90..0a1992598c8 100644 --- a/tests/Unit/Integrations/Front_End/Open_Graph_OEmbed_Test.php +++ b/tests/Unit/Integrations/Front_End/Open_Graph_OEmbed_Test.php @@ -59,7 +59,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Front_End_Conditional::class, Open_Graph_Conditional::class ], - Open_Graph_OEmbed::get_conditionals() + Open_Graph_OEmbed::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Front_End/RSS_Footer_Embed_Test.php b/tests/Unit/Integrations/Front_End/RSS_Footer_Embed_Test.php index 1e8db76fc09..119e6d120be 100644 --- a/tests/Unit/Integrations/Front_End/RSS_Footer_Embed_Test.php +++ b/tests/Unit/Integrations/Front_End/RSS_Footer_Embed_Test.php @@ -57,7 +57,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Front_End_Conditional::class ], - RSS_Footer_Embed::get_conditionals() + RSS_Footer_Embed::get_conditionals(), ); } @@ -88,7 +88,7 @@ public function test_embed_rssfooter_not_on_feed_page() { $this->assertEquals( 'Not on feed page', - $this->instance->embed_rssfooter( 'Not on feed page' ) + $this->instance->embed_rssfooter( 'Not on feed page' ), ); } @@ -109,7 +109,7 @@ public function test_embed_rssfooter_disabled_by_filter() { $this->assertEquals( 'Disabled feature by filter.', - $this->instance->embed_rssfooter( 'Disabled feature by filter.' ) + $this->instance->embed_rssfooter( 'Disabled feature by filter.' ), ); } @@ -134,7 +134,7 @@ public function test_embed_rss_footer_with_no_set_option_values() { $this->assertEquals( 'No options set', - $this->instance->embed_rssfooter( 'No options set' ) + $this->instance->embed_rssfooter( 'No options set' ), ); } @@ -168,7 +168,7 @@ public function test_embed_rss_footer() { '%%POSTLINK%%' => 'post_link', '%%BLOGLINK%%' => 'blog_link', '%%BLOGDESCLINK%%' => 'blog_description_link', - ] + ], ); $this->options->expects( 'get' )->with( 'rssbefore', '' )->once()->andReturn( '%%authorlink%%' ); @@ -176,7 +176,7 @@ public function test_embed_rss_footer() { $this->assertEquals( 'author_linkNo options set', - $this->instance->embed_rssfooter( 'No options set' ) + $this->instance->embed_rssfooter( 'No options set' ), ); } @@ -192,7 +192,7 @@ public function test_embed_rss_footer_excerpt_is_disabled() { $this->assertEquals( 'Feature is disabled', - $this->instance->embed_rssfooter_excerpt( 'Feature is disabled' ) + $this->instance->embed_rssfooter_excerpt( 'Feature is disabled' ), ); } @@ -230,7 +230,7 @@ public function test_embed_rss_footer_excerpt() { '%%POSTLINK%%' => 'post_link', '%%BLOGLINK%%' => 'blog_link', '%%BLOGDESCLINK%%' => 'blog_description_link', - ] + ], ); $this->options->expects( 'get' )->with( 'rssbefore', '' )->once()->andReturn( '%%authorlink%%' ); @@ -238,7 +238,7 @@ public function test_embed_rss_footer_excerpt() { $this->assertEquals( 'author_linkNo options set', - $this->instance->embed_rssfooter_excerpt( 'No options set' ) + $this->instance->embed_rssfooter_excerpt( 'No options set' ), ); } } diff --git a/tests/Unit/Integrations/Front_End/Redirects_Test.php b/tests/Unit/Integrations/Front_End/Redirects_Test.php index 779a7ed3515..21481a1e614 100644 --- a/tests/Unit/Integrations/Front_End/Redirects_Test.php +++ b/tests/Unit/Integrations/Front_End/Redirects_Test.php @@ -93,7 +93,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Front_End_Conditional::class ], - Redirects::get_conditionals() + Redirects::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Front_End/Robots_Txt_Integration_Test.php b/tests/Unit/Integrations/Front_End/Robots_Txt_Integration_Test.php index e2bef069556..f1154815d44 100644 --- a/tests/Unit/Integrations/Front_End/Robots_Txt_Integration_Test.php +++ b/tests/Unit/Integrations/Front_End/Robots_Txt_Integration_Test.php @@ -76,15 +76,15 @@ public function test_construct() { $this->assertInstanceOf( Robots_Txt_Integration::class, $this->instance ); $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); $this->assertInstanceOf( Robots_Txt_Helper::class, - $this->getPropertyValue( $this->instance, 'robots_txt_helper' ) + $this->getPropertyValue( $this->instance, 'robots_txt_helper' ), ); $this->assertInstanceOf( Robots_Txt_Presenter::class, - $this->getPropertyValue( $this->instance, 'robots_txt_presenter' ) + $this->getPropertyValue( $this->instance, 'robots_txt_presenter' ), ); } @@ -98,7 +98,7 @@ public function test_construct() { public function test_get_conditionals() { $this->assertEquals( [ Robots_Txt_Conditional::class ], - Robots_Txt_Integration::get_conditionals() + Robots_Txt_Integration::get_conditionals(), ); } @@ -237,7 +237,7 @@ public function test_multisite_sitemaps( $multisite ) { [ 'allow_enable_xml_sitemap' => true, 'wordpress-seo/wp-seo.php' => true, - ] + ], ); foreach ( $multisite['sites'] as $blog_id => $site ) { @@ -362,7 +362,7 @@ public function test_multisite_sitemaps_without_yoast_seo_active() { Monkey\Functions\when( 'get_network_option' )->justReturn( [ 'allow_enable_xml_sitemap' => true, - ] + ], ); Monkey\Functions\expect( 'get_sites' )->andReturn( [ 1, 2 ] ); Monkey\Functions\expect( 'get_home_url' ) @@ -541,7 +541,7 @@ public function test_remove_default_robots( $input, $expected ) { 'wpseo_should_add_subdirectory_multisite_xml_sitemaps', static function () { return false; - } + }, ); $this->options_helper diff --git a/tests/Unit/Integrations/Front_End/WP_Robots_Integration_Test.php b/tests/Unit/Integrations/Front_End/WP_Robots_Integration_Test.php index 66a832f43e8..27e84a1f5c5 100644 --- a/tests/Unit/Integrations/Front_End/WP_Robots_Integration_Test.php +++ b/tests/Unit/Integrations/Front_End/WP_Robots_Integration_Test.php @@ -55,7 +55,7 @@ protected function set_up() { public function test_construct() { $this->assertInstanceOf( Meta_Tags_Context_Memoizer::class, - $this->getPropertyValue( $this->instance, 'context_memoizer' ) + $this->getPropertyValue( $this->instance, 'context_memoizer' ), ); } @@ -85,7 +85,7 @@ public function test_get_conditionals() { Front_End_Conditional::class, WP_Robots_Conditional::class, ], - WP_Robots_Integration::get_conditionals() + WP_Robots_Integration::get_conditionals(), ); } @@ -117,7 +117,7 @@ public function test_add_robots_string_given() { 'index' => true, 'follow' => true, ], - $this->instance->add_robots( 'robots_string' ) + $this->instance->add_robots( 'robots_string' ), ); } @@ -153,7 +153,7 @@ public function test_add_robots_overwrite_robots_value_set_to_true() { [ 'index' => true, 'follow' => true, - ] + ], ); $this->assertEquals( @@ -162,7 +162,7 @@ public function test_add_robots_overwrite_robots_value_set_to_true() { 'index' => true, 'max-image-preview' => 'large', ], - $result + $result, ); } @@ -205,8 +205,8 @@ public function test_add_robots_with_noimageindex() { [ 'index' => true, 'follow' => true, - ] - ) + ], + ), ); } @@ -248,8 +248,8 @@ public function test_add_robots_with_noindex_set() { [ 'index' => true, 'follow' => true, - ] - ) + ], + ), ); } @@ -291,8 +291,8 @@ public function test_add_robots_with_index_true_and_noindex_false() { [ 'index' => true, 'noindex' => false, - ] - ) + ], + ), ); } @@ -336,8 +336,8 @@ public function test_add_robots_with_noimageindex_and_maximagepreview_empty() { [ 'noimageindex' => true, 'max-image-preview' => '', - ] - ) + ], + ), ); } @@ -385,8 +385,8 @@ public function test_enforce_robots_congruence() { 'archive' => true, 'imageindex' => true, 'snippet' => true, - ] - ) + ], + ), ); } } diff --git a/tests/Unit/Integrations/Front_End_Integration_Test.php b/tests/Unit/Integrations/Front_End_Integration_Test.php index c492da93d07..808558c2abd 100644 --- a/tests/Unit/Integrations/Front_End_Integration_Test.php +++ b/tests/Unit/Integrations/Front_End_Integration_Test.php @@ -115,7 +115,7 @@ protected function set_up() { Mockery::mock( WPSEO_Replace_Vars::class ), $this->indexable_repository, $this->permalink_helper, - ] + ], )->makePartial(); // Set up mocks for classes which which are used in multiple tests. @@ -136,7 +136,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Front_End_Conditional::class ], - Front_End_Integration::get_conditionals() + Front_End_Integration::get_conditionals(), ); } @@ -270,7 +270,7 @@ public function test_get_presenters_for_singular_page() { $this->assertEquals( $expected, - \array_map( $callback, $this->instance->get_presenters( 'Post_Type' ) ) + \array_map( $callback, $this->instance->get_presenters( 'Post_Type' ) ), ); } @@ -342,7 +342,7 @@ public function test_get_presenters_for_static_home_page() { $this->assertEquals( $expected, - \array_map( $callback, $this->instance->get_presenters( 'Static_Home_Page' ) ) + \array_map( $callback, $this->instance->get_presenters( 'Static_Home_Page' ) ), ); } @@ -390,7 +390,7 @@ public function test_get_presenters_for_error_page() { 'Yoast\WP\SEO\Presenters\Schema_Presenter', 'Yoast\WP\SEO\Presenters\Debug\Marker_Close_Presenter', ], - $expected + $expected, ); } @@ -460,7 +460,7 @@ public function test_get_presenters_for_non_singular_page() { 'Yoast\WP\SEO\Presenters\Schema_Presenter', 'Yoast\WP\SEO\Presenters\Debug\Marker_Close_Presenter', ], - $expected + $expected, ); } @@ -513,7 +513,7 @@ public function test_get_presenters_for_theme_without_title_tag_and_force_rewrit 'Yoast\WP\SEO\Presenters\Schema_Presenter', 'Yoast\WP\SEO\Presenters\Debug\Marker_Close_Presenter', ], - $actual + $actual, ); } @@ -560,7 +560,7 @@ public function test_get_presenters_for_theme_on_rest_request() { 'Yoast\WP\SEO\Presenters\Schema_Presenter', 'Yoast\WP\SEO\Presenters\Debug\Marker_Close_Presenter', ], - $actual + $actual, ); } @@ -614,7 +614,7 @@ public function test_get_presenters_for_theme_without_title_tag_and_force_rewrit 'Yoast\WP\SEO\Presenters\Schema_Presenter', 'Yoast\WP\SEO\Presenters\Debug\Marker_Close_Presenter', ], - $expected + $expected, ); } @@ -681,7 +681,7 @@ public function test_filter_robots_presenter_and_wp_robots_to_wp_head_filter() { 'Yoast\WP\SEO\Presenters\Title_Presenter', 'Yoast\WP\SEO\Presenters\Meta_Description_Presenter', ], - $this->instance->filter_robots_presenter( $presenters ) + $this->instance->filter_robots_presenter( $presenters ), ); } @@ -713,7 +713,7 @@ public function test_rest_request_should_output_robots_presenter() { 'Yoast\WP\SEO\Presenters\Meta_Description_Presenter', 'Yoast\WP\SEO\Presenters\Robots_Presenter', ], - $this->instance->filter_robots_presenter( $presenters ) + $this->instance->filter_robots_presenter( $presenters ), ); } diff --git a/tests/Unit/Integrations/Settings_Integration_Test.php b/tests/Unit/Integrations/Settings_Integration_Test.php index 59b7e01e83f..ca1907f425d 100644 --- a/tests/Unit/Integrations/Settings_Integration_Test.php +++ b/tests/Unit/Integrations/Settings_Integration_Test.php @@ -149,7 +149,7 @@ public function set_up() { $manual_post_collection, $file_runner, $this->route_helper, - $this->schema_configuration + $this->schema_configuration, ); $this->instance_double = new Settings_Integration_Double( @@ -170,7 +170,7 @@ public function set_up() { $manual_post_collection, $file_runner, $this->route_helper, - $this->schema_configuration + $this->schema_configuration, ); } @@ -186,7 +186,7 @@ public function test_get_conditionals() { [ Settings_Conditional::class, ], - Settings_Integration::get_conditionals() + Settings_Integration::get_conditionals(), ); } @@ -224,77 +224,77 @@ public function test_construct() { $this->assertInstanceOf( WPSEO_Admin_Asset_Manager::class, $this->getPropertyValue( $this->instance, 'asset_manager' ), - 'asset_manager is set.' + 'asset_manager is set.', ); $this->assertInstanceOf( WPSEO_Replace_Vars::class, $this->getPropertyValue( $this->instance, 'replace_vars' ), - 'replace_vars is set.' + 'replace_vars is set.', ); $this->assertInstanceOf( Schema_Types::class, $this->getPropertyValue( $this->instance, 'schema_types' ), - 'schema_types is set.' + 'schema_types is set.', ); $this->assertInstanceOf( Current_Page_Helper::class, $this->getPropertyValue( $this->instance, 'current_page_helper' ), - 'current_page_helper is set.' + 'current_page_helper is set.', ); $this->assertInstanceOf( Post_Type_Helper::class, $this->getPropertyValue( $this->instance, 'post_type_helper' ), - 'post_type_helper is set.' + 'post_type_helper is set.', ); $this->assertInstanceOf( Language_Helper::class, $this->getPropertyValue( $this->instance, 'language_helper' ), - 'language_helper is set.' + 'language_helper is set.', ); $this->assertInstanceOf( Taxonomy_Helper::class, $this->getPropertyValue( $this->instance, 'taxonomy_helper' ), - 'taxonomy_helper is set.' + 'taxonomy_helper is set.', ); $this->assertInstanceOf( Product_Helper::class, $this->getPropertyValue( $this->instance, 'product_helper' ), - 'product_helper is set.' + 'product_helper is set.', ); $this->assertInstanceOf( Woocommerce_Helper::class, $this->getPropertyValue( $this->instance, 'woocommerce_helper' ), - 'woocommerce_helper is set.' + 'woocommerce_helper is set.', ); $this->assertInstanceOf( Article_Helper::class, $this->getPropertyValue( $this->instance, 'article_helper' ), - 'article_helper is set.' + 'article_helper is set.', ); $this->assertInstanceOf( User_Helper::class, $this->getPropertyValue( $this->instance, 'user_helper' ), - 'user_helper is set.' + 'user_helper is set.', ); $this->assertInstanceOf( Options_Helper::class, $this->getPropertyValue( $this->instance, 'options' ), - 'Options helper is set.' + 'Options helper is set.', ); $this->assertInstanceOf( Content_Type_Visibility_Dismiss_Notifications::class, $this->getPropertyValue( $this->instance, 'content_type_visibility' ), - 'Content type visibility notifications is set.' + 'Content type visibility notifications is set.', ); $this->assertInstanceOf( Route_Helper::class, $this->getPropertyValue( $this->instance, 'route_helper' ), - 'Route_Helper is set.' + 'Route_Helper is set.', ); $this->assertInstanceOf( Schema_Configuration::class, $this->getPropertyValue( $this->instance, 'schema_configuration' ), - 'Schema_Configuration is set.' + 'Schema_Configuration is set.', ); } @@ -570,7 +570,7 @@ public function test_get_defaults_from_local_seo( $should_local_get_options, $mu 'location_email' => 'example@location.con', 'location_vat_id' => '123456', 'location_tax_id' => '654321', - ] + ], ); Monkey\Functions\expect( 'wpseo_has_primary_location' ) @@ -611,7 +611,7 @@ public function test_get_defaults_from_local_seo_when_there_is_primary_location( 'location_email' => 'example@location.con', 'location_vat_id' => '123456', 'location_tax_id' => '654321', - ] + ], ); Monkey\Functions\expect( 'wpseo_has_primary_location' ) @@ -681,7 +681,7 @@ public function test_get_defaults_from_local_seo_with_shared_business_info_and_p 'location_email' => 'example@location.con', 'location_vat_id' => '123456', 'location_tax_id' => '654321', - ] + ], ); Monkey\Functions\expect( 'wpseo_has_primary_location' ) diff --git a/tests/Unit/Integrations/Support_Integration_Test.php b/tests/Unit/Integrations/Support_Integration_Test.php index 05e65248c69..cb0ac672200 100644 --- a/tests/Unit/Integrations/Support_Integration_Test.php +++ b/tests/Unit/Integrations/Support_Integration_Test.php @@ -131,8 +131,8 @@ public function test_construct() { $this->product_helper, $this->shortlink_helper, $this->woocommerce_conditional, - $this->addon_manager - ) + $this->addon_manager, + ), ); } @@ -149,7 +149,7 @@ public function test_get_conditionals() { Admin_Conditional::class, User_Can_Manage_Wpseo_Options_Conditional::class, ], - Support_Integration::get_conditionals() + Support_Integration::get_conditionals(), ); } @@ -218,7 +218,7 @@ public function test_add_page() { [ 'page1', '', 'Page 1', 'manage_options', 'page1', [ $this, 'display_page' ] ], [ 'page2', '', 'Page 2', 'manage_options', 'page2', [ $this, 'display_page' ] ], [ 'page3', '', 'Page 3', 'manage_options', 'page3', [ $this, 'display_page' ] ], - ] + ], ); // Assert that the new page was added at index 3. diff --git a/tests/Unit/Integrations/Third_Party/AMP_Test.php b/tests/Unit/Integrations/Third_Party/AMP_Test.php index d3aacbd6110..3681b174690 100644 --- a/tests/Unit/Integrations/Third_Party/AMP_Test.php +++ b/tests/Unit/Integrations/Third_Party/AMP_Test.php @@ -54,7 +54,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Front_End_Conditional::class ], - AMP::get_conditionals() + AMP::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Third_Party/BbPress_Test.php b/tests/Unit/Integrations/Third_Party/BbPress_Test.php index 81b38255a8f..d6c4b6d4855 100644 --- a/tests/Unit/Integrations/Third_Party/BbPress_Test.php +++ b/tests/Unit/Integrations/Third_Party/BbPress_Test.php @@ -54,7 +54,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Front_End_Conditional::class ], - BbPress::get_conditionals() + BbPress::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Third_Party/Exclude_Elementor_Post_Types_Test.php b/tests/Unit/Integrations/Third_Party/Exclude_Elementor_Post_Types_Test.php index 594e81afe7b..585f93f600e 100644 --- a/tests/Unit/Integrations/Third_Party/Exclude_Elementor_Post_Types_Test.php +++ b/tests/Unit/Integrations/Third_Party/Exclude_Elementor_Post_Types_Test.php @@ -45,7 +45,7 @@ public function set_up() { public function test_get_conditionals() { self::assertEquals( [ Elementor_Activated_Conditional::class ], - Exclude_Elementor_Post_Types::get_conditionals() + Exclude_Elementor_Post_Types::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Third_Party/Exclude_WooCommerce_Post_Types_Test.php b/tests/Unit/Integrations/Third_Party/Exclude_WooCommerce_Post_Types_Test.php index baf8430bd60..0526fb73f7d 100644 --- a/tests/Unit/Integrations/Third_Party/Exclude_WooCommerce_Post_Types_Test.php +++ b/tests/Unit/Integrations/Third_Party/Exclude_WooCommerce_Post_Types_Test.php @@ -45,7 +45,7 @@ public function set_up() { public function test_get_conditionals() { self::assertEquals( [ WooCommerce_Conditional::class ], - Exclude_WooCommerce_Post_Types::get_conditionals() + Exclude_WooCommerce_Post_Types::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Third_Party/Jetpack_Test.php b/tests/Unit/Integrations/Third_Party/Jetpack_Test.php index 77b98e6b570..e1ad22a1350 100644 --- a/tests/Unit/Integrations/Third_Party/Jetpack_Test.php +++ b/tests/Unit/Integrations/Third_Party/Jetpack_Test.php @@ -45,7 +45,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Front_End_Conditional::class, Jetpack_Conditional::class, Open_Graph_Conditional::class ], - Jetpack::get_conditionals() + Jetpack::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Third_Party/WPML_Test.php b/tests/Unit/Integrations/Third_Party/WPML_Test.php index 97d8e4b3ff7..760a7715064 100644 --- a/tests/Unit/Integrations/Third_Party/WPML_Test.php +++ b/tests/Unit/Integrations/Third_Party/WPML_Test.php @@ -44,7 +44,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ WPML_Conditional::class ], - WPML::get_conditionals() + WPML::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Third_Party/WPML_WPSEO_Notification_Test.php b/tests/Unit/Integrations/Third_Party/WPML_WPSEO_Notification_Test.php index b80aea3c10f..db9e4762baf 100644 --- a/tests/Unit/Integrations/Third_Party/WPML_WPSEO_Notification_Test.php +++ b/tests/Unit/Integrations/Third_Party/WPML_WPSEO_Notification_Test.php @@ -60,7 +60,7 @@ public function set_up() { $this->instance = new WPML_WPSEO_Notification( $this->short_link_helper, $this->notification_center, - $this->wpml_wpseo_conditional + $this->wpml_wpseo_conditional, ); } @@ -74,15 +74,15 @@ public function set_up() { public function test_constructor() { self::assertInstanceOf( Yoast_Notification_Center::class, - $this->getPropertyValue( $this->instance, 'notification_center' ) + $this->getPropertyValue( $this->instance, 'notification_center' ), ); self::assertInstanceOf( WPML_WPSEO_Conditional::class, - $this->getPropertyValue( $this->instance, 'wpml_wpseo_conditional' ) + $this->getPropertyValue( $this->instance, 'wpml_wpseo_conditional' ), ); self::assertInstanceOf( Short_Link_Helper::class, - $this->getPropertyValue( $this->instance, 'short_link_helper' ) + $this->getPropertyValue( $this->instance, 'short_link_helper' ), ); } diff --git a/tests/Unit/Integrations/Third_Party/Web_Stories_Post_Edit_Test.php b/tests/Unit/Integrations/Third_Party/Web_Stories_Post_Edit_Test.php index 2ad0d61aa94..54d90674845 100644 --- a/tests/Unit/Integrations/Third_Party/Web_Stories_Post_Edit_Test.php +++ b/tests/Unit/Integrations/Third_Party/Web_Stories_Post_Edit_Test.php @@ -46,7 +46,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Web_Stories_Conditional::class, Post_Conditional::class ], - Web_Stories_Post_Edit::get_conditionals() + Web_Stories_Post_Edit::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Third_Party/Web_Stories_Test.php b/tests/Unit/Integrations/Third_Party/Web_Stories_Test.php index bc222c9b13f..ddfb6c7d765 100644 --- a/tests/Unit/Integrations/Third_Party/Web_Stories_Test.php +++ b/tests/Unit/Integrations/Third_Party/Web_Stories_Test.php @@ -62,7 +62,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Web_Stories_Conditional::class ], - Web_Stories::get_conditionals() + Web_Stories::get_conditionals(), ); } @@ -76,7 +76,7 @@ public function test_get_conditionals() { public function test_constructor() { $this->assertInstanceOf( Front_End_Integration::class, - $this->getPropertyValue( $this->instance, 'front_end' ) + $this->getPropertyValue( $this->instance, 'front_end' ), ); } diff --git a/tests/Unit/Integrations/Third_Party/Wincher_Publish_Test.php b/tests/Unit/Integrations/Third_Party/Wincher_Publish_Test.php index e1c92a6a1c1..d358d8e0778 100644 --- a/tests/Unit/Integrations/Third_Party/Wincher_Publish_Test.php +++ b/tests/Unit/Integrations/Third_Party/Wincher_Publish_Test.php @@ -81,7 +81,7 @@ protected function set_up() { $this->options_helper, $this->keyphrases_action, $this->account_action, - ] + ], ) ->shouldAllowMockingProtectedMethods() ->makePartial(); @@ -102,7 +102,7 @@ public function test_get_conditionals() { Wincher_Automatically_Track_Conditional::class, Wincher_Token_Conditional::class, ], - Wincher_Publish::get_conditionals() + Wincher_Publish::get_conditionals(), ); } @@ -118,27 +118,27 @@ public function test_constructor() { $this->wincher_enabled, $this->options_helper, $this->keyphrases_action, - $this->account_action + $this->account_action, ); $this->assertInstanceOf( Wincher_Enabled_Conditional::class, - $this->getPropertyValue( $instance, 'wincher_enabled' ) + $this->getPropertyValue( $instance, 'wincher_enabled' ), ); $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $instance, 'options_helper' ) + $this->getPropertyValue( $instance, 'options_helper' ), ); $this->assertInstanceOf( Wincher_Keyphrases_Action::class, - $this->getPropertyValue( $instance, 'keyphrases_action' ) + $this->getPropertyValue( $instance, 'keyphrases_action' ), ); $this->assertInstanceOf( Wincher_Account_Action::class, - $this->getPropertyValue( $instance, 'account_action' ) + $this->getPropertyValue( $instance, 'account_action' ), ); } @@ -174,7 +174,7 @@ public function test_track_request() { 'yoast seo', 'blog seo', 'wincher', - ] + ], ); $this->account_action @@ -186,7 +186,7 @@ public function test_track_request() { 'limit' => 100, 'usage' => 10, 'status' => 200, - ] + ], ); $this->keyphrases_action->expects( 'track_keyphrases' )->once(); diff --git a/tests/Unit/Integrations/Third_Party/WooCommerce_Permalinks_Test.php b/tests/Unit/Integrations/Third_Party/WooCommerce_Permalinks_Test.php index b57b13e7187..02f2b43734b 100644 --- a/tests/Unit/Integrations/Third_Party/WooCommerce_Permalinks_Test.php +++ b/tests/Unit/Integrations/Third_Party/WooCommerce_Permalinks_Test.php @@ -57,7 +57,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ WooCommerce_Conditional::class, Migrations_Conditional::class ], - Woocommerce_Permalinks::get_conditionals() + Woocommerce_Permalinks::get_conditionals(), ); } @@ -71,7 +71,7 @@ public function test_get_conditionals() { public function test_constructor() { $this->assertInstanceOf( Indexable_Helper::class, - $this->getPropertyValue( $this->instance, 'indexable_helper' ) + $this->getPropertyValue( $this->instance, 'indexable_helper' ), ); } @@ -107,8 +107,8 @@ public function test_filter_product_from_post_types() { 'post' => 'post', 'page' => 'page', 'product' => 'product', - ] - ) + ], + ), ); } diff --git a/tests/Unit/Integrations/Third_Party/WooCommerce_Post_Edit_Test.php b/tests/Unit/Integrations/Third_Party/WooCommerce_Post_Edit_Test.php index 97045487d84..6cb366949a3 100644 --- a/tests/Unit/Integrations/Third_Party/WooCommerce_Post_Edit_Test.php +++ b/tests/Unit/Integrations/Third_Party/WooCommerce_Post_Edit_Test.php @@ -46,7 +46,7 @@ protected function set_up() { public function test_conditionals() { $this->assertEquals( [ WooCommerce_Conditional::class, Post_Conditional::class ], - WooCommerce_Post_Edit::get_conditionals() + WooCommerce_Post_Edit::get_conditionals(), ); } @@ -66,8 +66,8 @@ public function test_register_hooks() { [ $this->instance, 'remove_meta_description_date', - ] - ) + ], + ), ); } diff --git a/tests/Unit/Integrations/Third_Party/WooCommerce_Test.php b/tests/Unit/Integrations/Third_Party/WooCommerce_Test.php index 83fe51b6994..d04cdfcf13d 100644 --- a/tests/Unit/Integrations/Third_Party/WooCommerce_Test.php +++ b/tests/Unit/Integrations/Third_Party/WooCommerce_Test.php @@ -113,7 +113,7 @@ protected function set_up() { $this->context_memoizer, $this->repository, $this->pagination_helper, - $this->woocommerce_helper + $this->woocommerce_helper, ); $presentation = new Indexable_Presentation(); @@ -131,7 +131,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ WooCommerce_Conditional::class, Front_End_Conditional::class ], - WooCommerce::get_conditionals() + WooCommerce::get_conditionals(), ); } @@ -149,16 +149,16 @@ public function test_constructor() { $this->context_memoizer, $this->repository, $this->pagination_helper, - $this->woocommerce_helper + $this->woocommerce_helper, ); $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $instance, 'options' ) + $this->getPropertyValue( $instance, 'options' ), ); $this->assertInstanceOf( WPSEO_Replace_Vars::class, - $this->getPropertyValue( $instance, 'replace_vars' ) + $this->getPropertyValue( $instance, 'replace_vars' ), ); } @@ -321,7 +321,7 @@ public function test_title( $expected, $model_value, $template_value, $is_shop_p $this->assertEquals( $expected, - $this->instance->title( 'This is a value', $this->presentation ) + $this->instance->title( 'This is a value', $this->presentation ), ); } @@ -366,7 +366,7 @@ public function test_description( $expected, $model_value, $template_value, $is_ $this->assertEquals( $expected, - $this->instance->description( 'This is a value', $this->presentation ) + $this->instance->description( 'This is a value', $this->presentation ), ); } @@ -461,7 +461,7 @@ public function test_title_by_using_the_product_archive_template() { $this->assertEquals( 'This is a template value', - $this->instance->title( 'This is a value', $this->presentation ) + $this->instance->title( 'This is a value', $this->presentation ), ); } @@ -498,7 +498,7 @@ public function test_description_by_using_the_product_archive_template() { $this->assertEquals( 'This is a template value', - $this->instance->description( 'This is a value', $this->presentation ) + $this->instance->description( 'This is a value', $this->presentation ), ); } diff --git a/tests/Unit/Integrations/Watchers/Addon_Update_Watcher_Test.php b/tests/Unit/Integrations/Watchers/Addon_Update_Watcher_Test.php index c1477324815..6306ff6f94b 100644 --- a/tests/Unit/Integrations/Watchers/Addon_Update_Watcher_Test.php +++ b/tests/Unit/Integrations/Watchers/Addon_Update_Watcher_Test.php @@ -173,7 +173,7 @@ public function test_enable_auto_updates_for_add_ons_on_free_auto_update_enabled $this->instance->toggle_auto_updates_for_add_ons( 'auto_update_plugins', $new, - $old + $old, ); } @@ -221,7 +221,7 @@ public function test_disable_auto_updates_for_add_ons_on_free_auto_update_disabl $this->instance->toggle_auto_updates_for_add_ons( 'auto_update_plugins', $new, - $old + $old, ); } @@ -265,7 +265,7 @@ public function test_do_nothing_for_add_ons_when_nothing_happens_to_free_auto_up $this->instance->toggle_auto_updates_for_add_ons( 'auto_update_plugins', $new, - $old + $old, ); } @@ -285,7 +285,7 @@ public function test_html_not_replaced_when_html_not_string() { $new_html = $this->instance->replace_auto_update_toggles_of_addons( $old_html, - 'other-plugin/plugin-file.php' + 'other-plugin/plugin-file.php', ); self::assertEquals( $old_html, $new_html ); @@ -308,7 +308,7 @@ public function test_html_not_replaced_when_auto_updated_plugins_does_not_exist( $new_html = $this->instance->replace_auto_update_toggles_of_addons( $old_html, - 'wordpress-seo-premium/wp-seo-premium.php' + 'wordpress-seo-premium/wp-seo-premium.php', ); self::assertEquals( 'Auto-updates are disabled based on this setting for Yoast SEO.', $new_html ); @@ -331,7 +331,7 @@ public function test_html_not_replaced_when_auto_updated_plugins_not_an_array() $new_html = $this->instance->replace_auto_update_toggles_of_addons( $old_html, - 'wordpress-seo-premium/wp-seo-premium.php' + 'wordpress-seo-premium/wp-seo-premium.php', ); self::assertEquals( 'Auto-updates are disabled based on this setting for Yoast SEO.', $new_html ); @@ -355,7 +355,7 @@ public function test_do_not_replace_auto_update_toggles_from_other_plugins() { $new_html = $this->instance->replace_auto_update_toggles_of_addons( $old_html, - 'other-plugin/plugin-file.php' + 'other-plugin/plugin-file.php', ); self::assertEquals( $old_html, $new_html ); @@ -383,7 +383,7 @@ public function test_replace_auto_update_toggles_from_addons_with_enabled_text( $new_html = $this->instance->replace_auto_update_toggles_of_addons( $old_html, - $plugin + $plugin, ); self::assertEquals( 'Auto-updates are enabled based on this setting for Yoast SEO.', $new_html ); @@ -412,7 +412,7 @@ public function test_replace_auto_update_toggles_from_addons_with_disabled_text( $new_html = $this->instance->replace_auto_update_toggles_of_addons( $old_html, - $plugin + $plugin, ); self::assertEquals( 'Auto-updates are disabled based on this setting for Yoast SEO.', $new_html ); @@ -441,7 +441,7 @@ public function test_replace_auto_update_toggles_from_addons_when_enabled_plugin $new_html = $this->instance->replace_auto_update_toggles_of_addons( $old_html, - $plugin + $plugin, ); self::assertEquals( 'Auto-updates are disabled based on this setting for Yoast SEO.', $new_html ); @@ -470,7 +470,7 @@ public function test_replace_auto_update_toggles_from_addons_when_enabled_plugin $new_html = $this->instance->replace_auto_update_toggles_of_addons( $old_html, - $plugin + $plugin, ); self::assertEquals( 'Auto-updates are disabled based on this setting for Yoast SEO.', $new_html ); diff --git a/tests/Unit/Integrations/Watchers/Auto_Update_Watcher_Test.php b/tests/Unit/Integrations/Watchers/Auto_Update_Watcher_Test.php index 08807215f49..fe858495a2f 100644 --- a/tests/Unit/Integrations/Watchers/Auto_Update_Watcher_Test.php +++ b/tests/Unit/Integrations/Watchers/Auto_Update_Watcher_Test.php @@ -43,7 +43,7 @@ public function set_up() { $this->notification_center = Mockery::mock( Yoast_Notification_Center::class ); $this->instance = new Auto_Update_Watcher( - $this->notification_center + $this->notification_center, ); } @@ -57,7 +57,7 @@ public function set_up() { public function test_constructor() { self::assertInstanceOf( Yoast_Notification_Center::class, - self::getPropertyValue( $this->instance, 'notification_center' ) + self::getPropertyValue( $this->instance, 'notification_center' ), ); } diff --git a/tests/Unit/Integrations/Watchers/Indexable_Ancestor_Watcher_Test.php b/tests/Unit/Integrations/Watchers/Indexable_Ancestor_Watcher_Test.php index 30065b03a78..fe033cb19ac 100644 --- a/tests/Unit/Integrations/Watchers/Indexable_Ancestor_Watcher_Test.php +++ b/tests/Unit/Integrations/Watchers/Indexable_Ancestor_Watcher_Test.php @@ -96,7 +96,7 @@ protected function set_up() { $this->indexable_hierarchy_repository, $this->indexable_helper, $this->permalink_helper, - $this->post_type_helper + $this->post_type_helper, ); } @@ -145,15 +145,15 @@ public function test_reset_children_for_non_changed_permalink() { public function test_construct() { $this->assertInstanceOf( Indexable_Repository::class, - $this->getPropertyValue( $this->instance, 'indexable_repository' ) + $this->getPropertyValue( $this->instance, 'indexable_repository' ), ); $this->assertInstanceOf( Indexable_Hierarchy_Builder::class, - $this->getPropertyValue( $this->instance, 'indexable_hierarchy_builder' ) + $this->getPropertyValue( $this->instance, 'indexable_hierarchy_builder' ), ); $this->assertInstanceOf( Permalink_Helper::class, - $this->getPropertyValue( $this->instance, 'permalink_helper' ) + $this->getPropertyValue( $this->instance, 'permalink_helper' ), ); } @@ -167,7 +167,7 @@ public function test_construct() { public function test_get_conditionals() { $this->assertEquals( [ Migrations_Conditional::class ], - Indexable_Ancestor_Watcher::get_conditionals() + Indexable_Ancestor_Watcher::get_conditionals(), ); } @@ -355,9 +355,9 @@ static function ( $haystack, $prop ) { static function ( $e ) use ( $prop ) { return $e->{$prop}; }, - $haystack + $haystack, ); - } + }, ); $this->set_expectations_for_get_object_ids_for_term( $term_id, $indexable_1->object_id, $indexable_2->object_id ); @@ -375,7 +375,7 @@ static function ( $e ) use ( $prop ) { 2 => 21, ], 'post', - false + false, ) ->andReturn( [ $indexable_term_1, $indexable_term_2 ] ); @@ -390,7 +390,7 @@ static function ( $e ) use ( $prop ) { [ 0 => 566, 2 => 569, - ] + ], ) ->andReturn( [ $additional_indexable_2 ] ); @@ -418,7 +418,7 @@ private function set_expectations_for_get_object_ids_for_term( ...$object_ids ) FROM %i WHERE term_id IN( ' . \implode( ', ', \array_fill( 0, ( \count( $object_ids ) ), '%s' ) ) . ' )', $wpdb->term_taxonomy, - ...$object_ids + ...$object_ids, ); $wpdb->expects( 'get_col' ) @@ -432,7 +432,7 @@ private function set_expectations_for_get_object_ids_for_term( ...$object_ids ) $wpdb->term_relationships, 321, 322, - 323 + 323, ); $wpdb->expects( 'get_col' ) diff --git a/tests/Unit/Integrations/Watchers/Indexable_Attachment_Watcher_Test.php b/tests/Unit/Integrations/Watchers/Indexable_Attachment_Watcher_Test.php index dfd2f04125f..6c535fa1cd4 100644 --- a/tests/Unit/Integrations/Watchers/Indexable_Attachment_Watcher_Test.php +++ b/tests/Unit/Integrations/Watchers/Indexable_Attachment_Watcher_Test.php @@ -78,7 +78,7 @@ protected function set_up() { $this->indexing_helper, $this->attachment_cleanup, $this->notification_center, - $this->indexable_helper + $this->indexable_helper, ); } diff --git a/tests/Unit/Integrations/Watchers/Indexable_Author_Watcher_Test.php b/tests/Unit/Integrations/Watchers/Indexable_Author_Watcher_Test.php index a831707de35..97d3b35dede 100644 --- a/tests/Unit/Integrations/Watchers/Indexable_Author_Watcher_Test.php +++ b/tests/Unit/Integrations/Watchers/Indexable_Author_Watcher_Test.php @@ -67,7 +67,7 @@ protected function set_up() { $this->instance = new Indexable_Author_Watcher( $this->repository, $this->indexable_helper, - $this->builder + $this->builder, ); } @@ -81,7 +81,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Migrations_Conditional::class ], - Indexable_Author_Watcher::get_conditionals() + Indexable_Author_Watcher::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Watchers/Indexable_Category_Permalink_Watcher_Test.php b/tests/Unit/Integrations/Watchers/Indexable_Category_Permalink_Watcher_Test.php index 5332f00d481..a5faf118c72 100644 --- a/tests/Unit/Integrations/Watchers/Indexable_Category_Permalink_Watcher_Test.php +++ b/tests/Unit/Integrations/Watchers/Indexable_Category_Permalink_Watcher_Test.php @@ -71,7 +71,7 @@ protected function set_up() { [ 'wp_next_scheduled' => false, 'wp_schedule_event' => false, - ] + ], ); $this->options = Mockery::mock( Options_Helper::class ); @@ -83,7 +83,7 @@ protected function set_up() { $this->post_type, $this->options, $this->indexable_helper, - $this->taxonomy_helper + $this->taxonomy_helper, ); } diff --git a/tests/Unit/Integrations/Watchers/Indexable_Date_Archive_Watcher_Test.php b/tests/Unit/Integrations/Watchers/Indexable_Date_Archive_Watcher_Test.php index 2aad3381ebe..3b6bceefe9c 100644 --- a/tests/Unit/Integrations/Watchers/Indexable_Date_Archive_Watcher_Test.php +++ b/tests/Unit/Integrations/Watchers/Indexable_Date_Archive_Watcher_Test.php @@ -66,7 +66,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Migrations_Conditional::class ], - Indexable_Date_Archive_Watcher::get_conditionals() + Indexable_Date_Archive_Watcher::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Watchers/Indexable_HomeUrl_Watcher_Test.php b/tests/Unit/Integrations/Watchers/Indexable_HomeUrl_Watcher_Test.php index 5e958e0a467..4e256ce770b 100644 --- a/tests/Unit/Integrations/Watchers/Indexable_HomeUrl_Watcher_Test.php +++ b/tests/Unit/Integrations/Watchers/Indexable_HomeUrl_Watcher_Test.php @@ -63,7 +63,7 @@ protected function set_up() { [ 'wp_next_scheduled' => false, 'wp_schedule_event' => false, - ] + ], ); $this->post_type = Mockery::mock( Post_Type_Helper::class ); @@ -84,7 +84,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Migrations_Conditional::class ], - Indexable_HomeUrl_Watcher::get_conditionals() + Indexable_HomeUrl_Watcher::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Watchers/Indexable_Home_Page_Watcher_Test.php b/tests/Unit/Integrations/Watchers/Indexable_Home_Page_Watcher_Test.php index 5daeae0d21c..00e2054f5e5 100644 --- a/tests/Unit/Integrations/Watchers/Indexable_Home_Page_Watcher_Test.php +++ b/tests/Unit/Integrations/Watchers/Indexable_Home_Page_Watcher_Test.php @@ -66,7 +66,7 @@ protected function set_up() { $this->instance = new Indexable_Home_Page_Watcher( $this->repository, $this->indexable_helper, - $this->builder + $this->builder, ); } @@ -80,7 +80,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Migrations_Conditional::class ], - Indexable_Home_Page_Watcher::get_conditionals() + Indexable_Home_Page_Watcher::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Watchers/Indexable_Permalink_Watcher_Test.php b/tests/Unit/Integrations/Watchers/Indexable_Permalink_Watcher_Test.php index 364532e51f7..e0f701b65d9 100644 --- a/tests/Unit/Integrations/Watchers/Indexable_Permalink_Watcher_Test.php +++ b/tests/Unit/Integrations/Watchers/Indexable_Permalink_Watcher_Test.php @@ -71,7 +71,7 @@ protected function set_up() { [ 'wp_next_scheduled' => false, 'wp_schedule_event' => false, - ] + ], ); $this->post_type = Mockery::mock( Post_Type_Helper::class ); @@ -93,7 +93,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Migrations_Conditional::class ], - Indexable_Permalink_Watcher::get_conditionals() + Indexable_Permalink_Watcher::get_conditionals(), ); } @@ -450,7 +450,7 @@ public function test_should_reset_altered_custom_taxonomies() { [ 'book-category' => 'book-category', 'book-genre' => 'book-genre', - ] + ], ); $this->options @@ -461,7 +461,7 @@ public function test_should_reset_altered_custom_taxonomies() { [ 'book-category' => 'yoast-book-category', 'book-genre' => 'yoast-test-book-genre', - ] + ], ); $this->taxonomy_helper @@ -480,7 +480,7 @@ public function test_should_reset_altered_custom_taxonomies() { [ 'book-category' => 'yoast-test-book-category', 'book-genre' => 'yoast-test-book-genre', - ] + ], ); $this->instance->reset_altered_custom_taxonomies(); @@ -501,7 +501,7 @@ public function test_shouldnt_reset_altered_custom_taxonomies() { [ 'book-category' => 'book-category', 'book-genre' => 'book-genre', - ] + ], ); $this->options @@ -512,7 +512,7 @@ public function test_shouldnt_reset_altered_custom_taxonomies() { [ 'book-category' => 'yoast-test-book-category', 'book-genre' => 'yoast-test-book-genre', - ] + ], ); $this->taxonomy_helper @@ -531,7 +531,7 @@ public function test_shouldnt_reset_altered_custom_taxonomies() { [ 'book-category' => 'yoast-test-book-category', 'book-genre' => 'yoast-test-book-genre', - ] + ], ); $this->instance->reset_altered_custom_taxonomies(); diff --git a/tests/Unit/Integrations/Watchers/Indexable_Post_Meta_Watcher_Test.php b/tests/Unit/Integrations/Watchers/Indexable_Post_Meta_Watcher_Test.php index e827878bc01..e1a5ffc002c 100644 --- a/tests/Unit/Integrations/Watchers/Indexable_Post_Meta_Watcher_Test.php +++ b/tests/Unit/Integrations/Watchers/Indexable_Post_Meta_Watcher_Test.php @@ -55,7 +55,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Migrations_Conditional::class ], - Indexable_Post_Watcher::get_conditionals() + Indexable_Post_Watcher::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Watchers/Indexable_Post_Type_Archive_Watcher_Test.php b/tests/Unit/Integrations/Watchers/Indexable_Post_Type_Archive_Watcher_Test.php index b1a65c97312..ecd7b20b82c 100644 --- a/tests/Unit/Integrations/Watchers/Indexable_Post_Type_Archive_Watcher_Test.php +++ b/tests/Unit/Integrations/Watchers/Indexable_Post_Type_Archive_Watcher_Test.php @@ -68,7 +68,7 @@ protected function set_up() { $this->instance = new Indexable_Post_Type_Archive_Watcher( $this->repository, $this->indexable_helper, - $this->builder + $this->builder, ); } @@ -82,7 +82,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Migrations_Conditional::class ], - Indexable_Post_Type_Archive_Watcher::get_conditionals() + Indexable_Post_Type_Archive_Watcher::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Watchers/Indexable_Post_Type_Change_Watcher_Test.php b/tests/Unit/Integrations/Watchers/Indexable_Post_Type_Change_Watcher_Test.php index 711f0ac39fb..bba9626ba39 100644 --- a/tests/Unit/Integrations/Watchers/Indexable_Post_Type_Change_Watcher_Test.php +++ b/tests/Unit/Integrations/Watchers/Indexable_Post_Type_Change_Watcher_Test.php @@ -93,7 +93,7 @@ protected function set_up() { $this->indexing_helper, $this->post_type_helper, $this->notification_center, - $this->indexable_helper + $this->indexable_helper, ); } @@ -111,7 +111,7 @@ public function test_get_conditionals() { Admin_Conditional::class, Migrations_Conditional::class, ], - Indexable_Post_Type_Change_Watcher::get_conditionals() + Indexable_Post_Type_Change_Watcher::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Watchers/Indexable_Post_Watcher_Test.php b/tests/Unit/Integrations/Watchers/Indexable_Post_Watcher_Test.php index fd0f8942b5d..e1715455a7d 100644 --- a/tests/Unit/Integrations/Watchers/Indexable_Post_Watcher_Test.php +++ b/tests/Unit/Integrations/Watchers/Indexable_Post_Watcher_Test.php @@ -122,7 +122,7 @@ protected function set_up() { $this->indexable_helper, $this->post, $this->logger, - ] + ], ) ->makePartial() ->shouldAllowMockingProtectedMethods(); @@ -138,7 +138,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Migrations_Conditional::class ], - Indexable_Post_Watcher::get_conditionals() + Indexable_Post_Watcher::get_conditionals(), ); } @@ -627,7 +627,7 @@ public function test_get_related_indexables() { [ 'taxonomy', 'another-taxonomy', - ] + ], ); Monkey\Functions\expect( 'is_taxonomy_viewable' ) @@ -651,7 +651,7 @@ public function test_get_related_indexables() { (object) [ 'term_id' => 1414, ], - ] + ], ); Monkey\Functions\expect( 'get_the_terms' ) @@ -670,7 +670,7 @@ public function test_get_related_indexables() { 'term_id' => 1414, ], ], - 'term_id' + 'term_id', ) ->andReturn( [ 1337, 1414 ] ); @@ -702,7 +702,7 @@ public function test_get_related_indexables() { $this->assertEquals( [ $indexable, $indexable, $indexable, $indexable ], - $this->instance->get_related_indexables( $post ) + $this->instance->get_related_indexables( $post ), ); } } diff --git a/tests/Unit/Integrations/Watchers/Indexable_Static_Home_Page_Watcher_Test.php b/tests/Unit/Integrations/Watchers/Indexable_Static_Home_Page_Watcher_Test.php index 7d546cbe578..dc26b5b3a18 100644 --- a/tests/Unit/Integrations/Watchers/Indexable_Static_Home_Page_Watcher_Test.php +++ b/tests/Unit/Integrations/Watchers/Indexable_Static_Home_Page_Watcher_Test.php @@ -57,7 +57,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Admin_Conditional::class ], - Indexable_Static_Home_Page_Watcher::get_conditionals() + Indexable_Static_Home_Page_Watcher::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Watchers/Indexable_System_Page_Watcher_Test.php b/tests/Unit/Integrations/Watchers/Indexable_System_Page_Watcher_Test.php index 056bb4a4d31..d2be5b8df4d 100644 --- a/tests/Unit/Integrations/Watchers/Indexable_System_Page_Watcher_Test.php +++ b/tests/Unit/Integrations/Watchers/Indexable_System_Page_Watcher_Test.php @@ -66,7 +66,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Migrations_Conditional::class ], - Indexable_System_Page_Watcher::get_conditionals() + Indexable_System_Page_Watcher::get_conditionals(), ); } @@ -131,7 +131,7 @@ public function test_update_wpseo_titles_value_without_change() { 'other_key' => 'baz', 'title-search-wpseo' => 'baz', 'title-404-wpseo' => 'baz', - ] + ], ); } diff --git a/tests/Unit/Integrations/Watchers/Indexable_Taxonomy_Change_Watcher_Test.php b/tests/Unit/Integrations/Watchers/Indexable_Taxonomy_Change_Watcher_Test.php index eaae46db50f..7b2b89d0acd 100644 --- a/tests/Unit/Integrations/Watchers/Indexable_Taxonomy_Change_Watcher_Test.php +++ b/tests/Unit/Integrations/Watchers/Indexable_Taxonomy_Change_Watcher_Test.php @@ -93,7 +93,7 @@ protected function set_up() { $this->options, $this->taxonomy_helper, $this->notification_center, - $this->indexable_helper + $this->indexable_helper, ); } @@ -111,7 +111,7 @@ public function test_get_conditionals() { Admin_Conditional::class, Migrations_Conditional::class, ], - Indexable_Taxonomy_Change_Watcher::get_conditionals() + Indexable_Taxonomy_Change_Watcher::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Watchers/Indexable_Term_Watcher_Test.php b/tests/Unit/Integrations/Watchers/Indexable_Term_Watcher_Test.php index c770d601568..93c098f1300 100644 --- a/tests/Unit/Integrations/Watchers/Indexable_Term_Watcher_Test.php +++ b/tests/Unit/Integrations/Watchers/Indexable_Term_Watcher_Test.php @@ -87,7 +87,7 @@ protected function set_up() { $this->builder, $this->link_builder, $this->indexable_helper, - $this->site + $this->site, ); } @@ -101,7 +101,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Migrations_Conditional::class ], - Indexable_Term_Watcher::get_conditionals() + Indexable_Term_Watcher::get_conditionals(), ); } @@ -212,7 +212,7 @@ public function test_build_indexable() { ->expects( 'build' ) ->with( $indexable, - 'This is a term description, with a link.' + 'This is a term description, with a link.', ); $this->indexable_helper @@ -377,7 +377,7 @@ public function test_build_does_not_exist() { ->expects( 'build' ) ->with( $indexable, - 'This is a term description, with a link.' + 'This is a term description, with a link.', ); $this->indexable_helper diff --git a/tests/Unit/Integrations/Watchers/Option_Titles_Watcher_Test.php b/tests/Unit/Integrations/Watchers/Option_Titles_Watcher_Test.php index fa6c7cebb83..3fb913aaac1 100644 --- a/tests/Unit/Integrations/Watchers/Option_Titles_Watcher_Test.php +++ b/tests/Unit/Integrations/Watchers/Option_Titles_Watcher_Test.php @@ -48,7 +48,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Migrations_Conditional::class ], - Option_Titles_Watcher::get_conditionals() + Option_Titles_Watcher::get_conditionals(), ); } @@ -157,7 +157,7 @@ public function test_check_option_with_ancestors_being_removed() { )", 'wp_yoast_indexable_hierarchy', 'wp_yoast_indexable', - 'post' + 'post', ) ->andReturn( " @@ -167,7 +167,7 @@ public function test_check_option_with_ancestors_being_removed() { FROM `wp_yoast_indexable` WHERE object_type = 'post' AND object_sub_type IN( post ) - )" + )", ); $wpdb @@ -181,7 +181,7 @@ public function test_check_option_with_ancestors_being_removed() { FROM `wp_yoast_indexable` WHERE object_type = 'post' AND object_sub_type IN( post ) - )" + )", ) ->andReturn( 2 ); @@ -199,8 +199,8 @@ public function test_check_option_with_ancestors_being_removed() { ], [ 'post_types-post-maintax' => 1, - ] - ) + ], + ), ); } @@ -232,7 +232,7 @@ public function test_check_option_with_ancestors_not_being_removed() { )", 'wp_yoast_indexable_hierarchy', 'wp_yoast_indexable', - 'post' + 'post', ) ->andReturn( 'the query' ); @@ -256,8 +256,8 @@ public function test_check_option_with_ancestors_not_being_removed() { ], [ 'post_types-post-maintax' => 1, - ] - ) + ], + ), ); } } diff --git a/tests/Unit/Integrations/Watchers/Primary_Category_Quick_Edit_Watcher_Test.php b/tests/Unit/Integrations/Watchers/Primary_Category_Quick_Edit_Watcher_Test.php index c43911cfcaa..d29a2c391e9 100644 --- a/tests/Unit/Integrations/Watchers/Primary_Category_Quick_Edit_Watcher_Test.php +++ b/tests/Unit/Integrations/Watchers/Primary_Category_Quick_Edit_Watcher_Test.php @@ -90,7 +90,7 @@ public function set_up() { $this->primary_term_repository, $this->post_type_helper, $this->indexable_repository, - $this->indexable_hierarchy_builder + $this->indexable_hierarchy_builder, ); } @@ -132,7 +132,7 @@ public function test_get_conditionals() { Migrations_Conditional::class, Doing_Post_Quick_Edit_Save_Conditional::class, ], - Primary_Category_Quick_Edit_Watcher::get_conditionals() + Primary_Category_Quick_Edit_Watcher::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Watchers/Primary_Term_Watcher_Test.php b/tests/Unit/Integrations/Watchers/Primary_Term_Watcher_Test.php index eb248ab289d..5e92ce4db72 100644 --- a/tests/Unit/Integrations/Watchers/Primary_Term_Watcher_Test.php +++ b/tests/Unit/Integrations/Watchers/Primary_Term_Watcher_Test.php @@ -77,7 +77,7 @@ protected function set_up() { $this->site, $this->primary_term, $this->primary_term_builder, - ] + ], ) ->shouldAllowMockingProtectedMethods() ->makePartial(); @@ -93,7 +93,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Migrations_Conditional::class ], - Primary_Term_Watcher::get_conditionals() + Primary_Term_Watcher::get_conditionals(), ); } diff --git a/tests/Unit/Integrations/Watchers/Search_Engines_Discouraged_Watcher_Test.php b/tests/Unit/Integrations/Watchers/Search_Engines_Discouraged_Watcher_Test.php index ed295485ee1..b6176007f0d 100644 --- a/tests/Unit/Integrations/Watchers/Search_Engines_Discouraged_Watcher_Test.php +++ b/tests/Unit/Integrations/Watchers/Search_Engines_Discouraged_Watcher_Test.php @@ -93,7 +93,7 @@ public function set_up() { $this->notification_helper, $this->current_page_helper, $this->options_helper, - $this->capability_helper + $this->capability_helper, ); } @@ -107,23 +107,23 @@ public function set_up() { public function test_constructor() { self::assertInstanceOf( Yoast_Notification_Center::class, - self::getPropertyValue( $this->instance, 'notification_center' ) + self::getPropertyValue( $this->instance, 'notification_center' ), ); self::assertInstanceOf( Notification_Helper::class, - self::getPropertyValue( $this->instance, 'notification_helper' ) + self::getPropertyValue( $this->instance, 'notification_helper' ), ); self::assertInstanceOf( Current_Page_Helper::class, - self::getPropertyValue( $this->instance, 'current_page_helper' ) + self::getPropertyValue( $this->instance, 'current_page_helper' ), ); self::assertInstanceOf( Options_Helper::class, - self::getPropertyValue( $this->instance, 'options_helper' ) + self::getPropertyValue( $this->instance, 'options_helper' ), ); self::assertInstanceOf( Capability_Helper::class, - self::getPropertyValue( $this->instance, 'capability_helper' ) + self::getPropertyValue( $this->instance, 'capability_helper' ), ); } diff --git a/tests/Unit/Integrations/Watchers/Woocommerce_Beta_Editor_Watcher_Test.php b/tests/Unit/Integrations/Watchers/Woocommerce_Beta_Editor_Watcher_Test.php index edccab9652b..fce942f56b9 100644 --- a/tests/Unit/Integrations/Watchers/Woocommerce_Beta_Editor_Watcher_Test.php +++ b/tests/Unit/Integrations/Watchers/Woocommerce_Beta_Editor_Watcher_Test.php @@ -76,7 +76,7 @@ public function set_up() { $this->notification_center, $this->notification_helper, $this->short_link_helper, - $this->woocommerce_conditional + $this->woocommerce_conditional, ); } @@ -90,15 +90,15 @@ public function set_up() { public function test_constructor() { self::assertInstanceOf( Yoast_Notification_Center::class, - self::getPropertyValue( $this->instance, 'notification_center' ) + self::getPropertyValue( $this->instance, 'notification_center' ), ); self::assertInstanceOf( Notification_Helper::class, - self::getPropertyValue( $this->instance, 'notification_helper' ) + self::getPropertyValue( $this->instance, 'notification_helper' ), ); self::assertInstanceOf( Short_Link_Helper::class, - self::getPropertyValue( $this->instance, 'short_link_helper' ) + self::getPropertyValue( $this->instance, 'short_link_helper' ), ); } diff --git a/tests/Unit/Integrations/Woocommerce_Product_Category_Permalink_Integration_Test.php b/tests/Unit/Integrations/Woocommerce_Product_Category_Permalink_Integration_Test.php index 8b564a08fd3..f555b3b6129 100644 --- a/tests/Unit/Integrations/Woocommerce_Product_Category_Permalink_Integration_Test.php +++ b/tests/Unit/Integrations/Woocommerce_Product_Category_Permalink_Integration_Test.php @@ -45,7 +45,7 @@ protected function set_up() { $this->dynamic_product_permalinks_conditional = Mockery::mock( Dynamic_Product_Permalinks_Conditional::class ); $this->instance = new Woocommerce_Product_Category_Permalink_Integration( - $this->dynamic_product_permalinks_conditional + $this->dynamic_product_permalinks_conditional, ); } @@ -62,7 +62,7 @@ public function test_get_conditionals() { WooCommerce_Version_Conditional::class, Woo_SEO_Inactive_Conditional::class, ], - Woocommerce_Product_Category_Permalink_Integration::get_conditionals() + Woocommerce_Product_Category_Permalink_Integration::get_conditionals(), ); } @@ -76,7 +76,7 @@ public function test_get_conditionals() { public function test_constructor() { $this->assertInstanceOf( Dynamic_Product_Permalinks_Conditional::class, - $this->getPropertyValue( $this->instance, 'dynamic_product_permalinks_conditional' ) + $this->getPropertyValue( $this->instance, 'dynamic_product_permalinks_conditional' ), ); } @@ -92,7 +92,7 @@ public function test_register_hooks() { $this->assertNotFalse( \has_filter( 'wc_product_post_type_link_product_cat', [ $this->instance, 'restore_legacy_permalink_category' ] ), - 'Does not have expected wc_product_post_type_link_product_cat filter' + 'Does not have expected wc_product_post_type_link_product_cat filter', ); } @@ -150,7 +150,7 @@ public function test_restore_legacy_permalink_category_with_dynamic_permalinks_d [ 'parent' => 'DESC', 'term_id' => 'ASC', - ] + ], ) ->andReturn( $sorted_terms ); diff --git a/tests/Unit/Introductions/Application/AI_Brand_Insights_Post_Launch_Test.php b/tests/Unit/Introductions/Application/AI_Brand_Insights_Post_Launch_Test.php index 723f91f28ab..05063995bb3 100644 --- a/tests/Unit/Introductions/Application/AI_Brand_Insights_Post_Launch_Test.php +++ b/tests/Unit/Introductions/Application/AI_Brand_Insights_Post_Launch_Test.php @@ -55,7 +55,7 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( Current_Page_Helper::class, - $this->getPropertyValue( $this->instance, 'current_page_helper' ) + $this->getPropertyValue( $this->instance, 'current_page_helper' ), ); } diff --git a/tests/Unit/Introductions/Application/Ai_Fix_Assessments_Upsell_Test.php b/tests/Unit/Introductions/Application/Ai_Fix_Assessments_Upsell_Test.php index 1b1e5114a10..6127eb714f4 100644 --- a/tests/Unit/Introductions/Application/Ai_Fix_Assessments_Upsell_Test.php +++ b/tests/Unit/Introductions/Application/Ai_Fix_Assessments_Upsell_Test.php @@ -71,11 +71,11 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( Product_Helper::class, - $this->getPropertyValue( $this->instance, 'product_helper' ) + $this->getPropertyValue( $this->instance, 'product_helper' ), ); $this->assertInstanceOf( User_Helper::class, - $this->getPropertyValue( $this->instance, 'user_helper' ) + $this->getPropertyValue( $this->instance, 'user_helper' ), ); } diff --git a/tests/Unit/Introductions/Application/Black_Friday_Announcement_Test.php b/tests/Unit/Introductions/Application/Black_Friday_Announcement_Test.php index b8deff2c58b..dae27d56bfc 100644 --- a/tests/Unit/Introductions/Application/Black_Friday_Announcement_Test.php +++ b/tests/Unit/Introductions/Application/Black_Friday_Announcement_Test.php @@ -63,7 +63,7 @@ protected function set_up() { $this->instance = new Black_Friday_Announcement( $this->current_page_helper, $this->promotion_manager, - $this->product_helper + $this->product_helper, ); } @@ -77,15 +77,15 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( Current_Page_Helper::class, - $this->getPropertyValue( $this->instance, 'current_page_helper' ) + $this->getPropertyValue( $this->instance, 'current_page_helper' ), ); $this->assertInstanceOf( Promotion_Manager::class, - $this->getPropertyValue( $this->instance, 'promotion_manager' ) + $this->getPropertyValue( $this->instance, 'promotion_manager' ), ); $this->assertInstanceOf( Product_Helper::class, - $this->getPropertyValue( $this->instance, 'product_helper' ) + $this->getPropertyValue( $this->instance, 'product_helper' ), ); } diff --git a/tests/Unit/Introductions/Application/Google_Docs_Addon_Upsell_Test.php b/tests/Unit/Introductions/Application/Google_Docs_Addon_Upsell_Test.php index 7e099eb29e4..24e38191d55 100644 --- a/tests/Unit/Introductions/Application/Google_Docs_Addon_Upsell_Test.php +++ b/tests/Unit/Introductions/Application/Google_Docs_Addon_Upsell_Test.php @@ -73,17 +73,17 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( Product_Helper::class, - $this->getPropertyValue( $this->instance, 'product_helper' ) + $this->getPropertyValue( $this->instance, 'product_helper' ), ); $this->assertInstanceOf( User_Helper::class, - $this->getPropertyValue( $this->instance, 'user_helper' ) + $this->getPropertyValue( $this->instance, 'user_helper' ), ); $this->assertInstanceOf( Current_Page_Helper::class, - $this->getPropertyValue( $this->instance, 'current_page_helper' ) + $this->getPropertyValue( $this->instance, 'current_page_helper' ), ); } diff --git a/tests/Unit/Introductions/Domain/Introduction_Item_Test.php b/tests/Unit/Introductions/Domain/Introduction_Item_Test.php index ab9c3aeae8d..f3680a8c890 100644 --- a/tests/Unit/Introductions/Domain/Introduction_Item_Test.php +++ b/tests/Unit/Introductions/Domain/Introduction_Item_Test.php @@ -56,7 +56,7 @@ public function test_to_array() { 'id' => 'test', 'priority' => 5, ], - $this->instance->to_array() + $this->instance->to_array(), ); } diff --git a/tests/Unit/Introductions/Domain/Introductions_Bucket_Test.php b/tests/Unit/Introductions/Domain/Introductions_Bucket_Test.php index 72f987dda5f..e23c0d4c1d9 100644 --- a/tests/Unit/Introductions/Domain/Introductions_Bucket_Test.php +++ b/tests/Unit/Introductions/Domain/Introductions_Bucket_Test.php @@ -67,7 +67,7 @@ public function test_to_array() { 'priority' => 2, ], ], - $instance->to_array() + $instance->to_array(), ); } } diff --git a/tests/Unit/Introductions/Infrastructure/Introductions_Seen_Repository_Test.php b/tests/Unit/Introductions/Infrastructure/Introductions_Seen_Repository_Test.php index 52299877f51..5ae04e6ee80 100644 --- a/tests/Unit/Introductions/Infrastructure/Introductions_Seen_Repository_Test.php +++ b/tests/Unit/Introductions/Infrastructure/Introductions_Seen_Repository_Test.php @@ -54,7 +54,7 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( User_Helper::class, - $this->getPropertyValue( $this->instance, 'user_helper' ) + $this->getPropertyValue( $this->instance, 'user_helper' ), ); } @@ -97,13 +97,13 @@ public static function provide_get_all_introductions_test_data() { 'meta' => [ 'foo' => [ 'is_seen' => true, - 'seen_on' => 12345678, + 'seen_on' => 12_345_678, ], ], 'expected' => [ 'foo' => [ 'is_seen' => true, - 'seen_on' => 12345678, + 'seen_on' => 12_345_678, ], ], ], @@ -190,7 +190,7 @@ public static function provide_is_introduction_seen_test_data() { 'meta' => [ 'foo' => [ 'is_seen' => true, - 'seen_on' => 12345678, + 'seen_on' => 12_345_678, ], ], 'expected' => true, @@ -210,7 +210,7 @@ public static function provide_is_introduction_seen_test_data() { 'meta' => [ 'foo' => [ 'is_seen' => 1, - 'seen_on' => 12345678, + 'seen_on' => 12_345_678, ], ], 'expected' => true, @@ -225,7 +225,7 @@ public static function provide_is_introduction_seen_test_data() { 'meta' => [ 'foo' => [ 'is_seen' => '1', - 'seen_on' => 12345678, + 'seen_on' => 12_345_678, ], ], 'expected' => true, @@ -298,13 +298,13 @@ public static function provide_set_introduction_test_data() { 'meta' => [ 'foo' => [ 'is_seen' => true, - 'seen_on' => 12345678, + 'seen_on' => 12_345_678, ], ], 'expected_meta' => [ 'foo' => [ 'is_seen' => true, - 'seen_on' => 12345678, + 'seen_on' => 12_345_678, ], ], ], diff --git a/tests/Unit/Introductions/Infrastructure/Wistia_Embed_Permission_Repository_Test.php b/tests/Unit/Introductions/Infrastructure/Wistia_Embed_Permission_Repository_Test.php index 77a9782cd73..59bddedf869 100644 --- a/tests/Unit/Introductions/Infrastructure/Wistia_Embed_Permission_Repository_Test.php +++ b/tests/Unit/Introductions/Infrastructure/Wistia_Embed_Permission_Repository_Test.php @@ -54,7 +54,7 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( User_Helper::class, - $this->getPropertyValue( $this->instance, 'user_helper' ) + $this->getPropertyValue( $this->instance, 'user_helper' ), ); } diff --git a/tests/Unit/Introductions/User_Interface/Introductions_Integration_Test.php b/tests/Unit/Introductions/User_Interface/Introductions_Integration_Test.php index 2125ca980a6..19812998b82 100644 --- a/tests/Unit/Introductions/User_Interface/Introductions_Integration_Test.php +++ b/tests/Unit/Introductions/User_Interface/Introductions_Integration_Test.php @@ -106,7 +106,7 @@ protected function set_up() { $this->user_helper, $this->short_link_helper, $this->wistia_embed_permission_repository, - $this->woocommerce_conditional + $this->woocommerce_conditional, ); } @@ -131,31 +131,31 @@ public function test_get_conditionals() { public function test_constructor() { $this->assertInstanceOf( WPSEO_Admin_Asset_Manager::class, - $this->getPropertyValue( $this->instance, 'admin_asset_manager' ) + $this->getPropertyValue( $this->instance, 'admin_asset_manager' ), ); $this->assertInstanceOf( Introductions_Collector::class, - $this->getPropertyValue( $this->instance, 'introductions_collector' ) + $this->getPropertyValue( $this->instance, 'introductions_collector' ), ); $this->assertInstanceOf( Product_Helper::class, - $this->getPropertyValue( $this->instance, 'product_helper' ) + $this->getPropertyValue( $this->instance, 'product_helper' ), ); $this->assertInstanceOf( User_Helper::class, - $this->getPropertyValue( $this->instance, 'user_helper' ) + $this->getPropertyValue( $this->instance, 'user_helper' ), ); $this->assertInstanceOf( Short_Link_Helper::class, - $this->getPropertyValue( $this->instance, 'short_link_helper' ) + $this->getPropertyValue( $this->instance, 'short_link_helper' ), ); $this->assertInstanceOf( Wistia_Embed_Permission_Repository::class, - $this->getPropertyValue( $this->instance, 'wistia_embed_permission_repository' ) + $this->getPropertyValue( $this->instance, 'wistia_embed_permission_repository' ), ); $this->assertInstanceOf( WooCommerce_Conditional::class, - $this->getPropertyValue( $this->instance, 'woocommerce_conditional' ) + $this->getPropertyValue( $this->instance, 'woocommerce_conditional' ), ); } @@ -368,7 +368,7 @@ private function expect_localized_data_for( $introductions, $user_id ) { 'pluginUrl' => $plugin_url, 'wistiaEmbedPermission' => $wistia_embed_permission, 'isWooEnabled' => true, - ] + ], ); } } diff --git a/tests/Unit/Introductions/User_Interface/Introductions_Seen_Route_Test.php b/tests/Unit/Introductions/User_Interface/Introductions_Seen_Route_Test.php index 6f995b4daea..cb044a4b74c 100644 --- a/tests/Unit/Introductions/User_Interface/Introductions_Seen_Route_Test.php +++ b/tests/Unit/Introductions/User_Interface/Introductions_Seen_Route_Test.php @@ -78,11 +78,11 @@ protected function set_up() { public function test_construct() { $this->assertInstanceOf( Introductions_Seen_Repository::class, - $this->getPropertyValue( $this->instance, 'introductions_seen_repository' ) + $this->getPropertyValue( $this->instance, 'introductions_seen_repository' ), ); $this->assertInstanceOf( User_Helper::class, - $this->getPropertyValue( $this->instance, 'user_helper' ) + $this->getPropertyValue( $this->instance, 'user_helper' ), ); } @@ -129,7 +129,7 @@ public function test_register_routes() { ], ], ], - ] + ], ); $this->instance->register_routes(); @@ -175,7 +175,7 @@ public function test_set_introduction_seen() { 'success' => true, ], ], - 200 + 200, ) ->once(); @@ -187,12 +187,12 @@ public function test_set_introduction_seen() { [ 'introduction_id' => $introduction_id, 'is_seen' => true, - ] + ], ); $this->assertInstanceOf( 'WP_REST_Response', - $this->instance->set_introduction_seen( $wp_rest_request ) + $this->instance->set_introduction_seen( $wp_rest_request ), ); } @@ -223,7 +223,7 @@ public function test_set_introduction_seen_failed() { 'success' => false, ], ], - 400 + 400, ) ->once(); @@ -235,12 +235,12 @@ public function test_set_introduction_seen_failed() { [ 'introduction_id' => $introduction_id, 'is_seen' => true, - ] + ], ); $this->assertInstanceOf( 'WP_REST_Response', - $this->instance->set_introduction_seen( $wp_rest_request ) + $this->instance->set_introduction_seen( $wp_rest_request ), ); } @@ -270,12 +270,12 @@ public function test_set_wistia_embed_permission_with_error() { [ 'introduction_id' => $introduction_id, 'is_seen' => true, - ] + ], ); $this->assertInstanceOf( 'WP_Error', - $this->instance->set_introduction_seen( $wp_rest_request ) + $this->instance->set_introduction_seen( $wp_rest_request ), ); } @@ -297,7 +297,7 @@ public function test_set_introduction_seen_invalid_id() { ->expects( '__construct' ) ->with( [], - 400 + 400, ) ->once(); @@ -309,12 +309,12 @@ public function test_set_introduction_seen_invalid_id() { [ 'introduction_id' => $introduction_id, 'is_seen' => true, - ] + ], ); $this->assertInstanceOf( 'WP_REST_Response', - $this->instance->set_introduction_seen( $wp_rest_request ) + $this->instance->set_introduction_seen( $wp_rest_request ), ); } } diff --git a/tests/Unit/Introductions/User_Interface/Wistia_Embed_Permission_Route_Test.php b/tests/Unit/Introductions/User_Interface/Wistia_Embed_Permission_Route_Test.php index 29f491f37e4..5e83434863d 100644 --- a/tests/Unit/Introductions/User_Interface/Wistia_Embed_Permission_Route_Test.php +++ b/tests/Unit/Introductions/User_Interface/Wistia_Embed_Permission_Route_Test.php @@ -69,11 +69,11 @@ protected function set_up() { public function test_construct() { $this->assertInstanceOf( Wistia_Embed_Permission_Repository::class, - $this->getPropertyValue( $this->instance, 'wistia_embed_permission_repository' ) + $this->getPropertyValue( $this->instance, 'wistia_embed_permission_repository' ), ); $this->assertInstanceOf( User_Helper::class, - $this->getPropertyValue( $this->instance, 'user_helper' ) + $this->getPropertyValue( $this->instance, 'user_helper' ), ); } @@ -119,7 +119,7 @@ public function test_register_routes() { ], ], ], - ] + ], ); $this->instance->register_routes(); @@ -162,13 +162,13 @@ public function test_get_wistia_embed_permission() { 'json' => (object) [ 'value' => true, ], - ] + ], ) ->once(); $this->assertInstanceOf( 'WP_REST_Response', - $this->instance->get_wistia_embed_permission() + $this->instance->get_wistia_embed_permission(), ); } @@ -190,7 +190,7 @@ public function test_get_wistia_embed_permission_with_error() { $this->assertInstanceOf( 'WP_Error', - $this->instance->get_wistia_embed_permission() + $this->instance->get_wistia_embed_permission(), ); } @@ -219,7 +219,7 @@ public function test_set_wistia_embed_permission() { 'success' => true, ], ], - 200 + 200, ) ->once(); @@ -231,7 +231,7 @@ public function test_set_wistia_embed_permission() { $this->assertInstanceOf( 'WP_REST_Response', - $this->instance->set_wistia_embed_permission( $wp_rest_request ) + $this->instance->set_wistia_embed_permission( $wp_rest_request ), ); } @@ -260,7 +260,7 @@ public function test_set_wistia_embed_permission_failed() { 'success' => false, ], ], - 400 + 400, ) ->once(); @@ -272,7 +272,7 @@ public function test_set_wistia_embed_permission_failed() { $this->assertInstanceOf( 'WP_REST_Response', - $this->instance->set_wistia_embed_permission( $wp_rest_request ) + $this->instance->set_wistia_embed_permission( $wp_rest_request ), ); } @@ -300,7 +300,7 @@ public function test_set_wistia_embed_permission_with_error() { $this->assertInstanceOf( 'WP_Error', - $this->instance->set_wistia_embed_permission( $wp_rest_request ) + $this->instance->set_wistia_embed_permission( $wp_rest_request ), ); } } diff --git a/tests/Unit/Llms_Txt/Application/Configuration/Abstract_Llms_Txt_Configuration_Test.php b/tests/Unit/Llms_Txt/Application/Configuration/Abstract_Llms_Txt_Configuration_Test.php index dff3c704caa..7ea96590c57 100644 --- a/tests/Unit/Llms_Txt/Application/Configuration/Abstract_Llms_Txt_Configuration_Test.php +++ b/tests/Unit/Llms_Txt/Application/Configuration/Abstract_Llms_Txt_Configuration_Test.php @@ -60,7 +60,7 @@ protected function set_up() { $this->instance = new Llms_Txt_Configuration( $this->runner, $this->post_type_helper, - $this->options_helper + $this->options_helper, ); } } diff --git a/tests/Unit/Llms_Txt/Application/Configuration/Llms_Txt_Configuration_Constructor_Test.php b/tests/Unit/Llms_Txt/Application/Configuration/Llms_Txt_Configuration_Constructor_Test.php index 432038714f7..2fa1209b019 100644 --- a/tests/Unit/Llms_Txt/Application/Configuration/Llms_Txt_Configuration_Constructor_Test.php +++ b/tests/Unit/Llms_Txt/Application/Configuration/Llms_Txt_Configuration_Constructor_Test.php @@ -26,15 +26,15 @@ final class Llms_Txt_Configuration_Constructor_Test extends Abstract_Llms_Txt_Co public function test_constructor() { $this->assertInstanceOf( File_Runner::class, - $this->getPropertyValue( $this->instance, 'runner' ) + $this->getPropertyValue( $this->instance, 'runner' ), ); $this->assertInstanceOf( Post_Type_Helper::class, - $this->getPropertyValue( $this->instance, 'post_type_helper' ) + $this->getPropertyValue( $this->instance, 'post_type_helper' ), ); $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); } } diff --git a/tests/Unit/Llms_Txt/Application/File/Commands/Populate_File/Abstract_Populate_File_Command_Handler_Test.php b/tests/Unit/Llms_Txt/Application/File/Commands/Populate_File/Abstract_Populate_File_Command_Handler_Test.php index 36e04da278e..9c2aaa86db2 100644 --- a/tests/Unit/Llms_Txt/Application/File/Commands/Populate_File/Abstract_Populate_File_Command_Handler_Test.php +++ b/tests/Unit/Llms_Txt/Application/File/Commands/Populate_File/Abstract_Populate_File_Command_Handler_Test.php @@ -71,7 +71,7 @@ protected function setUp(): void { $this->options_helper, $this->file_system_adapter, $this->markdown_builder, - $this->permission_gate + $this->permission_gate, ); } } diff --git a/tests/Unit/Llms_Txt/Application/File/Commands/Populate_File/Constructor_Test.php b/tests/Unit/Llms_Txt/Application/File/Commands/Populate_File/Constructor_Test.php index 6cde9929425..a5711ef31cd 100644 --- a/tests/Unit/Llms_Txt/Application/File/Commands/Populate_File/Constructor_Test.php +++ b/tests/Unit/Llms_Txt/Application/File/Commands/Populate_File/Constructor_Test.php @@ -27,19 +27,19 @@ final class Constructor_Test extends Abstract_Populate_File_Command_Handler_Test public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); $this->assertInstanceOf( WordPress_File_System_Adapter::class, - $this->getPropertyValue( $this->instance, 'file_system_adapter' ) + $this->getPropertyValue( $this->instance, 'file_system_adapter' ), ); $this->assertInstanceOf( Markdown_Builder::class, - $this->getPropertyValue( $this->instance, 'markdown_builder' ) + $this->getPropertyValue( $this->instance, 'markdown_builder' ), ); $this->assertInstanceOf( WordPress_Llms_Txt_Permission_Gate::class, - $this->getPropertyValue( $this->instance, 'permission_gate' ) + $this->getPropertyValue( $this->instance, 'permission_gate' ), ); } } diff --git a/tests/Unit/Llms_Txt/Application/File/Commands/Remove_File/Abstract_Remove_File_Command_Handler_Test.php b/tests/Unit/Llms_Txt/Application/File/Commands/Remove_File/Abstract_Remove_File_Command_Handler_Test.php index acc5338f821..5cf2403daf0 100644 --- a/tests/Unit/Llms_Txt/Application/File/Commands/Remove_File/Abstract_Remove_File_Command_Handler_Test.php +++ b/tests/Unit/Llms_Txt/Application/File/Commands/Remove_File/Abstract_Remove_File_Command_Handler_Test.php @@ -61,7 +61,7 @@ protected function setUp(): void { $this->instance = new Remove_File_Command_Handler( $this->options_helper, $this->file_system_adapter, - $this->permission_gate + $this->permission_gate, ); } } diff --git a/tests/Unit/Llms_Txt/Application/File/Commands/Remove_File/Constructor_Test.php b/tests/Unit/Llms_Txt/Application/File/Commands/Remove_File/Constructor_Test.php index a895f8c9941..ae28d08bf9c 100644 --- a/tests/Unit/Llms_Txt/Application/File/Commands/Remove_File/Constructor_Test.php +++ b/tests/Unit/Llms_Txt/Application/File/Commands/Remove_File/Constructor_Test.php @@ -26,15 +26,15 @@ final class Constructor_Test extends Abstract_Remove_File_Command_Handler_Test { public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); $this->assertInstanceOf( WordPress_File_System_Adapter::class, - $this->getPropertyValue( $this->instance, 'file_system_adapter' ) + $this->getPropertyValue( $this->instance, 'file_system_adapter' ), ); $this->assertInstanceOf( WordPress_Llms_Txt_Permission_Gate::class, - $this->getPropertyValue( $this->instance, 'permission_gate' ) + $this->getPropertyValue( $this->instance, 'permission_gate' ), ); } } diff --git a/tests/Unit/Llms_Txt/Application/File/Llms_Txt_Cron_Scheduler/Constructor_Test.php b/tests/Unit/Llms_Txt/Application/File/Llms_Txt_Cron_Scheduler/Constructor_Test.php index 71ce9a61afa..6102bdd142f 100644 --- a/tests/Unit/Llms_Txt/Application/File/Llms_Txt_Cron_Scheduler/Constructor_Test.php +++ b/tests/Unit/Llms_Txt/Application/File/Llms_Txt_Cron_Scheduler/Constructor_Test.php @@ -23,7 +23,7 @@ final class Constructor_Test extends Abstract_Llms_Txt_Cron_Scheduler_Test { public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); } } diff --git a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Description_Builder/Abstract_Description_Builder_Test.php b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Description_Builder/Abstract_Description_Builder_Test.php index 9fbce44f92d..aafc90336e1 100644 --- a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Description_Builder/Abstract_Description_Builder_Test.php +++ b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Description_Builder/Abstract_Description_Builder_Test.php @@ -41,7 +41,7 @@ protected function set_up() { $this->description_adapter = Mockery::mock( Description_Adapter::class ); $this->instance = new Description_Builder( - $this->description_adapter + $this->description_adapter, ); } } diff --git a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Description_Builder/Constructor_Test.php b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Description_Builder/Constructor_Test.php index 8c0bc487b5b..4b4d8be6ed3 100644 --- a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Description_Builder/Constructor_Test.php +++ b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Description_Builder/Constructor_Test.php @@ -23,7 +23,7 @@ final class Constructor_Test extends Abstract_Description_Builder_Test { public function test_constructor() { $this->assertInstanceOf( Description_Adapter::class, - $this->getPropertyValue( $this->instance, 'description_adapter' ) + $this->getPropertyValue( $this->instance, 'description_adapter' ), ); } } diff --git a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Intro_Builder/Build_Intro_Test.php b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Intro_Builder/Build_Intro_Test.php index d2604dcf487..6251c6bf8b6 100644 --- a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Intro_Builder/Build_Intro_Test.php +++ b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Intro_Builder/Build_Intro_Test.php @@ -24,7 +24,7 @@ final class Build_Intro_Test extends Abstract_Intro_Builder_Test { public function test_build_intro() { $built_intro = new Intro( 'Generated by Yoast SEO v1.0, this is an llms.txt file, meant for consumption by LLMs.', - [] + [], ); $this->assertEquals( $built_intro, $this->instance->build_intro() ); } diff --git a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Link_Lists_Builder/Abstract_Link_Lists_Builder_Test.php b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Link_Lists_Builder/Abstract_Link_Lists_Builder_Test.php index b57f2757df5..83e53b50076 100644 --- a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Link_Lists_Builder/Abstract_Link_Lists_Builder_Test.php +++ b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Link_Lists_Builder/Abstract_Link_Lists_Builder_Test.php @@ -51,7 +51,7 @@ protected function set_up() { $this->instance = new Link_Lists_Builder( $this->content_types_collector, - $this->terms_collector + $this->terms_collector, ); } } diff --git a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Link_Lists_Builder/Constructor_Test.php b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Link_Lists_Builder/Constructor_Test.php index 3bcffd0321c..2ea5438258c 100644 --- a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Link_Lists_Builder/Constructor_Test.php +++ b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Link_Lists_Builder/Constructor_Test.php @@ -24,11 +24,11 @@ final class Constructor_Test extends Abstract_Link_Lists_Builder_Test { public function test_constructor() { $this->assertInstanceOf( Content_Types_Collector::class, - $this->getPropertyValue( $this->instance, 'content_types_collector' ) + $this->getPropertyValue( $this->instance, 'content_types_collector' ), ); $this->assertInstanceOf( Terms_Collector::class, - $this->getPropertyValue( $this->instance, 'terms_collector' ) + $this->getPropertyValue( $this->instance, 'terms_collector' ), ); } } diff --git a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Markdown_Builder/Abstract_Markdown_Builder_Test.php b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Markdown_Builder/Abstract_Markdown_Builder_Test.php index f2606dc9b4a..0289addf717 100644 --- a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Markdown_Builder/Abstract_Markdown_Builder_Test.php +++ b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Markdown_Builder/Abstract_Markdown_Builder_Test.php @@ -101,7 +101,7 @@ protected function set_up() { $this->description_builder, $this->link_lists_builder, $this->markdown_escaper, - $this->optional_link_list_builder + $this->optional_link_list_builder, ); } } diff --git a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Markdown_Builder/Constructor_Test.php b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Markdown_Builder/Constructor_Test.php index db3040dd377..055858897cb 100644 --- a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Markdown_Builder/Constructor_Test.php +++ b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Markdown_Builder/Constructor_Test.php @@ -29,31 +29,31 @@ final class Constructor_Test extends Abstract_Markdown_Builder_Test { public function test_constructor() { $this->assertInstanceOf( Llms_Txt_Renderer::class, - $this->getPropertyValue( $this->instance, 'llms_txt_renderer' ) + $this->getPropertyValue( $this->instance, 'llms_txt_renderer' ), ); $this->assertInstanceOf( Intro_Builder::class, - $this->getPropertyValue( $this->instance, 'intro_builder' ) + $this->getPropertyValue( $this->instance, 'intro_builder' ), ); $this->assertInstanceOf( Title_Builder::class, - $this->getPropertyValue( $this->instance, 'title_builder' ) + $this->getPropertyValue( $this->instance, 'title_builder' ), ); $this->assertInstanceOf( Description_Builder::class, - $this->getPropertyValue( $this->instance, 'description_builder' ) + $this->getPropertyValue( $this->instance, 'description_builder' ), ); $this->assertInstanceOf( Link_Lists_Builder::class, - $this->getPropertyValue( $this->instance, 'link_lists_builder' ) + $this->getPropertyValue( $this->instance, 'link_lists_builder' ), ); $this->assertInstanceOf( Markdown_Escaper::class, - $this->getPropertyValue( $this->instance, 'markdown_escaper' ) + $this->getPropertyValue( $this->instance, 'markdown_escaper' ), ); $this->assertInstanceOf( Optional_Link_List_Builder::class, - $this->getPropertyValue( $this->instance, 'optional_link_list_builder' ) + $this->getPropertyValue( $this->instance, 'optional_link_list_builder' ), ); } } diff --git a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Markdown_Builder/Render_Test.php b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Markdown_Builder/Render_Test.php index 30c0144ecf9..f72e8dd2537 100644 --- a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Markdown_Builder/Render_Test.php +++ b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Markdown_Builder/Render_Test.php @@ -68,7 +68,7 @@ public function test_render() { $built_link_list1, $built_link_list2, $optional_built_link_list, - ] + ], ); $built_intro->shouldReceive( 'escape_markdown' )->once()->with( $this->markdown_escaper ); diff --git a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Optional_Link_List_Builder/Abstract_Optional_Link_List_Builder_Test.php b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Optional_Link_List_Builder/Abstract_Optional_Link_List_Builder_Test.php index 24e9b423520..67b103b7ad1 100644 --- a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Optional_Link_List_Builder/Abstract_Optional_Link_List_Builder_Test.php +++ b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Optional_Link_List_Builder/Abstract_Optional_Link_List_Builder_Test.php @@ -41,7 +41,7 @@ protected function set_up() { $this->sitemap_link_collector = Mockery::mock( Sitemap_Link_Collector::class ); $this->instance = new Optional_Link_List_Builder( - $this->sitemap_link_collector + $this->sitemap_link_collector, ); } } diff --git a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Optional_Link_List_Builder/Constructor_Test.php b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Optional_Link_List_Builder/Constructor_Test.php index dc9e31597f2..9fe34e062e4 100644 --- a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Optional_Link_List_Builder/Constructor_Test.php +++ b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Optional_Link_List_Builder/Constructor_Test.php @@ -23,7 +23,7 @@ final class Constructor_Test extends Abstract_Optional_Link_List_Builder_Test { public function test_constructor() { $this->assertInstanceOf( Sitemap_Link_Collector::class, - $this->getPropertyValue( $this->instance, 'sitemap_link_collector' ) + $this->getPropertyValue( $this->instance, 'sitemap_link_collector' ), ); } } diff --git a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Title_Builder/Abstract_Title_Builder_Test.php b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Title_Builder/Abstract_Title_Builder_Test.php index d0d870ef0f8..88a80d59467 100644 --- a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Title_Builder/Abstract_Title_Builder_Test.php +++ b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Title_Builder/Abstract_Title_Builder_Test.php @@ -41,7 +41,7 @@ protected function set_up() { $this->title_adapter = Mockery::mock( Title_Adapter::class ); $this->instance = new Title_Builder( - $this->title_adapter + $this->title_adapter, ); } } diff --git a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Title_Builder/Constructor_Test.php b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Title_Builder/Constructor_Test.php index d32a5dbeb76..66645cae8d2 100644 --- a/tests/Unit/Llms_Txt/Application/Markdown_Builders/Title_Builder/Constructor_Test.php +++ b/tests/Unit/Llms_Txt/Application/Markdown_Builders/Title_Builder/Constructor_Test.php @@ -23,7 +23,7 @@ final class Constructor_Test extends Abstract_Title_Builder_Test { public function test_constructor() { $this->assertInstanceOf( Title_Adapter::class, - $this->getPropertyValue( $this->instance, 'title_adapter' ) + $this->getPropertyValue( $this->instance, 'title_adapter' ), ); } } diff --git a/tests/Unit/Llms_Txt/Infrastructure/Content_Types_Collector/Abstract_Content_Types_Collector_Test.php b/tests/Unit/Llms_Txt/Infrastructure/Content_Types_Collector/Abstract_Content_Types_Collector_Test.php index 7c4995fc178..d5d523339ac 100644 --- a/tests/Unit/Llms_Txt/Infrastructure/Content_Types_Collector/Abstract_Content_Types_Collector_Test.php +++ b/tests/Unit/Llms_Txt/Infrastructure/Content_Types_Collector/Abstract_Content_Types_Collector_Test.php @@ -77,7 +77,7 @@ protected function set_up() { $this->instance = new Content_Types_Collector( $this->post_type_helper, $this->post_collection_factory, - $this->options_helper + $this->options_helper, ); } } diff --git a/tests/Unit/Llms_Txt/Infrastructure/Content_Types_Collector/Constructor_Test.php b/tests/Unit/Llms_Txt/Infrastructure/Content_Types_Collector/Constructor_Test.php index bdf3caa77b8..a5032f45b0f 100644 --- a/tests/Unit/Llms_Txt/Infrastructure/Content_Types_Collector/Constructor_Test.php +++ b/tests/Unit/Llms_Txt/Infrastructure/Content_Types_Collector/Constructor_Test.php @@ -25,15 +25,15 @@ final class Constructor_Test extends Abstract_Content_Types_Collector_Test { public function test_constructor() { $this->assertInstanceOf( Post_Type_Helper::class, - $this->getPropertyValue( $this->instance, 'post_type_helper' ) + $this->getPropertyValue( $this->instance, 'post_type_helper' ), ); $this->assertInstanceOf( Post_Collection_Factory::class, - $this->getPropertyValue( $this->instance, 'collection_factory' ) + $this->getPropertyValue( $this->instance, 'collection_factory' ), ); $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); } } diff --git a/tests/Unit/Llms_Txt/Infrastructure/Description_Adapter/Abstract_Description_Adapter_Test.php b/tests/Unit/Llms_Txt/Infrastructure/Description_Adapter/Abstract_Description_Adapter_Test.php index e220ee215e7..3b171d0595e 100644 --- a/tests/Unit/Llms_Txt/Infrastructure/Description_Adapter/Abstract_Description_Adapter_Test.php +++ b/tests/Unit/Llms_Txt/Infrastructure/Description_Adapter/Abstract_Description_Adapter_Test.php @@ -41,7 +41,7 @@ protected function set_up() { $this->meta = Mockery::mock( Meta_Surface::class ); $this->instance = new Description_Adapter( - $this->meta + $this->meta, ); } } diff --git a/tests/Unit/Llms_Txt/Infrastructure/Description_Adapter/Constructor_Test.php b/tests/Unit/Llms_Txt/Infrastructure/Description_Adapter/Constructor_Test.php index a13378a0907..7dd78cfabc8 100644 --- a/tests/Unit/Llms_Txt/Infrastructure/Description_Adapter/Constructor_Test.php +++ b/tests/Unit/Llms_Txt/Infrastructure/Description_Adapter/Constructor_Test.php @@ -23,7 +23,7 @@ final class Constructor_Test extends Abstract_Description_Adapter_Test { public function test_constructor() { $this->assertInstanceOf( Meta_Surface::class, - $this->getPropertyValue( $this->instance, 'meta' ) + $this->getPropertyValue( $this->instance, 'meta' ), ); } } diff --git a/tests/Unit/Llms_Txt/Infrastructure/Terms_Collector/Abstract_Terms_Collector_Test.php b/tests/Unit/Llms_Txt/Infrastructure/Terms_Collector/Abstract_Terms_Collector_Test.php index 9237114b62a..124c1deedfe 100644 --- a/tests/Unit/Llms_Txt/Infrastructure/Terms_Collector/Abstract_Terms_Collector_Test.php +++ b/tests/Unit/Llms_Txt/Infrastructure/Terms_Collector/Abstract_Terms_Collector_Test.php @@ -41,7 +41,7 @@ protected function set_up() { $this->taxonomy_helper = Mockery::mock( Taxonomy_Helper::class ); $this->instance = new Terms_Collector( - $this->taxonomy_helper + $this->taxonomy_helper, ); } } diff --git a/tests/Unit/Llms_Txt/Infrastructure/Terms_Collector/Constructor_Test.php b/tests/Unit/Llms_Txt/Infrastructure/Terms_Collector/Constructor_Test.php index 809295b5fcf..a85e73a728c 100644 --- a/tests/Unit/Llms_Txt/Infrastructure/Terms_Collector/Constructor_Test.php +++ b/tests/Unit/Llms_Txt/Infrastructure/Terms_Collector/Constructor_Test.php @@ -23,7 +23,7 @@ final class Constructor_Test extends Abstract_Terms_Collector_Test { public function test_constructor() { $this->assertInstanceOf( Taxonomy_Helper::class, - $this->getPropertyValue( $this->instance, 'taxonomy_helper' ) + $this->getPropertyValue( $this->instance, 'taxonomy_helper' ), ); } } diff --git a/tests/Unit/Llms_Txt/Infrastructure/Title_Adapter/Abstract_Title_Adapter_Test.php b/tests/Unit/Llms_Txt/Infrastructure/Title_Adapter/Abstract_Title_Adapter_Test.php index 762be8fb8a1..0961221be78 100644 --- a/tests/Unit/Llms_Txt/Infrastructure/Title_Adapter/Abstract_Title_Adapter_Test.php +++ b/tests/Unit/Llms_Txt/Infrastructure/Title_Adapter/Abstract_Title_Adapter_Test.php @@ -41,7 +41,7 @@ protected function set_up() { $this->default_tagline_runner = Mockery::mock( Default_Tagline_Runner::class ); $this->instance = new Title_Adapter( - $this->default_tagline_runner + $this->default_tagline_runner, ); } } diff --git a/tests/Unit/Llms_Txt/Infrastructure/Title_Adapter/Constructor_Test.php b/tests/Unit/Llms_Txt/Infrastructure/Title_Adapter/Constructor_Test.php index 55418b056a7..ae304e2caa3 100644 --- a/tests/Unit/Llms_Txt/Infrastructure/Title_Adapter/Constructor_Test.php +++ b/tests/Unit/Llms_Txt/Infrastructure/Title_Adapter/Constructor_Test.php @@ -23,7 +23,7 @@ final class Constructor_Test extends Abstract_Title_Adapter_Test { public function test_constructor() { $this->assertInstanceOf( Default_Tagline_Runner::class, - $this->getPropertyValue( $this->instance, 'default_tagline_runner' ) + $this->getPropertyValue( $this->instance, 'default_tagline_runner' ), ); } } diff --git a/tests/Unit/Llms_Txt/User_Interface/Available_Posts/Abstract_Available_Posts_Route_Test.php b/tests/Unit/Llms_Txt/User_Interface/Available_Posts/Abstract_Available_Posts_Route_Test.php index e3a5b9b864e..17b61b2445e 100644 --- a/tests/Unit/Llms_Txt/User_Interface/Available_Posts/Abstract_Available_Posts_Route_Test.php +++ b/tests/Unit/Llms_Txt/User_Interface/Available_Posts/Abstract_Available_Posts_Route_Test.php @@ -52,7 +52,7 @@ protected function set_up() { $this->instance = new Available_Posts_Route( $this->available_posts_repository, - $this->capability_helper + $this->capability_helper, ); } } diff --git a/tests/Unit/Llms_Txt/User_Interface/Available_Posts/Available_Posts_Route_Constructor_Test.php b/tests/Unit/Llms_Txt/User_Interface/Available_Posts/Available_Posts_Route_Constructor_Test.php index d0ed1fb0cd2..ac5358f88b8 100644 --- a/tests/Unit/Llms_Txt/User_Interface/Available_Posts/Available_Posts_Route_Constructor_Test.php +++ b/tests/Unit/Llms_Txt/User_Interface/Available_Posts/Available_Posts_Route_Constructor_Test.php @@ -25,12 +25,12 @@ final class Available_Posts_Route_Constructor_Test extends Abstract_Available_Po public function test_construct() { $this->assertInstanceOf( Available_Posts_Repository::class, - $this->getPropertyValue( $this->instance, 'available_posts_repository' ) + $this->getPropertyValue( $this->instance, 'available_posts_repository' ), ); $this->assertInstanceOf( Capability_Helper::class, - $this->getPropertyValue( $this->instance, 'capability_helper' ) + $this->getPropertyValue( $this->instance, 'capability_helper' ), ); } } diff --git a/tests/Unit/Llms_Txt/User_Interface/Available_Posts/Available_Posts_Route_Get_Posts_Test.php b/tests/Unit/Llms_Txt/User_Interface/Available_Posts/Available_Posts_Route_Get_Posts_Test.php index 580b6e81b04..22588237aaa 100644 --- a/tests/Unit/Llms_Txt/User_Interface/Available_Posts/Available_Posts_Route_Get_Posts_Test.php +++ b/tests/Unit/Llms_Txt/User_Interface/Available_Posts/Available_Posts_Route_Get_Posts_Test.php @@ -87,15 +87,15 @@ static function ( $request_parameters ) use ( $post_type, $search ) { return $request_parameters instanceof Parameters && $request_parameters->get_post_type() === $post_type && $request_parameters->get_search_filter() === $search; - } - ) + }, + ), ) ->times( $available_posts_times ) ->andReturn( $data_container_mock ); $this->assertInstanceOf( 'WP_REST_Response', - $this->instance->get_available_posts( $wp_rest_request ) + $this->instance->get_available_posts( $wp_rest_request ), ); } diff --git a/tests/Unit/Llms_Txt/User_Interface/Available_Posts/Available_Posts_Route_Register_Routes_Test.php b/tests/Unit/Llms_Txt/User_Interface/Available_Posts/Available_Posts_Route_Register_Routes_Test.php index 170ee7291be..dfa0c7071a1 100644 --- a/tests/Unit/Llms_Txt/User_Interface/Available_Posts/Available_Posts_Route_Register_Routes_Test.php +++ b/tests/Unit/Llms_Txt/User_Interface/Available_Posts/Available_Posts_Route_Register_Routes_Test.php @@ -45,7 +45,7 @@ public function test_register_routes() { ], ], ], - ] + ], ); $this->instance->register_routes(); diff --git a/tests/Unit/Llms_Txt/User_Interface/Cleanup_Llms_Txt_On_Deactivation/Abstract_Cleanup_Llms_Txt_On_Deactivation_Test.php b/tests/Unit/Llms_Txt/User_Interface/Cleanup_Llms_Txt_On_Deactivation/Abstract_Cleanup_Llms_Txt_On_Deactivation_Test.php index c5a9e835f2f..e69c4dd2226 100644 --- a/tests/Unit/Llms_Txt/User_Interface/Cleanup_Llms_Txt_On_Deactivation/Abstract_Cleanup_Llms_Txt_On_Deactivation_Test.php +++ b/tests/Unit/Llms_Txt/User_Interface/Cleanup_Llms_Txt_On_Deactivation/Abstract_Cleanup_Llms_Txt_On_Deactivation_Test.php @@ -53,7 +53,7 @@ protected function setUp(): void { $this->instance = new Cleanup_Llms_Txt_On_Deactivation( $this->command_handler, - $this->cron_scheduler + $this->cron_scheduler, ); } } diff --git a/tests/Unit/Llms_Txt/User_Interface/Cleanup_Llms_Txt_On_Deactivation/Constructor_Test.php b/tests/Unit/Llms_Txt/User_Interface/Cleanup_Llms_Txt_On_Deactivation/Constructor_Test.php index 3dcab5b0a2d..f7dafc8339e 100644 --- a/tests/Unit/Llms_Txt/User_Interface/Cleanup_Llms_Txt_On_Deactivation/Constructor_Test.php +++ b/tests/Unit/Llms_Txt/User_Interface/Cleanup_Llms_Txt_On_Deactivation/Constructor_Test.php @@ -24,11 +24,11 @@ final class Constructor_Test extends Abstract_Cleanup_Llms_Txt_On_Deactivation_T public function test_constructor() { $this->assertInstanceOf( Remove_File_Command_Handler::class, - $this->getPropertyValue( $this->instance, 'command_handler' ) + $this->getPropertyValue( $this->instance, 'command_handler' ), ); $this->assertInstanceOf( Llms_Txt_Cron_Scheduler::class, - $this->getPropertyValue( $this->instance, 'cron_scheduler' ) + $this->getPropertyValue( $this->instance, 'cron_scheduler' ), ); } } diff --git a/tests/Unit/Llms_Txt/User_Interface/Cleanup_Llms_Txt_On_Deactivation/Register_Hooks_Test.php b/tests/Unit/Llms_Txt/User_Interface/Cleanup_Llms_Txt_On_Deactivation/Register_Hooks_Test.php index 0e4bc628c11..274eab90d3e 100644 --- a/tests/Unit/Llms_Txt/User_Interface/Cleanup_Llms_Txt_On_Deactivation/Register_Hooks_Test.php +++ b/tests/Unit/Llms_Txt/User_Interface/Cleanup_Llms_Txt_On_Deactivation/Register_Hooks_Test.php @@ -25,8 +25,8 @@ public function test_register_hooks() { 10, \has_action( 'wpseo_deactivate', - [ $this->instance, 'maybe_remove_llms_file' ] - ) + [ $this->instance, 'maybe_remove_llms_file' ], + ), ); } } diff --git a/tests/Unit/Llms_Txt/User_Interface/Enable_Llms_Txt_Option_Watcher/Abstract_Enable_Llms_Txt_Option_Watcher_Test.php b/tests/Unit/Llms_Txt/User_Interface/Enable_Llms_Txt_Option_Watcher/Abstract_Enable_Llms_Txt_Option_Watcher_Test.php index f805ec346b4..39b094f1d75 100644 --- a/tests/Unit/Llms_Txt/User_Interface/Enable_Llms_Txt_Option_Watcher/Abstract_Enable_Llms_Txt_Option_Watcher_Test.php +++ b/tests/Unit/Llms_Txt/User_Interface/Enable_Llms_Txt_Option_Watcher/Abstract_Enable_Llms_Txt_Option_Watcher_Test.php @@ -74,7 +74,7 @@ protected function setUp(): void { $this->cron_scheduler, $this->command_handler, $this->populate_file_command_handler, - $this->options_helper + $this->options_helper, ); } } diff --git a/tests/Unit/Llms_Txt/User_Interface/Enable_Llms_Txt_Option_Watcher/Constructor_Test.php b/tests/Unit/Llms_Txt/User_Interface/Enable_Llms_Txt_Option_Watcher/Constructor_Test.php index b9f855bbbe0..4552d9885b2 100644 --- a/tests/Unit/Llms_Txt/User_Interface/Enable_Llms_Txt_Option_Watcher/Constructor_Test.php +++ b/tests/Unit/Llms_Txt/User_Interface/Enable_Llms_Txt_Option_Watcher/Constructor_Test.php @@ -25,15 +25,15 @@ final class Constructor_Test extends Abstract_Enable_Llms_Txt_Option_Watcher_Tes public function test_constructor() { $this->assertInstanceOf( Llms_Txt_Cron_Scheduler::class, - $this->getPropertyValue( $this->instance, 'scheduler' ) + $this->getPropertyValue( $this->instance, 'scheduler' ), ); $this->assertInstanceOf( Remove_File_Command_Handler::class, - $this->getPropertyValue( $this->instance, 'remove_file_command_handler' ) + $this->getPropertyValue( $this->instance, 'remove_file_command_handler' ), ); $this->assertInstanceOf( Populate_File_Command_Handler::class, - $this->getPropertyValue( $this->instance, 'populate_file_command_handler' ) + $this->getPropertyValue( $this->instance, 'populate_file_command_handler' ), ); } } diff --git a/tests/Unit/Llms_Txt/User_Interface/Enable_Llms_Txt_Option_Watcher/Register_Hooks_Test.php b/tests/Unit/Llms_Txt/User_Interface/Enable_Llms_Txt_Option_Watcher/Register_Hooks_Test.php index fa211be0458..1449445441f 100644 --- a/tests/Unit/Llms_Txt/User_Interface/Enable_Llms_Txt_Option_Watcher/Register_Hooks_Test.php +++ b/tests/Unit/Llms_Txt/User_Interface/Enable_Llms_Txt_Option_Watcher/Register_Hooks_Test.php @@ -25,8 +25,8 @@ public function test_register_hooks() { 10, \has_action( 'update_option_wpseo', - [ $this->instance, 'check_toggle_llms_txt' ] - ) + [ $this->instance, 'check_toggle_llms_txt' ], + ), ); } } diff --git a/tests/Unit/Llms_Txt/User_Interface/File_Failure_Llms_Txt_Notification_Integration/Abstract_File_Failure_Llms_Txt_Notification_Integration_Test.php b/tests/Unit/Llms_Txt/User_Interface/File_Failure_Llms_Txt_Notification_Integration/Abstract_File_Failure_Llms_Txt_Notification_Integration_Test.php index 8ba13d69540..32d9c7c4418 100644 --- a/tests/Unit/Llms_Txt/User_Interface/File_Failure_Llms_Txt_Notification_Integration/Abstract_File_Failure_Llms_Txt_Notification_Integration_Test.php +++ b/tests/Unit/Llms_Txt/User_Interface/File_Failure_Llms_Txt_Notification_Integration/Abstract_File_Failure_Llms_Txt_Notification_Integration_Test.php @@ -63,7 +63,7 @@ protected function set_up() { $this->instance = new File_Failure_Llms_Txt_Notification_Integration( $this->options_helper, $this->notification_center, - $this->file_failure_notification_presenter + $this->file_failure_notification_presenter, ); } } diff --git a/tests/Unit/Llms_Txt/User_Interface/File_Failure_Llms_Txt_Notification_Integration/Constructor_Test.php b/tests/Unit/Llms_Txt/User_Interface/File_Failure_Llms_Txt_Notification_Integration/Constructor_Test.php index 5f5baea5ce0..4ab21bb648c 100644 --- a/tests/Unit/Llms_Txt/User_Interface/File_Failure_Llms_Txt_Notification_Integration/Constructor_Test.php +++ b/tests/Unit/Llms_Txt/User_Interface/File_Failure_Llms_Txt_Notification_Integration/Constructor_Test.php @@ -25,15 +25,15 @@ final class Constructor_Test extends Abstract_File_Failure_Llms_Txt_Notification public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); $this->assertInstanceOf( Yoast_Notification_Center::class, - $this->getPropertyValue( $this->instance, 'notification_center' ) + $this->getPropertyValue( $this->instance, 'notification_center' ), ); $this->assertInstanceOf( File_Failure_Notification_Presenter::class, - $this->getPropertyValue( $this->instance, 'presenter' ) + $this->getPropertyValue( $this->instance, 'presenter' ), ); } } diff --git a/tests/Unit/Llms_Txt/User_Interface/File_Failure_Llms_Txt_Notification_Integration/Register_Hooks_Test.php b/tests/Unit/Llms_Txt/User_Interface/File_Failure_Llms_Txt_Notification_Integration/Register_Hooks_Test.php index 2b5635a3f1c..5c1968b807c 100644 --- a/tests/Unit/Llms_Txt/User_Interface/File_Failure_Llms_Txt_Notification_Integration/Register_Hooks_Test.php +++ b/tests/Unit/Llms_Txt/User_Interface/File_Failure_Llms_Txt_Notification_Integration/Register_Hooks_Test.php @@ -25,8 +25,8 @@ public function test_register_hooks() { 10, \has_action( 'admin_init', - [ $this->instance, 'maybe_show_notification' ] - ) + [ $this->instance, 'maybe_show_notification' ], + ), ); } } diff --git a/tests/Unit/Llms_Txt/User_Interface/Llms_Txt_Cron_Callback_Integration/Abstract_Llms_Txt_Cron_Callback_Integration_Test.php b/tests/Unit/Llms_Txt/User_Interface/Llms_Txt_Cron_Callback_Integration/Abstract_Llms_Txt_Cron_Callback_Integration_Test.php index dd343b44eb5..eed21e2db7c 100644 --- a/tests/Unit/Llms_Txt/User_Interface/Llms_Txt_Cron_Callback_Integration/Abstract_Llms_Txt_Cron_Callback_Integration_Test.php +++ b/tests/Unit/Llms_Txt/User_Interface/Llms_Txt_Cron_Callback_Integration/Abstract_Llms_Txt_Cron_Callback_Integration_Test.php @@ -74,7 +74,7 @@ protected function setUp(): void { $this->options_helper, $this->cron_scheduler, $this->populate_file_command_handler, - $this->command_handler + $this->command_handler, ); } } diff --git a/tests/Unit/Llms_Txt/User_Interface/Llms_Txt_Cron_Callback_Integration/Constructor_Test.php b/tests/Unit/Llms_Txt/User_Interface/Llms_Txt_Cron_Callback_Integration/Constructor_Test.php index 5f88aa9ad25..af95efc43e7 100644 --- a/tests/Unit/Llms_Txt/User_Interface/Llms_Txt_Cron_Callback_Integration/Constructor_Test.php +++ b/tests/Unit/Llms_Txt/User_Interface/Llms_Txt_Cron_Callback_Integration/Constructor_Test.php @@ -26,19 +26,19 @@ final class Constructor_Test extends Abstract_Llms_Txt_Cron_Callback_Integration public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); $this->assertInstanceOf( Llms_Txt_Cron_Scheduler::class, - $this->getPropertyValue( $this->instance, 'scheduler' ) + $this->getPropertyValue( $this->instance, 'scheduler' ), ); $this->assertInstanceOf( Populate_File_Command_Handler::class, - $this->getPropertyValue( $this->instance, 'populate_file_command_handler' ) + $this->getPropertyValue( $this->instance, 'populate_file_command_handler' ), ); $this->assertInstanceOf( Remove_File_Command_Handler::class, - $this->getPropertyValue( $this->instance, 'remove_file_command_handler' ) + $this->getPropertyValue( $this->instance, 'remove_file_command_handler' ), ); } } diff --git a/tests/Unit/Llms_Txt/User_Interface/Llms_Txt_Cron_Callback_Integration/Register_Hooks_Test.php b/tests/Unit/Llms_Txt/User_Interface/Llms_Txt_Cron_Callback_Integration/Register_Hooks_Test.php index 38fceef2b06..b8ae6c87a48 100644 --- a/tests/Unit/Llms_Txt/User_Interface/Llms_Txt_Cron_Callback_Integration/Register_Hooks_Test.php +++ b/tests/Unit/Llms_Txt/User_Interface/Llms_Txt_Cron_Callback_Integration/Register_Hooks_Test.php @@ -27,8 +27,8 @@ public function test_register_hooks() { 10, \has_action( Llms_Txt_Cron_Scheduler::LLMS_TXT_POPULATION, - [ $this->instance, 'populate_file' ] - ) + [ $this->instance, 'populate_file' ], + ), ); } } diff --git a/tests/Unit/Llms_Txt/User_Interface/Schedule_Population_On_Activation_Integration/Abstract_Schedule_Population_On_Activation_Integration_Test.php b/tests/Unit/Llms_Txt/User_Interface/Schedule_Population_On_Activation_Integration/Abstract_Schedule_Population_On_Activation_Integration_Test.php index 71217787172..0dc01285e88 100644 --- a/tests/Unit/Llms_Txt/User_Interface/Schedule_Population_On_Activation_Integration/Abstract_Schedule_Population_On_Activation_Integration_Test.php +++ b/tests/Unit/Llms_Txt/User_Interface/Schedule_Population_On_Activation_Integration/Abstract_Schedule_Population_On_Activation_Integration_Test.php @@ -54,7 +54,7 @@ protected function setUp(): void { $this->instance = new Schedule_Population_On_Activation_Integration( $this->cron_scheduler, - $this->options_helper + $this->options_helper, ); } } diff --git a/tests/Unit/Llms_Txt/User_Interface/Schedule_Population_On_Activation_Integration/Constructor_Test.php b/tests/Unit/Llms_Txt/User_Interface/Schedule_Population_On_Activation_Integration/Constructor_Test.php index e959c37a21e..2de7fdd6bd4 100644 --- a/tests/Unit/Llms_Txt/User_Interface/Schedule_Population_On_Activation_Integration/Constructor_Test.php +++ b/tests/Unit/Llms_Txt/User_Interface/Schedule_Population_On_Activation_Integration/Constructor_Test.php @@ -24,11 +24,11 @@ final class Constructor_Test extends Abstract_Schedule_Population_On_Activation_ public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); $this->assertInstanceOf( Llms_Txt_Cron_Scheduler::class, - $this->getPropertyValue( $this->instance, 'scheduler' ) + $this->getPropertyValue( $this->instance, 'scheduler' ), ); } } diff --git a/tests/Unit/Llms_Txt/User_Interface/Schedule_Population_On_Activation_Integration/Register_Hooks_Test.php b/tests/Unit/Llms_Txt/User_Interface/Schedule_Population_On_Activation_Integration/Register_Hooks_Test.php index 52e7c768957..a63a0c6ed60 100644 --- a/tests/Unit/Llms_Txt/User_Interface/Schedule_Population_On_Activation_Integration/Register_Hooks_Test.php +++ b/tests/Unit/Llms_Txt/User_Interface/Schedule_Population_On_Activation_Integration/Register_Hooks_Test.php @@ -25,8 +25,8 @@ public function test_register_hooks() { 10, \has_action( 'wpseo_activate', - [ $this->instance, 'schedule_llms_txt_population' ] - ) + [ $this->instance, 'schedule_llms_txt_population' ], + ), ); } } diff --git a/tests/Unit/Memoizers/Meta_Tags_Context_Memoizer_Test.php b/tests/Unit/Memoizers/Meta_Tags_Context_Memoizer_Test.php index f6a7448fdc5..b13d95612b2 100644 --- a/tests/Unit/Memoizers/Meta_Tags_Context_Memoizer_Test.php +++ b/tests/Unit/Memoizers/Meta_Tags_Context_Memoizer_Test.php @@ -110,7 +110,7 @@ protected function set_up() { $this->current_page, $this->indexable_repository, $this->meta_tags_context, - $this->presentation_memoizer + $this->presentation_memoizer, ); $this->meta_tags_context_mock = new Meta_Tags_Context_Mock(); @@ -127,23 +127,23 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( Blocks_Helper::class, - $this->getPropertyValue( $this->instance, 'blocks' ) + $this->getPropertyValue( $this->instance, 'blocks' ), ); $this->assertInstanceOf( Current_Page_Helper::class, - $this->getPropertyValue( $this->instance, 'current_page' ) + $this->getPropertyValue( $this->instance, 'current_page' ), ); $this->assertInstanceOf( Indexable_Repository::class, - $this->getPropertyValue( $this->instance, 'repository' ) + $this->getPropertyValue( $this->instance, 'repository' ), ); $this->assertInstanceOf( Meta_Tags_Context::class, - $this->getPropertyValue( $this->instance, 'context_prototype' ) + $this->getPropertyValue( $this->instance, 'context_prototype' ), ); $this->assertInstanceOf( Presentation_Memoizer::class, - $this->getPropertyValue( $this->instance, 'presentation_memoizer' ) + $this->getPropertyValue( $this->instance, 'presentation_memoizer' ), ); } diff --git a/tests/Unit/Memoizers/Presentation_Memoizer_Test.php b/tests/Unit/Memoizers/Presentation_Memoizer_Test.php index fa0da31a1f2..f2b05ab649b 100644 --- a/tests/Unit/Memoizers/Presentation_Memoizer_Test.php +++ b/tests/Unit/Memoizers/Presentation_Memoizer_Test.php @@ -87,7 +87,7 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( ContainerInterface::class, - $this->getPropertyValue( $this->instance, 'container' ) + $this->getPropertyValue( $this->instance, 'container' ), ); } diff --git a/tests/Unit/Models/Indexable_Test.php b/tests/Unit/Models/Indexable_Test.php index 9c54c5205e3..a131f9c1492 100644 --- a/tests/Unit/Models/Indexable_Test.php +++ b/tests/Unit/Models/Indexable_Test.php @@ -59,7 +59,7 @@ public function test_save() { [ 'scheme' => 'https', 'host' => 'example.com', - ] + ], ); $this->instance->orm->expects( 'set' ) @@ -99,7 +99,7 @@ public function test_save_trailing_slash() { [ 'scheme' => 'https', 'host' => 'example.com', - ] + ], ); $this->instance->orm->expects( 'set' )->once()->with( 'permalink', $permalink_slash ); diff --git a/tests/Unit/Plans/Application/Add_Ons_Collector_Test.php b/tests/Unit/Plans/Application/Add_Ons_Collector_Test.php index 363d608b61a..0dee27b524e 100644 --- a/tests/Unit/Plans/Application/Add_Ons_Collector_Test.php +++ b/tests/Unit/Plans/Application/Add_Ons_Collector_Test.php @@ -86,7 +86,7 @@ public function test_get() { $this->premium, $this->woo, ], - $this->instance->get() + $this->instance->get(), ); } diff --git a/tests/Unit/Plans/User_Interface/Plans_Page_Integration_Test.php b/tests/Unit/Plans/User_Interface/Plans_Page_Integration_Test.php index 67646e5a229..1c214a0dbf5 100644 --- a/tests/Unit/Plans/User_Interface/Plans_Page_Integration_Test.php +++ b/tests/Unit/Plans/User_Interface/Plans_Page_Integration_Test.php @@ -111,7 +111,7 @@ protected function set_up() { 'has_license' => true, 'get_ctb_action' => 'load-nfd-ctb', 'get_ctb_id' => 'f6a84663-465f-4cb5-8ba5-f7a6d72224b2', - ] + ], ); $this->add_ons_collector = new Add_Ons_Collector( $this->addon_manager, $premium_add_on ); @@ -128,7 +128,7 @@ protected function set_up() { $this->short_link_helper, $this->admin_conditional, $this->promotion_manager, - $this->duplicate_post_manager + $this->duplicate_post_manager, ); } @@ -255,7 +255,7 @@ public function test_add_page() { [ $this->instance, 'display_page' ], ], ], - $this->instance->add_page( [ 'wpseo_tools' ] ) + $this->instance->add_page( [ 'wpseo_tools' ] ), ); } diff --git a/tests/Unit/Presentations/Indexable_Author_Archive_Presentation/Presentation_Instance_Builder.php b/tests/Unit/Presentations/Indexable_Author_Archive_Presentation/Presentation_Instance_Builder.php index 97eb4e20a30..d2fbf3186d7 100644 --- a/tests/Unit/Presentations/Indexable_Author_Archive_Presentation/Presentation_Instance_Builder.php +++ b/tests/Unit/Presentations/Indexable_Author_Archive_Presentation/Presentation_Instance_Builder.php @@ -80,7 +80,7 @@ protected function set_instance() { [ 'model' => $this->indexable, 'context' => $this->context, - ] + ], ); $this->set_instance_dependencies( $this->instance ); diff --git a/tests/Unit/Presentations/Indexable_Post_Type_Presentation/Canonical_Test.php b/tests/Unit/Presentations/Indexable_Post_Type_Presentation/Canonical_Test.php index 8dd19dd2e47..fa869ae2d15 100644 --- a/tests/Unit/Presentations/Indexable_Post_Type_Presentation/Canonical_Test.php +++ b/tests/Unit/Presentations/Indexable_Post_Type_Presentation/Canonical_Test.php @@ -68,7 +68,7 @@ public function test_without_canonical() { ->andReturnUsing( static function ( $val ) { return $val; - } + }, ); Monkey\Functions\expect( 'is_date' ) @@ -115,7 +115,7 @@ public function test_with_pagination() { ->andReturnUsing( static function ( $val ) { return $val; - } + }, ); Monkey\Functions\expect( 'is_date' ) @@ -162,7 +162,7 @@ public function test_without_canonical_with_dynamic_permalinks() { ->andReturnUsing( static function ( $val ) { return $val; - } + }, ); $this->assertEquals( 'https://example.com/dynamic-permalink/', $this->instance->generate_canonical() ); @@ -207,7 +207,7 @@ public function test_with_pagination_with_dynamic_permalinks() { ->andReturnUsing( static function ( $val ) { return $val; - } + }, ); $this->assertEquals( 'https://example.com/dynamic-permalink/2/', $this->instance->generate_canonical() ); diff --git a/tests/Unit/Presentations/Indexable_Post_Type_Presentation/Presentation_Instance_Builder.php b/tests/Unit/Presentations/Indexable_Post_Type_Presentation/Presentation_Instance_Builder.php index 52d1e549efd..93a4f35e55c 100644 --- a/tests/Unit/Presentations/Indexable_Post_Type_Presentation/Presentation_Instance_Builder.php +++ b/tests/Unit/Presentations/Indexable_Post_Type_Presentation/Presentation_Instance_Builder.php @@ -89,7 +89,7 @@ protected function set_instance() { $this->date, $this->pagination, $this->post, - ] + ], ) ->shouldAllowMockingProtectedMethods() ->makePartial(); @@ -98,7 +98,7 @@ protected function set_instance() { [ 'model' => $this->indexable, 'context' => $this->context, - ] + ], ); $this->set_instance_dependencies( $this->instance ); diff --git a/tests/Unit/Presentations/Indexable_Post_Type_Presentation/Twitter_Image_Test.php b/tests/Unit/Presentations/Indexable_Post_Type_Presentation/Twitter_Image_Test.php index 8274d09475f..08687f9b7c1 100644 --- a/tests/Unit/Presentations/Indexable_Post_Type_Presentation/Twitter_Image_Test.php +++ b/tests/Unit/Presentations/Indexable_Post_Type_Presentation/Twitter_Image_Test.php @@ -67,7 +67,7 @@ public function test_generate_twitter_image() { 'twitter_image.jpg' => [ 'url' => 'twitter_image.jpg', ], - ] + ], ); $this->assertEquals( 'twitter_image.jpg', $this->instance->generate_twitter_image() ); diff --git a/tests/Unit/Presentations/Indexable_Presentation/Presentation_Instance_Builder.php b/tests/Unit/Presentations/Indexable_Presentation/Presentation_Instance_Builder.php index 4840f68774c..3d1e9635e28 100644 --- a/tests/Unit/Presentations/Indexable_Presentation/Presentation_Instance_Builder.php +++ b/tests/Unit/Presentations/Indexable_Presentation/Presentation_Instance_Builder.php @@ -54,7 +54,7 @@ protected function set_instance() { [ 'model' => $this->indexable, 'context' => $this->context, - ] + ], ); $this->set_instance_dependencies( $this->instance ); diff --git a/tests/Unit/Presentations/Indexable_Presentation/Robots_Test.php b/tests/Unit/Presentations/Indexable_Presentation/Robots_Test.php index e907878d296..8f14897507b 100644 --- a/tests/Unit/Presentations/Indexable_Presentation/Robots_Test.php +++ b/tests/Unit/Presentations/Indexable_Presentation/Robots_Test.php @@ -71,7 +71,7 @@ public function test_generate_robots_with_filter_return_false() { 'index' => 'noindex', 'follow' => 'nofollow', ], - $this->instance->generate_robots() + $this->instance->generate_robots(), ); } @@ -96,7 +96,7 @@ public function test_generate_robots_with_filter_returning_duplicates() { 'index' => 'noindex', 'follow' => 'follow', ], - $this->instance->generate_robots() + $this->instance->generate_robots(), ); } @@ -121,13 +121,13 @@ public function test_generate_robots_with_array_filter() { 'max-image-preview' => 'max-image-preview:large', 'max-video-preview' => 'max-video-preview:-1', ], - $this->instance + $this->instance, ) ->andReturn( [ 'index' => 'noindex', 'follow' => 'nofollow', - ] + ], ); $this->assertEquals( @@ -135,7 +135,7 @@ public function test_generate_robots_with_array_filter() { 'index' => 'noindex', 'follow' => 'nofollow', ], - $this->instance->generate_robots() + $this->instance->generate_robots(), ); } diff --git a/tests/Unit/Presentations/Indexable_Static_Home_Page_Presentation/Canonical_Test.php b/tests/Unit/Presentations/Indexable_Static_Home_Page_Presentation/Canonical_Test.php index e10aab502e6..02d3390d3dd 100644 --- a/tests/Unit/Presentations/Indexable_Static_Home_Page_Presentation/Canonical_Test.php +++ b/tests/Unit/Presentations/Indexable_Static_Home_Page_Presentation/Canonical_Test.php @@ -68,7 +68,7 @@ public function test_without_canonical() { ->andReturnUsing( static function ( $val ) { return $val; - } + }, ); Monkey\Functions\expect( 'is_date' ) @@ -116,7 +116,7 @@ public function test_with_pagination() { ->andReturnUsing( static function ( $val ) { return $val; - } + }, ); Monkey\Functions\expect( 'is_date' ) @@ -163,7 +163,7 @@ public function test_without_canonical_with_dynamic_permalinks() { ->andReturnUsing( static function ( $val ) { return $val; - } + }, ); $this->assertEquals( 'https://example.com/dynamic-permalink/', $this->instance->generate_canonical() ); @@ -209,7 +209,7 @@ public function test_with_pagination_with_dynamic_permalinks() { ->andReturnUsing( static function ( $val ) { return $val; - } + }, ); $this->assertEquals( 'https://example.com/dynamic-permalink/2/', $this->instance->generate_canonical() ); diff --git a/tests/Unit/Presentations/Indexable_Static_Home_Page_Presentation/Presentation_Instance_Builder.php b/tests/Unit/Presentations/Indexable_Static_Home_Page_Presentation/Presentation_Instance_Builder.php index 2dc94f35522..227830d6a7a 100644 --- a/tests/Unit/Presentations/Indexable_Static_Home_Page_Presentation/Presentation_Instance_Builder.php +++ b/tests/Unit/Presentations/Indexable_Static_Home_Page_Presentation/Presentation_Instance_Builder.php @@ -90,7 +90,7 @@ protected function set_instance() { $this->date, $this->pagination, $this->post, - ] + ], ) ->shouldAllowMockingProtectedMethods() ->makePartial(); @@ -99,7 +99,7 @@ protected function set_instance() { [ 'model' => $this->indexable, 'context' => $this->context, - ] + ], ); $this->set_instance_dependencies( $this->instance ); diff --git a/tests/Unit/Presentations/Indexable_Static_Posts_Page_Presentation/Presentation_Instance_Builder.php b/tests/Unit/Presentations/Indexable_Static_Posts_Page_Presentation/Presentation_Instance_Builder.php index 692e23bde9a..d7bdbda2694 100644 --- a/tests/Unit/Presentations/Indexable_Static_Posts_Page_Presentation/Presentation_Instance_Builder.php +++ b/tests/Unit/Presentations/Indexable_Static_Posts_Page_Presentation/Presentation_Instance_Builder.php @@ -78,7 +78,7 @@ protected function set_instance() { $this->post_type, $this->date, $this->pagination, - $this->post + $this->post, ); $this->instance = $instance->of( [ 'model' => $this->indexable ] ); diff --git a/tests/Unit/Presentations/Indexable_Term_Archive_Presentation/Presentation_Instance_Builder.php b/tests/Unit/Presentations/Indexable_Term_Archive_Presentation/Presentation_Instance_Builder.php index 8831ae38aea..43e7a5c1148 100644 --- a/tests/Unit/Presentations/Indexable_Term_Archive_Presentation/Presentation_Instance_Builder.php +++ b/tests/Unit/Presentations/Indexable_Term_Archive_Presentation/Presentation_Instance_Builder.php @@ -78,7 +78,7 @@ protected function set_instance() { [ $this->wp_query_wrapper, $this->taxonomy, - ] + ], ) ->makePartial() ->shouldAllowMockingProtectedMethods(); diff --git a/tests/Unit/Presentations/Presentation_Instance_Dependencies.php b/tests/Unit/Presentations/Presentation_Instance_Dependencies.php index 1ca29289745..1da5161bff2 100644 --- a/tests/Unit/Presentations/Presentation_Instance_Dependencies.php +++ b/tests/Unit/Presentations/Presentation_Instance_Dependencies.php @@ -133,7 +133,7 @@ protected function set_instance_dependencies( Indexable_Presentation $presentati $this->user, $this->indexable_helper, $this->permalink_helper, - $this->values_helper + $this->values_helper, ); $this->open_graph_image_generator = Mockery::mock( @@ -143,7 +143,7 @@ protected function set_instance_dependencies( Indexable_Presentation $presentati $this->image, $this->options, $this->url, - ] + ], ); $this->twitter_image_generator = Mockery::mock( @@ -152,7 +152,7 @@ protected function set_instance_dependencies( Indexable_Presentation $presentati $this->image, $this->url, $this->twitter, - ] + ], ); $presentation_instance->set_generators( @@ -160,7 +160,7 @@ protected function set_instance_dependencies( Indexable_Presentation $presentati new Open_Graph_Locale_Generator(), $this->open_graph_image_generator, $this->twitter_image_generator, - Mockery::mock( Breadcrumbs_Generator::class ) + Mockery::mock( Breadcrumbs_Generator::class ), ); } } diff --git a/tests/Unit/Presenters/Admin/Alert_Presenter_Test.php b/tests/Unit/Presenters/Admin/Alert_Presenter_Test.php index 8906904092d..5a7c468015c 100644 --- a/tests/Unit/Presenters/Admin/Alert_Presenter_Test.php +++ b/tests/Unit/Presenters/Admin/Alert_Presenter_Test.php @@ -44,7 +44,7 @@ public function test_construct() { $this->assertInstanceOf( WPSEO_Admin_Asset_Manager::class, - $this->getPropertyValue( $test, 'asset_manager' ) + $this->getPropertyValue( $test, 'asset_manager' ), ); } diff --git a/tests/Unit/Presenters/Admin/Help_Link_Presenter_Test.php b/tests/Unit/Presenters/Admin/Help_Link_Presenter_Test.php index 68c9eb9e902..0efad42b5c7 100644 --- a/tests/Unit/Presenters/Admin/Help_Link_Presenter_Test.php +++ b/tests/Unit/Presenters/Admin/Help_Link_Presenter_Test.php @@ -45,7 +45,7 @@ public function test_construct() { $this->assertInstanceOf( WPSEO_Admin_Asset_Manager::class, - $this->getPropertyValue( $test, 'asset_manager' ) + $this->getPropertyValue( $test, 'asset_manager' ), ); } diff --git a/tests/Unit/Presenters/Admin/Indexing_Error_Presenter_Test.php b/tests/Unit/Presenters/Admin/Indexing_Error_Presenter_Test.php index af342165d2d..7b97edf47fd 100644 --- a/tests/Unit/Presenters/Admin/Indexing_Error_Presenter_Test.php +++ b/tests/Unit/Presenters/Admin/Indexing_Error_Presenter_Test.php @@ -59,7 +59,7 @@ protected function set_up() { $this->instance = new Indexing_Error_Presenter( $this->short_link_helper, $this->product_helper, - $this->addon_manager + $this->addon_manager, ); $this->short_link_helper @@ -80,15 +80,15 @@ protected function set_up() { public function test_constructor() { self::assertInstanceOf( Short_Link_Helper::class, - self::getPropertyValue( $this->instance, 'short_link_helper' ) + self::getPropertyValue( $this->instance, 'short_link_helper' ), ); self::assertInstanceOf( Product_Helper::class, - self::getPropertyValue( $this->instance, 'product_helper' ) + self::getPropertyValue( $this->instance, 'product_helper' ), ); self::assertInstanceOf( WPSEO_Addon_Manager::class, - self::getPropertyValue( $this->instance, 'addon_manager' ) + self::getPropertyValue( $this->instance, 'addon_manager' ), ); } @@ -117,7 +117,7 @@ public function test_present_not_premium_no_valid_premium_subscription() { self::assertEquals( '

    Oops, something has gone wrong and we couldn\'t complete the optimization of your SEO data. Please click the button again to re-start the process.

    ' . '

    Below are the technical details for the error. See this page for a more detailed explanation.

    ', - $actual + $actual, ); } @@ -147,7 +147,7 @@ public function test_present_premium_no_valid_premium_subscription() { '

    Oops, something has gone wrong and we couldn\'t complete the optimization of your SEO data. ' . 'Please make sure to activate your subscription in MyYoast by completing these steps.

    ' . '

    Below are the technical details for the error. See this page for a more detailed explanation.

    ', - $actual + $actual, ); } @@ -177,7 +177,7 @@ public function test_present_premium_valid_premium_subscription() { '

    Oops, something has gone wrong and we couldn\'t complete the optimization of your SEO data. ' . 'Please click the button again to re-start the process. If the problem persists, please contact support.

    ' . '

    Below are the technical details for the error. See this page for a more detailed explanation.

    ', - $actual + $actual, ); } } diff --git a/tests/Unit/Presenters/Admin/Indexing_Notification_Presenter_Test.php b/tests/Unit/Presenters/Admin/Indexing_Notification_Presenter_Test.php index 1ffcbce2e52..965b714708b 100644 --- a/tests/Unit/Presenters/Admin/Indexing_Notification_Presenter_Test.php +++ b/tests/Unit/Presenters/Admin/Indexing_Notification_Presenter_Test.php @@ -53,7 +53,7 @@ public function test_present_few_indexables() { $instance = new Indexing_Notification_Presenter( $this->short_link_helper, 50, - '' + '', ); $expected = '

    You can speed up your site and get insight into your internal linking structure by letting us perform a few optimizations to the way SEO data is stored. We estimate this will take less than a minute.

    Start SEO data optimization'; @@ -78,7 +78,7 @@ public function test_present_some_indexables() { $instance = new Indexing_Notification_Presenter( $this->short_link_helper, 500, - '' + '', ); $expected = '

    You can speed up your site and get insight into your internal linking structure by letting us perform a few optimizations to the way SEO data is stored. We estimate this will take a couple of minutes.

    Start SEO data optimization'; @@ -111,7 +111,7 @@ public function test_present_many_indexables() { $instance = new Indexing_Notification_Presenter( $this->short_link_helper, 4000, - 'A message to show in the notification.' + 'A message to show in the notification.', ); $expected = '

    You can speed up your site and get insight into your internal linking structure by letting us perform a few optimizations to the way SEO data is stored. We estimate this could take a long time, due to the size of your site. As an alternative to waiting, you could:

    Start SEO data optimization'; diff --git a/tests/Unit/Presenters/Admin/Migration_Error_Presenter_Test.php b/tests/Unit/Presenters/Admin/Migration_Error_Presenter_Test.php index 5d0655c22ed..9adca471042 100644 --- a/tests/Unit/Presenters/Admin/Migration_Error_Presenter_Test.php +++ b/tests/Unit/Presenters/Admin/Migration_Error_Presenter_Test.php @@ -65,7 +65,7 @@ private function expect_shortlinker() { $container = $this->create_container_with( [ Short_Link_Helper::class => $short_link_mock, - ] + ], ); Monkey\Functions\expect( 'YoastSEO' ) diff --git a/tests/Unit/Presenters/Admin/Notice_Presenter_Test.php b/tests/Unit/Presenters/Admin/Notice_Presenter_Test.php index 46218efbd43..55683c47ade 100644 --- a/tests/Unit/Presenters/Admin/Notice_Presenter_Test.php +++ b/tests/Unit/Presenters/Admin/Notice_Presenter_Test.php @@ -46,7 +46,7 @@ public function test_construct() { $this->assertInstanceOf( WPSEO_Admin_Asset_Manager::class, - $this->getPropertyValue( $test, 'asset_manager' ) + $this->getPropertyValue( $test, 'asset_manager' ), ); } diff --git a/tests/Unit/Presenters/Breadcrumbs_Presenter_Test.php b/tests/Unit/Presenters/Breadcrumbs_Presenter_Test.php index 55851b59dda..5f73cd7e76a 100644 --- a/tests/Unit/Presenters/Breadcrumbs_Presenter_Test.php +++ b/tests/Unit/Presenters/Breadcrumbs_Presenter_Test.php @@ -132,7 +132,7 @@ public function test_present_happy_path() { $this->assertEquals( $output_with_prefix, - $this->instance->present() + $this->instance->present(), ); } @@ -264,7 +264,7 @@ public function test_present_no_breadcrumbs_prefix() { $this->assertEquals( $output_without_prefix, - $this->instance->present() + $this->instance->present(), ); } @@ -291,7 +291,7 @@ public function test_crumb_to_link_not_last_element() { $this->assertEquals( $link, - $this->instance->crumb_to_link( $breadcrumb, 0, 2 ) + $this->instance->crumb_to_link( $breadcrumb, 0, 2 ), ); } @@ -322,7 +322,7 @@ public function test_crumb_to_link_filter_applied() { $this->assertEquals( $link, - $this->instance->crumb_to_link( $breadcrumb, 0, 2 ) + $this->instance->crumb_to_link( $breadcrumb, 0, 2 ), ); } @@ -350,7 +350,7 @@ public function test_crumb_to_link_title_is_set() { $this->assertEquals( $link, - $this->instance->crumb_to_link( $breadcrumb, 0, 2 ) + $this->instance->crumb_to_link( $breadcrumb, 0, 2 ), ); } @@ -378,7 +378,7 @@ public function test_crumb_in_editor() { $_GET['context'] = 'edit'; $this->assertEquals( $link, - $this->instance->crumb_to_link( $breadcrumb, 0, 2 ) + $this->instance->crumb_to_link( $breadcrumb, 0, 2 ), ); unset( $_GET['context'] ); } @@ -413,7 +413,7 @@ public function test_crumb_to_link_last_element_bold() { $this->assertEquals( $link, - $this->instance->crumb_to_link( $breadcrumb, 1, 2 ) + $this->instance->crumb_to_link( $breadcrumb, 1, 2 ), ); } @@ -447,7 +447,7 @@ public function test_crumb_to_link_last_element_not_bold() { $this->assertEquals( $link, - $this->instance->crumb_to_link( $breadcrumb, 1, 2 ) + $this->instance->crumb_to_link( $breadcrumb, 1, 2 ), ); } @@ -481,7 +481,7 @@ public function test_crumb_to_link_add_closing_elements() { $this->assertEquals( $link, - $this->instance->crumb_to_link( $breadcrumb, 3, 4 ) + $this->instance->crumb_to_link( $breadcrumb, 3, 4 ), ); } @@ -828,7 +828,7 @@ public function test_get() { $breadcrumb_1, $breadcrumb_2, ], - $this->instance->get() + $this->instance->get(), ); } } diff --git a/tests/Unit/Presenters/Canonical_Presenter_Test.php b/tests/Unit/Presenters/Canonical_Presenter_Test.php index aa0999bc6e8..3a484132fef 100644 --- a/tests/Unit/Presenters/Canonical_Presenter_Test.php +++ b/tests/Unit/Presenters/Canonical_Presenter_Test.php @@ -50,7 +50,7 @@ public function test_present() { $this->assertEquals( '', - $presented_canonical + $presented_canonical, ); } @@ -97,7 +97,7 @@ public function test_present_with_filter() { $this->assertEquals( '', - $instance->present() + $instance->present(), ); } @@ -142,7 +142,7 @@ public function test_present_with_class() { $this->assertEquals( '', - $presented_canonical + $presented_canonical, ); } } diff --git a/tests/Unit/Presenters/Debug/Marker_Close_Presenter_Test.php b/tests/Unit/Presenters/Debug/Marker_Close_Presenter_Test.php index 14dbd11aeb8..cb28e774dbb 100644 --- a/tests/Unit/Presenters/Debug/Marker_Close_Presenter_Test.php +++ b/tests/Unit/Presenters/Debug/Marker_Close_Presenter_Test.php @@ -40,7 +40,7 @@ public function test_present() { $this->assertEquals( '', - $instance->present() + $instance->present(), ); } @@ -64,7 +64,7 @@ public function test_present_disabled_by_filter() { $this->assertEquals( '', - $instance->present() + $instance->present(), ); } diff --git a/tests/Unit/Presenters/Debug/Marker_Open_Presenter_Test.php b/tests/Unit/Presenters/Debug/Marker_Open_Presenter_Test.php index 832076cf64c..4ea0b0fcfb6 100644 --- a/tests/Unit/Presenters/Debug/Marker_Open_Presenter_Test.php +++ b/tests/Unit/Presenters/Debug/Marker_Open_Presenter_Test.php @@ -39,7 +39,7 @@ public function test_present() { $this->assertEquals( '', - $instance->present() + $instance->present(), ); } @@ -63,7 +63,7 @@ public function test_present_disabled_by_filter() { $this->assertEquals( '', - $instance->present() + $instance->present(), ); } @@ -111,7 +111,7 @@ public function test_present_premium() { $expected_version = 'v' . \WPSEO_PREMIUM_VERSION . ' (Yoast SEO v' . \WPSEO_VERSION . ')'; $this->assertEquals( '', - $instance->present() + $instance->present(), ); } } diff --git a/tests/Unit/Presenters/Meta_Description_Presenter_Test.php b/tests/Unit/Presenters/Meta_Description_Presenter_Test.php index 1a8d3f92f6b..f748b1266c8 100644 --- a/tests/Unit/Presenters/Meta_Description_Presenter_Test.php +++ b/tests/Unit/Presenters/Meta_Description_Presenter_Test.php @@ -92,7 +92,7 @@ public function test_present_and_filter_happy_path() { ->andReturnUsing( static function ( $replace_string ) { return $replace_string; - } + }, ); Monkey\Filters\expectApplied( 'wpseo_metadesc' ) @@ -128,7 +128,7 @@ public function test_present_meta_description_not_string() { ->andReturnUsing( static function ( $replace_string ) { return $replace_string; - } + }, ); $this->string @@ -162,7 +162,7 @@ public function test_present_meta_description_not_string_show_notice() { ->andReturnUsing( static function ( $replace_string ) { return $replace_string; - } + }, ); $this->string @@ -198,7 +198,7 @@ public function test_present_and_filter_with_class() { ->andReturnUsing( static function ( $replace_string ) { return $replace_string; - } + }, ); Monkey\Filters\expectApplied( 'wpseo_metadesc' ) diff --git a/tests/Unit/Presenters/Open_Graph/Description_Presenter_Test.php b/tests/Unit/Presenters/Open_Graph/Description_Presenter_Test.php index cb5291cc38f..2d3659278be 100644 --- a/tests/Unit/Presenters/Open_Graph/Description_Presenter_Test.php +++ b/tests/Unit/Presenters/Open_Graph/Description_Presenter_Test.php @@ -76,7 +76,7 @@ protected function set_up() { ->andReturnUsing( static function ( $str ) { return $str; - } + }, ); $this->presentation->source = []; @@ -87,7 +87,7 @@ static function ( $str ) { ->andReturnUsing( static function ( $str ) { return $str; - } + }, ); } diff --git a/tests/Unit/Presenters/Open_Graph/Image_Presenter_Test.php b/tests/Unit/Presenters/Open_Graph/Image_Presenter_Test.php index 360bbbb7f3d..ebb867ced66 100644 --- a/tests/Unit/Presenters/Open_Graph/Image_Presenter_Test.php +++ b/tests/Unit/Presenters/Open_Graph/Image_Presenter_Test.php @@ -87,7 +87,7 @@ public function test_present_with_a_set_image() { $this->assertEquals( '' . \PHP_EOL . "\t" . '' . \PHP_EOL . "\t" . '', - $this->instance->present() + $this->instance->present(), ); } @@ -117,7 +117,7 @@ public function test_filter_wrong_image_url_returned() { 'height' => '', ], ], - $this->instance->get() + $this->instance->get(), ); } @@ -167,7 +167,7 @@ public function test_filter() { 'type' => 'png', ], ], - $this->instance->get() + $this->instance->get(), ); } @@ -224,7 +224,7 @@ public function test_present_with_a_set_image_with_class() { $this->assertEquals( '' . \PHP_EOL . "\t" . '' . \PHP_EOL . "\t" . '', - $this->instance->present() + $this->instance->present(), ); } @@ -264,7 +264,7 @@ public function test_present_with_attachment_page() { $this->assertEquals( '' . \PHP_EOL . "\t" . '' . \PHP_EOL . "\t" . '', - $this->instance->present() + $this->instance->present(), ); } } diff --git a/tests/Unit/Presenters/Open_Graph/Title_Presenter_Test.php b/tests/Unit/Presenters/Open_Graph/Title_Presenter_Test.php index d8671784436..52a14cad956 100644 --- a/tests/Unit/Presenters/Open_Graph/Title_Presenter_Test.php +++ b/tests/Unit/Presenters/Open_Graph/Title_Presenter_Test.php @@ -77,7 +77,7 @@ protected function set_up() { ->andReturnUsing( static function ( $str ) { return $str; - } + }, ); } @@ -96,7 +96,7 @@ public function test_present() { ->andReturnUsing( static function ( $str ) { return $str; - } + }, ); Monkey\Functions\expect( 'is_admin_bar_showing' )->andReturn( false ); @@ -121,7 +121,7 @@ public function test_present_title_is_empty() { ->andReturnUsing( static function ( $str ) { return $str; - } + }, ); $actual = $this->instance->present(); @@ -145,7 +145,7 @@ public function test_present_filter() { ->andReturnUsing( static function ( $str ) { return $str; - } + }, ); Monkey\Filters\expectApplied( 'wpseo_opengraph_title' ) @@ -175,7 +175,7 @@ public function test_present_with_class() { ->andReturnUsing( static function ( $str ) { return $str; - } + }, ); Monkey\Functions\expect( 'is_admin_bar_showing' )->andReturn( true ); diff --git a/tests/Unit/Presenters/Rel_Next_Presenter_Test.php b/tests/Unit/Presenters/Rel_Next_Presenter_Test.php index 62d437c32a2..2755355e41a 100644 --- a/tests/Unit/Presenters/Rel_Next_Presenter_Test.php +++ b/tests/Unit/Presenters/Rel_Next_Presenter_Test.php @@ -55,7 +55,7 @@ public function test_present_empty() { $this->assertEquals( '', - $this->instance->present() + $this->instance->present(), ); } @@ -100,7 +100,7 @@ public function test_present_with_filter() { $this->assertEquals( '', - $this->instance->present() + $this->instance->present(), ); } @@ -123,7 +123,7 @@ public function test_present_with_class() { $this->assertEquals( '', - $this->instance->present() + $this->instance->present(), ); } } diff --git a/tests/Unit/Presenters/Rel_Prev_Presenter_Test.php b/tests/Unit/Presenters/Rel_Prev_Presenter_Test.php index 34d4cc89efc..4f76fb8d1b7 100644 --- a/tests/Unit/Presenters/Rel_Prev_Presenter_Test.php +++ b/tests/Unit/Presenters/Rel_Prev_Presenter_Test.php @@ -57,7 +57,7 @@ public function test_present() { $this->assertEquals( '', - $this->instance->present() + $this->instance->present(), ); } @@ -78,7 +78,7 @@ public function test_present_empty() { $this->assertEquals( '', - $this->instance->present() + $this->instance->present(), ); } @@ -123,7 +123,7 @@ public function test_present_with_filter() { $this->assertEquals( '', - $this->instance->present() + $this->instance->present(), ); } @@ -146,7 +146,7 @@ public function test_present_with_class() { $this->assertEquals( '', - $this->instance->present() + $this->instance->present(), ); } } diff --git a/tests/Unit/Presenters/Robots_Presenter_Test.php b/tests/Unit/Presenters/Robots_Presenter_Test.php index f737ae45ed5..a0b9baf32ab 100644 --- a/tests/Unit/Presenters/Robots_Presenter_Test.php +++ b/tests/Unit/Presenters/Robots_Presenter_Test.php @@ -99,7 +99,7 @@ public function test_get() { 'index' => 'index', 'follow' => 'nofollow', ], - $this->instance->get() + $this->instance->get(), ); } } diff --git a/tests/Unit/Presenters/Robots_Txt_Presenter_Test.php b/tests/Unit/Presenters/Robots_Txt_Presenter_Test.php index d63a9cfa281..7d57e2d5006 100644 --- a/tests/Unit/Presenters/Robots_Txt_Presenter_Test.php +++ b/tests/Unit/Presenters/Robots_Txt_Presenter_Test.php @@ -75,7 +75,7 @@ public function test_present( $robots_txt_user_agents, $sitemaps, $expected ) { $this->assertSame( $expected, - $this->instance->present() + $this->instance->present(), ); } diff --git a/tests/Unit/Presenters/Slack/Enhanced_Data_Presenter_Test.php b/tests/Unit/Presenters/Slack/Enhanced_Data_Presenter_Test.php index 35c2c6c3c6c..7816e0f66f6 100644 --- a/tests/Unit/Presenters/Slack/Enhanced_Data_Presenter_Test.php +++ b/tests/Unit/Presenters/Slack/Enhanced_Data_Presenter_Test.php @@ -75,7 +75,7 @@ public function test_present() { [ 'get_the_author_meta' => 'Agatha Christie', 'is_singular' => true, - ] + ], ); Functions\expect( 'is_admin_bar_showing' )->andReturn( false ); @@ -84,7 +84,7 @@ public function test_present() { . "\t\n" . "\t\n" . "\t", - $this->instance->present() + $this->instance->present(), ); } @@ -111,14 +111,14 @@ public function test_present_no_post() { [ 'get_the_author_meta' => 'Agatha Christie', 'is_singular' => true, - ] + ], ); Functions\expect( 'is_admin_bar_showing' )->andReturn( false ); $this->assertEquals( "\n" . "\t", - $this->instance->present() + $this->instance->present(), ); } @@ -145,7 +145,7 @@ public function test_present_with_class() { [ 'get_the_author_meta' => 'Agatha Christie', 'is_singular' => true, - ] + ], ); Functions\expect( 'is_admin_bar_showing' )->andReturn( true ); @@ -154,7 +154,7 @@ public function test_present_with_class() { . "\t\n" . "\t\n" . "\t", - $this->instance->present() + $this->instance->present(), ); } } diff --git a/tests/Unit/Presenters/Title_Presenter_Test.php b/tests/Unit/Presenters/Title_Presenter_Test.php index 425291cc9e0..fa8115d9877 100644 --- a/tests/Unit/Presenters/Title_Presenter_Test.php +++ b/tests/Unit/Presenters/Title_Presenter_Test.php @@ -79,14 +79,14 @@ protected function set_up() { ->andReturnUsing( static function ( $str ) { return $str; - } + }, ); Monkey\Functions\expect( 'wp_get_document_title' ) ->andReturnUsing( function () { return $this->instance->get_title(); - } + }, ); } @@ -105,7 +105,7 @@ public function test_present() { ->andReturnUsing( static function ( $str ) { return $str; - } + }, ); $expected = 'example_title'; @@ -129,7 +129,7 @@ public function test_present_title_is_empty() { ->andReturnUsing( static function ( $str ) { return $str; - } + }, ); $actual = $this->instance->present(); @@ -153,7 +153,7 @@ public function test_present_filter() { ->andReturnUsing( static function ( $str ) { return $str; - } + }, ); Monkey\Filters\expectApplied( 'wpseo_title' ) diff --git a/tests/Unit/Presenters/Twitter/Card_Presenter_Test.php b/tests/Unit/Presenters/Twitter/Card_Presenter_Test.php index 1bfe299c582..f7b36028f5f 100644 --- a/tests/Unit/Presenters/Twitter/Card_Presenter_Test.php +++ b/tests/Unit/Presenters/Twitter/Card_Presenter_Test.php @@ -55,7 +55,7 @@ public function test_present() { $this->assertEquals( '', - $this->instance->present() + $this->instance->present(), ); } @@ -92,7 +92,7 @@ public function test_present_with_class() { $this->assertEquals( '', - $this->instance->present() + $this->instance->present(), ); } } diff --git a/tests/Unit/Presenters/Twitter/Creator_Presenter_Test.php b/tests/Unit/Presenters/Twitter/Creator_Presenter_Test.php index 1cd78a2f709..3021e9c056f 100644 --- a/tests/Unit/Presenters/Twitter/Creator_Presenter_Test.php +++ b/tests/Unit/Presenters/Twitter/Creator_Presenter_Test.php @@ -62,7 +62,7 @@ public function test_present() { $this->assertEquals( '', - $this->instance->present() + $this->instance->present(), ); } @@ -108,7 +108,7 @@ public function test_present_with_class() { $this->assertEquals( '', - $this->instance->present() + $this->instance->present(), ); } } diff --git a/tests/Unit/Presenters/Twitter/Description_Presenter_Test.php b/tests/Unit/Presenters/Twitter/Description_Presenter_Test.php index 17d998db55d..f033766495d 100644 --- a/tests/Unit/Presenters/Twitter/Description_Presenter_Test.php +++ b/tests/Unit/Presenters/Twitter/Description_Presenter_Test.php @@ -71,7 +71,7 @@ public function test_present() { $this->assertEquals( '', - $this->instance->present() + $this->instance->present(), ); } @@ -117,7 +117,7 @@ public function test_present_with_class() { $this->assertEquals( '', - $this->instance->present() + $this->instance->present(), ); } } diff --git a/tests/Unit/Presenters/Twitter/Site_Presenter_Test.php b/tests/Unit/Presenters/Twitter/Site_Presenter_Test.php index 221fe1350d7..ecb8d8bc569 100644 --- a/tests/Unit/Presenters/Twitter/Site_Presenter_Test.php +++ b/tests/Unit/Presenters/Twitter/Site_Presenter_Test.php @@ -80,7 +80,7 @@ public function test_present_with_filter() { $this->assertEquals( '', - $this->instance->present() + $this->instance->present(), ); } @@ -99,7 +99,7 @@ public function test_present_with_get_twitter_id_fixing_url_as_input() { $this->assertEquals( '', - $this->instance->present() + $this->instance->present(), ); } @@ -170,7 +170,7 @@ public function test_present_with_class() { $this->assertEquals( '', - $this->instance->present() + $this->instance->present(), ); } } diff --git a/tests/Unit/Presenters/Twitter/Title_Presenter_Test.php b/tests/Unit/Presenters/Twitter/Title_Presenter_Test.php index 82ff05a5946..7ca5f7acf1c 100644 --- a/tests/Unit/Presenters/Twitter/Title_Presenter_Test.php +++ b/tests/Unit/Presenters/Twitter/Title_Presenter_Test.php @@ -74,7 +74,7 @@ public function test_present() { ->andReturnUsing( static function ( $str ) { return $str; - } + }, ); Monkey\Functions\expect( 'is_admin_bar_showing' )->andReturn( false ); @@ -98,7 +98,7 @@ public function test_present_twitter_title_is_empty() { ->andReturnUsing( static function ( $str ) { return $str; - } + }, ); $actual = $this->instance->present(); @@ -121,7 +121,7 @@ public function test_present_filter() { ->andReturnUsing( static function ( $str ) { return $str; - } + }, ); Monkey\Filters\expectApplied( 'wpseo_twitter_title' ) @@ -151,7 +151,7 @@ public function test_present_with_class() { ->andReturnUsing( static function ( $str ) { return $str; - } + }, ); Monkey\Functions\expect( 'is_admin_bar_showing' )->andReturn( true ); diff --git a/tests/Unit/Presenters/Webmaster/Baidu_Presenter_Test.php b/tests/Unit/Presenters/Webmaster/Baidu_Presenter_Test.php index e752d31a87d..168e08934b4 100644 --- a/tests/Unit/Presenters/Webmaster/Baidu_Presenter_Test.php +++ b/tests/Unit/Presenters/Webmaster/Baidu_Presenter_Test.php @@ -73,7 +73,7 @@ public function test_present() { $this->assertSame( '', - $this->instance->present() + $this->instance->present(), ); } @@ -90,7 +90,7 @@ public function test_empty_presentation() { $this->assertSame( '', - $this->instance->present() + $this->instance->present(), ); } @@ -106,7 +106,7 @@ public function test_get() { $this->assertSame( 'baidu', - $this->instance->get() + $this->instance->get(), ); } @@ -122,7 +122,7 @@ public function test_get_empty() { $this->assertSame( '', - $this->instance->get() + $this->instance->get(), ); } @@ -141,7 +141,7 @@ public function test_present_with_class() { $this->assertSame( '', - $this->instance->present() + $this->instance->present(), ); } } diff --git a/tests/Unit/Presenters/Webmaster/Bing_Presenter_Test.php b/tests/Unit/Presenters/Webmaster/Bing_Presenter_Test.php index 86060c1d76e..853b28b9b6f 100644 --- a/tests/Unit/Presenters/Webmaster/Bing_Presenter_Test.php +++ b/tests/Unit/Presenters/Webmaster/Bing_Presenter_Test.php @@ -73,7 +73,7 @@ public function test_present() { $this->assertSame( '', - $this->instance->present() + $this->instance->present(), ); } @@ -90,7 +90,7 @@ public function test_empty_present() { $this->assertSame( '', - $this->instance->present() + $this->instance->present(), ); } @@ -106,7 +106,7 @@ public function test_get() { $this->assertSame( 'bing-ver', - $this->instance->get() + $this->instance->get(), ); } @@ -125,7 +125,7 @@ public function test_present_with_class() { $this->assertSame( '', - $this->instance->present() + $this->instance->present(), ); } } diff --git a/tests/Unit/Presenters/Webmaster/Google_Presenter_Test.php b/tests/Unit/Presenters/Webmaster/Google_Presenter_Test.php index ce551d313ba..c8648be9ea6 100644 --- a/tests/Unit/Presenters/Webmaster/Google_Presenter_Test.php +++ b/tests/Unit/Presenters/Webmaster/Google_Presenter_Test.php @@ -73,7 +73,7 @@ public function test_present() { $this->assertSame( '', - $this->instance->present() + $this->instance->present(), ); } @@ -90,7 +90,7 @@ public function test_present_empty() { $this->assertSame( '', - $this->instance->present() + $this->instance->present(), ); } @@ -106,7 +106,7 @@ public function test_get() { $this->assertSame( 'google-ver', - $this->instance->get() + $this->instance->get(), ); } @@ -125,7 +125,7 @@ public function test_present_with_class() { $this->assertSame( '', - $this->instance->present() + $this->instance->present(), ); } } diff --git a/tests/Unit/Presenters/Webmaster/Pinterest_Presenter_Test.php b/tests/Unit/Presenters/Webmaster/Pinterest_Presenter_Test.php index 131e51396e9..f88a0dbbc15 100644 --- a/tests/Unit/Presenters/Webmaster/Pinterest_Presenter_Test.php +++ b/tests/Unit/Presenters/Webmaster/Pinterest_Presenter_Test.php @@ -73,7 +73,7 @@ public function test_present() { $this->assertSame( '', - $this->instance->present() + $this->instance->present(), ); } @@ -90,7 +90,7 @@ public function test_present_empty() { $this->assertSame( '', - $this->instance->present() + $this->instance->present(), ); } @@ -106,7 +106,7 @@ public function test_get() { $this->assertSame( 'pinterest-ver', - $this->instance->get() + $this->instance->get(), ); } @@ -125,7 +125,7 @@ public function test_present_with_class() { $this->assertSame( '', - $this->instance->present() + $this->instance->present(), ); } } diff --git a/tests/Unit/Presenters/Webmaster/Yandex_Presenter_Test.php b/tests/Unit/Presenters/Webmaster/Yandex_Presenter_Test.php index 7fa1cac1838..6f41bba01c8 100644 --- a/tests/Unit/Presenters/Webmaster/Yandex_Presenter_Test.php +++ b/tests/Unit/Presenters/Webmaster/Yandex_Presenter_Test.php @@ -73,7 +73,7 @@ public function test_present() { $this->assertSame( '', - $this->instance->present() + $this->instance->present(), ); } @@ -90,7 +90,7 @@ public function test_empty_output() { $this->assertSame( '', - $this->instance->present() + $this->instance->present(), ); } @@ -106,7 +106,7 @@ public function test_get() { $this->assertSame( 'yandex-ver', - $this->instance->get() + $this->instance->get(), ); } @@ -125,7 +125,7 @@ public function test_present_with_class() { $this->assertSame( '', - $this->instance->present() + $this->instance->present(), ); } } diff --git a/tests/Unit/Promotions/Application/Fake_Expired_Promotion.php b/tests/Unit/Promotions/Application/Fake_Expired_Promotion.php index e6b66d5d6a0..d7f640a82b4 100644 --- a/tests/Unit/Promotions/Application/Fake_Expired_Promotion.php +++ b/tests/Unit/Promotions/Application/Fake_Expired_Promotion.php @@ -17,7 +17,7 @@ final class Fake_Expired_Promotion extends Abstract_Promotion implements Promoti public function __construct() { parent::__construct( 'fake_expired_promotion', - new Time_Interval( \gmmktime( 00, 00, 00, 01, 01, 1980 ), \gmmktime( 00, 00, 00, 12, 31, 1980 ) ) + new Time_Interval( \gmmktime( 00, 00, 00, 01, 01, 1980 ), \gmmktime( 00, 00, 00, 12, 31, 1980 ) ), ); } } diff --git a/tests/Unit/Promotions/Application/Fake_Promotion.php b/tests/Unit/Promotions/Application/Fake_Promotion.php index 0594dc4eef6..7e12c365805 100644 --- a/tests/Unit/Promotions/Application/Fake_Promotion.php +++ b/tests/Unit/Promotions/Application/Fake_Promotion.php @@ -17,7 +17,7 @@ final class Fake_Promotion extends Abstract_Promotion implements Promotion_Inter public function __construct() { parent::__construct( 'fake_promotion', - new Time_Interval( ( \time() - 10000 ), ( \time() + 10000 ) ) + new Time_Interval( ( \time() - 10_000 ), ( \time() + 10_000 ) ), ); } } diff --git a/tests/Unit/Repositories/Indexable_Cleanup_Repository_Test.php b/tests/Unit/Repositories/Indexable_Cleanup_Repository_Test.php index bf7a00d742e..a9ad160f523 100644 --- a/tests/Unit/Repositories/Indexable_Cleanup_Repository_Test.php +++ b/tests/Unit/Repositories/Indexable_Cleanup_Repository_Test.php @@ -84,7 +84,7 @@ protected function set_up() { $this->taxonomy, $this->post_type, $this->author_archive, - ] + ], )->makePartial(); global $wpdb; @@ -111,7 +111,7 @@ public function test_clean_indexables_with_object_type_and_object_sub_type_mocks 'DELETE FROM wp_yoast_indexable WHERE object_type = %s AND object_sub_type = %s ORDER BY id LIMIT %d', 'post', 'shop_order', - $this->limit + $this->limit, ) ->andReturn( 'prepared_shop_order_delete_query' ); @@ -135,7 +135,7 @@ public function test_clean_indexables_with_post_status_mocks() { ->with( 'DELETE FROM wp_yoast_indexable WHERE object_type = \'post\' AND post_status = %s ORDER BY id LIMIT %d', 'auto-draft', - $this->limit + $this->limit, ) ->andReturn( 'prepared_auto_draft_delete_query' ); @@ -172,7 +172,7 @@ public function test_cleanup_orphaned_from_table( $return_value, $model_name, $c WHERE indexable_table.id IS NULL AND table_to_clean.{$column} IS NOT NULL LIMIT %d", - $this->limit + $this->limit, ) ->andReturn( 'prepared_indexable_hierarchy_select_query' ); @@ -215,7 +215,7 @@ public function test_clean_indexables_for_non_publicly_viewable_post() { 'my_cpt', 'post', 'attachment', - ] + ], ); $this->wpdb->shouldReceive( 'prepare' ) ->once() @@ -225,7 +225,7 @@ public function test_clean_indexables_for_non_publicly_viewable_post() { AND object_sub_type IS NOT NULL AND object_sub_type NOT IN ( %s, %s, %s ) LIMIT %d', - [ 'my_cpt', 'post', 'attachment', $this->limit ] + [ 'my_cpt', 'post', 'attachment', $this->limit ], ) ->andReturn( 'prepared_clean_query' ); @@ -249,7 +249,7 @@ public function test_clean_indexables_for_non_publicly_viewable_taxonomies() { 'category', 'post_tag', 'my_custom_tax', - ] + ], ); $this->wpdb->shouldReceive( 'prepare' ) @@ -260,7 +260,7 @@ public function test_clean_indexables_for_non_publicly_viewable_taxonomies() { AND object_sub_type IS NOT NULL AND object_sub_type NOT IN ( %s, %s, %s ) LIMIT %d', - [ 'category', 'post_tag', 'my_custom_tax', $this->limit ] + [ 'category', 'post_tag', 'my_custom_tax', $this->limit ], ) ->andReturn( 'prepared_clean_query' ); @@ -298,7 +298,7 @@ public function test_clean_indexables_for_non_publicly_viewable_post_type_archiv AND object_sub_type IS NOT NULL AND object_sub_type NOT IN ( %s, %s, %s ) LIMIT %d', - [ 'my_cpt', 'post', 'attachment', $this->limit ] + [ 'my_cpt', 'post', 'attachment', $this->limit ], ) ->andReturn( 'prepared_clean_query' ); @@ -345,7 +345,7 @@ public function test_clean_indexables_for_authors_without_archive() { Monkey\Functions\expect( 'is_post_status_viewable' )->twice()->andReturnUsing( static function ( $value ) { return $value === 'publish'; - } + }, ); $this->wpdb->posts = 'wp_posts'; @@ -360,7 +360,7 @@ static function ( $value ) { WHERE post_type IN ( %s ) AND post_status IN ( %s ) ) LIMIT %d', - [ 'post', 'publish', $this->limit ] + [ 'post', 'publish', $this->limit ], ) ->andReturn( 'prepared_clean_query' ); @@ -395,7 +395,7 @@ public function test_update_indexables_author_to_reassigned() { GROUP BY wp_yoast_indexable.author_id, wp_posts.post_author ORDER BY wp_yoast_indexable.author_id LIMIT %d", - $this->limit + $this->limit, ) ->andReturn( 'prepared_select_query' ); @@ -417,7 +417,7 @@ public function test_update_indexables_author_to_reassigned() { WHERE wp_yoast_indexable.author_id = 1 AND object_type=\'post\' LIMIT %d', - $this->limit + $this->limit, ) ->andReturn( 'prepared_update_query' ); @@ -454,7 +454,7 @@ public function test_clean_indexables_for_object_type_and_source_table( $return_ AND indexable_table.object_id IS NOT NULL AND indexable_table.object_type = '{$object_type}' LIMIT %d", - $this->limit + $this->limit, ) ->andReturn( 'prepared_clean_query' ); @@ -498,7 +498,7 @@ public function test_clean_indexables_for_orphaned_users() { AND indexable_table.object_id IS NOT NULL AND indexable_table.object_type = 'user' LIMIT %d", - $this->limit + $this->limit, ) ->andReturn( 'prepared_clean_query' ); diff --git a/tests/Unit/Repositories/Indexable_Hierarchy_Repository_Test.php b/tests/Unit/Repositories/Indexable_Hierarchy_Repository_Test.php index 3a06e429cbc..7ee355fe356 100644 --- a/tests/Unit/Repositories/Indexable_Hierarchy_Repository_Test.php +++ b/tests/Unit/Repositories/Indexable_Hierarchy_Repository_Test.php @@ -67,7 +67,7 @@ public function test_set_builder() { $this->assertInstanceOf( Indexable_Hierarchy_Builder::class, - $this->getPropertyValue( $this->instance, 'builder' ) + $this->getPropertyValue( $this->instance, 'builder' ), ); } @@ -83,7 +83,7 @@ public function test_set_helper() { $this->assertInstanceOf( Indexable_Helper::class, - $this->getPropertyValue( $this->instance, 'indexable_helper' ) + $this->getPropertyValue( $this->instance, 'indexable_helper' ), ); } @@ -253,7 +253,7 @@ public function test_add_ancestor() { 'ancestor_id' => 2, 'depth' => 1, 'blog_id' => 1, - ] + ], ) ->andReturn( $hierarchy ); $this->instance->expects( 'query' )->andReturn( $orm_object ); @@ -324,7 +324,7 @@ public function test_find_children() { [ 0 => 2, 1 => 3, - ] + ], ); $this->assertSame( [ 2, 3 ], $this->instance->find_children( $indexable ) ); diff --git a/tests/Unit/Repositories/Indexable_Repository_Test.php b/tests/Unit/Repositories/Indexable_Repository_Test.php index 1c3ffc23a07..59af504c758 100644 --- a/tests/Unit/Repositories/Indexable_Repository_Test.php +++ b/tests/Unit/Repositories/Indexable_Repository_Test.php @@ -97,7 +97,7 @@ protected function set_up() { $this->hierarchy_repository, $this->wpdb, $this->version_manager, - ] + ], )->makePartial(); } @@ -394,7 +394,7 @@ public function test_reset_permalink() { 'permalink' => null, 'permalink_hash' => null, 'version' => 0, - ] + ], ) ->once() ->andReturnSelf(); @@ -428,7 +428,7 @@ public function test_reset_permalink_with_args() { 'permalink' => null, 'permalink_hash' => null, 'version' => 0, - ] + ], ) ->once() ->andReturnSelf(); @@ -472,7 +472,7 @@ public function test_reset_permalink_with_invalid_args() { 'permalink' => null, 'permalink_hash' => null, 'version' => 0, - ] + ], ) ->once() ->andReturnSelf(); diff --git a/tests/Unit/Routes/Alert_Dismissal_Route_Test.php b/tests/Unit/Routes/Alert_Dismissal_Route_Test.php index 61c707425d5..25e9014e94b 100644 --- a/tests/Unit/Routes/Alert_Dismissal_Route_Test.php +++ b/tests/Unit/Routes/Alert_Dismissal_Route_Test.php @@ -57,7 +57,7 @@ protected function set_up() { public function test_construct() { $this->assertInstanceOf( Alert_Dismissal_Action::class, - $this->getPropertyValue( $this->instance, 'alert_dismissal_action' ) + $this->getPropertyValue( $this->instance, 'alert_dismissal_action' ), ); } @@ -71,7 +71,7 @@ public function test_construct() { public function test_get_conditionals() { $this->assertEquals( [], - Alert_Dismissal_Route::get_conditionals() + Alert_Dismissal_Route::get_conditionals(), ); } @@ -97,7 +97,7 @@ public function test_register_routes() { 'required' => true, ], ], - ] + ], ) ->once(); diff --git a/tests/Unit/Routes/First_Time_Configuration_Route_Test.php b/tests/Unit/Routes/First_Time_Configuration_Route_Test.php index 77d452ebb4e..db8ef9c90bf 100644 --- a/tests/Unit/Routes/First_Time_Configuration_Route_Test.php +++ b/tests/Unit/Routes/First_Time_Configuration_Route_Test.php @@ -55,7 +55,7 @@ protected function set_up() { public function test_construct() { $this->assertInstanceOf( First_Time_Configuration_Action::class, - $this->getPropertyValue( $this->instance, 'first_time_configuration_action' ) + $this->getPropertyValue( $this->instance, 'first_time_configuration_action' ), ); } @@ -106,7 +106,7 @@ public function test_register_routes() { 'type' => 'string', ], ], - ] + ], ); Monkey\Functions\expect( 'register_rest_route' ) @@ -128,7 +128,7 @@ public function test_register_routes() { 'type' => 'array', ], ], - ] + ], ); Monkey\Functions\expect( 'register_rest_route' ) @@ -144,7 +144,7 @@ public function test_register_routes() { 'required' => true, ], ], - ] + ], ); Monkey\Functions\expect( 'register_rest_route' ) @@ -161,7 +161,7 @@ public function test_register_routes() { 'required' => true, ], ], - ] + ], ); Monkey\Functions\expect( 'register_rest_route' ) @@ -178,7 +178,7 @@ public function test_register_routes() { 'required' => true, ], ], - ] + ], ); Monkey\Functions\expect( 'register_rest_route' ) @@ -191,7 +191,7 @@ public function test_register_routes() { 'callback' => [ $this->instance, 'get_configuration_state' ], 'permission_callback' => [ $this->instance, 'can_manage_options' ], ], - ] + ], ); $this->instance->register_routes(); @@ -239,7 +239,7 @@ public function test_can_edit_user( $can_edit, $expected ) { $this->assertEquals( $expected, - $this->instance->can_edit_user( $request ) + $this->instance->can_edit_user( $request ), ); } diff --git a/tests/Unit/Routes/Importing_Route_Test.php b/tests/Unit/Routes/Importing_Route_Test.php index ebb9e703da2..934721a63e7 100644 --- a/tests/Unit/Routes/Importing_Route_Test.php +++ b/tests/Unit/Routes/Importing_Route_Test.php @@ -60,7 +60,7 @@ protected function set_up() { $this->instance = new Importing_Route( $this->importable_detector, - ...$this->importers + ...$this->importers, ); } @@ -99,7 +99,7 @@ public function test_register_routes() { 'methods' => [ 'POST' ], 'callback' => [ $this->instance, 'execute' ], 'permission_callback' => [ $this->instance, 'is_user_permitted_to_import' ], - ] + ], ); $this->instance->register_routes(); @@ -142,7 +142,7 @@ public function test_execute_import_aioseo_posts( $plugin, $type, $is_enabled, $ [ 'plugin' => $plugin, 'type' => $type, - ] + ], ); $this->assertInstanceOf( $expected_response, $wp_rest_response ); @@ -205,7 +205,7 @@ public function test_execute_non_existent_route() { [ 'plugin' => 'non', 'type' => 'existent', - ] + ], ); $this->assertInstanceOf( WP_Error::class, $response ); diff --git a/tests/Unit/Routes/Indexables_Head_Route_Test.php b/tests/Unit/Routes/Indexables_Head_Route_Test.php index 49d0568b169..1efb074bdec 100644 --- a/tests/Unit/Routes/Indexables_Head_Route_Test.php +++ b/tests/Unit/Routes/Indexables_Head_Route_Test.php @@ -66,7 +66,7 @@ protected function set_up() { public function test_construct() { $this->assertInstanceOf( Indexable_Head_Action::class, - $this->getPropertyValue( $this->instance, 'head_action' ) + $this->getPropertyValue( $this->instance, 'head_action' ), ); } @@ -82,7 +82,7 @@ public function test_get_conditionals() { [ Headless_Rest_Endpoints_Enabled_Conditional::class, ], - Indexables_Head_Route::get_conditionals() + Indexables_Head_Route::get_conditionals(), ); } @@ -108,7 +108,7 @@ public function test_register_routes() { 'required' => true, ], ], - ] + ], ); $this->instance->register_routes(); diff --git a/tests/Unit/Routes/Indexing_Route_Test.php b/tests/Unit/Routes/Indexing_Route_Test.php index a078519f3f1..dae2735479d 100644 --- a/tests/Unit/Routes/Indexing_Route_Test.php +++ b/tests/Unit/Routes/Indexing_Route_Test.php @@ -149,7 +149,7 @@ protected function set_up() { $this->post_link_indexing_action, $this->term_link_indexing_action, $this->options_helper, - $this->indexing_helper + $this->indexing_helper, ); } @@ -163,47 +163,47 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( Indexable_Post_Indexation_Action::class, - $this->getPropertyValue( $this->instance, 'post_indexation_action' ) + $this->getPropertyValue( $this->instance, 'post_indexation_action' ), ); $this->assertInstanceOf( Indexable_Term_Indexation_Action::class, - $this->getPropertyValue( $this->instance, 'term_indexation_action' ) + $this->getPropertyValue( $this->instance, 'term_indexation_action' ), ); $this->assertInstanceOf( Indexable_Post_Type_Archive_Indexation_Action::class, - $this->getPropertyValue( $this->instance, 'post_type_archive_indexation_action' ) + $this->getPropertyValue( $this->instance, 'post_type_archive_indexation_action' ), ); $this->assertInstanceOf( Indexable_General_Indexation_Action::class, - $this->getPropertyValue( $this->instance, 'general_indexation_action' ) + $this->getPropertyValue( $this->instance, 'general_indexation_action' ), ); $this->assertInstanceOf( Indexable_Indexing_Complete_Action::class, - $this->getPropertyValue( $this->instance, 'indexable_indexing_complete_action' ) + $this->getPropertyValue( $this->instance, 'indexable_indexing_complete_action' ), ); $this->assertInstanceOf( Indexing_Complete_Action::class, - $this->getPropertyValue( $this->instance, 'indexing_complete_action' ) + $this->getPropertyValue( $this->instance, 'indexing_complete_action' ), ); $this->assertInstanceOf( Indexing_Prepare_Action::class, - $this->getPropertyValue( $this->instance, 'prepare_indexing_action' ) + $this->getPropertyValue( $this->instance, 'prepare_indexing_action' ), ); $this->assertInstanceOf( Post_Link_Indexing_Action::class, - $this->getPropertyValue( $this->instance, 'post_link_indexing_action' ) + $this->getPropertyValue( $this->instance, 'post_link_indexing_action' ), ); $this->assertInstanceOf( Term_Link_Indexing_Action::class, - $this->getPropertyValue( $this->instance, 'term_link_indexing_action' ) + $this->getPropertyValue( $this->instance, 'term_link_indexing_action' ), ); $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); $this->assertInstanceOf( Indexing_Helper::class, - $this->getPropertyValue( $this->instance, 'indexing_helper' ) + $this->getPropertyValue( $this->instance, 'indexing_helper' ), ); } @@ -223,7 +223,7 @@ public function test_register_routes() { 'methods' => 'POST', 'callback' => [ $this->instance, 'prepare' ], 'permission_callback' => [ $this->instance, 'can_index' ], - ] + ], ); Monkey\Functions\expect( 'register_rest_route' ) @@ -234,7 +234,7 @@ public function test_register_routes() { 'methods' => 'POST', 'callback' => [ $this->instance, 'complete' ], 'permission_callback' => [ $this->instance, 'can_index' ], - ] + ], ); Monkey\Functions\expect( 'register_rest_route' ) @@ -245,7 +245,7 @@ public function test_register_routes() { 'methods' => 'POST', 'callback' => [ $this->instance, 'index_posts' ], 'permission_callback' => [ $this->instance, 'can_index' ], - ] + ], ); Monkey\Functions\expect( 'register_rest_route' ) @@ -256,7 +256,7 @@ public function test_register_routes() { 'methods' => 'POST', 'callback' => [ $this->instance, 'index_terms' ], 'permission_callback' => [ $this->instance, 'can_index' ], - ] + ], ); Monkey\Functions\expect( 'register_rest_route' ) @@ -267,7 +267,7 @@ public function test_register_routes() { 'methods' => 'POST', 'callback' => [ $this->instance, 'index_post_type_archives' ], 'permission_callback' => [ $this->instance, 'can_index' ], - ] + ], ); Monkey\Functions\expect( 'register_rest_route' ) @@ -278,7 +278,7 @@ public function test_register_routes() { 'methods' => 'POST', 'callback' => [ $this->instance, 'index_general' ], 'permission_callback' => [ $this->instance, 'can_index' ], - ] + ], ); Monkey\Functions\expect( 'register_rest_route' ) @@ -289,7 +289,7 @@ public function test_register_routes() { 'methods' => 'POST', 'callback' => [ $this->instance, 'indexables_complete' ], 'permission_callback' => [ $this->instance, 'can_index' ], - ] + ], ); Monkey\Functions\expect( 'register_rest_route' ) @@ -300,7 +300,7 @@ public function test_register_routes() { 'methods' => 'POST', 'callback' => [ $this->instance, 'index_post_links' ], 'permission_callback' => [ $this->instance, 'can_index' ], - ] + ], ); Monkey\Functions\expect( 'register_rest_route' ) @@ -311,7 +311,7 @@ public function test_register_routes() { 'methods' => 'POST', 'callback' => [ $this->instance, 'index_term_links' ], 'permission_callback' => [ $this->instance, 'can_index' ], - ] + ], ); $this->instance->register_routes(); diff --git a/tests/Unit/Routes/SEMrush_Route_Test.php b/tests/Unit/Routes/SEMrush_Route_Test.php index 7dc08fe8721..7e3cbbbc036 100644 --- a/tests/Unit/Routes/SEMrush_Route_Test.php +++ b/tests/Unit/Routes/SEMrush_Route_Test.php @@ -75,15 +75,15 @@ protected function set_up() { public function test_construct() { $this->assertInstanceOf( SEMrush_Login_Action::class, - $this->getPropertyValue( $this->instance, 'login_action' ) + $this->getPropertyValue( $this->instance, 'login_action' ), ); $this->assertInstanceOf( SEMrush_Options_Action::class, - $this->getPropertyValue( $this->instance, 'options_action' ) + $this->getPropertyValue( $this->instance, 'options_action' ), ); $this->assertInstanceOf( SEMrush_Phrases_Action::class, - $this->getPropertyValue( $this->instance, 'phrases_action' ) + $this->getPropertyValue( $this->instance, 'phrases_action' ), ); } @@ -97,7 +97,7 @@ public function test_construct() { public function test_get_conditionals() { $this->assertEquals( [ SEMrush_Enabled_Conditional::class ], - SEMrush_Route::get_conditionals() + SEMrush_Route::get_conditionals(), ); } @@ -123,7 +123,7 @@ public function test_register_routes() { 'required' => true, ], ], - ] + ], ); Monkey\Functions\expect( 'register_rest_route' ) @@ -140,7 +140,7 @@ public function test_register_routes() { 'required' => true, ], ], - ] + ], ); Monkey\Functions\expect( 'register_rest_route' ) @@ -160,7 +160,7 @@ public function test_register_routes() { 'required' => true, ], ], - ] + ], ); $this->instance->register_routes(); diff --git a/tests/Unit/Routes/Supported_Features_Route_Test.php b/tests/Unit/Routes/Supported_Features_Route_Test.php index 0deb2783d80..337abe32b1d 100644 --- a/tests/Unit/Routes/Supported_Features_Route_Test.php +++ b/tests/Unit/Routes/Supported_Features_Route_Test.php @@ -45,7 +45,7 @@ protected function set_up() { public function test_get_conditionals() { $this->assertEquals( [ Addon_Installation_Conditional::class ], - Supported_Features_Route::get_conditionals() + Supported_Features_Route::get_conditionals(), ); } @@ -65,7 +65,7 @@ public function test_register_routes() { 'methods' => 'GET', 'callback' => [ $this, 'get_supported_features' ], 'permission_callback' => '__return_true', - ] + ], ) ->once(); @@ -86,7 +86,7 @@ public function test_get_supported_features() { $expected = new WP_REST_Response( [ 'addon-installation' => 1, - ] + ], ); $this->assertInstanceOf( WP_REST_Response::class, $actual ); diff --git a/tests/Unit/Routes/Wincher_Route_Test.php b/tests/Unit/Routes/Wincher_Route_Test.php index 29ca4b96bee..7c1cf89e8b7 100644 --- a/tests/Unit/Routes/Wincher_Route_Test.php +++ b/tests/Unit/Routes/Wincher_Route_Test.php @@ -65,7 +65,7 @@ protected function set_up() { $this->instance = new Wincher_Route( $this->login_action, $this->account_action, - $this->keyphrases_action + $this->keyphrases_action, ); } @@ -79,15 +79,15 @@ protected function set_up() { public function test_construct() { $this->assertInstanceOf( Wincher_Login_Action::class, - $this->getPropertyValue( $this->instance, 'login_action' ) + $this->getPropertyValue( $this->instance, 'login_action' ), ); $this->assertInstanceOf( Wincher_Account_Action::class, - $this->getPropertyValue( $this->instance, 'account_action' ) + $this->getPropertyValue( $this->instance, 'account_action' ), ); $this->assertInstanceOf( Wincher_Keyphrases_Action::class, - $this->getPropertyValue( $this->instance, 'keyphrases_action' ) + $this->getPropertyValue( $this->instance, 'keyphrases_action' ), ); } @@ -101,7 +101,7 @@ public function test_construct() { public function test_get_conditionals() { $this->assertEquals( [ Wincher_Enabled_Conditional::class ], - Wincher_Route::get_conditionals() + Wincher_Route::get_conditionals(), ); } @@ -131,7 +131,7 @@ public function test_register_routes() { 'required' => true, ], ], - ] + ], ); Monkey\Functions\expect( 'register_rest_route' ) @@ -142,7 +142,7 @@ public function test_register_routes() { 'methods' => 'GET', 'callback' => [ $this->instance, 'get_authorization_url' ], 'permission_callback' => [ $this->instance, 'can_use_wincher' ], - ] + ], ); Monkey\Functions\expect( 'register_rest_route' ) @@ -158,7 +158,7 @@ public function test_register_routes() { 'required' => true, ], ], - ] + ], ); Monkey\Functions\expect( 'register_rest_route' ) @@ -180,7 +180,7 @@ public function test_register_routes() { 'required' => false, ], ], - ] + ], ); Monkey\Functions\expect( 'register_rest_route' ) @@ -191,7 +191,7 @@ public function test_register_routes() { 'methods' => 'DELETE', 'callback' => [ $this->instance, 'untrack_keyphrase' ], 'permission_callback' => [ $this->instance, 'can_use_wincher' ], - ] + ], ); Monkey\Functions\expect( 'register_rest_route' ) @@ -202,7 +202,7 @@ public function test_register_routes() { 'methods' => 'GET', 'callback' => [ $this->instance, 'check_limit' ], 'permission_callback' => [ $this->instance, 'can_use_wincher' ], - ] + ], ); Monkey\Functions\expect( 'register_rest_route' ) @@ -213,7 +213,7 @@ public function test_register_routes() { 'methods' => 'GET', 'callback' => [ $this->instance, 'get_upgrade_campaign' ], 'permission_callback' => [ $this->instance, 'can_use_wincher' ], - ] + ], ); $this->instance->register_routes(); @@ -249,7 +249,7 @@ public function test_is_valid_code_with_valid_code_given() { * @return void */ public function test_is_valid_website_when_valid_id_is_passed() { - $this->assertTrue( $this->instance->has_valid_website_id( 12345 ) ); + $this->assertTrue( $this->instance->has_valid_website_id( 12_345 ) ); } /** @@ -358,7 +358,7 @@ public function test_track_keyphrases() { ->expects( 'track_keyphrases' ) ->with( [ 'seo' ], - $limit_response + $limit_response, ) ->andReturn( (object) [ 'status' => '200' ] ); @@ -396,7 +396,7 @@ public function test_get_tracked_keyphrases() { ->with( [ 'seo' ], 'https://example.com', - '2023-01-01' + '2023-01-01', ) ->andReturn( (object) [ 'status' => '200' ] ); @@ -434,7 +434,7 @@ public function test_get_tracked_keyphrases_without_permalink() { ->with( [ 'seo' ], '', - '2023-01-01' + '2023-01-01', ) ->andReturn( (object) [ 'status' => '200' ] ); @@ -464,7 +464,7 @@ public function test_untrack_keyphrase() { (object) [ 'results' => [], 'status' => '200', - ] + ], ); Mockery::mock( 'overload:' . WP_REST_Response::class ); diff --git a/tests/Unit/Routes/Yoast_Head_REST_Field_Test.php b/tests/Unit/Routes/Yoast_Head_REST_Field_Test.php index 4981a99a7a5..701a8e03b33 100644 --- a/tests/Unit/Routes/Yoast_Head_REST_Field_Test.php +++ b/tests/Unit/Routes/Yoast_Head_REST_Field_Test.php @@ -74,7 +74,7 @@ protected function set_up() { $this->post_type_helper, $this->taxonomy_helper, $this->post_helper, - $this->head_action + $this->head_action, ); } @@ -99,15 +99,15 @@ public function test_get_conditionals() { public function test_constructor() { $this->assertInstanceOf( Post_Type_Helper::class, - $this->getPropertyValue( $this->instance, 'post_type_helper' ) + $this->getPropertyValue( $this->instance, 'post_type_helper' ), ); $this->assertInstanceOf( Taxonomy_Helper::class, - $this->getPropertyValue( $this->instance, 'taxonomy_helper' ) + $this->getPropertyValue( $this->instance, 'taxonomy_helper' ), ); $this->assertInstanceOf( Indexable_Head_Action::class, - $this->getPropertyValue( $this->instance, 'head_action' ) + $this->getPropertyValue( $this->instance, 'head_action' ), ); } @@ -134,7 +134,7 @@ public function test_register_routes() { ->with( 'post_type', Yoast_Head_REST_Field::YOAST_HEAD_ATTRIBUTE_NAME, - [ 'get_callback' => [ $this->instance, 'for_post' ] ] + [ 'get_callback' => [ $this->instance, 'for_post' ] ], ); Monkey\Functions\expect( 'register_rest_field' ) @@ -142,7 +142,7 @@ public function test_register_routes() { ->with( 'taxonomy', Yoast_Head_REST_Field::YOAST_HEAD_ATTRIBUTE_NAME, - [ 'get_callback' => [ $this->instance, 'for_term' ] ] + [ 'get_callback' => [ $this->instance, 'for_term' ] ], ); Monkey\Functions\expect( 'register_rest_field' ) @@ -150,7 +150,7 @@ public function test_register_routes() { ->with( 'tag', Yoast_Head_REST_Field::YOAST_HEAD_ATTRIBUTE_NAME, - [ 'get_callback' => [ $this->instance, 'for_term' ] ] + [ 'get_callback' => [ $this->instance, 'for_term' ] ], ); Monkey\Functions\expect( 'register_rest_field' ) @@ -158,7 +158,7 @@ public function test_register_routes() { ->with( 'user', Yoast_Head_REST_Field::YOAST_HEAD_ATTRIBUTE_NAME, - [ 'get_callback' => [ $this->instance, 'for_author' ] ] + [ 'get_callback' => [ $this->instance, 'for_author' ] ], ); Monkey\Functions\expect( 'register_rest_field' ) @@ -166,7 +166,7 @@ public function test_register_routes() { ->with( 'type', Yoast_Head_REST_Field::YOAST_HEAD_ATTRIBUTE_NAME, - [ 'get_callback' => [ $this->instance, 'for_post_type_archive' ] ] + [ 'get_callback' => [ $this->instance, 'for_post_type_archive' ] ], ); $this->instance->register_routes(); @@ -264,7 +264,7 @@ public function test_adding_yoast_head_with_404( $method, $params, $input ) { (object) [ 'status' => 404, 'head' => 'this is the 404 head', - ] + ], ); if ( $method === 'for_post' ) { @@ -293,7 +293,7 @@ public function test_adding_yoast_head_to_posts_page_with_404() { (object) [ 'status' => 404, 'head' => 'this is the 404 head', - ] + ], ); $this->assertNull( $this->instance->for_post_type_archive( [ 'slug' => 'post' ] ) ); diff --git a/tests/Unit/Schema_Aggregator/Application/Aggregate_Site_Schema_Command_Handler/Abstract_Aggregate_Site_Schema_Command_Handler_Test.php b/tests/Unit/Schema_Aggregator/Application/Aggregate_Site_Schema_Command_Handler/Abstract_Aggregate_Site_Schema_Command_Handler_Test.php index 976b9bed5c6..079eaed3b2d 100644 --- a/tests/Unit/Schema_Aggregator/Application/Aggregate_Site_Schema_Command_Handler/Abstract_Aggregate_Site_Schema_Command_Handler_Test.php +++ b/tests/Unit/Schema_Aggregator/Application/Aggregate_Site_Schema_Command_Handler/Abstract_Aggregate_Site_Schema_Command_Handler_Test.php @@ -60,7 +60,7 @@ protected function set_up() { $this->instance = new Aggregate_Site_Schema_Command_Handler( $this->schema_piece_repository, $this->schema_piece_aggregator, - $this->schema_response_composer + $this->schema_response_composer, ); } } diff --git a/tests/Unit/Schema_Aggregator/Application/Aggregate_Site_Schema_Command_Handler/Constructor_Test.php b/tests/Unit/Schema_Aggregator/Application/Aggregate_Site_Schema_Command_Handler/Constructor_Test.php index 209870c52c6..168db8d7c9d 100644 --- a/tests/Unit/Schema_Aggregator/Application/Aggregate_Site_Schema_Command_Handler/Constructor_Test.php +++ b/tests/Unit/Schema_Aggregator/Application/Aggregate_Site_Schema_Command_Handler/Constructor_Test.php @@ -24,15 +24,15 @@ final class Constructor_Test extends Abstract_Aggregate_Site_Schema_Command_Hand public function test_constructor() { $this->assertInstanceOf( Schema_Piece_Repository::class, - $this->getPropertyValue( $this->instance, 'schema_piece_repository' ) + $this->getPropertyValue( $this->instance, 'schema_piece_repository' ), ); $this->assertInstanceOf( Schema_Pieces_Aggregator::class, - $this->getPropertyValue( $this->instance, 'schema_piece_aggregator' ) + $this->getPropertyValue( $this->instance, 'schema_piece_aggregator' ), ); $this->assertInstanceOf( Schema_Aggregator_Response_Composer::class, - $this->getPropertyValue( $this->instance, 'schema_response_composer' ) + $this->getPropertyValue( $this->instance, 'schema_response_composer' ), ); } } diff --git a/tests/Unit/Schema_Aggregator/Application/Aggregate_Site_Schema_Map_Command_Handler/Abstract_Aggregate_Site_Schema_Map_Command_Handler_Test.php b/tests/Unit/Schema_Aggregator/Application/Aggregate_Site_Schema_Map_Command_Handler/Abstract_Aggregate_Site_Schema_Map_Command_Handler_Test.php index 0aa5519fd6a..c854b2fbad9 100644 --- a/tests/Unit/Schema_Aggregator/Application/Aggregate_Site_Schema_Map_Command_Handler/Abstract_Aggregate_Site_Schema_Map_Command_Handler_Test.php +++ b/tests/Unit/Schema_Aggregator/Application/Aggregate_Site_Schema_Map_Command_Handler/Abstract_Aggregate_Site_Schema_Map_Command_Handler_Test.php @@ -69,7 +69,7 @@ protected function set_up() { $this->schema_map_repository_factory, $this->schema_map_builder, $this->schema_map_xml_renderer, - $this->indexable_helper + $this->indexable_helper, ); } } diff --git a/tests/Unit/Schema_Aggregator/Application/Aggregate_Site_Schema_Map_Command_Handler/Constructor_Test.php b/tests/Unit/Schema_Aggregator/Application/Aggregate_Site_Schema_Map_Command_Handler/Constructor_Test.php index 0fa3e0af73b..9c28a390c09 100644 --- a/tests/Unit/Schema_Aggregator/Application/Aggregate_Site_Schema_Map_Command_Handler/Constructor_Test.php +++ b/tests/Unit/Schema_Aggregator/Application/Aggregate_Site_Schema_Map_Command_Handler/Constructor_Test.php @@ -25,19 +25,19 @@ final class Constructor_Test extends Abstract_Aggregate_Site_Schema_Map_Command_ public function test_constructor() { $this->assertInstanceOf( Schema_Map_Repository_Factory::class, - $this->getPropertyValue( $this->instance, 'schema_map_repository_factory' ) + $this->getPropertyValue( $this->instance, 'schema_map_repository_factory' ), ); $this->assertInstanceOf( Schema_Map_Builder::class, - $this->getPropertyValue( $this->instance, 'schema_map_builder' ) + $this->getPropertyValue( $this->instance, 'schema_map_builder' ), ); $this->assertInstanceOf( Schema_Map_Xml_Renderer::class, - $this->getPropertyValue( $this->instance, 'schema_map_xml_renderer' ) + $this->getPropertyValue( $this->instance, 'schema_map_xml_renderer' ), ); $this->assertInstanceOf( Indexable_Helper::class, - $this->getPropertyValue( $this->instance, 'indexable_helper' ) + $this->getPropertyValue( $this->instance, 'indexable_helper' ), ); } } diff --git a/tests/Unit/Schema_Aggregator/Application/Cache/Constructor_Test.php b/tests/Unit/Schema_Aggregator/Application/Cache/Constructor_Test.php index 7d7a767fe09..fad3c1dc0e5 100644 --- a/tests/Unit/Schema_Aggregator/Application/Cache/Constructor_Test.php +++ b/tests/Unit/Schema_Aggregator/Application/Cache/Constructor_Test.php @@ -22,7 +22,7 @@ final class Constructor_Test extends Abstract_Manager_Test { public function test_constructor() { $this->assertInstanceOf( Config::class, - $this->getPropertyValue( $this->instance, 'config' ) + $this->getPropertyValue( $this->instance, 'config' ), ); } } diff --git a/tests/Unit/Schema_Aggregator/Application/Cache/Invalidate_All_Test.php b/tests/Unit/Schema_Aggregator/Application/Cache/Invalidate_All_Test.php index 93efb8d706a..5e83990cf57 100644 --- a/tests/Unit/Schema_Aggregator/Application/Cache/Invalidate_All_Test.php +++ b/tests/Unit/Schema_Aggregator/Application/Cache/Invalidate_All_Test.php @@ -30,7 +30,7 @@ public function test_invalidate_all_deletes_all_entries() { ->with( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s OR option_name LIKE %s", '_transient_yoast_schema_aggregator_page_%', - '_transient_timeout_yoast_schema_aggregator_page_%' + '_transient_timeout_yoast_schema_aggregator_page_%', ) ->andReturn( 'PREPARED_QUERY' ); diff --git a/tests/Unit/Schema_Aggregator/Application/Cache/Invalidate_Test.php b/tests/Unit/Schema_Aggregator/Application/Cache/Invalidate_Test.php index b9742f798ce..87e647df90f 100644 --- a/tests/Unit/Schema_Aggregator/Application/Cache/Invalidate_Test.php +++ b/tests/Unit/Schema_Aggregator/Application/Cache/Invalidate_Test.php @@ -47,7 +47,7 @@ public function test_invalidate_clears_all_per_page_variations_for_page() { ->with( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s OR option_name LIKE %s", '_transient_yoast_schema_aggregator_page_1_per_%', - '_transient_timeout_yoast_schema_aggregator_page_1_per_%' + '_transient_timeout_yoast_schema_aggregator_page_1_per_%', ) ->andReturn( 'PREPARED_QUERY' ); diff --git a/tests/Unit/Schema_Aggregator/Application/Cache/Set_Test.php b/tests/Unit/Schema_Aggregator/Application/Cache/Set_Test.php index e0e138eb143..84bcf4d46b4 100644 --- a/tests/Unit/Schema_Aggregator/Application/Cache/Set_Test.php +++ b/tests/Unit/Schema_Aggregator/Application/Cache/Set_Test.php @@ -132,7 +132,7 @@ public static function set_cache_data_provider() { 'page' => 2, 'per_page' => 50, 'data' => \array_fill( 0, 100, 'large_data' ), - 'expiration' => 21600, + 'expiration' => 21_600, 'expected_key' => 'yoast_schema_aggregator_page_2_per_50_type_post_v1', ]; } diff --git a/tests/Unit/Schema_Aggregator/Application/Cache/Xml_Manager/Constructor_Test.php b/tests/Unit/Schema_Aggregator/Application/Cache/Xml_Manager/Constructor_Test.php index 0d8ca947a25..36889c7ce5c 100644 --- a/tests/Unit/Schema_Aggregator/Application/Cache/Xml_Manager/Constructor_Test.php +++ b/tests/Unit/Schema_Aggregator/Application/Cache/Xml_Manager/Constructor_Test.php @@ -22,7 +22,7 @@ final class Constructor_Test extends Abstract_Xml_Manager_Test { public function test_constructor() { $this->assertInstanceOf( Config::class, - $this->getPropertyValue( $this->instance, 'config' ) + $this->getPropertyValue( $this->instance, 'config' ), ); } } diff --git a/tests/Unit/Schema_Aggregator/Application/Cache/Xml_Manager/Set_Test.php b/tests/Unit/Schema_Aggregator/Application/Cache/Xml_Manager/Set_Test.php index bae7fc1b622..29ba68080c3 100644 --- a/tests/Unit/Schema_Aggregator/Application/Cache/Xml_Manager/Set_Test.php +++ b/tests/Unit/Schema_Aggregator/Application/Cache/Xml_Manager/Set_Test.php @@ -105,7 +105,7 @@ public static function set_data_provider() { ]; yield 'Large XML, long expiration' => [ 'data' => \str_repeat( 'large content here', 500 ), - 'expiration' => 21600, + 'expiration' => 21_600, 'expected' => true, ]; yield 'Empty string' => [ diff --git a/tests/Unit/Schema_Aggregator/Application/Enhancement/Schema_Enhancement_Factory/Abstract_Schema_Enhancement_Factory_Test.php b/tests/Unit/Schema_Aggregator/Application/Enhancement/Schema_Enhancement_Factory/Abstract_Schema_Enhancement_Factory_Test.php index 1610fb56504..225ccd783c4 100644 --- a/tests/Unit/Schema_Aggregator/Application/Enhancement/Schema_Enhancement_Factory/Abstract_Schema_Enhancement_Factory_Test.php +++ b/tests/Unit/Schema_Aggregator/Application/Enhancement/Schema_Enhancement_Factory/Abstract_Schema_Enhancement_Factory_Test.php @@ -47,7 +47,7 @@ protected function set_up() { $this->person_enhancer = Mockery::mock( Person_Schema_Enhancer::class ); $this->instance = new Schema_Enhancement_Factory( $this->article_enhancer, - $this->person_enhancer + $this->person_enhancer, ); } } diff --git a/tests/Unit/Schema_Aggregator/Application/Enhancement/Schema_Enhancement_Factory/Constructor_Test.php b/tests/Unit/Schema_Aggregator/Application/Enhancement/Schema_Enhancement_Factory/Constructor_Test.php index aef2831ccda..0bdd447f7b9 100644 --- a/tests/Unit/Schema_Aggregator/Application/Enhancement/Schema_Enhancement_Factory/Constructor_Test.php +++ b/tests/Unit/Schema_Aggregator/Application/Enhancement/Schema_Enhancement_Factory/Constructor_Test.php @@ -23,11 +23,11 @@ final class Constructor_Test extends Abstract_Schema_Enhancement_Factory_Test { public function test_constructor() { $this->assertInstanceOf( Article_Schema_Enhancer::class, - $this->getPropertyValue( $this->instance, 'article_schema_enhancer' ) + $this->getPropertyValue( $this->instance, 'article_schema_enhancer' ), ); $this->assertInstanceOf( Person_Schema_Enhancer::class, - $this->getPropertyValue( $this->instance, 'person_schema_enhancer' ) + $this->getPropertyValue( $this->instance, 'person_schema_enhancer' ), ); } } diff --git a/tests/Unit/Schema_Aggregator/Application/Filtering/Default_Filter/Constructor_Test.php b/tests/Unit/Schema_Aggregator/Application/Filtering/Default_Filter/Constructor_Test.php index 387a56713b6..7137b61de88 100644 --- a/tests/Unit/Schema_Aggregator/Application/Filtering/Default_Filter/Constructor_Test.php +++ b/tests/Unit/Schema_Aggregator/Application/Filtering/Default_Filter/Constructor_Test.php @@ -22,7 +22,7 @@ final class Constructor_Test extends Abstract_Default_Filter_Test { public function test_constructor(): void { $this->assertInstanceOf( Elements_Context_Map_Repository::class, - $this->getPropertyValue( $this->instance, 'elements_context_map_repository' ) + $this->getPropertyValue( $this->instance, 'elements_context_map_repository' ), ); } } diff --git a/tests/Unit/Schema_Aggregator/Application/Filtering/Default_Filter/Filter_Test.php b/tests/Unit/Schema_Aggregator/Application/Filtering/Default_Filter/Filter_Test.php index 51c60340600..7c5bb8ac895 100644 --- a/tests/Unit/Schema_Aggregator/Application/Filtering/Default_Filter/Filter_Test.php +++ b/tests/Unit/Schema_Aggregator/Application/Filtering/Default_Filter/Filter_Test.php @@ -57,7 +57,7 @@ public function test_schema_pieces_filter( array $elements_context_map, array $s static function ( $piece ) { return $piece->get_data(); }, - $result->to_array() + $result->to_array(), ); $this->assertSame( $expected_data, $result_data ); @@ -87,7 +87,7 @@ public function test_schema_piece_properties_filter( array $elements_context_map static function ( $piece ) { return $piece->get_data(); }, - $result->to_array() + $result->to_array(), ); $this->assertCount( 1, $result_data ); diff --git a/tests/Unit/Schema_Aggregator/Application/Filtering/Schema_Node_Filter/WebSite_Schema_Node_Filter/Constructor_Test.php b/tests/Unit/Schema_Aggregator/Application/Filtering/Schema_Node_Filter/WebSite_Schema_Node_Filter/Constructor_Test.php index 1bae4e8ceb9..2b14a021c60 100644 --- a/tests/Unit/Schema_Aggregator/Application/Filtering/Schema_Node_Filter/WebSite_Schema_Node_Filter/Constructor_Test.php +++ b/tests/Unit/Schema_Aggregator/Application/Filtering/Schema_Node_Filter/WebSite_Schema_Node_Filter/Constructor_Test.php @@ -23,7 +23,7 @@ public function test_constructor() { $this->assertInstanceOf( WordPress_Current_Site_URL_Provider::class, - $this->getPropertyValue( $this->instance, 'current_site_url_provider' ) + $this->getPropertyValue( $this->instance, 'current_site_url_provider' ), ); } } diff --git a/tests/Unit/Schema_Aggregator/Application/Schema_Aggregator_Announcement/Abstract_Schema_Aggregator_Announcement_Test.php b/tests/Unit/Schema_Aggregator/Application/Schema_Aggregator_Announcement/Abstract_Schema_Aggregator_Announcement_Test.php index 0dd8f517fc8..5650d7ffb8f 100644 --- a/tests/Unit/Schema_Aggregator/Application/Schema_Aggregator_Announcement/Abstract_Schema_Aggregator_Announcement_Test.php +++ b/tests/Unit/Schema_Aggregator/Application/Schema_Aggregator_Announcement/Abstract_Schema_Aggregator_Announcement_Test.php @@ -43,7 +43,7 @@ protected function set_up() { $this->current_page_helper = Mockery::mock( Current_Page_Helper::class ); $this->instance = new Schema_Aggregator_Announcement( - $this->current_page_helper + $this->current_page_helper, ); } } diff --git a/tests/Unit/Schema_Aggregator/Application/Schema_Aggregator_Announcement/Constructor_Test.php b/tests/Unit/Schema_Aggregator/Application/Schema_Aggregator_Announcement/Constructor_Test.php index 82d20a8215e..06d65fa8aba 100644 --- a/tests/Unit/Schema_Aggregator/Application/Schema_Aggregator_Announcement/Constructor_Test.php +++ b/tests/Unit/Schema_Aggregator/Application/Schema_Aggregator_Announcement/Constructor_Test.php @@ -25,7 +25,7 @@ final class Constructor_Test extends Abstract_Schema_Aggregator_Announcement_Tes public function test_constructor(): void { $this->assertInstanceOf( Current_Page_Helper::class, - $this->getPropertyValue( $this->instance, 'current_page_helper' ) + $this->getPropertyValue( $this->instance, 'current_page_helper' ), ); } } diff --git a/tests/Unit/Schema_Aggregator/Application/Schema_Map/Schema_Map_Builder/Build_Test.php b/tests/Unit/Schema_Aggregator/Application/Schema_Map/Schema_Map_Builder/Build_Test.php index 70262099784..dcc66ebb027 100644 --- a/tests/Unit/Schema_Aggregator/Application/Schema_Map/Schema_Map_Builder/Build_Test.php +++ b/tests/Unit/Schema_Aggregator/Application/Schema_Map/Schema_Map_Builder/Build_Test.php @@ -51,7 +51,7 @@ public function test_build( array $indexable_counts_data, int $per_page, array $ ->andReturnUsing( static function ( $route ) { return 'https://example.com/wp-json/' . $route; - } + }, ); $result = $this->instance->build( $collection ); diff --git a/tests/Unit/Schema_Aggregator/Application/Schema_Map/Schema_Map_Builder/Constructor_Test.php b/tests/Unit/Schema_Aggregator/Application/Schema_Map/Schema_Map_Builder/Constructor_Test.php index 430329c76b5..0136bbb231f 100644 --- a/tests/Unit/Schema_Aggregator/Application/Schema_Map/Schema_Map_Builder/Constructor_Test.php +++ b/tests/Unit/Schema_Aggregator/Application/Schema_Map/Schema_Map_Builder/Constructor_Test.php @@ -24,7 +24,7 @@ final class Constructor_Test extends Abstract_Schema_Map_Builder_Test { public function test_constructor() { $this->assertInstanceOf( Config::class, - $this->getPropertyValue( $this->instance, 'config' ) + $this->getPropertyValue( $this->instance, 'config' ), ); } } diff --git a/tests/Unit/Schema_Aggregator/Application/Schema_Map/Schema_Map_Builder/Get_Rest_Route_Test.php b/tests/Unit/Schema_Aggregator/Application/Schema_Map/Schema_Map_Builder/Get_Rest_Route_Test.php index 63b6e4df79b..13fc70b4432 100644 --- a/tests/Unit/Schema_Aggregator/Application/Schema_Map/Schema_Map_Builder/Get_Rest_Route_Test.php +++ b/tests/Unit/Schema_Aggregator/Application/Schema_Map/Schema_Map_Builder/Get_Rest_Route_Test.php @@ -35,7 +35,7 @@ public function test_get_rest_route( string $post_type, int $page, string $expec ->andReturnUsing( static function ( $route ) { return 'https://example.com/wp-json/' . $route; - } + }, ); $result = $this->instance->get_rest_route( $post_type, $page ); diff --git a/tests/Unit/Schema_Aggregator/Application/Schema_Map/Schema_Map_Builder/With_Repository_Test.php b/tests/Unit/Schema_Aggregator/Application/Schema_Map/Schema_Map_Builder/With_Repository_Test.php index 967bf2cdbfe..d4a84a19457 100644 --- a/tests/Unit/Schema_Aggregator/Application/Schema_Map/Schema_Map_Builder/With_Repository_Test.php +++ b/tests/Unit/Schema_Aggregator/Application/Schema_Map/Schema_Map_Builder/With_Repository_Test.php @@ -42,7 +42,7 @@ public function test_with_repository_returns_self() { public function test_with_repository_sets_property() { $this->assertInstanceOf( Schema_Map_Repository_Interface::class, - $this->getPropertyValue( $this->instance, 'schema_map_repository' ) + $this->getPropertyValue( $this->instance, 'schema_map_repository' ), ); } } diff --git a/tests/Unit/Schema_Aggregator/Application/Schema_Map/Schema_Map_Xml_Renderer/Constructor_Test.php b/tests/Unit/Schema_Aggregator/Application/Schema_Map/Schema_Map_Xml_Renderer/Constructor_Test.php index fdf8d9818f4..07835ca002a 100644 --- a/tests/Unit/Schema_Aggregator/Application/Schema_Map/Schema_Map_Xml_Renderer/Constructor_Test.php +++ b/tests/Unit/Schema_Aggregator/Application/Schema_Map/Schema_Map_Xml_Renderer/Constructor_Test.php @@ -24,7 +24,7 @@ final class Constructor_Test extends Abstract_Schema_Map_Xml_Renderer_Test { public function test_constructor() { $this->assertInstanceOf( Schema_Map_Config::class, - $this->getPropertyValue( $this->instance, 'config' ) + $this->getPropertyValue( $this->instance, 'config' ), ); } } diff --git a/tests/Unit/Schema_Aggregator/Domain/Indexable_Count_Collection_Test.php b/tests/Unit/Schema_Aggregator/Domain/Indexable_Count_Collection_Test.php index d67a1c15321..62bc49ae78a 100644 --- a/tests/Unit/Schema_Aggregator/Domain/Indexable_Count_Collection_Test.php +++ b/tests/Unit/Schema_Aggregator/Domain/Indexable_Count_Collection_Test.php @@ -27,7 +27,7 @@ public function test_constructor() { $this->assertSame( [], - $this->getPropertyValue( $instance, 'indexable_counts' ) + $this->getPropertyValue( $instance, 'indexable_counts' ), ); } diff --git a/tests/Unit/Schema_Aggregator/Domain/Indexable_Count_Test.php b/tests/Unit/Schema_Aggregator/Domain/Indexable_Count_Test.php index 85bbe73d51d..19072fcb1e3 100644 --- a/tests/Unit/Schema_Aggregator/Domain/Indexable_Count_Test.php +++ b/tests/Unit/Schema_Aggregator/Domain/Indexable_Count_Test.php @@ -27,11 +27,11 @@ public function test_constructor() { $this->assertSame( 'post', - $this->getPropertyValue( $instance, 'post_type' ) + $this->getPropertyValue( $instance, 'post_type' ), ); $this->assertSame( 42, - $this->getPropertyValue( $instance, 'count' ) + $this->getPropertyValue( $instance, 'count' ), ); } @@ -66,8 +66,8 @@ public static function count_data_provider() { 'expected' => 0, ]; yield 'Large count' => [ - 'count' => 999999, - 'expected' => 999999, + 'count' => 999_999, + 'expected' => 999_999, ]; yield 'Small count' => [ 'count' => 1, @@ -160,7 +160,7 @@ public static function constructor_values_data_provider() { ]; yield 'Custom post type with large count' => [ 'post_type' => 'product', - 'count' => 500000, + 'count' => 500_000, ]; yield 'Post type with underscore and count' => [ 'post_type' => 'custom_type', diff --git a/tests/Unit/Schema_Aggregator/Domain/Page_Controls_Test.php b/tests/Unit/Schema_Aggregator/Domain/Page_Controls_Test.php index 539d0ab9e32..967b7e01865 100644 --- a/tests/Unit/Schema_Aggregator/Domain/Page_Controls_Test.php +++ b/tests/Unit/Schema_Aggregator/Domain/Page_Controls_Test.php @@ -28,15 +28,15 @@ public function test_constructor() { $this->assertSame( 1, - $this->getPropertyValue( $instance, 'page' ) + $this->getPropertyValue( $instance, 'page' ), ); $this->assertSame( 20, - $this->getPropertyValue( $instance, 'page_size' ) + $this->getPropertyValue( $instance, 'page_size' ), ); $this->assertSame( 'post', - $this->getPropertyValue( $instance, 'post_type' ) + $this->getPropertyValue( $instance, 'post_type' ), ); } diff --git a/tests/Unit/Schema_Aggregator/Domain/Schema_Piece_Collection_Test.php b/tests/Unit/Schema_Aggregator/Domain/Schema_Piece_Collection_Test.php index 38744c174c8..9d8ca75b5f6 100644 --- a/tests/Unit/Schema_Aggregator/Domain/Schema_Piece_Collection_Test.php +++ b/tests/Unit/Schema_Aggregator/Domain/Schema_Piece_Collection_Test.php @@ -27,7 +27,7 @@ public function test_constructor() { $this->assertSame( [], - $this->getPropertyValue( $instance, 'pieces' ) + $this->getPropertyValue( $instance, 'pieces' ), ); } @@ -54,7 +54,7 @@ public function test_add_single_schema_piece() { '@type' => 'Article', 'name' => 'Test Article', ], - 'Article' + 'Article', ); $instance->add( $schema_piece ); @@ -77,21 +77,21 @@ public function test_add_multiple_schema_pieces() { '@type' => 'Article', 'name' => 'Article 1', ], - 'Article' + 'Article', ); $piece2 = new Schema_Piece( [ '@type' => 'Person', 'name' => 'John Doe', ], - 'Person' + 'Person', ); $piece3 = new Schema_Piece( [ '@type' => 'Organization', 'name' => 'Yoast', ], - 'Organization' + 'Organization', ); $instance->add( $piece1 ); @@ -117,7 +117,7 @@ public function test_to_array_returns_array() { '@type' => 'WebPage', 'name' => 'Test Page', ], - 'WebPage' + 'WebPage', ); $instance->add( $schema_piece ); @@ -140,28 +140,28 @@ public function test_collection_maintains_order() { '@type' => 'Article', 'headline' => 'Article 1', ], - 'Article' + 'Article', ); $piece2 = new Schema_Piece( [ '@type' => 'Person', 'name' => 'Person 1', ], - 'Person' + 'Person', ); $piece3 = new Schema_Piece( [ '@type' => 'Organization', 'name' => 'Org 1', ], - 'Organization' + 'Organization', ); $piece4 = new Schema_Piece( [ '@type' => 'WebPage', 'name' => 'Page 1', ], - 'WebPage' + 'WebPage', ); $instance->add( $piece1 ); @@ -188,14 +188,14 @@ public function test_constructor_with_pieces() { '@type' => 'Article', 'headline' => 'Test Article', ], - 'Article' + 'Article', ); $piece2 = new Schema_Piece( [ '@type' => 'Person', 'name' => 'Test Person', ], - 'Person' + 'Person', ); $instance = new Schema_Piece_Collection( [ $piece1, $piece2 ] ); diff --git a/tests/Unit/Schema_Aggregator/Domain/Schema_Piece_Test.php b/tests/Unit/Schema_Aggregator/Domain/Schema_Piece_Test.php index 0fb94637179..407ced3adcb 100644 --- a/tests/Unit/Schema_Aggregator/Domain/Schema_Piece_Test.php +++ b/tests/Unit/Schema_Aggregator/Domain/Schema_Piece_Test.php @@ -34,11 +34,11 @@ public function test_constructor_with_string_type() { $this->assertSame( $data, - $this->getPropertyValue( $instance, 'data' ) + $this->getPropertyValue( $instance, 'data' ), ); $this->assertSame( $type, - $this->getPropertyValue( $instance, 'type' ) + $this->getPropertyValue( $instance, 'type' ), ); } @@ -54,11 +54,11 @@ public function test_constructor_with_array_type() { $this->assertSame( $data, - $this->getPropertyValue( $instance, 'data' ) + $this->getPropertyValue( $instance, 'data' ), ); $this->assertSame( $type, - $this->getPropertyValue( $instance, 'type' ) + $this->getPropertyValue( $instance, 'type' ), ); } diff --git a/tests/Unit/Schema_Aggregator/Infrastructure/Config/Config_Get_Expiration_Test.php b/tests/Unit/Schema_Aggregator/Infrastructure/Config/Config_Get_Expiration_Test.php index e8cf93c9842..84eb79f2657 100644 --- a/tests/Unit/Schema_Aggregator/Infrastructure/Config/Config_Get_Expiration_Test.php +++ b/tests/Unit/Schema_Aggregator/Infrastructure/Config/Config_Get_Expiration_Test.php @@ -46,43 +46,43 @@ public function test_get_expiration( $data, $filtered_ttl, $expected ) { */ public static function get_expiration_data() { yield 'Small data (< 100KB) - shorter cache' => [ - 'data' => self::generate_array_of_size( 50000 ), + 'data' => self::generate_array_of_size( 50_000 ), 'filtered_ttl' => 1800, 'expected' => 1800, ]; yield 'Medium data (100KB - 1MB) - default cache' => [ - 'data' => self::generate_array_of_size( 500000 ), + 'data' => self::generate_array_of_size( 500_000 ), 'filtered_ttl' => 3600, 'expected' => 3600, ]; yield 'Large data (> 1MB) - longer cache' => [ - 'data' => self::generate_array_of_size( 1100000 ), - 'filtered_ttl' => 21600, - 'expected' => 21600, + 'data' => self::generate_array_of_size( 1_100_000 ), + 'filtered_ttl' => 21_600, + 'expected' => 21_600, ]; yield 'Filter returns invalid (zero) - falls back to default' => [ - 'data' => self::generate_array_of_size( 500000 ), + 'data' => self::generate_array_of_size( 500_000 ), 'filtered_ttl' => 0, 'expected' => 3600, ]; yield 'Filter returns invalid (negative) - falls back to default' => [ - 'data' => self::generate_array_of_size( 500000 ), + 'data' => self::generate_array_of_size( 500_000 ), 'filtered_ttl' => -100, 'expected' => 3600, ]; yield 'Filter returns non-integer (string) - falls back to default' => [ - 'data' => self::generate_array_of_size( 500000 ), + 'data' => self::generate_array_of_size( 500_000 ), 'filtered_ttl' => 'invalid', 'expected' => 3600, ]; yield 'Filter returns valid positive integer' => [ - 'data' => self::generate_array_of_size( 50000 ), + 'data' => self::generate_array_of_size( 50_000 ), 'filtered_ttl' => 7200, 'expected' => 7200, ]; @@ -94,33 +94,33 @@ public static function get_expiration_data() { ]; yield 'Data just below small boundary' => [ - 'data' => self::generate_array_of_size( 102399 ), + 'data' => self::generate_array_of_size( 102_399 ), 'filtered_ttl' => 1800, 'expected' => 1800, ]; yield 'Data at small boundary (102400 bytes) - uses default' => [ - 'data' => self::generate_array_of_size( 102400 ), + 'data' => self::generate_array_of_size( 102_400 ), 'filtered_ttl' => 3600, 'expected' => 3600, ]; yield 'Data just above small boundary' => [ - 'data' => self::generate_array_of_size( 102401 ), + 'data' => self::generate_array_of_size( 102_401 ), 'filtered_ttl' => 3600, 'expected' => 3600, ]; yield 'Data just below large boundary' => [ - 'data' => self::generate_array_of_size( 1048575 ), + 'data' => self::generate_array_of_size( 1_048_575 ), 'filtered_ttl' => 3600, 'expected' => 3600, ]; yield 'Data just above large boundary (1048577 bytes) - uses large cache' => [ - 'data' => self::generate_array_of_size( 1048577 ), - 'filtered_ttl' => 21600, - 'expected' => 21600, + 'data' => self::generate_array_of_size( 1_048_577 ), + 'filtered_ttl' => 21_600, + 'expected' => 21_600, ]; } diff --git a/tests/Unit/Schema_Aggregator/Infrastructure/Elements_Context_Map_Repository/Abstract_Elements_Context_Map_Repository_Test.php b/tests/Unit/Schema_Aggregator/Infrastructure/Elements_Context_Map_Repository/Abstract_Elements_Context_Map_Repository_Test.php index 27ac612a848..b31bc8fa7eb 100644 --- a/tests/Unit/Schema_Aggregator/Infrastructure/Elements_Context_Map_Repository/Abstract_Elements_Context_Map_Repository_Test.php +++ b/tests/Unit/Schema_Aggregator/Infrastructure/Elements_Context_Map_Repository/Abstract_Elements_Context_Map_Repository_Test.php @@ -42,7 +42,7 @@ protected function set_up() { $this->map_loader = Mockery::mock( Map_Loader_Interface::class ); $this->instance = new Elements_Context_Map_Repository( - $this->map_loader + $this->map_loader, ); } } diff --git a/tests/Unit/Schema_Aggregator/Infrastructure/Elements_Context_Map_Repository/Constructor_Test.php b/tests/Unit/Schema_Aggregator/Infrastructure/Elements_Context_Map_Repository/Constructor_Test.php index d2b8b1ebd5a..9d244a54b6d 100644 --- a/tests/Unit/Schema_Aggregator/Infrastructure/Elements_Context_Map_Repository/Constructor_Test.php +++ b/tests/Unit/Schema_Aggregator/Infrastructure/Elements_Context_Map_Repository/Constructor_Test.php @@ -24,7 +24,7 @@ final class Constructor_Test extends Abstract_Elements_Context_Map_Repository_Te public function test_constructor(): void { $this->assertInstanceOf( Map_Loader_Interface::class, - $this->getPropertyValue( $this->instance, 'map_loader' ) + $this->getPropertyValue( $this->instance, 'map_loader' ), ); } } diff --git a/tests/Unit/Schema_Aggregator/Infrastructure/Indexable_Repository/Constructor_Test.php b/tests/Unit/Schema_Aggregator/Infrastructure/Indexable_Repository/Constructor_Test.php index e8f6d3e26c4..88e9c6bbd48 100644 --- a/tests/Unit/Schema_Aggregator/Infrastructure/Indexable_Repository/Constructor_Test.php +++ b/tests/Unit/Schema_Aggregator/Infrastructure/Indexable_Repository/Constructor_Test.php @@ -50,7 +50,7 @@ public function setUp(): void { public function test_constructor(): void { $this->assertInstanceOf( Base_Indexable_Repository::class, - $this->getPropertyValue( $this->instance, 'indexable_repository' ) + $this->getPropertyValue( $this->instance, 'indexable_repository' ), ); } } diff --git a/tests/Unit/Schema_Aggregator/Infrastructure/Indexable_Repository/Indexable_Repository_Factory/Abstract_Indexable_Repository_Factory_Test.php b/tests/Unit/Schema_Aggregator/Infrastructure/Indexable_Repository/Indexable_Repository_Factory/Abstract_Indexable_Repository_Factory_Test.php index 87fe6f91354..d3361e1addc 100644 --- a/tests/Unit/Schema_Aggregator/Infrastructure/Indexable_Repository/Indexable_Repository_Factory/Abstract_Indexable_Repository_Factory_Test.php +++ b/tests/Unit/Schema_Aggregator/Infrastructure/Indexable_Repository/Indexable_Repository_Factory/Abstract_Indexable_Repository_Factory_Test.php @@ -46,7 +46,7 @@ public function setUp(): void { $this->wordpress_query_repository = Mockery::mock( WordPress_Query_Repository::class ); $this->instance = new Indexable_Repository_Factory( $this->indexable_repository, - $this->wordpress_query_repository + $this->wordpress_query_repository, ); } } diff --git a/tests/Unit/Schema_Aggregator/Infrastructure/Indexable_Repository/Indexable_Repository_Factory/Constructor_Test.php b/tests/Unit/Schema_Aggregator/Infrastructure/Indexable_Repository/Indexable_Repository_Factory/Constructor_Test.php index 480b29a90c9..ebf6b0bcd05 100644 --- a/tests/Unit/Schema_Aggregator/Infrastructure/Indexable_Repository/Indexable_Repository_Factory/Constructor_Test.php +++ b/tests/Unit/Schema_Aggregator/Infrastructure/Indexable_Repository/Indexable_Repository_Factory/Constructor_Test.php @@ -23,12 +23,12 @@ final class Constructor_Test extends Abstract_Indexable_Repository_Factory_Test public function test_constructor(): void { $this->assertInstanceOf( Indexable_Repository::class, - $this->getPropertyValue( $this->instance, 'native_repository' ) + $this->getPropertyValue( $this->instance, 'native_repository' ), ); $this->assertInstanceOf( WordPress_Query_Repository::class, - $this->getPropertyValue( $this->instance, 'wordpress_repository' ) + $this->getPropertyValue( $this->instance, 'wordpress_repository' ), ); } } diff --git a/tests/Unit/Schema_Aggregator/Infrastructure/Indexable_Repository/WordPress_Query_Repository/Constructor_Test.php b/tests/Unit/Schema_Aggregator/Infrastructure/Indexable_Repository/WordPress_Query_Repository/Constructor_Test.php index 7393c2209e8..fcb640efcdb 100644 --- a/tests/Unit/Schema_Aggregator/Infrastructure/Indexable_Repository/WordPress_Query_Repository/Constructor_Test.php +++ b/tests/Unit/Schema_Aggregator/Infrastructure/Indexable_Repository/WordPress_Query_Repository/Constructor_Test.php @@ -59,12 +59,12 @@ public function setUp(): void { public function test_constructor(): void { $this->assertInstanceOf( Indexable_Builder::class, - $this->getPropertyValue( $this->instance, 'indexable_builder' ) + $this->getPropertyValue( $this->instance, 'indexable_builder' ), ); $this->assertInstanceOf( Pure_Indexable_Repository::class, - $this->getPropertyValue( $this->instance, 'indexable_repository' ) + $this->getPropertyValue( $this->instance, 'indexable_repository' ), ); } } diff --git a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Conditional/Abstract_Schema_Aggregator_Conditional_Test.php b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Conditional/Abstract_Schema_Aggregator_Conditional_Test.php index 18fb1540ad4..84503a5a069 100644 --- a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Conditional/Abstract_Schema_Aggregator_Conditional_Test.php +++ b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Conditional/Abstract_Schema_Aggregator_Conditional_Test.php @@ -40,7 +40,7 @@ protected function set_up() { $this->options = Mockery::mock( Options_Helper::class ); $this->instance = new Schema_Aggregator_Conditional( - $this->options + $this->options, ); } } diff --git a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Conditional/Constructor_Test.php b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Conditional/Constructor_Test.php index 64484fc73d1..d678a7941c2 100644 --- a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Conditional/Constructor_Test.php +++ b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Conditional/Constructor_Test.php @@ -22,7 +22,7 @@ final class Constructor_Test extends Abstract_Schema_Aggregator_Conditional_Test public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options' ) + $this->getPropertyValue( $this->instance, 'options' ), ); } } diff --git a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Watcher/Abstract_Schema_Aggregator_Watcher_Test.php b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Watcher/Abstract_Schema_Aggregator_Watcher_Test.php index cc84920b0c4..d7c9d9ba8cb 100644 --- a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Watcher/Abstract_Schema_Aggregator_Watcher_Test.php +++ b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Watcher/Abstract_Schema_Aggregator_Watcher_Test.php @@ -40,7 +40,7 @@ protected function set_up() { $this->options_helper = Mockery::mock( Options_Helper::class ); $this->instance = new Schema_Aggregator_Watcher( - $this->options_helper + $this->options_helper, ); } } diff --git a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Watcher/Check_Schema_Aggregator_Enabled_Test.php b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Watcher/Check_Schema_Aggregator_Enabled_Test.php index d5a7fbd8afe..fb2d7924f76 100644 --- a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Watcher/Check_Schema_Aggregator_Enabled_Test.php +++ b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Watcher/Check_Schema_Aggregator_Enabled_Test.php @@ -77,7 +77,7 @@ public static function data_check_schema_aggregator_enabled() { 'expected' => false, 'should_check_timestamp' => true, 'should_set_timestamp' => false, - 'current_timestamp' => 1234567890, + 'current_timestamp' => 1_234_567_890, ]; yield 'Returns false when already enabled (no transition)' => [ 'old_value' => [ 'enable_schema_aggregation_endpoint' => true ], @@ -174,7 +174,7 @@ public function test_check_schema_aggregator_enabled_does_not_overwrite_existing ->expects( 'get' ) ->once() ->with( 'schema_aggregation_endpoint_enabled_on' ) - ->andReturn( 1234567890 ); + ->andReturn( 1_234_567_890 ); $this->options_helper ->expects( 'set' ) diff --git a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Watcher/Constructor_Test.php b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Watcher/Constructor_Test.php index 35c65e1b47c..500cab4c45a 100644 --- a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Watcher/Constructor_Test.php +++ b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Watcher/Constructor_Test.php @@ -22,7 +22,7 @@ final class Constructor_Test extends Abstract_Schema_Aggregator_Watcher_Test { public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); } } diff --git a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Watcher/Register_Hooks_Test.php b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Watcher/Register_Hooks_Test.php index aef05d97e8f..287a02886a6 100644 --- a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Watcher/Register_Hooks_Test.php +++ b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Aggregator_Watcher/Register_Hooks_Test.php @@ -24,8 +24,8 @@ public function test_register_hooks() { 10, \has_action( 'update_option_wpseo', - [ $this->instance, 'check_schema_aggregator_enabled' ] - ) + [ $this->instance, 'check_schema_aggregator_enabled' ], + ), ); } } diff --git a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Edd_Schema_Piece_Repository/Abstract_Edd_Schema_Piece_Repository_Test.php b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Edd_Schema_Piece_Repository/Abstract_Edd_Schema_Piece_Repository_Test.php index 008a9cc2612..17c71474bf2 100644 --- a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Edd_Schema_Piece_Repository/Abstract_Edd_Schema_Piece_Repository_Test.php +++ b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Edd_Schema_Piece_Repository/Abstract_Edd_Schema_Piece_Repository_Test.php @@ -52,7 +52,7 @@ protected function set_up() { $this->instance = new Edd_Schema_Piece_Repository( $this->edd_conditional, - $this->meta + $this->meta, ); } } diff --git a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Edd_Schema_Piece_Repository/Constructor_Test.php b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Edd_Schema_Piece_Repository/Constructor_Test.php index edb5579130d..1a917827ba1 100644 --- a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Edd_Schema_Piece_Repository/Constructor_Test.php +++ b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Edd_Schema_Piece_Repository/Constructor_Test.php @@ -25,12 +25,12 @@ final class Constructor_Test extends Abstract_Edd_Schema_Piece_Repository_Test { public function test_constructor(): void { $this->assertInstanceOf( EDD_Conditional::class, - $this->getPropertyValue( $this->instance, 'edd_conditional' ) + $this->getPropertyValue( $this->instance, 'edd_conditional' ), ); $this->assertInstanceOf( Meta_Surface::class, - $this->getPropertyValue( $this->instance, 'meta' ) + $this->getPropertyValue( $this->instance, 'meta' ), ); } } diff --git a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Schema_Piece_Repository/Abstract_Schema_Piece_Repository_Test.php b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Schema_Piece_Repository/Abstract_Schema_Piece_Repository_Test.php index cfb09bc0ff1..89efdddb6bb 100644 --- a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Schema_Piece_Repository/Abstract_Schema_Piece_Repository_Test.php +++ b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Schema_Piece_Repository/Abstract_Schema_Piece_Repository_Test.php @@ -112,7 +112,7 @@ protected function set_up() { $this->enhancement_factory, $this->indexable_repository_factory, $this->global_state_adapter, - $this->external_repository + $this->external_repository, ); } } diff --git a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Schema_Piece_Repository/Constructor_Test.php b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Schema_Piece_Repository/Constructor_Test.php index f81ab215cd4..71b321065b6 100644 --- a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Schema_Piece_Repository/Constructor_Test.php +++ b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Schema_Piece_Repository/Constructor_Test.php @@ -31,37 +31,37 @@ final class Constructor_Test extends Abstract_Schema_Piece_Repository_Test { public function test_constructor(): void { $this->assertInstanceOf( Meta_Tags_Context_Memoizer::class, - $this->getPropertyValue( $this->instance, 'memoizer' ) + $this->getPropertyValue( $this->instance, 'memoizer' ), ); $this->assertInstanceOf( Indexable_Helper::class, - $this->getPropertyValue( $this->instance, 'indexable_helper' ) + $this->getPropertyValue( $this->instance, 'indexable_helper' ), ); $this->assertInstanceOf( Meta_Tags_Context_Memoizer_Adapter::class, - $this->getPropertyValue( $this->instance, 'adapter' ) + $this->getPropertyValue( $this->instance, 'adapter' ), ); $this->assertInstanceOf( Aggregator_Config::class, - $this->getPropertyValue( $this->instance, 'config' ) + $this->getPropertyValue( $this->instance, 'config' ), ); $this->assertInstanceOf( Schema_Enhancement_Factory::class, - $this->getPropertyValue( $this->instance, 'enhancement_factory' ) + $this->getPropertyValue( $this->instance, 'enhancement_factory' ), ); $this->assertInstanceOf( Indexable_Repository_Factory::class, - $this->getPropertyValue( $this->instance, 'indexable_repository_factory' ) + $this->getPropertyValue( $this->instance, 'indexable_repository_factory' ), ); $this->assertInstanceOf( WordPress_Global_State_Adapter::class, - $this->getPropertyValue( $this->instance, 'global_state_adapter' ) + $this->getPropertyValue( $this->instance, 'global_state_adapter' ), ); $external_repositories = $this->getPropertyValue( $this->instance, 'external_repositories' ); @@ -69,7 +69,7 @@ public function test_constructor(): void { $this->assertCount( 1, $external_repositories ); $this->assertInstanceOf( External_Schema_Piece_Repository_Interface::class, - $external_repositories[0] + $external_repositories[0], ); } } diff --git a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Woo_Schema_Piece_Repository/Abstract_Woo_Schema_Piece_Repository_Test.php b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Woo_Schema_Piece_Repository/Abstract_Woo_Schema_Piece_Repository_Test.php index e996f10d3d4..58cb225ca95 100644 --- a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Woo_Schema_Piece_Repository/Abstract_Woo_Schema_Piece_Repository_Test.php +++ b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Woo_Schema_Piece_Repository/Abstract_Woo_Schema_Piece_Repository_Test.php @@ -42,7 +42,7 @@ protected function set_up() { $this->woocommerce_conditional = Mockery::mock( WooCommerce_Conditional::class ); $this->instance = new Woo_Schema_Piece_Repository( - $this->woocommerce_conditional + $this->woocommerce_conditional, ); } } diff --git a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Woo_Schema_Piece_Repository/Constructor_Test.php b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Woo_Schema_Piece_Repository/Constructor_Test.php index 58226a0b374..857880ccd7f 100644 --- a/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Woo_Schema_Piece_Repository/Constructor_Test.php +++ b/tests/Unit/Schema_Aggregator/Infrastructure/Schema_Pieces/Woo_Schema_Piece_Repository/Constructor_Test.php @@ -24,7 +24,7 @@ final class Constructor_Test extends Abstract_Woo_Schema_Piece_Repository_Test { public function test_constructor(): void { $this->assertInstanceOf( WooCommerce_Conditional::class, - $this->getPropertyValue( $this->instance, 'woocommerce_conditional' ) + $this->getPropertyValue( $this->instance, 'woocommerce_conditional' ), ); } } diff --git a/tests/Unit/Schema_Aggregator/User_Interface/Cache/Abstract_Cache_Listener_Integration/Abstract_Cache_Listener_Integration_Constructor_Test.php b/tests/Unit/Schema_Aggregator/User_Interface/Cache/Abstract_Cache_Listener_Integration/Abstract_Cache_Listener_Integration_Constructor_Test.php index 85967787e92..4db31ea03ae 100644 --- a/tests/Unit/Schema_Aggregator/User_Interface/Cache/Abstract_Cache_Listener_Integration/Abstract_Cache_Listener_Integration_Constructor_Test.php +++ b/tests/Unit/Schema_Aggregator/User_Interface/Cache/Abstract_Cache_Listener_Integration/Abstract_Cache_Listener_Integration_Constructor_Test.php @@ -71,19 +71,19 @@ public static function get_conditionals(): array { public function test_constructor() { $this->assertInstanceOf( Indexable_Repository::class, - $this->getPropertyValue( $this->instance, 'indexable_repository' ) + $this->getPropertyValue( $this->instance, 'indexable_repository' ), ); $this->assertInstanceOf( Config::class, - $this->getPropertyValue( $this->instance, 'config' ) + $this->getPropertyValue( $this->instance, 'config' ), ); $this->assertInstanceOf( Manager::class, - $this->getPropertyValue( $this->instance, 'manager' ) + $this->getPropertyValue( $this->instance, 'manager' ), ); $this->assertInstanceOf( Xml_Manager::class, - $this->getPropertyValue( $this->instance, 'xml_manager' ) + $this->getPropertyValue( $this->instance, 'xml_manager' ), ); } } diff --git a/tests/Unit/Schema_Aggregator/User_Interface/Cache/Indexables_Update_Listener_Integration/Abstract_Indexables_Update_Listener_Integration_Test.php b/tests/Unit/Schema_Aggregator/User_Interface/Cache/Indexables_Update_Listener_Integration/Abstract_Indexables_Update_Listener_Integration_Test.php index 598ac2d59ad..6688b1ded2f 100644 --- a/tests/Unit/Schema_Aggregator/User_Interface/Cache/Indexables_Update_Listener_Integration/Abstract_Indexables_Update_Listener_Integration_Test.php +++ b/tests/Unit/Schema_Aggregator/User_Interface/Cache/Indexables_Update_Listener_Integration/Abstract_Indexables_Update_Listener_Integration_Test.php @@ -70,7 +70,7 @@ protected function set_up() { $this->indexable_repository, $this->config, $this->manager, - $this->xml_manager + $this->xml_manager, ); } } diff --git a/tests/Unit/Schema_Aggregator/User_Interface/Cache/Indexables_Update_Listener_Integration/Indexables_Update_Listener_Integration_Get_Conditionals_Test.php b/tests/Unit/Schema_Aggregator/User_Interface/Cache/Indexables_Update_Listener_Integration/Indexables_Update_Listener_Integration_Get_Conditionals_Test.php index 3045c6722df..61efc0f1903 100644 --- a/tests/Unit/Schema_Aggregator/User_Interface/Cache/Indexables_Update_Listener_Integration/Indexables_Update_Listener_Integration_Get_Conditionals_Test.php +++ b/tests/Unit/Schema_Aggregator/User_Interface/Cache/Indexables_Update_Listener_Integration/Indexables_Update_Listener_Integration_Get_Conditionals_Test.php @@ -26,7 +26,7 @@ final class Indexables_Update_Listener_Integration_Get_Conditionals_Test extends public function test_get_conditionals() { $this->assertEquals( [ Schema_Aggregator_Conditional::class ], - Indexables_Update_Listener_Integration::get_conditionals() + Indexables_Update_Listener_Integration::get_conditionals(), ); } } diff --git a/tests/Unit/Schema_Aggregator/User_Interface/Cache/Indexables_Update_Listener_Integration/Indexables_Update_Listener_Integration_Register_Hooks_Test.php b/tests/Unit/Schema_Aggregator/User_Interface/Cache/Indexables_Update_Listener_Integration/Indexables_Update_Listener_Integration_Register_Hooks_Test.php index 62cea7f9aea..d995313f22a 100644 --- a/tests/Unit/Schema_Aggregator/User_Interface/Cache/Indexables_Update_Listener_Integration/Indexables_Update_Listener_Integration_Register_Hooks_Test.php +++ b/tests/Unit/Schema_Aggregator/User_Interface/Cache/Indexables_Update_Listener_Integration/Indexables_Update_Listener_Integration_Register_Hooks_Test.php @@ -26,7 +26,7 @@ public function test_register_hooks() { $this->instance->register_hooks(); $this->assertNotFalse( - Monkey\Actions\has( 'wpseo_save_indexable', [ $this->instance, 'reset_cache' ] ) + Monkey\Actions\has( 'wpseo_save_indexable', [ $this->instance, 'reset_cache' ] ), ); } } diff --git a/tests/Unit/Schema_Aggregator/User_Interface/Cache/WooCommerce_Product_Type_Change_Listener_Integration/Abstract_WooCommerce_Product_Type_Change_Listener_Integration_TestCase.php b/tests/Unit/Schema_Aggregator/User_Interface/Cache/WooCommerce_Product_Type_Change_Listener_Integration/Abstract_WooCommerce_Product_Type_Change_Listener_Integration_TestCase.php index 5c7c809f28d..2f18054af49 100644 --- a/tests/Unit/Schema_Aggregator/User_Interface/Cache/WooCommerce_Product_Type_Change_Listener_Integration/Abstract_WooCommerce_Product_Type_Change_Listener_Integration_TestCase.php +++ b/tests/Unit/Schema_Aggregator/User_Interface/Cache/WooCommerce_Product_Type_Change_Listener_Integration/Abstract_WooCommerce_Product_Type_Change_Listener_Integration_TestCase.php @@ -70,7 +70,7 @@ protected function set_up() { $this->indexable_repository, $this->config, $this->manager, - $this->xml_manager + $this->xml_manager, ); } } diff --git a/tests/Unit/Schema_Aggregator/User_Interface/Cache/WooCommerce_Product_Type_Change_Listener_Integration/WooCommerce_Product_Type_Change_Listener_Integration_Register_Hooks_Test.php b/tests/Unit/Schema_Aggregator/User_Interface/Cache/WooCommerce_Product_Type_Change_Listener_Integration/WooCommerce_Product_Type_Change_Listener_Integration_Register_Hooks_Test.php index e01f4769e96..81e0a596e07 100644 --- a/tests/Unit/Schema_Aggregator/User_Interface/Cache/WooCommerce_Product_Type_Change_Listener_Integration/WooCommerce_Product_Type_Change_Listener_Integration_Register_Hooks_Test.php +++ b/tests/Unit/Schema_Aggregator/User_Interface/Cache/WooCommerce_Product_Type_Change_Listener_Integration/WooCommerce_Product_Type_Change_Listener_Integration_Register_Hooks_Test.php @@ -26,7 +26,7 @@ public function test_register_hooks() { $this->instance->register_hooks(); $this->assertNotFalse( - Monkey\Actions\has( 'woocommerce_product_type_changed', [ $this->instance, 'reset_cache' ] ) + Monkey\Actions\has( 'woocommerce_product_type_changed', [ $this->instance, 'reset_cache' ] ), ); } } diff --git a/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Aggregator_Route/Abstract_Site_Schema_Aggregator_Route_Test.php b/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Aggregator_Route/Abstract_Site_Schema_Aggregator_Route_Test.php index 3c293e2a121..c673281099b 100644 --- a/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Aggregator_Route/Abstract_Site_Schema_Aggregator_Route_Test.php +++ b/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Aggregator_Route/Abstract_Site_Schema_Aggregator_Route_Test.php @@ -72,7 +72,7 @@ protected function set_up() { $this->config, $this->capability_helper, $this->command_handler, - $this->cache_manager + $this->cache_manager, ); } } diff --git a/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Aggregator_Route/Constructor_Test.php b/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Aggregator_Route/Constructor_Test.php index 88bf7282b50..73bdd0f53a7 100644 --- a/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Aggregator_Route/Constructor_Test.php +++ b/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Aggregator_Route/Constructor_Test.php @@ -27,22 +27,22 @@ final class Constructor_Test extends Abstract_Site_Schema_Aggregator_Route_Test public function test_constructor(): void { $this->assertInstanceOf( Config::class, - $this->getPropertyValue( $this->instance, 'config' ) + $this->getPropertyValue( $this->instance, 'config' ), ); $this->assertInstanceOf( Capability_Helper::class, - $this->getPropertyValue( $this->instance, 'capability_helper' ) + $this->getPropertyValue( $this->instance, 'capability_helper' ), ); $this->assertInstanceOf( Aggregate_Site_Schema_Command_Handler::class, - $this->getPropertyValue( $this->instance, 'aggregate_site_schema_command_handler' ) + $this->getPropertyValue( $this->instance, 'aggregate_site_schema_command_handler' ), ); $this->assertInstanceOf( Manager::class, - $this->getPropertyValue( $this->instance, 'cache_manager' ) + $this->getPropertyValue( $this->instance, 'cache_manager' ), ); } } diff --git a/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Aggregator_Route/Register_Routes_Test.php b/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Aggregator_Route/Register_Routes_Test.php index 8db4b8393b5..dfe35513af9 100644 --- a/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Aggregator_Route/Register_Routes_Test.php +++ b/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Aggregator_Route/Register_Routes_Test.php @@ -28,7 +28,7 @@ public function test_register_routes() { ->with( 'yoast/v1', Mockery::type( 'string' ), - Mockery::type( 'array' ) + Mockery::type( 'array' ), ); $this->instance->register_routes(); @@ -51,8 +51,8 @@ public function test_register_routes_registers_post_type_route() { static function ( $config ) use ( &$captured_config ) { $captured_config = $config; return true; - } - ) + }, + ), ); Functions\expect( 'register_rest_route' ) @@ -60,7 +60,7 @@ static function ( $config ) use ( &$captured_config ) { ->with( 'yoast/v1', 'schema-aggregator/get-schema/(?P[a-z0-9_-]+)/(?P\d+)', - Mockery::type( 'array' ) + Mockery::type( 'array' ), ); $this->instance->register_routes(); @@ -85,7 +85,7 @@ public function test_register_routes_registers_paginated_route() { ->with( 'yoast/v1', 'schema-aggregator/get-schema/(?P[a-z0-9_-]+)', - Mockery::type( 'array' ) + Mockery::type( 'array' ), ); Functions\expect( 'register_rest_route' ) @@ -97,8 +97,8 @@ public function test_register_routes_registers_paginated_route() { static function ( $config ) use ( &$captured_config ) { $captured_config = $config; return true; - } - ) + }, + ), ); $this->instance->register_routes(); diff --git a/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Aggregator_XML_Route/Abstract_Site_Schema_Aggregator_Xml_Route_Test.php b/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Aggregator_XML_Route/Abstract_Site_Schema_Aggregator_Xml_Route_Test.php index a8477a384e9..8766b576bab 100644 --- a/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Aggregator_XML_Route/Abstract_Site_Schema_Aggregator_Xml_Route_Test.php +++ b/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Aggregator_XML_Route/Abstract_Site_Schema_Aggregator_Xml_Route_Test.php @@ -62,7 +62,7 @@ protected function set_up() { $this->instance = new Site_Schema_Aggregator_Xml_Route( $this->command_handler, $this->xml_cache_manager, - $this->aggregator_config + $this->aggregator_config, ); } } diff --git a/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Aggregator_XML_Route/Register_Routes_Test.php b/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Aggregator_XML_Route/Register_Routes_Test.php index 3f985e5605e..9930e2c9ae7 100644 --- a/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Aggregator_XML_Route/Register_Routes_Test.php +++ b/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Aggregator_XML_Route/Register_Routes_Test.php @@ -31,7 +31,7 @@ public function test_register_routes() { 'methods' => 'GET', 'callback' => [ $this->instance, 'render_schema_xml' ], 'permission_callback' => [ $this->instance, 'get_permission_callback' ], - ] + ], ); $this->instance->register_routes(); diff --git a/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Response_Header_Integration/Abstract_Site_Schema_Response_Header_Integration_Test.php b/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Response_Header_Integration/Abstract_Site_Schema_Response_Header_Integration_Test.php index 4ab172ee96c..e66389371dd 100644 --- a/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Response_Header_Integration/Abstract_Site_Schema_Response_Header_Integration_Test.php +++ b/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Response_Header_Integration/Abstract_Site_Schema_Response_Header_Integration_Test.php @@ -40,7 +40,7 @@ protected function set_up() { $this->schema_map_header_adapter = Mockery::mock( Schema_Map_Header_Adapter::class ); $this->instance = new Site_Schema_Response_Header_Integration( - $this->schema_map_header_adapter + $this->schema_map_header_adapter, ); } } diff --git a/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Response_Header_Integration/Site_Schema_Response_Header_Integration_Construct_Test.php b/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Response_Header_Integration/Site_Schema_Response_Header_Integration_Construct_Test.php index 70dc4cd3595..fecaa6bc171 100644 --- a/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Response_Header_Integration/Site_Schema_Response_Header_Integration_Construct_Test.php +++ b/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Response_Header_Integration/Site_Schema_Response_Header_Integration_Construct_Test.php @@ -26,7 +26,7 @@ public function test_construct() { $this->assertInstanceOf( Site_Schema_Response_Header_Integration::class, $this->instance ); $this->assertInstanceOf( Schema_Map_Header_Adapter::class, - $this->getPropertyValue( $this->instance, 'schema_map_header_adapter' ) + $this->getPropertyValue( $this->instance, 'schema_map_header_adapter' ), ); } } diff --git a/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Response_Header_Integration/Site_Schema_Response_Header_Integration_Register_Hooks_Test.php b/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Response_Header_Integration/Site_Schema_Response_Header_Integration_Register_Hooks_Test.php index 8b0d34f2167..d1e003309d7 100644 --- a/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Response_Header_Integration/Site_Schema_Response_Header_Integration_Register_Hooks_Test.php +++ b/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Response_Header_Integration/Site_Schema_Response_Header_Integration_Register_Hooks_Test.php @@ -25,7 +25,7 @@ public function test_register_hooks() { $this->instance->register_hooks(); $this->assertNotFalse( - Monkey\Filters\has( 'rest_pre_serve_request', [ $this->instance, 'serve_custom_response' ] ) + Monkey\Filters\has( 'rest_pre_serve_request', [ $this->instance, 'serve_custom_response' ] ), ); } } diff --git a/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Robots_Txt_Integration/Site_Schema_Robots_Txt_Integration_Get_Conditionals_Test.php b/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Robots_Txt_Integration/Site_Schema_Robots_Txt_Integration_Get_Conditionals_Test.php index 34d2945ce10..bb17a686c83 100644 --- a/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Robots_Txt_Integration/Site_Schema_Robots_Txt_Integration_Get_Conditionals_Test.php +++ b/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Robots_Txt_Integration/Site_Schema_Robots_Txt_Integration_Get_Conditionals_Test.php @@ -26,7 +26,7 @@ final class Site_Schema_Robots_Txt_Integration_Get_Conditionals_Test extends Abs public function test_get_conditionals() { $this->assertEquals( [ Schema_Aggregator_Conditional::class ], - Site_Schema_Robots_Txt_Integration::get_conditionals() + Site_Schema_Robots_Txt_Integration::get_conditionals(), ); } } diff --git a/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Robots_Txt_Integration/Site_Schema_Robots_Txt_Integration_Register_Hooks_Test.php b/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Robots_Txt_Integration/Site_Schema_Robots_Txt_Integration_Register_Hooks_Test.php index 5d4565ec84d..9afdf4a0b2d 100644 --- a/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Robots_Txt_Integration/Site_Schema_Robots_Txt_Integration_Register_Hooks_Test.php +++ b/tests/Unit/Schema_Aggregator/User_Interface/Site_Schema_Robots_Txt_Integration/Site_Schema_Robots_Txt_Integration_Register_Hooks_Test.php @@ -26,7 +26,7 @@ public function test_register_hooks() { $this->instance->register_hooks(); $this->assertNotFalse( - Monkey\Actions\has( 'Yoast\WP\SEO\register_robots_rules', [ $this->instance, 'maybe_add_xml_schema_map' ] ) + Monkey\Actions\has( 'Yoast\WP\SEO\register_robots_rules', [ $this->instance, 'maybe_add_xml_schema_map' ] ), ); } } diff --git a/tests/Unit/Services/Importing/Aioseo_Social_Images_Provider_Service_Test.php b/tests/Unit/Services/Importing/Aioseo_Social_Images_Provider_Service_Test.php index f8c2ac1822f..9471d27be6e 100644 --- a/tests/Unit/Services/Importing/Aioseo_Social_Images_Provider_Service_Test.php +++ b/tests/Unit/Services/Importing/Aioseo_Social_Images_Provider_Service_Test.php @@ -161,7 +161,7 @@ public function test_get_first_attached_image( $post_type, $attachment_type_time 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', - ] + ], ) ->andReturn( $children ); diff --git a/tests/Unit/Services/Importing/Conflicting_Plugins_Service_Test.php b/tests/Unit/Services/Importing/Conflicting_Plugins_Service_Test.php index 6936f4c2cd5..7da9999dd82 100644 --- a/tests/Unit/Services/Importing/Conflicting_Plugins_Service_Test.php +++ b/tests/Unit/Services/Importing/Conflicting_Plugins_Service_Test.php @@ -70,7 +70,7 @@ public function test_detect_conflicting_plugins() { [ 'xml-sitemaps/xml-sitemaps.php', 'not-conflicting/plugin.php', - ] + ], ); // Act. @@ -98,7 +98,7 @@ public function test_detect_deactivating_conflicting_plugins() { [ 'xml-sitemaps/xml-sitemaps.php', 'not-conflicting/plugin.php', - ] + ], ); Monkey\Functions\expect( 'wp_unslash' ) ->andReturnFirstArg(); @@ -139,7 +139,7 @@ public function test_detect_deactivating_conflicting_plugins_plugin_is_int( $act [ 'xml-sitemaps/xml-sitemaps.php', 'not-conflicting/plugin.php', - ] + ], ); $_GET['action'] = $action; diff --git a/tests/Unit/Services/Importing/Importable_Detector_Service_Test.php b/tests/Unit/Services/Importing/Importable_Detector_Service_Test.php index 65686dc56b0..06f025d33af 100644 --- a/tests/Unit/Services/Importing/Importable_Detector_Service_Test.php +++ b/tests/Unit/Services/Importing/Importable_Detector_Service_Test.php @@ -206,7 +206,7 @@ protected function set_up() { $this->robots_provider, $this->robots_transformer, $this->social_images_provider, - ] + ], )->makePartial()->shouldAllowMockingProtectedMethods(); $this->cleanup_action = Mockery::mock( @@ -215,7 +215,7 @@ protected function set_up() { $this->wpdb, $this->options, $this->wpdb_helper, - ] + ], )->makePartial()->shouldAllowMockingProtectedMethods(); $this->instance = new Importable_Detector_Service( $this->importing_action, $this->cleanup_action ); @@ -224,7 +224,7 @@ protected function set_up() { [ $this->importing_action, $this->cleanup_action, - ] + ], )->makePartial()->shouldAllowMockingProtectedMethods(); } @@ -241,7 +241,7 @@ public function test_construct() { $importer = \array_values( self::getPropertyValue( $this->instance, 'importers' ) )[0]; $this->assertInstanceOf( Aioseo_Posts_Importing_Action::class, - $importer + $importer, ); } @@ -457,7 +457,7 @@ public function test_filter_actions_no_filters() { $this->assertTrue( \count( $filtered_importers_no_filters ) === 1 ); $this->assertInstanceOf( Aioseo_Posts_Importing_Action::class, - $filtered_importers_no_filters[0] + $filtered_importers_no_filters[0], ); } @@ -475,7 +475,7 @@ public function test_filter_actions_plugin_filter_only() { $this->assertTrue( \count( $filtered_importers_plugin_filters ) === 1 ); $this->assertInstanceOf( Aioseo_Posts_Importing_Action::class, - $filtered_importers_plugin_filters[0] + $filtered_importers_plugin_filters[0], ); } @@ -493,7 +493,7 @@ public function test_filter_actions_type_filter_only() { $this->assertTrue( \count( $filtered_importers_type_filters ) === 1 ); $this->assertInstanceOf( Aioseo_Posts_Importing_Action::class, - $filtered_importers_type_filters[0] + $filtered_importers_type_filters[0], ); } @@ -511,7 +511,7 @@ public function test_filter_actions_plugin_and_type_filter() { $this->assertTrue( \count( $filtered_importers_plugin_type_filters ) === 1 ); $this->assertInstanceOf( Aioseo_Posts_Importing_Action::class, - $filtered_importers_plugin_type_filters[0] + $filtered_importers_plugin_type_filters[0], ); } diff --git a/tests/Unit/Services/Indexables/Indexable_Version_Manager_Test.php b/tests/Unit/Services/Indexables/Indexable_Version_Manager_Test.php index 9312093f25b..cf0e0931d6b 100644 --- a/tests/Unit/Services/Indexables/Indexable_Version_Manager_Test.php +++ b/tests/Unit/Services/Indexables/Indexable_Version_Manager_Test.php @@ -63,7 +63,7 @@ protected function set_up() { public function test_construct() { self::assertInstanceOf( Indexable_Builder_Versions::class, - self::getPropertyValue( $this->instance, 'indexable_builder_versions' ) + self::getPropertyValue( $this->instance, 'indexable_builder_versions' ), ); } diff --git a/tests/Unit/Surfaces/Meta_Surface_Test.php b/tests/Unit/Surfaces/Meta_Surface_Test.php index e312213d523..0de689f5de2 100644 --- a/tests/Unit/Surfaces/Meta_Surface_Test.php +++ b/tests/Unit/Surfaces/Meta_Surface_Test.php @@ -103,7 +103,7 @@ protected function set_up() { $this->context_memoizer, $this->repository, $this->wp_rewrite_wrapper, - $this->indexable_helper + $this->indexable_helper, ); $this->context->presentation = (object) [ 'test' => 'succeeds' ]; @@ -517,7 +517,7 @@ static function ( $url, $component = -1 ) use ( $page_type, $is_date_archive ) { // phpcs:ignore WordPress.WP.AlternativeFunctions.parse_url_parse_url -- Test mock. return \parse_url( $url, $component ); } - } + }, ); $this->container->expects( 'get' ) @@ -563,7 +563,7 @@ static function ( $url, $component = -1 ) use ( $page_type, $is_date_archive ) { '([0-9]{4})/page/?([0-9]{1,})/?$' => 'index.php?year=$matches[1]&paged=$matches[2]', '([0-9]{4})/([0-9]{1,2})/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]', '([0-9]{4})/?$' => 'index.php?year=$matches[1]', - ] + ], ); $this->indexable->object_type = $object_type; @@ -616,7 +616,7 @@ public function test_for_url_with_unexpected_value( $url ) { 'wp_parse_url' => static function ( $url ) { return \parse_url( $url ); }, - ] + ], ); $this->assertFalse( $this->instance->for_url( $url ) ); diff --git a/tests/Unit/Surfaces/Values/Meta_Test.php b/tests/Unit/Surfaces/Values/Meta_Test.php index 16ec9758b83..7ec864a6119 100644 --- a/tests/Unit/Surfaces/Values/Meta_Test.php +++ b/tests/Unit/Surfaces/Values/Meta_Test.php @@ -60,12 +60,12 @@ protected function set_up() { Helpers_Surface::class => $helpers, WPSEO_Replace_Vars::class => $replace_vars, Front_End_Integration::class => $front_end, - ] + ], ); $this->instance = new Meta( $this->context, - $this->container + $this->container, ); } diff --git a/tests/Unit/Task_List/Application/Configuration/Abstract_Task_List_Configuration_Test.php b/tests/Unit/Task_List/Application/Configuration/Abstract_Task_List_Configuration_Test.php index 5330a9a2190..16b1d7d6f8f 100644 --- a/tests/Unit/Task_List/Application/Configuration/Abstract_Task_List_Configuration_Test.php +++ b/tests/Unit/Task_List/Application/Configuration/Abstract_Task_List_Configuration_Test.php @@ -50,7 +50,7 @@ protected function set_up() { $this->instance = new Task_List_Configuration( $this->options_helper, - $this->endpoints_repository + $this->endpoints_repository, ); } } diff --git a/tests/Unit/Task_List/Application/Configuration/Task_List_Configuration_Constructor_Test.php b/tests/Unit/Task_List/Application/Configuration/Task_List_Configuration_Constructor_Test.php index acbe8fb3335..de370a2b4cb 100644 --- a/tests/Unit/Task_List/Application/Configuration/Task_List_Configuration_Constructor_Test.php +++ b/tests/Unit/Task_List/Application/Configuration/Task_List_Configuration_Constructor_Test.php @@ -25,11 +25,11 @@ final class Task_List_Configuration_Constructor_Test extends Abstract_Task_List_ public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); $this->assertInstanceOf( Endpoints_Repository::class, - $this->getPropertyValue( $this->instance, 'endpoints_repository' ) + $this->getPropertyValue( $this->instance, 'endpoints_repository' ), ); } } diff --git a/tests/Unit/Task_List/Application/Tasks/Complete_FTC/Complete_FTC_Constructor_Test.php b/tests/Unit/Task_List/Application/Tasks/Complete_FTC/Complete_FTC_Constructor_Test.php index 34dfb79cdf2..6a0dcdac464 100644 --- a/tests/Unit/Task_List/Application/Tasks/Complete_FTC/Complete_FTC_Constructor_Test.php +++ b/tests/Unit/Task_List/Application/Tasks/Complete_FTC/Complete_FTC_Constructor_Test.php @@ -25,7 +25,7 @@ final class Complete_FTC_Constructor_Test extends Abstract_Complete_FTC_Test { public function test_constructor() { $this->assertInstanceOf( First_Time_Configuration_Notice_Helper::class, - $this->getPropertyValue( $this->instance, 'ftc_notice_helper' ) + $this->getPropertyValue( $this->instance, 'ftc_notice_helper' ), ); } } diff --git a/tests/Unit/Task_List/Application/Tasks/Create_New_Content/Create_New_Content_Constructor_Test.php b/tests/Unit/Task_List/Application/Tasks/Create_New_Content/Create_New_Content_Constructor_Test.php index 43f0c630857..b32cf12c91d 100644 --- a/tests/Unit/Task_List/Application/Tasks/Create_New_Content/Create_New_Content_Constructor_Test.php +++ b/tests/Unit/Task_List/Application/Tasks/Create_New_Content/Create_New_Content_Constructor_Test.php @@ -25,7 +25,7 @@ final class Create_New_Content_Constructor_Test extends Abstract_Create_New_Cont public function test_constructor() { $this->assertInstanceOf( Post_Type_Helper::class, - $this->getPropertyValue( $this->instance, 'post_type_helper' ) + $this->getPropertyValue( $this->instance, 'post_type_helper' ), ); } } diff --git a/tests/Unit/Task_List/Application/Tasks/Enable_Llms_Txt/Enable_Llms_Txt_Constructor_Test.php b/tests/Unit/Task_List/Application/Tasks/Enable_Llms_Txt/Enable_Llms_Txt_Constructor_Test.php index eca27e09b50..a3b2bffaffc 100644 --- a/tests/Unit/Task_List/Application/Tasks/Enable_Llms_Txt/Enable_Llms_Txt_Constructor_Test.php +++ b/tests/Unit/Task_List/Application/Tasks/Enable_Llms_Txt/Enable_Llms_Txt_Constructor_Test.php @@ -25,7 +25,7 @@ final class Enable_Llms_Txt_Constructor_Test extends Abstract_Enable_Llms_Txt_Te public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); } } diff --git a/tests/Unit/Task_List/Application/Tasks/Enable_Llms_Txt/Enable_Llms_Txt_Is_Valid_Test.php b/tests/Unit/Task_List/Application/Tasks/Enable_Llms_Txt/Enable_Llms_Txt_Is_Valid_Test.php index f1d6ce847a2..356a28afc55 100644 --- a/tests/Unit/Task_List/Application/Tasks/Enable_Llms_Txt/Enable_Llms_Txt_Is_Valid_Test.php +++ b/tests/Unit/Task_List/Application/Tasks/Enable_Llms_Txt/Enable_Llms_Txt_Is_Valid_Test.php @@ -26,7 +26,7 @@ public function test_is_valid_on_single_site() { Monkey\Functions\stubs( [ 'is_multisite' => false, - ] + ], ); $this->assertTrue( $this->instance->is_valid() ); @@ -41,7 +41,7 @@ public function test_is_not_valid_on_multisite() { Monkey\Functions\stubs( [ 'is_multisite' => true, - ] + ], ); $this->assertFalse( $this->instance->is_valid() ); diff --git a/tests/Unit/Task_List/Application/Tasks_Repository_Constructor_Test.php b/tests/Unit/Task_List/Application/Tasks_Repository_Constructor_Test.php index 7394c7d17a9..2e1c952b842 100644 --- a/tests/Unit/Task_List/Application/Tasks_Repository_Constructor_Test.php +++ b/tests/Unit/Task_List/Application/Tasks_Repository_Constructor_Test.php @@ -24,7 +24,7 @@ final class Tasks_Repository_Constructor_Test extends Abstract_Tasks_Repository_ public function test_constructor() { $this->assertInstanceOf( Cached_Tasks_Collector::class, - $this->getPropertyValue( $this->instance, 'tasks_collector' ) + $this->getPropertyValue( $this->instance, 'tasks_collector' ), ); } } diff --git a/tests/Unit/Task_List/Infrastructure/Register_Post_Type_Tasks_Integration_Register_Hooks_Test.php b/tests/Unit/Task_List/Infrastructure/Register_Post_Type_Tasks_Integration_Register_Hooks_Test.php index a5294526ecf..e56fdbac560 100644 --- a/tests/Unit/Task_List/Infrastructure/Register_Post_Type_Tasks_Integration_Register_Hooks_Test.php +++ b/tests/Unit/Task_List/Infrastructure/Register_Post_Type_Tasks_Integration_Register_Hooks_Test.php @@ -27,8 +27,8 @@ public function test_register_hooks() { 10, \has_filter( 'wpseo_task_list_tasks', - [ $this->instance, 'register_post_type_tasks' ] - ) + [ $this->instance, 'register_post_type_tasks' ], + ), ); } } diff --git a/tests/Unit/Task_List/Infrastructure/Tasks_Collectors/Cached_Collector/Cached_Tasks_Collector_Constructor_Test.php b/tests/Unit/Task_List/Infrastructure/Tasks_Collectors/Cached_Collector/Cached_Tasks_Collector_Constructor_Test.php index 948292ab364..c2b466f4257 100644 --- a/tests/Unit/Task_List/Infrastructure/Tasks_Collectors/Cached_Collector/Cached_Tasks_Collector_Constructor_Test.php +++ b/tests/Unit/Task_List/Infrastructure/Tasks_Collectors/Cached_Collector/Cached_Tasks_Collector_Constructor_Test.php @@ -25,7 +25,7 @@ final class Cached_Tasks_Collector_Constructor_Test extends Abstract_Cached_Task public function test_constructor() { $this->assertInstanceOf( Tasks_Collector::class, - $this->getPropertyValue( $this->instance, 'tasks_collector' ) + $this->getPropertyValue( $this->instance, 'tasks_collector' ), ); } } diff --git a/tests/Unit/Task_List/User_Interface/Complete_Task/Abstract_Complete_Task_Route_Test.php b/tests/Unit/Task_List/User_Interface/Complete_Task/Abstract_Complete_Task_Route_Test.php index f53feb515dd..b1c71768380 100644 --- a/tests/Unit/Task_List/User_Interface/Complete_Task/Abstract_Complete_Task_Route_Test.php +++ b/tests/Unit/Task_List/User_Interface/Complete_Task/Abstract_Complete_Task_Route_Test.php @@ -62,7 +62,7 @@ protected function set_up() { $this->instance = new Complete_Task_Route( $this->tasks_collector, $this->capability_helper, - $this->action_tracker + $this->action_tracker, ); } diff --git a/tests/Unit/Task_List/User_Interface/Complete_Task/Complete_Task_Route_Constructor_Test.php b/tests/Unit/Task_List/User_Interface/Complete_Task/Complete_Task_Route_Constructor_Test.php index 88082d70ab3..11318dbe3d3 100644 --- a/tests/Unit/Task_List/User_Interface/Complete_Task/Complete_Task_Route_Constructor_Test.php +++ b/tests/Unit/Task_List/User_Interface/Complete_Task/Complete_Task_Route_Constructor_Test.php @@ -26,15 +26,15 @@ final class Complete_Task_Route_Constructor_Test extends Abstract_Complete_Task_ public function test_constructor() { $this->assertInstanceOf( Tasks_Collector::class, - $this->getPropertyValue( $this->instance, 'tasks_collector' ) + $this->getPropertyValue( $this->instance, 'tasks_collector' ), ); $this->assertInstanceOf( Capability_Helper::class, - $this->getPropertyValue( $this->instance, 'capability_helper' ) + $this->getPropertyValue( $this->instance, 'capability_helper' ), ); $this->assertInstanceOf( Action_Tracker::class, - $this->getPropertyValue( $this->instance, 'action_tracker' ) + $this->getPropertyValue( $this->instance, 'action_tracker' ), ); } } diff --git a/tests/Unit/Task_List/User_Interface/Complete_Task/Complete_Task_Route_Register_Routes_Test.php b/tests/Unit/Task_List/User_Interface/Complete_Task/Complete_Task_Route_Register_Routes_Test.php index e25b6acab2d..dab01810345 100644 --- a/tests/Unit/Task_List/User_Interface/Complete_Task/Complete_Task_Route_Register_Routes_Test.php +++ b/tests/Unit/Task_List/User_Interface/Complete_Task/Complete_Task_Route_Register_Routes_Test.php @@ -46,7 +46,7 @@ public function test_register_routes() { ], ], ], - ] + ], ); $this->instance->register_routes(); diff --git a/tests/Unit/Task_List/User_Interface/Get_Tasks/Abstract_Get_Tasks_Route_Test.php b/tests/Unit/Task_List/User_Interface/Get_Tasks/Abstract_Get_Tasks_Route_Test.php index 9a5829ceaf4..cc7313a40a0 100644 --- a/tests/Unit/Task_List/User_Interface/Get_Tasks/Abstract_Get_Tasks_Route_Test.php +++ b/tests/Unit/Task_List/User_Interface/Get_Tasks/Abstract_Get_Tasks_Route_Test.php @@ -60,7 +60,7 @@ protected function set_up() { $this->instance = new Get_Tasks_Route( $this->tasks_repository, $this->capability_helper, - $this->action_tracker + $this->action_tracker, ); } } diff --git a/tests/Unit/Task_List/User_Interface/Get_Tasks/Get_Tasks_Route_Constructor_Test.php b/tests/Unit/Task_List/User_Interface/Get_Tasks/Get_Tasks_Route_Constructor_Test.php index c1bc8757b10..0076c948d07 100644 --- a/tests/Unit/Task_List/User_Interface/Get_Tasks/Get_Tasks_Route_Constructor_Test.php +++ b/tests/Unit/Task_List/User_Interface/Get_Tasks/Get_Tasks_Route_Constructor_Test.php @@ -26,15 +26,15 @@ final class Get_Tasks_Route_Constructor_Test extends Abstract_Get_Tasks_Route_Te public function test_constructor() { $this->assertInstanceOf( Tasks_Repository::class, - $this->getPropertyValue( $this->instance, 'tasks_repository' ) + $this->getPropertyValue( $this->instance, 'tasks_repository' ), ); $this->assertInstanceOf( Capability_Helper::class, - $this->getPropertyValue( $this->instance, 'capability_helper' ) + $this->getPropertyValue( $this->instance, 'capability_helper' ), ); $this->assertInstanceOf( Action_Tracker::class, - $this->getPropertyValue( $this->instance, 'action_tracker' ) + $this->getPropertyValue( $this->instance, 'action_tracker' ), ); } } diff --git a/tests/Unit/Task_List/User_Interface/Get_Tasks/Get_Tasks_Route_Register_Routes_Test.php b/tests/Unit/Task_List/User_Interface/Get_Tasks/Get_Tasks_Route_Register_Routes_Test.php index 2dee1f1d5d8..df98116cba9 100644 --- a/tests/Unit/Task_List/User_Interface/Get_Tasks/Get_Tasks_Route_Register_Routes_Test.php +++ b/tests/Unit/Task_List/User_Interface/Get_Tasks/Get_Tasks_Route_Register_Routes_Test.php @@ -51,7 +51,7 @@ public function test_register_routes() { ], ], ], - ] + ], ); $this->instance->register_routes(); diff --git a/tests/Unit/TestCase.php b/tests/Unit/TestCase.php index 61838e58b4a..e03d39886d9 100644 --- a/tests/Unit/TestCase.php +++ b/tests/Unit/TestCase.php @@ -37,7 +37,7 @@ protected function set_up() { [ // Null makes it so the function returns its first argument. 'is_admin' => false, - ] + ], ); Monkey\Functions\expect( 'get_option' ) @@ -87,7 +87,7 @@ protected function create_helper_surface( ContainerInterface $container ) { $container, new Open_Graph_Helpers_Surface( $container ), new Schema_Helpers_Surface( $container ), - new Twitter_Helpers_Surface( $container ) + new Twitter_Helpers_Surface( $container ), ); } diff --git a/tests/Unit/Tracking/Infrastructure/Tracking_Link_Adapter_Test.php b/tests/Unit/Tracking/Infrastructure/Tracking_Link_Adapter_Test.php index b6f4b9a4677..6703ca747df 100644 --- a/tests/Unit/Tracking/Infrastructure/Tracking_Link_Adapter_Test.php +++ b/tests/Unit/Tracking/Infrastructure/Tracking_Link_Adapter_Test.php @@ -66,7 +66,7 @@ public function test_create_tracking_link_for_tasks_valid_url() { 'wpseo_tracked_action' => 'task_first_actioned_on', 'wpseo_tracking_nonce' => $nonce_value, ], - $input_url + $input_url, ) ->once() ->andReturn( $expected_url ); diff --git a/tests/Unit/Tracking/Infrastructure/Tracking_On_Page_Load/Abstract_Tracking_On_Page_Load_Integration_Test.php b/tests/Unit/Tracking/Infrastructure/Tracking_On_Page_Load/Abstract_Tracking_On_Page_Load_Integration_Test.php index 340693252b9..65674ee324d 100644 --- a/tests/Unit/Tracking/Infrastructure/Tracking_On_Page_Load/Abstract_Tracking_On_Page_Load_Integration_Test.php +++ b/tests/Unit/Tracking/Infrastructure/Tracking_On_Page_Load/Abstract_Tracking_On_Page_Load_Integration_Test.php @@ -62,7 +62,7 @@ protected function set_up() { $this->instance = new Tracking_On_Page_Load_Integration( $this->action_tracker, $this->capability_helper, - $this->options_helper + $this->options_helper, ); } } diff --git a/tests/Unit/Tracking/Infrastructure/Tracking_On_Page_Load/Constructor_Test.php b/tests/Unit/Tracking/Infrastructure/Tracking_On_Page_Load/Constructor_Test.php index 36155201a9e..167ad196bd1 100644 --- a/tests/Unit/Tracking/Infrastructure/Tracking_On_Page_Load/Constructor_Test.php +++ b/tests/Unit/Tracking/Infrastructure/Tracking_On_Page_Load/Constructor_Test.php @@ -24,15 +24,15 @@ final class Constructor_Test extends Abstract_Tracking_On_Page_Load_Integration_ public function test_constructor() { $this->assertInstanceOf( Action_Tracker::class, - $this->getPropertyValue( $this->instance, 'action_tracker' ) + $this->getPropertyValue( $this->instance, 'action_tracker' ), ); $this->assertInstanceOf( Capability_Helper::class, - $this->getPropertyValue( $this->instance, 'capability_helper' ) + $this->getPropertyValue( $this->instance, 'capability_helper' ), ); $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); } } diff --git a/tests/Unit/Tracking/User_Interface/Action_Tracking/Abstract_Action_Tracking_Route_Test.php b/tests/Unit/Tracking/User_Interface/Action_Tracking/Abstract_Action_Tracking_Route_Test.php index dc9f9f664af..fd9d077737b 100644 --- a/tests/Unit/Tracking/User_Interface/Action_Tracking/Abstract_Action_Tracking_Route_Test.php +++ b/tests/Unit/Tracking/User_Interface/Action_Tracking/Abstract_Action_Tracking_Route_Test.php @@ -61,7 +61,7 @@ protected function set_up() { $this->instance = new Action_Tracking_Route( $this->action_tracker, $this->capability_helper, - $this->options_helper + $this->options_helper, ); } diff --git a/tests/Unit/Tracking/User_Interface/Action_Tracking/Action_Tracking_Route_Constructor_Test.php b/tests/Unit/Tracking/User_Interface/Action_Tracking/Action_Tracking_Route_Constructor_Test.php index fd89ba793be..7e65216fa09 100644 --- a/tests/Unit/Tracking/User_Interface/Action_Tracking/Action_Tracking_Route_Constructor_Test.php +++ b/tests/Unit/Tracking/User_Interface/Action_Tracking/Action_Tracking_Route_Constructor_Test.php @@ -26,15 +26,15 @@ final class Action_Tracking_Route_Constructor_Test extends Abstract_Action_Track public function test_constructor() { $this->assertInstanceOf( Action_Tracker::class, - $this->getPropertyValue( $this->instance, 'action_tracker' ) + $this->getPropertyValue( $this->instance, 'action_tracker' ), ); $this->assertInstanceOf( Capability_Helper::class, - $this->getPropertyValue( $this->instance, 'capability_helper' ) + $this->getPropertyValue( $this->instance, 'capability_helper' ), ); $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); } } diff --git a/tests/Unit/Tracking/User_Interface/Action_Tracking/Action_Tracking_Route_Register_Routes_Test.php b/tests/Unit/Tracking/User_Interface/Action_Tracking/Action_Tracking_Route_Register_Routes_Test.php index 8da3a04aac6..463f00033b0 100644 --- a/tests/Unit/Tracking/User_Interface/Action_Tracking/Action_Tracking_Route_Register_Routes_Test.php +++ b/tests/Unit/Tracking/User_Interface/Action_Tracking/Action_Tracking_Route_Register_Routes_Test.php @@ -40,7 +40,7 @@ public function test_register_routes() { ], ], ], - ] + ], ); $this->instance->register_routes(); diff --git a/tests/Unit/User_Meta/Application/Additional_Contactmethods_Collector_Test.php b/tests/Unit/User_Meta/Application/Additional_Contactmethods_Collector_Test.php index e635ac1cef0..401dbead15e 100644 --- a/tests/Unit/User_Meta/Application/Additional_Contactmethods_Collector_Test.php +++ b/tests/Unit/User_Meta/Application/Additional_Contactmethods_Collector_Test.php @@ -52,7 +52,7 @@ protected function set_up() { $this->instance = new Additional_Contactmethods_Collector( $this->facebook, - $this->youtube + $this->youtube, ); } diff --git a/tests/Unit/User_Meta/Application/Cleanup_Service_Test.php b/tests/Unit/User_Meta/Application/Cleanup_Service_Test.php index d0b5d935f40..0d030bb240f 100644 --- a/tests/Unit/User_Meta/Application/Cleanup_Service_Test.php +++ b/tests/Unit/User_Meta/Application/Cleanup_Service_Test.php @@ -61,7 +61,7 @@ protected function set_up() { $this->instance = new Cleanup_Service( $this->additional_contactmethods_collector, $this->custom_meta_collector, - $this->cleanup_repository + $this->cleanup_repository, ); } @@ -75,15 +75,15 @@ protected function set_up() { public function test_constructor() { $this->assertInstanceOf( Additional_Contactmethods_Collector::class, - $this->getPropertyValue( $this->instance, 'additional_contactmethods_collector' ) + $this->getPropertyValue( $this->instance, 'additional_contactmethods_collector' ), ); $this->assertInstanceOf( Custom_Meta_Collector::class, - $this->getPropertyValue( $this->instance, 'custom_meta_collector' ) + $this->getPropertyValue( $this->instance, 'custom_meta_collector' ), ); $this->assertInstanceOf( Cleanup_Repository::class, - $this->getPropertyValue( $this->instance, 'cleanup_repository' ) + $this->getPropertyValue( $this->instance, 'cleanup_repository' ), ); } diff --git a/tests/Unit/User_Meta/Application/Custom_Meta_Collector_Test.php b/tests/Unit/User_Meta/Application/Custom_Meta_Collector_Test.php index 9b19b07733c..ceab48402ce 100644 --- a/tests/Unit/User_Meta/Application/Custom_Meta_Collector_Test.php +++ b/tests/Unit/User_Meta/Application/Custom_Meta_Collector_Test.php @@ -51,7 +51,7 @@ protected function set_up() { $this->instance = new Custom_Meta_Collector( $this->author_metadesc, - $this->noindex_author + $this->noindex_author, ); } diff --git a/tests/Unit/User_Meta/Framework/Custom_Meta/Author_Metadesc_Test.php b/tests/Unit/User_Meta/Framework/Custom_Meta/Author_Metadesc_Test.php index 66f7c94b3da..6509efebe9e 100644 --- a/tests/Unit/User_Meta/Framework/Custom_Meta/Author_Metadesc_Test.php +++ b/tests/Unit/User_Meta/Framework/Custom_Meta/Author_Metadesc_Test.php @@ -56,7 +56,7 @@ protected function set_up(): void { public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); } diff --git a/tests/Unit/User_Meta/Framework/Custom_Meta/Author_Title_Test.php b/tests/Unit/User_Meta/Framework/Custom_Meta/Author_Title_Test.php index aab2dcefd9e..f37fc1615e1 100644 --- a/tests/Unit/User_Meta/Framework/Custom_Meta/Author_Title_Test.php +++ b/tests/Unit/User_Meta/Framework/Custom_Meta/Author_Title_Test.php @@ -56,7 +56,7 @@ protected function set_up(): void { public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); } diff --git a/tests/Unit/User_Meta/Framework/Custom_Meta/Content_Analysis_Disable_Test.php b/tests/Unit/User_Meta/Framework/Custom_Meta/Content_Analysis_Disable_Test.php index dfe34e07f8c..afdfc2ce9fc 100644 --- a/tests/Unit/User_Meta/Framework/Custom_Meta/Content_Analysis_Disable_Test.php +++ b/tests/Unit/User_Meta/Framework/Custom_Meta/Content_Analysis_Disable_Test.php @@ -56,7 +56,7 @@ protected function set_up(): void { public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); } diff --git a/tests/Unit/User_Meta/Framework/Custom_Meta/Inclusive_Language_Analysis_Disable_Test.php b/tests/Unit/User_Meta/Framework/Custom_Meta/Inclusive_Language_Analysis_Disable_Test.php index a34f346674a..1c4cc9204e6 100644 --- a/tests/Unit/User_Meta/Framework/Custom_Meta/Inclusive_Language_Analysis_Disable_Test.php +++ b/tests/Unit/User_Meta/Framework/Custom_Meta/Inclusive_Language_Analysis_Disable_Test.php @@ -56,7 +56,7 @@ protected function set_up(): void { public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); } diff --git a/tests/Unit/User_Meta/Framework/Custom_Meta/Keyword_Analysis_Disable_Test.php b/tests/Unit/User_Meta/Framework/Custom_Meta/Keyword_Analysis_Disable_Test.php index 6b9f63c84e9..3bda5a50bf5 100644 --- a/tests/Unit/User_Meta/Framework/Custom_Meta/Keyword_Analysis_Disable_Test.php +++ b/tests/Unit/User_Meta/Framework/Custom_Meta/Keyword_Analysis_Disable_Test.php @@ -56,7 +56,7 @@ protected function set_up(): void { public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); } diff --git a/tests/Unit/User_Meta/Framework/Custom_Meta/Noindex_Author_Test.php b/tests/Unit/User_Meta/Framework/Custom_Meta/Noindex_Author_Test.php index d9fa4a073ac..3410a72c5e7 100644 --- a/tests/Unit/User_Meta/Framework/Custom_Meta/Noindex_Author_Test.php +++ b/tests/Unit/User_Meta/Framework/Custom_Meta/Noindex_Author_Test.php @@ -56,7 +56,7 @@ protected function set_up(): void { public function test_constructor() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); } diff --git a/tests/Unit/User_Meta/Infrastructure/Cleanup_Repository_Test.php b/tests/Unit/User_Meta/Infrastructure/Cleanup_Repository_Test.php index 7eb99fb897b..5128a77c609 100644 --- a/tests/Unit/User_Meta/Infrastructure/Cleanup_Repository_Test.php +++ b/tests/Unit/User_Meta/Infrastructure/Cleanup_Repository_Test.php @@ -64,7 +64,7 @@ public function test_delete_empty_usermeta_query() { 'facebook', 'wpseo_noindex_author', 1000, - ] + ], ) ->andReturn( ' @@ -72,7 +72,7 @@ public function test_delete_empty_usermeta_query() { WHERE meta_key IN( "facebook", "wpseo_noindex_author" ) AND meta_value = "" ORDER BY user_id - LIMIT 1000' + LIMIT 1000', ); $wpdb @@ -84,7 +84,7 @@ public function test_delete_empty_usermeta_query() { WHERE meta_key IN( "facebook", "wpseo_noindex_author" ) AND meta_value = "" ORDER BY user_id - LIMIT 1000' + LIMIT 1000', ) ->andReturn( 200 ); diff --git a/tests/Unit/User_Meta/User_Interface/Additional_Contactmethods_Integration_Test.php b/tests/Unit/User_Meta/User_Interface/Additional_Contactmethods_Integration_Test.php index f64c962d133..4c739c67ed8 100644 --- a/tests/Unit/User_Meta/User_Interface/Additional_Contactmethods_Integration_Test.php +++ b/tests/Unit/User_Meta/User_Interface/Additional_Contactmethods_Integration_Test.php @@ -42,7 +42,7 @@ protected function set_up() { $this->additional_contactmethods_collector = Mockery::mock( Additional_Contactmethods_Collector::class ); $this->instance = new Additional_Contactmethods_Integration( - $this->additional_contactmethods_collector + $this->additional_contactmethods_collector, ); } @@ -67,7 +67,7 @@ public function test_get_conditionals() { public function test_constructor() { $this->assertInstanceOf( Additional_Contactmethods_Collector::class, - $this->getPropertyValue( $this->instance, 'additional_contactmethods_collector' ) + $this->getPropertyValue( $this->instance, 'additional_contactmethods_collector' ), ); } diff --git a/tests/Unit/User_Meta/User_Interface/Cleanup_Integration_Test.php b/tests/Unit/User_Meta/User_Interface/Cleanup_Integration_Test.php index 7fd3643fc50..061fc183dd5 100644 --- a/tests/Unit/User_Meta/User_Interface/Cleanup_Integration_Test.php +++ b/tests/Unit/User_Meta/User_Interface/Cleanup_Integration_Test.php @@ -42,7 +42,7 @@ protected function set_up() { $this->cleanup_service = Mockery::mock( Cleanup_Service::class ); $this->instance = new Cleanup_Integration( - $this->cleanup_service + $this->cleanup_service, ); } @@ -67,7 +67,7 @@ public function test_get_conditionals() { public function test_constructor() { $this->assertInstanceOf( Cleanup_Service::class, - $this->getPropertyValue( $this->instance, 'cleanup_service' ) + $this->getPropertyValue( $this->instance, 'cleanup_service' ), ); } diff --git a/tests/Unit/User_Meta/User_Interface/Custom_Meta_Integration_Test.php b/tests/Unit/User_Meta/User_Interface/Custom_Meta_Integration_Test.php index 431d4073a3d..a8d3de453cb 100644 --- a/tests/Unit/User_Meta/User_Interface/Custom_Meta_Integration_Test.php +++ b/tests/Unit/User_Meta/User_Interface/Custom_Meta_Integration_Test.php @@ -48,7 +48,7 @@ protected function set_up() { $this->custom_meta_collector = Mockery::mock( Custom_Meta_Collector::class ); $this->instance = new Custom_Meta_Integration( - $this->custom_meta_collector + $this->custom_meta_collector, ); } @@ -79,7 +79,7 @@ public function test_get_conditionals() { public function test_constructor() { $this->assertInstanceOf( Custom_Meta_Collector::class, - $this->getPropertyValue( $this->instance, 'custom_meta_collector' ) + $this->getPropertyValue( $this->instance, 'custom_meta_collector' ), ); } diff --git a/tests/Unit/User_Profiles_Additions/User_Interface/User_Profiles_Additions_Ui_Test.php b/tests/Unit/User_Profiles_Additions/User_Interface/User_Profiles_Additions_Ui_Test.php index a8b58f35f30..b001ffb161a 100644 --- a/tests/Unit/User_Profiles_Additions/User_Interface/User_Profiles_Additions_Ui_Test.php +++ b/tests/Unit/User_Profiles_Additions/User_Interface/User_Profiles_Additions_Ui_Test.php @@ -65,11 +65,11 @@ protected function set_up() { public function test_construct() { $this->assertInstanceOf( WPSEO_Admin_Asset_Manager::class, - $this->getPropertyValue( $this->instance, 'asset_manager' ) + $this->getPropertyValue( $this->instance, 'asset_manager' ), ); $this->assertInstanceOf( Product_Helper::class, - $this->getPropertyValue( $this->instance, 'product_helper' ) + $this->getPropertyValue( $this->instance, 'product_helper' ), ); } @@ -83,7 +83,7 @@ public function test_construct() { public function test_get_conditionals() { $this->assertEquals( [ User_Profile_Conditional::class ], - User_Profiles_Additions_Ui::get_conditionals() + User_Profiles_Additions_Ui::get_conditionals(), ); } diff --git a/tests/Unit/Values/Images_Test.php b/tests/Unit/Values/Images_Test.php index 8ac4fc1947c..35a36899b64 100644 --- a/tests/Unit/Values/Images_Test.php +++ b/tests/Unit/Values/Images_Test.php @@ -74,7 +74,7 @@ public function test_add_image() { [ 'image.jpg' => $image, ], - $this->instance->get_images() + $this->instance->get_images(), ); } @@ -101,7 +101,7 @@ public function test_add_image_with_string_given() { 'url' => $image, ], ], - $this->instance->get_images() + $this->instance->get_images(), ); } @@ -153,7 +153,7 @@ public function test_add_image_that_is_added_before() { [ 'image.jpg' => $image1, ], - $this->instance->get_images() + $this->instance->get_images(), ); } @@ -230,7 +230,7 @@ public function test_add_image_by_url_with_no_image_id() { [ 'image.jpg' => $image, ], - $this->instance->get_images() + $this->instance->get_images(), ); } @@ -261,7 +261,7 @@ public function test_add_image_by_id() { 'url' => 'image.jpg', ], ], - $this->instance->get_images() + $this->instance->get_images(), ); } diff --git a/tests/Unit/Values/OAuth/OAuth_Token_Test.php b/tests/Unit/Values/OAuth/OAuth_Token_Test.php index 76b80c34488..40ec55ea98b 100644 --- a/tests/Unit/Values/OAuth/OAuth_Token_Test.php +++ b/tests/Unit/Values/OAuth/OAuth_Token_Test.php @@ -44,7 +44,7 @@ protected function set_up() { * @return void */ public function test_creating_new_instance() { - $instance = new OAuth_Token( '000000', '000001', 604800, false, $this->created_at ); + $instance = new OAuth_Token( '000000', '000001', 604_800, false, $this->created_at ); $this->assertInstanceOf( OAuth_Token::class, $instance ); } @@ -59,7 +59,7 @@ public function test_creating_new_instance() { public function test_creating_new_instance_empty_access_token() { $this->expectException( Empty_Property_Exception::class ); - new OAuth_Token( '', '000001', 604800, true, $this->created_at ); + new OAuth_Token( '', '000001', 604_800, true, $this->created_at ); } /** @@ -72,7 +72,7 @@ public function test_creating_new_instance_empty_access_token() { public function test_creating_new_instance_empty_refresh_token() { $this->expectException( Empty_Property_Exception::class ); - new OAuth_Token( '000000', '', 604800, true, $this->created_at ); + new OAuth_Token( '000000', '', 604_800, true, $this->created_at ); } /** @@ -98,7 +98,7 @@ public function test_creating_new_instance_empty_expires() { public function test_creating_new_instance_empty_has_expired() { $this->expectException( Empty_Property_Exception::class ); - new OAuth_Token( '000000', '000001', 604800, null, $this->created_at ); + new OAuth_Token( '000000', '000001', 604_800, null, $this->created_at ); } /** @@ -109,11 +109,11 @@ public function test_creating_new_instance_empty_has_expired() { * @return void */ public function test_getters() { - $instance = new OAuth_Token( '000000', '000001', ( $this->created_at + 604800 ), false, $this->created_at ); + $instance = new OAuth_Token( '000000', '000001', ( $this->created_at + 604_800 ), false, $this->created_at ); $this->assertEquals( '000000', $instance->access_token ); $this->assertEquals( '000001', $instance->refresh_token ); - $this->assertEquals( ( $this->created_at + 604800 ), $instance->expires ); + $this->assertEquals( ( $this->created_at + 604_800 ), $instance->expires ); $this->assertFalse( $instance->has_expired() ); $this->assertEquals( $this->created_at, $instance->created_at ); $this->assertEquals( 0, $instance->error_count ); @@ -130,21 +130,21 @@ public function test_to_array() { $instance = new OAuth_Token( '000000', '000001', - ( $this->created_at + 604800 ), + ( $this->created_at + 604_800 ), false, - $this->created_at + $this->created_at, ); $this->assertEquals( [ 'access_token' => '000000', 'refresh_token' => '000001', - 'expires' => ( $this->created_at + 604800 ), + 'expires' => ( $this->created_at + 604_800 ), 'has_expired' => false, 'created_at' => $this->created_at, 'error_count' => 0, ], - $instance->to_array() + $instance->to_array(), ); } @@ -162,9 +162,9 @@ public function test_from_response() { [ 'getToken' => '000000', 'getRefreshToken' => '000001', - 'getExpires' => 604800, + 'getExpires' => 604_800, 'hasExpired' => false, - ] + ], ); $instance = OAuth_Token::from_response( $response ); @@ -172,7 +172,7 @@ public function test_from_response() { $this->assertInstanceOf( OAuth_Token::class, $instance ); $this->assertEquals( '000000', $this->getPropertyValue( $instance, 'access_token' ) ); $this->assertEquals( '000001', $this->getPropertyValue( $instance, 'refresh_token' ) ); - $this->assertEquals( 604800, $this->getPropertyValue( $instance, 'expires' ) ); + $this->assertEquals( 604_800, $this->getPropertyValue( $instance, 'expires' ) ); $this->assertEquals( false, $this->getPropertyValue( $instance, 'has_expired' ) ); $this->assertEquals( $this->created_at, $this->getPropertyValue( $instance, 'created_at' ) ); } diff --git a/tests/Unit/Values/Open_Graph/Images_Test.php b/tests/Unit/Values/Open_Graph/Images_Test.php index 391cf787cb2..36fd88b96e6 100644 --- a/tests/Unit/Values/Open_Graph/Images_Test.php +++ b/tests/Unit/Values/Open_Graph/Images_Test.php @@ -60,7 +60,7 @@ protected function set_up() { $this->url = Mockery::mock( Url_Helper::class )->makePartial(); $this->open_graph_image = Mockery::mock( Open_Graph_Image_Helper::class, - [ new Url_Helper(), $this->image ] + [ new Url_Helper(), $this->image ], )->makePartial(); $this->instance = new Images( $this->image, $this->url ); @@ -89,7 +89,7 @@ public function test_add_image_by_id() { 'url' => 'image.jpg', ], ], - $this->instance->get_images() + $this->instance->get_images(), ); } diff --git a/tests/Unit/bootstrap.php b/tests/Unit/bootstrap.php index b7a94f592e8..991bcf2fc87 100644 --- a/tests/Unit/bootstrap.php +++ b/tests/Unit/bootstrap.php @@ -64,7 +64,7 @@ 'WP_Term', 'WP_User', 'wpdb', - ] + ], ); /* ********************* DEFINES DEPENDING ON AUTOLOADED CODE ********************* */ diff --git a/tests/WP/Admin/Asset_Manager_Test.php b/tests/WP/Admin/Asset_Manager_Test.php index d0371e7e15d..cbcc2bb3e37 100644 --- a/tests/WP/Admin/Asset_Manager_Test.php +++ b/tests/WP/Admin/Asset_Manager_Test.php @@ -46,7 +46,7 @@ public function test_DEFAULT_register() { 'register_styles', 'scripts_to_be_registered', 'styles_to_be_registered', - ] + ], ) ->getMock(); @@ -54,14 +54,14 @@ public function test_DEFAULT_register() { ->expects( $this->once() ) ->method( 'scripts_to_be_registered' ) ->willReturn( - [ 'script' ] + [ 'script' ], ); $instance ->expects( $this->once() ) ->method( 'styles_to_be_registered' ) ->willReturn( - [ 'style' ] + [ 'style' ], ); $instance @@ -265,7 +265,7 @@ public function test_register_scripts() { ->method( 'register_script' ) ->withConsecutive( [ $this->equalTo( new WPSEO_Admin_Asset( $asset_args[0] ) ) ], - [ $this->equalTo( new WPSEO_Admin_Asset( $asset_args[1] ) ) ] + [ $this->equalTo( new WPSEO_Admin_Asset( $asset_args[1] ) ) ], ); $class_instance->register_scripts( $asset_args ); @@ -302,7 +302,7 @@ public function test_register_styles() { ->method( 'register_style' ) ->withConsecutive( [ $this->equalTo( new WPSEO_Admin_Asset( $asset_args[0] ) ) ], - [ $this->equalTo( new WPSEO_Admin_Asset( $asset_args[1] ) ) ] + [ $this->equalTo( new WPSEO_Admin_Asset( $asset_args[1] ) ) ], ); $class_instance->register_styles( $asset_args ); diff --git a/tests/WP/Admin/Database_Proxy_Test.php b/tests/WP/Admin/Database_Proxy_Test.php index e3edff4a8e9..e3ba423a728 100644 --- a/tests/WP/Admin/Database_Proxy_Test.php +++ b/tests/WP/Admin/Database_Proxy_Test.php @@ -44,7 +44,7 @@ public static function set_up_before_class() { ], [ 'PRIMARY KEY (id)', - ] + ], ); } @@ -90,7 +90,7 @@ public function test_insert() { 'testkey' => 'key2', 'testval' => 'value2', ], - [ '%s', '%s' ] + [ '%s', '%s' ], ); $this->assertSame( 1, $result ); @@ -109,7 +109,7 @@ public function test_insert_exists() { 'testkey' => 'key2', 'testval' => 'value2', ], - [ '%s', '%s' ] + [ '%s', '%s' ], ); $result = self::$proxy->insert( @@ -118,7 +118,7 @@ public function test_insert_exists() { 'testkey' => 'key2', 'testval' => 'value2', ], - [ '%d', '%s', '%s' ] + [ '%d', '%s', '%s' ], ); $this->assertFalse( $result ); @@ -136,7 +136,7 @@ public function test_insert_invalid() { [ 'testvalue' => 'value2', ], - [ '%s' ] + [ '%s' ], ); $this->assertFalse( $result ); @@ -155,7 +155,7 @@ public function test_update() { 'testkey' => 'key2', 'testval' => 'value2', ], - [ '%s', '%s' ] + [ '%s', '%s' ], ); $result = self::$proxy->update( @@ -166,7 +166,7 @@ public function test_update() { 'testkey' => 'key2', ], [ '%s' ], - [ '%s' ] + [ '%s' ], ); $this->assertSame( 1, $result ); @@ -188,7 +188,7 @@ public function test_update_not_exists() { 'testkey' => 'key2', ], [ '%s' ], - [ '%s' ] + [ '%s' ], ); $this->assertSame( 0, $result ); @@ -210,7 +210,7 @@ public function test_update_invalid() { 'testkey' => 'key1', ], [ '%s' ], - [ '%s' ] + [ '%s' ], ); $this->assertFalse( $result ); @@ -233,7 +233,7 @@ public function test_upsert_new() { [ 'id' => 2, ], - [ '%d', '%s', '%s' ] + [ '%d', '%s', '%s' ], ); $this->assertSame( 1, $result ); @@ -253,7 +253,7 @@ public function test_upsert_existing() { 'testkey' => 'key10', 'testval' => 'value10-1', ], - [ '%d', '%s', '%s' ] + [ '%d', '%s', '%s' ], ); $result = self::$proxy->upsert( @@ -265,7 +265,7 @@ public function test_upsert_existing() { [ 'id' => 10, ], - [ '%d', '%s', '%s' ] + [ '%d', '%s', '%s' ], ); /* @@ -288,7 +288,7 @@ public function test_upsert_existing() { 'testkey' => 'key10', 'testval' => 'value10-2', ], - $results[0] + $results[0], ); } @@ -305,14 +305,14 @@ public function test_delete() { 'testkey' => 'key1', 'testval' => 'value', ], - [ '%s', '%s' ] + [ '%s', '%s' ], ); $result = self::$proxy->delete( [ 'testkey' => 'key1', ], - [ '%s' ] + [ '%s' ], ); $this->assertSame( 1, $result ); @@ -330,7 +330,7 @@ public function test_delete_not_exists() { [ 'testkey' => 'key2', ], - [ '%s' ] + [ '%s' ], ); $this->assertSame( 0, $result ); @@ -348,7 +348,7 @@ public function test_delete_invalid() { [ 'testvalue' => 'key1', ], - [ '%s' ] + [ '%s' ], ); $this->assertFalse( $result ); @@ -369,7 +369,7 @@ public function test_get_results() { 'testkey' => 'key1', 'testval' => 'value', ], - [ '%s', '%s' ] + [ '%s', '%s' ], ); $result = self::$proxy->get_results( "SELECT * FROM $table_name WHERE testkey = 'key1'" ); @@ -406,7 +406,7 @@ public function test_create_table() { ], [ 'PRIMARY KEY (id)', - ] + ], ); $this->assertTrue( $result ); diff --git a/tests/WP/Admin/Editor_Specific_Replace_Vars_Test.php b/tests/WP/Admin/Editor_Specific_Replace_Vars_Test.php index 23f5f94cfc1..9295750910f 100644 --- a/tests/WP/Admin/Editor_Specific_Replace_Vars_Test.php +++ b/tests/WP/Admin/Editor_Specific_Replace_Vars_Test.php @@ -39,7 +39,7 @@ public function set_up() { public function test_add_for_page_types() { $this->class_instance->add_for_page_types( [ 'post' ], - [ 'cf_custom_field' ] + [ 'cf_custom_field' ], ); $actual = $this->class_instance->get(); @@ -94,8 +94,8 @@ public function test_get_shared_replace_vars_filters_editor_specific_replace_var $this->assertEquals( [ 'title' ], $this->class_instance->get_generic( - $replace_vars_list - ) + $replace_vars_list, + ), ); } @@ -326,7 +326,7 @@ private function create_and_get_with_post_type( $post_type = 'post' ) { return self::factory()->post->create_and_get( [ 'post_type' => $post_type, - ] + ], ); } @@ -354,7 +354,7 @@ public function test_editor_specific_replacement_variables_filter() { $this->assertEquals( $expected_replacement_variables, - $this->class_instance->get() + $this->class_instance->get(), ); \remove_filter( 'wpseo_editor_specific_replace_vars', [ $this, 'filter_editor_specific_replacement_variables' ] ); @@ -385,7 +385,7 @@ public function test_editor_specific_replacement_variables_filter_with_wrong_ret $this->assertEquals( $expected_replacement_variables, - $this->class_instance->get() + $this->class_instance->get(), ); \remove_filter( 'wpseo_editor_specific_replace_vars', '__return_false' ); diff --git a/tests/WP/Admin/Exceptions/File_Size_Exception_Test.php b/tests/WP/Admin/Exceptions/File_Size_Exception_Test.php index 538b880765c..d8182623d36 100644 --- a/tests/WP/Admin/Exceptions/File_Size_Exception_Test.php +++ b/tests/WP/Admin/Exceptions/File_Size_Exception_Test.php @@ -22,7 +22,7 @@ public function test_externally_hosted_exception() { $this->assertEquals( 'Cannot get the size of https://external.im/age.jpg because it is hosted externally.', - $expected_exception->getMessage() + $expected_exception->getMessage(), ); } @@ -38,7 +38,7 @@ public function test_unknown_error() { $this->assertEquals( 'Cannot get the size of image.jpg because of unknown reasons.', - $expected_exception->getMessage() + $expected_exception->getMessage(), ); } } diff --git a/tests/WP/Admin/Import/Premium_SEO_Pack_Test.php b/tests/WP/Admin/Import/Premium_SEO_Pack_Test.php index 65532a2fbbc..e3a9ff3d471 100644 --- a/tests/WP/Admin/Import/Premium_SEO_Pack_Test.php +++ b/tests/WP/Admin/Import/Premium_SEO_Pack_Test.php @@ -301,7 +301,7 @@ private function setup_post( $pre_existing_yoast_data = false ) { 'og_media' => 'http://local.wordpress.test/wp-content/uploads/2018/01/actionable-seo.png', 'og_title' => 'OpenGraph AIOSEO title', 'cornerstone' => 1, - ] + ], ); $this->insert_post( $post_id, $blob ); @@ -346,7 +346,7 @@ private function build_data_blob( $data = [] ) { 'patterns' => '', 'sep' => '', ], - $data + $data, ); } @@ -376,8 +376,8 @@ private function insert_post( $post_id, $blob ) { $post_id, \get_permalink( $post_id ), \md5( \get_permalink( $post_id ) ), - \serialize( $blob ) - ) + \serialize( $blob ), + ), ); } @@ -404,7 +404,7 @@ private function create_table() { UNIQUE KEY `url_hash` (`url_hash`) USING BTREE, KEY `post_id` (`post_id`) USING BTREE, KEY `blog_id_url_hash` (`blog_id`,`url_hash`) USING BTREE - ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8" + ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8", ); } } diff --git a/tests/WP/Admin/Import/RankMath_Test.php b/tests/WP/Admin/Import/RankMath_Test.php index 9b23196d9be..d3db7249e53 100644 --- a/tests/WP/Admin/Import/RankMath_Test.php +++ b/tests/WP/Admin/Import/RankMath_Test.php @@ -206,7 +206,7 @@ private function setup_options() { 'homepage_title' => 'Test homepage title', 'homepage_description' => 'Test homepage description', 'pt_post_title' => 'Test post title template %sep% %sitename%', - ] + ], ); } } diff --git a/tests/WP/Admin/Import/Squirrly_Test.php b/tests/WP/Admin/Import/Squirrly_Test.php index 1a6b0d2c828..7b248136abd 100644 --- a/tests/WP/Admin/Import/Squirrly_Test.php +++ b/tests/WP/Admin/Import/Squirrly_Test.php @@ -337,7 +337,7 @@ private function setup_post( $pre_existing_yoast_data = false ) { 'og_media' => 'http://local.wordpress.test/wp-content/uploads/2018/01/actionable-seo.png', 'og_title' => 'OpenGraph AIOSEO title', 'cornerstone' => 1, - ] + ], ); $this->insert_post( $post_id, $blob ); \update_post_meta( $post_id, '_sq_post_keyword', '{"keyword":"squirrly test","update":1521207189}' ); @@ -383,7 +383,7 @@ private function build_data_blob( $data = [] ) { 'patterns' => '', 'sep' => '', ], - $data + $data, ); } @@ -413,8 +413,8 @@ private function insert_post( $post_id, $blob ) { $post_id, \get_permalink( $post_id ), \md5( \get_permalink( $post_id ) ), - \serialize( $blob ) - ) + \serialize( $blob ), + ), ); } @@ -441,7 +441,7 @@ private function create_table() { UNIQUE KEY `url_hash` (`url_hash`) USING BTREE, KEY `post_id` (`post_id`) USING BTREE, KEY `blog_id_url_hash` (`blog_id`,`url_hash`) USING BTREE - ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8" + ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8", ); } } diff --git a/tests/WP/Admin/Import/WPSEO_Test.php b/tests/WP/Admin/Import/WPSEO_Test.php index f2105b63da5..b8701ccad97 100644 --- a/tests/WP/Admin/Import/WPSEO_Test.php +++ b/tests/WP/Admin/Import/WPSEO_Test.php @@ -247,7 +247,7 @@ private function create_category_metadata( $name, $desc, $robots ) { [ 'name' => $name, 'taxonomy' => 'category', - ] + ], ); \update_option( 'wpseo_category_' . $term_id, $desc ); \update_option( 'wpseo_category_' . $term_id . '_robots', $robots ); diff --git a/tests/WP/Admin/Input_Select_Test.php b/tests/WP/Admin/Input_Select_Test.php index ba757c27b00..706067783af 100644 --- a/tests/WP/Admin/Input_Select_Test.php +++ b/tests/WP/Admin/Input_Select_Test.php @@ -29,7 +29,7 @@ public function test_html_with_options() { 'foo' => 'bar', 'baz' => 'foo', ], - false + false, ); $html = $select->get_html(); @@ -76,7 +76,7 @@ public function test_html_with_options_and_one_active() { 'foo' => 'bar', 'baz' => 'foo', ], - 'baz' + 'baz', ); $html = $select->get_html(); diff --git a/tests/WP/Admin/Metabox/Metabox_Test.php b/tests/WP/Admin/Metabox/Metabox_Test.php index 00dfda7bd44..19faddb6f07 100644 --- a/tests/WP/Admin/Metabox/Metabox_Test.php +++ b/tests/WP/Admin/Metabox/Metabox_Test.php @@ -133,7 +133,7 @@ public function test_save_postdata() { $meta_fields, WPSEO_Meta::get_meta_field_defs( 'general', $post->post_type ), WPSEO_Meta::get_meta_field_defs( 'advanced' ), - WPSEO_Meta::get_meta_field_defs( 'schema', $post->post_type ) + WPSEO_Meta::get_meta_field_defs( 'schema', $post->post_type ), ); // Set $_POST data to be saved. diff --git a/tests/WP/Admin/Recommended_Replace_Vars_Test.php b/tests/WP/Admin/Recommended_Replace_Vars_Test.php index 9011530b5e4..2682ff0a82b 100644 --- a/tests/WP/Admin/Recommended_Replace_Vars_Test.php +++ b/tests/WP/Admin/Recommended_Replace_Vars_Test.php @@ -309,7 +309,7 @@ private function create_and_get_with_post_type( $post_type = 'post' ) { return self::factory()->post->create_and_get( [ 'post_type' => $post_type, - ] + ], ); } } diff --git a/tests/WP/Admin/Watchers/Indexable_Ancestor_Watcher_Test.php b/tests/WP/Admin/Watchers/Indexable_Ancestor_Watcher_Test.php index 21bf8af4e51..51fc9a6a23c 100644 --- a/tests/WP/Admin/Watchers/Indexable_Ancestor_Watcher_Test.php +++ b/tests/WP/Admin/Watchers/Indexable_Ancestor_Watcher_Test.php @@ -95,7 +95,7 @@ public function set_up() { $this->indexable_hierarchy_repository, $this->indexable_helper, $this->permalink_helper, - $this->post_type_helper + $this->post_type_helper, ); } @@ -114,7 +114,7 @@ public function test_get_object_ids_for_term() { [ 'name' => 'test_term', 'taxonomy' => 'category', - ] + ], ); \wp_set_object_terms( $post1->ID, $term_id, 'category' ); diff --git a/tests/WP/Admin/Watchers/Indexable_Post_Watcher_Test.php b/tests/WP/Admin/Watchers/Indexable_Post_Watcher_Test.php index 988fe484f79..9bd7aa5de40 100644 --- a/tests/WP/Admin/Watchers/Indexable_Post_Watcher_Test.php +++ b/tests/WP/Admin/Watchers/Indexable_Post_Watcher_Test.php @@ -88,13 +88,13 @@ public function test_create_post_with_hierarchy() { $parent = $this->factory()->post->create_and_get( [ 'post_type' => 'page', - ] + ], ); $child = $this->factory()->post->create_and_get( [ 'post_type' => 'page', 'post_parent' => $parent->ID, - ] + ], ); $parent_indexable = \current( $this->get_indexables_for( $parent ) ); @@ -120,13 +120,13 @@ public function test_delete_post_with_hierarchy() { $parent = $this->factory()->post->create_and_get( [ 'post_type' => 'page', - ] + ], ); $child = $this->factory()->post->create_and_get( [ 'post_type' => 'page', 'post_parent' => $parent->ID, - ] + ], ); $parent_indexable = \current( $this->get_indexables_for( $parent ) ); diff --git a/tests/WP/Admin/Watchers/Slug_Change_Watcher_Test.php b/tests/WP/Admin/Watchers/Slug_Change_Watcher_Test.php index 1bf245aa051..df0089bb9b2 100644 --- a/tests/WP/Admin/Watchers/Slug_Change_Watcher_Test.php +++ b/tests/WP/Admin/Watchers/Slug_Change_Watcher_Test.php @@ -306,6 +306,6 @@ public function test_detect_term_delete_when_not_exists() { $instance->register_hooks(); - \wp_delete_term( 11111, 'category' ); + \wp_delete_term( 11_111, 'category' ); } } diff --git a/tests/WP/Builders/Indexable_Author_Builder_Test.php b/tests/WP/Builders/Indexable_Author_Builder_Test.php index 9c5c3b68611..cd6b1686452 100644 --- a/tests/WP/Builders/Indexable_Author_Builder_Test.php +++ b/tests/WP/Builders/Indexable_Author_Builder_Test.php @@ -41,7 +41,7 @@ public function set_up(): void { [ 'user_login' => 'user', 'user_pass' => 'password', - ] + ], )->ID; \update_user_meta( $this->user_id, 'wpseo_title', 'Title' ); @@ -54,7 +54,7 @@ public function set_up(): void { \YoastSEO()->helpers->author_archive, \YoastSEO()->classes->get( 'Yoast\WP\SEO\Values\Indexables\Indexable_Builder_Versions' ), \YoastSEO()->helpers->options, - \YoastSEO()->helpers->post + \YoastSEO()->helpers->post, ); } @@ -72,7 +72,7 @@ public function test_build() { 'post_date' => '1978-09-13 08:50:00', 'post_status' => 'publish', 'post_author' => $this->user_id, - ] + ], ); $indexable = new Indexable(); @@ -124,7 +124,7 @@ public function test_build_when_author_archives_are_disabled() { 'post_date' => '1978-09-13 08:50:00', 'post_status' => 'publish', 'post_author' => $this->user_id, - ] + ], ); \YoastSEO()->helpers->options->set( 'disable-author', true ); @@ -183,7 +183,7 @@ public function test_build_when_author_is_filtered() { 'post_date' => '1978-09-13 08:50:00', 'post_status' => 'publish', 'post_author' => $this->user_id, - ] + ], ); \YoastSEO()->helpers->options->set( 'disable-author', true ); @@ -194,7 +194,7 @@ static function ( $exception, $user_id ) { return new Author_Not_Built_Exception( 'Author not built because of filter.' ); }, 10, - 2 + 2, ); $this->expectException( Author_Not_Built_Exception::class ); $this->expectExceptionMessage( 'Author not built because of filter' ); diff --git a/tests/WP/Builders/Indexable_Date_Archive_Builder_Test.php b/tests/WP/Builders/Indexable_Date_Archive_Builder_Test.php index b4621c078fe..0e86304921b 100644 --- a/tests/WP/Builders/Indexable_Date_Archive_Builder_Test.php +++ b/tests/WP/Builders/Indexable_Date_Archive_Builder_Test.php @@ -31,7 +31,7 @@ public function set_up(): void { $this->instance = new Indexable_Date_Archive_Builder( \YoastSEO()->helpers->options, - \YoastSEO()->classes->get( 'Yoast\WP\SEO\Values\Indexables\Indexable_Builder_Versions' ) + \YoastSEO()->classes->get( 'Yoast\WP\SEO\Values\Indexables\Indexable_Builder_Versions' ), ); } diff --git a/tests/WP/Builders/Indexable_Home_Page_Builder_Test.php b/tests/WP/Builders/Indexable_Home_Page_Builder_Test.php index 297fc513924..9973b25da6d 100644 --- a/tests/WP/Builders/Indexable_Home_Page_Builder_Test.php +++ b/tests/WP/Builders/Indexable_Home_Page_Builder_Test.php @@ -34,13 +34,13 @@ public function set_up(): void { \YoastSEO()->helpers->options, \YoastSEO()->helpers->url, \YoastSEO()->classes->get( Indexable_Builder_Versions::class ), - \YoastSEO()->helpers->post + \YoastSEO()->helpers->post, ); $this->instance->set_social_image_helpers( \YoastSEO()->helpers->image, \YoastSEO()->helpers->open_graph->image, - \YoastSEO()->helpers->twitter->image + \YoastSEO()->helpers->twitter->image, ); } @@ -146,7 +146,7 @@ public function test_build_when_open_graph_image_is_present() { 'post_parent' => 0, 'post_mime_type' => 'image/jpeg', 'guid' => \home_url() . $fake_image_path, - ] + ], ); $expected_image['id'] = $id; @@ -158,7 +158,7 @@ public function test_build_when_open_graph_image_is_present() { [ 'width' => $fake_image_width, 'height' => $fake_image_height, - ] + ], ); \YoastSEO()->helpers->options->set( 'open_graph_frontpage_image_id', $id ); diff --git a/tests/WP/Builders/Indexable_Post_Type_Archive_Builder_Test.php b/tests/WP/Builders/Indexable_Post_Type_Archive_Builder_Test.php index 60fda177480..63da74d7616 100644 --- a/tests/WP/Builders/Indexable_Post_Type_Archive_Builder_Test.php +++ b/tests/WP/Builders/Indexable_Post_Type_Archive_Builder_Test.php @@ -34,7 +34,7 @@ public function set_up(): void { \YoastSEO()->helpers->options, \YoastSEO()->classes->get( 'Yoast\WP\SEO\Values\Indexables\Indexable_Builder_Versions' ), \YoastSEO()->helpers->post, - \YoastSEO()->helpers->post_type + \YoastSEO()->helpers->post_type, ); } @@ -54,7 +54,7 @@ public function test_build() { 'has_archive' => true, 'description' => 'a cool post type', 'label' => $post_type, - ] + ], ); $post = [ @@ -98,7 +98,7 @@ public function test_build_when_post_type_not_public() { 'has_archive' => true, 'description' => 'a cool post type', 'label' => $post_type, - ] + ], ); $post = [ diff --git a/tests/WP/Builders/Indexable_Term_Builder_Test.php b/tests/WP/Builders/Indexable_Term_Builder_Test.php index bce7978055e..ffe23e3e331 100644 --- a/tests/WP/Builders/Indexable_Term_Builder_Test.php +++ b/tests/WP/Builders/Indexable_Term_Builder_Test.php @@ -52,14 +52,14 @@ public function set_up(): void { 'post_title' => 'Test post', 'post_date' => '1978-09-13 08:50:00', 'post_status' => 'publish', - ] + ], ); $this->term_id = self::factory()->category->create( [ 'name' => 'test_term', 'taxonomy' => 'category', - ] + ], ); self::factory()->term->add_post_terms( $post_id, $this->term_id, 'category', true ); @@ -82,13 +82,13 @@ public function set_up(): void { $this->instance = new Indexable_Term_Builder( \YoastSEO()->helpers->taxonomy, \YoastSEO()->classes->get( Indexable_Builder_Versions::class ), - \YoastSEO()->helpers->post + \YoastSEO()->helpers->post, ); $this->instance->set_social_image_helpers( \YoastSEO()->helpers->image, \YoastSEO()->helpers->open_graph->image, - \YoastSEO()->helpers->twitter->image + \YoastSEO()->helpers->twitter->image, ); } @@ -155,14 +155,14 @@ public function test_build_category_not_indexable() { [ 'public' => false, 'query_var' => false, - ] + ], ); $term_id = self::factory()->term->create( [ 'taxonomy' => 'test_tax', 'name' => 'test_term', - ] + ], ); $indexable = new Indexable(); diff --git a/tests/WP/Content_Type_Visibility/Dismiss_New_Route_Test.php b/tests/WP/Content_Type_Visibility/Dismiss_New_Route_Test.php index dbf3883dae8..1513d6ef572 100644 --- a/tests/WP/Content_Type_Visibility/Dismiss_New_Route_Test.php +++ b/tests/WP/Content_Type_Visibility/Dismiss_New_Route_Test.php @@ -138,13 +138,13 @@ public function test_post_type_dismiss( $new_post_types, $post_type_name, $messa $this->assertInstanceOf( WP_REST_Response::class, $result, - 'post_type_dismiss_returns WP_REST_Response object' + 'post_type_dismiss_returns WP_REST_Response object', ); $this->assertSame( $message, $result->data->message, - 'post_type_dismiss_returns correct message' + 'post_type_dismiss_returns correct message', ); } @@ -192,13 +192,13 @@ public function test_taxonomy_dismiss( $new_taxonomies, $taxonomy_name, $message $this->assertInstanceOf( WP_REST_Response::class, $result, - 'taxonomy_dismiss_returns WP_REST_Response object' + 'taxonomy_dismiss_returns WP_REST_Response object', ); $this->assertSame( $message, $result->data->message, - 'taxonomy_dismiss_returns correct message' + 'taxonomy_dismiss_returns correct message', ); } @@ -238,13 +238,13 @@ public function test_taxonomy_dismiss_fail() { $this->assertInstanceOf( WP_REST_Response::class, $result, - 'taxonomy_dismiss_returns WP_REST_Response object' + 'taxonomy_dismiss_returns WP_REST_Response object', ); $this->assertSame( 'Error: Taxonomy was not removed from new_taxonomies list.', $result->data->message, - 'taxonomy_dismiss_returns correct message' + 'taxonomy_dismiss_returns correct message', ); } @@ -284,13 +284,13 @@ public function test_post_type_dismiss_fail() { $this->assertInstanceOf( WP_REST_Response::class, $result, - 'post_type_dismiss_returns WP_REST_Response object' + 'post_type_dismiss_returns WP_REST_Response object', ); $this->assertSame( 'Error: Post type was not removed from new_post_types list.', $result->data->message, - 'post_type_dismiss_returns correct message' + 'post_type_dismiss_returns correct message', ); } } diff --git a/tests/WP/Dashboard/Application/Filter_Pairs/Filter_Pairs_Repository_Test.php b/tests/WP/Dashboard/Application/Filter_Pairs/Filter_Pairs_Repository_Test.php index 4d161b451b2..a4b9152e28e 100644 --- a/tests/WP/Dashboard/Application/Filter_Pairs/Filter_Pairs_Repository_Test.php +++ b/tests/WP/Dashboard/Application/Filter_Pairs/Filter_Pairs_Repository_Test.php @@ -63,7 +63,7 @@ public function test_get_taxonomy( [ 'public' => $is_public, 'show_in_rest' => $show_in_rest, - ] + ], ); self::assertEquals( $expected, $this->instance->get_taxonomy( $object_type_name ) ); \unregister_taxonomy( $taxonomy_name ); diff --git a/tests/WP/Dashboard/Application/Taxonomies/Taxonomies_Repository_Test.php b/tests/WP/Dashboard/Application/Taxonomies/Taxonomies_Repository_Test.php index 13b321a1d33..86198f93a5d 100644 --- a/tests/WP/Dashboard/Application/Taxonomies/Taxonomies_Repository_Test.php +++ b/tests/WP/Dashboard/Application/Taxonomies/Taxonomies_Repository_Test.php @@ -58,7 +58,7 @@ public function set_up(): void { 'slug' => 'yoast-test-books', ], 'show_in_rest' => true, - ] + ], ); \register_taxonomy( 'alternative-genre', @@ -70,7 +70,7 @@ public function set_up(): void { 'rest_base' => 'alternative_genres', 'rest_namespace' => 'my_custom_namespace/v1', 'rewrite' => [ 'slug' => 'alternative-genre' ], - ] + ], ); \register_taxonomy( @@ -79,7 +79,7 @@ public function set_up(): void { [ 'public' => true, 'show_in_rest' => true, - ] + ], ); } diff --git a/tests/WP/Dashboard/Infrastructure/Analytics_4/Analytics_4_Adapter_Construct_Test.php b/tests/WP/Dashboard/Infrastructure/Analytics_4/Analytics_4_Adapter_Construct_Test.php index 650486fe716..9380b398156 100644 --- a/tests/WP/Dashboard/Infrastructure/Analytics_4/Analytics_4_Adapter_Construct_Test.php +++ b/tests/WP/Dashboard/Infrastructure/Analytics_4/Analytics_4_Adapter_Construct_Test.php @@ -25,7 +25,7 @@ final class Analytics_4_Adapter_Construct_Test extends Abstract_Analytics_4_Adap public function test_construct() { $this->assertInstanceOf( Site_Kit_Analytics_4_Api_Call::class, - $this->getPropertyValue( $this->instance, 'site_kit_search_console_api_call' ) + $this->getPropertyValue( $this->instance, 'site_kit_search_console_api_call' ), ); } } diff --git a/tests/WP/Dashboard/Infrastructure/Analytics_4/Analytics_4_Adapter_Validate_Comparison_Response_Test.php b/tests/WP/Dashboard/Infrastructure/Analytics_4/Analytics_4_Adapter_Validate_Comparison_Response_Test.php index 37b515d0c3e..0abbafa4465 100644 --- a/tests/WP/Dashboard/Infrastructure/Analytics_4/Analytics_4_Adapter_Validate_Comparison_Response_Test.php +++ b/tests/WP/Dashboard/Infrastructure/Analytics_4/Analytics_4_Adapter_Validate_Comparison_Response_Test.php @@ -61,7 +61,7 @@ public function test_validate_response_failed_request() { 'this is an error', [ 'status' => 400, - ] + ], ); $api_response_mock = Mockery::mock( WP_REST_Response::class ); diff --git a/tests/WP/Dashboard/Infrastructure/Analytics_4/Analytics_4_Adapter_Validate_Daily_Response_Test.php b/tests/WP/Dashboard/Infrastructure/Analytics_4/Analytics_4_Adapter_Validate_Daily_Response_Test.php index 7fc539e3612..eff66c49b40 100644 --- a/tests/WP/Dashboard/Infrastructure/Analytics_4/Analytics_4_Adapter_Validate_Daily_Response_Test.php +++ b/tests/WP/Dashboard/Infrastructure/Analytics_4/Analytics_4_Adapter_Validate_Daily_Response_Test.php @@ -61,7 +61,7 @@ public function test_validate_response_failed_request() { 'this is an error', [ 'status' => 400, - ] + ], ); $api_response_mock = Mockery::mock( WP_REST_Response::class ); diff --git a/tests/WP/Dashboard/Infrastructure/Integrations/Is_Site_Kit_On_Boarded_Test.php b/tests/WP/Dashboard/Infrastructure/Integrations/Is_Site_Kit_On_Boarded_Test.php index fe84057b658..c73d7d686aa 100644 --- a/tests/WP/Dashboard/Infrastructure/Integrations/Is_Site_Kit_On_Boarded_Test.php +++ b/tests/WP/Dashboard/Infrastructure/Integrations/Is_Site_Kit_On_Boarded_Test.php @@ -86,7 +86,7 @@ public function test_is_site_kit_onboarded( 'googlesitekit_oauth_secret', static function () use ( $oauth_keys ) { return $oauth_keys; - } + }, ); $this->site_kit_consent_repository->set_site_kit_consent( $is_consent_granted ); @@ -106,7 +106,7 @@ public static function generate_site_kit_onboarded_provider() { 'client_id' => 'client_id', 'client_secret' => 'client_secret', ], - ] + ], ), 'is_consent_granted' => true, 'expected' => true, @@ -118,7 +118,7 @@ public static function generate_site_kit_onboarded_provider() { 'client_id' => 'client_id', 'client_secret' => 'client_secret', ], - ] + ], ), 'is_consent_granted' => false, 'expected' => false, @@ -134,7 +134,7 @@ public static function generate_site_kit_onboarded_provider() { 'web' => [ 'client_id' => 'client_id', ], - ] + ], ), 'is_consent_granted' => true, 'expected' => false, diff --git a/tests/WP/Dashboard/Infrastructure/Search_Console/Search_Console_Adapter_Construct.php b/tests/WP/Dashboard/Infrastructure/Search_Console/Search_Console_Adapter_Construct.php index 3ae6955176c..e873b326e8e 100644 --- a/tests/WP/Dashboard/Infrastructure/Search_Console/Search_Console_Adapter_Construct.php +++ b/tests/WP/Dashboard/Infrastructure/Search_Console/Search_Console_Adapter_Construct.php @@ -28,7 +28,7 @@ public function test_construct() { $this->assertInstanceOf( Module::class, - $module + $module, ); } } diff --git a/tests/WP/Dashboard/Infrastructure/Search_Console/Search_Console_Adapter_Validate_Comparison_Response_Test.php b/tests/WP/Dashboard/Infrastructure/Search_Console/Search_Console_Adapter_Validate_Comparison_Response_Test.php index 0dc5146a13c..d43223fbbc6 100644 --- a/tests/WP/Dashboard/Infrastructure/Search_Console/Search_Console_Adapter_Validate_Comparison_Response_Test.php +++ b/tests/WP/Dashboard/Infrastructure/Search_Console/Search_Console_Adapter_Validate_Comparison_Response_Test.php @@ -61,7 +61,7 @@ public function test_validate_response_failed_request() { 'this is an error', [ 'status' => 400, - ] + ], ); $api_response_mock = Mockery::mock( WP_REST_Response::class ); $api_response_mock->expects( 'get_data' )->once()->andReturn( 'not an array' ); diff --git a/tests/WP/Dashboard/Infrastructure/Search_Console/Search_Console_Adapter_Validate_Response_Test.php b/tests/WP/Dashboard/Infrastructure/Search_Console/Search_Console_Adapter_Validate_Response_Test.php index bf03d0115ee..521cf343d2e 100644 --- a/tests/WP/Dashboard/Infrastructure/Search_Console/Search_Console_Adapter_Validate_Response_Test.php +++ b/tests/WP/Dashboard/Infrastructure/Search_Console/Search_Console_Adapter_Validate_Response_Test.php @@ -62,7 +62,7 @@ public function test_validate_response_failed_request() { 'this is an error', [ 'status' => 400, - ] + ], ); $api_response_mock = Mockery::mock( WP_REST_Response::class ); diff --git a/tests/WP/Dashboard/User_Interface/Configuration/Site_Kit_Capabilities_Integration_Test.php b/tests/WP/Dashboard/User_Interface/Configuration/Site_Kit_Capabilities_Integration_Test.php index 8886ca45bd7..27428b439b0 100644 --- a/tests/WP/Dashboard/User_Interface/Configuration/Site_Kit_Capabilities_Integration_Test.php +++ b/tests/WP/Dashboard/User_Interface/Configuration/Site_Kit_Capabilities_Integration_Test.php @@ -56,10 +56,10 @@ public function set_up() { * @return void */ public function test_enable_site_kit_capabilities( $current_capabilities, $capability_to_check, $user_roles, $expected ) { - $user_id = self::factory()->user->create_and_get( + $user_id = self::factory()->user->create( [ 'role' => $user_roles, - ] + ], ); \wp_set_current_user( $user_id ); $this->assertSame( $expected, $this->instance->enable_site_kit_capabilities( $current_capabilities, $capability_to_check ) ); diff --git a/tests/WP/Dashboard/User_Interface/Readability_Scores/Get_Scores_Test.php b/tests/WP/Dashboard/User_Interface/Readability_Scores/Get_Scores_Test.php index 292e6057d35..bd211f6c84d 100644 --- a/tests/WP/Dashboard/User_Interface/Readability_Scores/Get_Scores_Test.php +++ b/tests/WP/Dashboard/User_Interface/Readability_Scores/Get_Scores_Test.php @@ -56,7 +56,7 @@ public function test_get_readability_scores( $inserted_posts, $taxonomy_filter, [ 'slug' => 'test-category', ], - ] + ], ); $term_id = (int) $term->term_id; @@ -84,7 +84,7 @@ public function test_get_readability_scores( $inserted_posts, $taxonomy_filter, 'post_type' => 'blog-post', 'post_category' => ( $post['custom_category'] ) ? [ $term_id ] : [ 1 ], 'meta_input' => $meta_input, - ] + ], ); } diff --git a/tests/WP/Dashboard/User_Interface/Readability_Scores/Invalid_Term_Test.php b/tests/WP/Dashboard/User_Interface/Readability_Scores/Invalid_Term_Test.php index d45f8b924d1..e53d154d94d 100644 --- a/tests/WP/Dashboard/User_Interface/Readability_Scores/Invalid_Term_Test.php +++ b/tests/WP/Dashboard/User_Interface/Readability_Scores/Invalid_Term_Test.php @@ -26,7 +26,7 @@ public function test_get_readability_scores_with_invalid_term() { 'post_tag', [ 'slug' => 'test-tag', - ] + ], ); $request = new WP_REST_Request( 'GET', '/yoast/v1/readability_scores' ); diff --git a/tests/WP/Dashboard/User_Interface/SEO_Scores/Get_Scores_Test.php b/tests/WP/Dashboard/User_Interface/SEO_Scores/Get_Scores_Test.php index b624f4c53c0..f4b80e07a49 100644 --- a/tests/WP/Dashboard/User_Interface/SEO_Scores/Get_Scores_Test.php +++ b/tests/WP/Dashboard/User_Interface/SEO_Scores/Get_Scores_Test.php @@ -56,7 +56,7 @@ public function test_get_seo_scores( $inserted_posts, $taxonomy_filter, $expecte [ 'slug' => 'test-category', ], - ] + ], ); $term_id = (int) $term->term_id; @@ -84,7 +84,7 @@ public function test_get_seo_scores( $inserted_posts, $taxonomy_filter, $expecte 'post_type' => 'blog-post', 'post_category' => ( $post['custom_category'] ) ? [ $term_id ] : [ 1 ], 'meta_input' => $meta_input, - ] + ], ); } diff --git a/tests/WP/Dashboard/User_Interface/SEO_Scores/Invalid_Term_Test.php b/tests/WP/Dashboard/User_Interface/SEO_Scores/Invalid_Term_Test.php index 0a423b2a20d..cd7854f233f 100644 --- a/tests/WP/Dashboard/User_Interface/SEO_Scores/Invalid_Term_Test.php +++ b/tests/WP/Dashboard/User_Interface/SEO_Scores/Invalid_Term_Test.php @@ -26,7 +26,7 @@ public function test_get_seo_scores_with_invalid_term() { 'post_tag', [ 'slug' => 'test-tag', - ] + ], ); $request = new WP_REST_Request( 'GET', '/yoast/v1/seo_scores' ); diff --git a/tests/WP/Doubles/Admin/Gutenberg_Compatibility_Double.php b/tests/WP/Doubles/Admin/Gutenberg_Compatibility_Double.php index 74005e4b707..d33abad3ad4 100644 --- a/tests/WP/Doubles/Admin/Gutenberg_Compatibility_Double.php +++ b/tests/WP/Doubles/Admin/Gutenberg_Compatibility_Double.php @@ -17,9 +17,7 @@ class Gutenberg_Compatibility_Double extends WPSEO_Gutenberg_Compatibility { * @return void */ public function set_installed_gutenberg_version( $version = null ) { - if ( $version === null ) { - $version = $this->detect_installed_gutenberg_version(); - } + $version ??= $this->detect_installed_gutenberg_version(); $this->current_version = $version; } diff --git a/tests/WP/Frontend/Front_End_Integration_Test.php b/tests/WP/Frontend/Front_End_Integration_Test.php index eb9468363ff..7a3020b69c6 100644 --- a/tests/WP/Frontend/Front_End_Integration_Test.php +++ b/tests/WP/Frontend/Front_End_Integration_Test.php @@ -99,7 +99,7 @@ public function set_up(): void { $this->helpers, $this->replace_vars, $this->indexable_repository, - $this->permalink_helper + $this->permalink_helper, ); } diff --git a/tests/WP/Frontend/Image_Utils_Test.php b/tests/WP/Frontend/Image_Utils_Test.php index c100a58635c..9afa54f7834 100644 --- a/tests/WP/Frontend/Image_Utils_Test.php +++ b/tests/WP/Frontend/Image_Utils_Test.php @@ -25,7 +25,7 @@ public function test_get_full_image() { [ 'width' => 1000, 'height' => 1000, - ] + ], ); $this->assertEquals( @@ -37,10 +37,10 @@ public function test_get_full_image() { 'size' => 'full', 'id' => $attachment, 'alt' => '', - 'pixels' => 1000000, + 'pixels' => 1_000_000, 'type' => '', ], - WPSEO_Image_Utils::get_image( $attachment, 'full' ) + WPSEO_Image_Utils::get_image( $attachment, 'full' ), ); } @@ -59,7 +59,7 @@ public function test_get_medium_image() { [ 'width' => 1000, 'height' => 1000, - ] + ], ); $this->assertFalse( WPSEO_Image_Utils::get_image( $attachment, 'medium' ) ); @@ -105,7 +105,7 @@ public function test_get_data( $image, $expected, $attachment_id, $message ) { $this->assertEquals( $expected, WPSEO_Image_Utils::get_data( $image, $attachment_id ), - $message + $message, ); } diff --git a/tests/WP/Functions_Test.php b/tests/WP/Functions_Test.php index f1dc66419a8..c1a5c5f124b 100644 --- a/tests/WP/Functions_Test.php +++ b/tests/WP/Functions_Test.php @@ -21,7 +21,7 @@ public function test_wpseo_replace_vars() { [ 'user_login' => 'User_Login', 'display_name' => 'User_Nicename', - ] + ], ); // Create post. @@ -32,7 +32,7 @@ public function test_wpseo_replace_vars() { 'post_excerpt' => 'Post_Excerpt', 'post_author' => $user_id, 'post_date' => \date( 'Y-m-d H:i:s', \strtotime( '2000-01-01 2:30:00' ) ), - ] + ], ); // Get post. @@ -74,7 +74,7 @@ public function test_wpseo_replace_vars_excerpt( $post_data, $locale, $expected, 'locale', static function () use ( $locale ) { return $locale; - } + }, ); $post = null; diff --git a/tests/WP/General/User_Interface/Set_Opt_In_Seen_Test.php b/tests/WP/General/User_Interface/Set_Opt_In_Seen_Test.php index 1120307d289..aa2d00cd397 100644 --- a/tests/WP/General/User_Interface/Set_Opt_In_Seen_Test.php +++ b/tests/WP/General/User_Interface/Set_Opt_In_Seen_Test.php @@ -35,7 +35,7 @@ static function () { $capability_helper = new Capability_Helper(); $opt_in_route = new Opt_In_Route( $user_helper, $capability_helper ); $opt_in_route->register_routes(); - } + }, ); // Trigger the rest_api_init action to register routes. diff --git a/tests/WP/Generators/Schema/Organization_Test.php b/tests/WP/Generators/Schema/Organization_Test.php index 665e8bd1876..628859d6dd3 100644 --- a/tests/WP/Generators/Schema/Organization_Test.php +++ b/tests/WP/Generators/Schema/Organization_Test.php @@ -47,13 +47,13 @@ public function set_up() { \YoastSEO()->helpers->post_type, \YoastSEO()->classes->get( Indexable_Builder_Versions::class ), \YoastSEO()->helpers->meta, - \YoastSEO()->helpers->permalink + \YoastSEO()->helpers->permalink, ); $indexable_post_builder->set_social_image_helpers( \YoastSEO()->helpers->image, \YoastSEO()->helpers->open_graph->image, - \YoastSEO()->helpers->twitter->image + \YoastSEO()->helpers->twitter->image, ); $post_type = 'my-custom-post-type'; @@ -64,7 +64,7 @@ public function set_up() { 'has_archive' => true, 'description' => 'a cool post type', 'label' => $post_type, - ] + ], ); $post = [ @@ -83,7 +83,7 @@ public function set_up() { \YoastSEO()->helpers->current_page, \YoastSEO()->classes->get( Indexable_Repository::class ), \YoastSEO()->classes->get( Meta_Tags_Context::class ), - \YoastSEO()->classes->get( Presentation_Memoizer::class ) + \YoastSEO()->classes->get( Presentation_Memoizer::class ), ); $this->context = $meta_tags_context_memoizer->get( $built_indexable, 'page' ); } diff --git a/tests/WP/Generators/Schema/Person_Test.php b/tests/WP/Generators/Schema/Person_Test.php index 3f56f3a8688..066422b1fca 100644 --- a/tests/WP/Generators/Schema/Person_Test.php +++ b/tests/WP/Generators/Schema/Person_Test.php @@ -47,13 +47,13 @@ public function set_up() { \YoastSEO()->helpers->post_type, \YoastSEO()->classes->get( Indexable_Builder_Versions::class ), \YoastSEO()->helpers->meta, - \YoastSEO()->helpers->permalink + \YoastSEO()->helpers->permalink, ); $indexable_post_builder->set_social_image_helpers( \YoastSEO()->helpers->image, \YoastSEO()->helpers->open_graph->image, - \YoastSEO()->helpers->twitter->image + \YoastSEO()->helpers->twitter->image, ); $post_type = 'my-custom-post-type'; @@ -64,7 +64,7 @@ public function set_up() { 'has_archive' => true, 'description' => 'a cool post type', 'label' => $post_type, - ] + ], ); $post = [ @@ -83,7 +83,7 @@ public function set_up() { \YoastSEO()->helpers->current_page, \YoastSEO()->classes->get( Indexable_Repository::class ), \YoastSEO()->classes->get( Meta_Tags_Context::class ), - \YoastSEO()->classes->get( Presentation_Memoizer::class ) + \YoastSEO()->classes->get( Presentation_Memoizer::class ), ); $this->context = $meta_tags_context_memoizer->get( $built_indexable, 'page' ); } diff --git a/tests/WP/Generators/Schema/WebPage_Test.php b/tests/WP/Generators/Schema/WebPage_Test.php index 5af98027a43..75a12f1179e 100644 --- a/tests/WP/Generators/Schema/WebPage_Test.php +++ b/tests/WP/Generators/Schema/WebPage_Test.php @@ -59,14 +59,14 @@ public function set_up() { $this->indexable_system_page_builder = new Indexable_System_Page_Builder( \YoastSEO()->helpers->options, - \YoastSEO()->classes->get( Indexable_Builder_Versions::class ) + \YoastSEO()->classes->get( Indexable_Builder_Versions::class ), ); $this->meta_tags_context_memoizer = new Meta_Tags_Context_Memoizer( \YoastSEO()->helpers->blocks, \YoastSEO()->helpers->current_page, \YoastSEO()->classes->get( Indexable_Repository::class ), \YoastSEO()->classes->get( Meta_Tags_Context::class ), - \YoastSEO()->classes->get( Presentation_Memoizer::class ) + \YoastSEO()->classes->get( Presentation_Memoizer::class ), ); } diff --git a/tests/WP/Helpers/First_Time_Configuration_Notice_Helper_Test.php b/tests/WP/Helpers/First_Time_Configuration_Notice_Helper_Test.php index 56fb1fe1701..1cb3b4374ab 100644 --- a/tests/WP/Helpers/First_Time_Configuration_Notice_Helper_Test.php +++ b/tests/WP/Helpers/First_Time_Configuration_Notice_Helper_Test.php @@ -67,14 +67,14 @@ public function set_up(): void { public function test_construct() { $this->assertInstanceOf( Options_Helper::class, - $this->getPropertyValue( $this->instance, 'options_helper' ) + $this->getPropertyValue( $this->instance, 'options_helper' ), ); $this->assertInstanceOf( Indexing_Helper::class, - $this->getPropertyValue( $this->instance, 'indexing_helper' ) + $this->getPropertyValue( $this->instance, 'indexing_helper' ), ); $this->assertIsBool( - $this->getPropertyValue( $this->instance, 'show_alternate_message' ) + $this->getPropertyValue( $this->instance, 'show_alternate_message' ), ); } diff --git a/tests/WP/Helpers/Get_Attachment_By_Url_Image_Helper_Test.php b/tests/WP/Helpers/Get_Attachment_By_Url_Image_Helper_Test.php index 98a43e3d1fc..ad56e62b1bb 100644 --- a/tests/WP/Helpers/Get_Attachment_By_Url_Image_Helper_Test.php +++ b/tests/WP/Helpers/Get_Attachment_By_Url_Image_Helper_Test.php @@ -45,7 +45,7 @@ public function set_up(): void { 'target_post_id' => '112', 'target_indexable_id' => '344', 'id' => '113', - ] + ], ); } diff --git a/tests/WP/Inc/Admin_Bar_Menu_Test.php b/tests/WP/Inc/Admin_Bar_Menu_Test.php index f4717f8415f..d285da81e24 100644 --- a/tests/WP/Inc/Admin_Bar_Menu_Test.php +++ b/tests/WP/Inc/Admin_Bar_Menu_Test.php @@ -269,8 +269,8 @@ public function test_meets_requirements() { $first_result = $admin_bar_menu->meets_requirements(); $this->assertFalse( $first_result ); - \add_filter( 'option_wpseo', [ $this, 'filter_enable_admin_bar_menu_true' ], 10000 ); - \add_filter( 'default_option_wpseo', [ $this, 'filter_enable_admin_bar_menu_true' ], 10000 ); + \add_filter( 'option_wpseo', [ $this, 'filter_enable_admin_bar_menu_true' ], 10_000 ); + \add_filter( 'default_option_wpseo', [ $this, 'filter_enable_admin_bar_menu_true' ], 10_000 ); WPSEO_Options::clear_cache(); $second_result = $admin_bar_menu->meets_requirements(); diff --git a/tests/WP/Inc/Meta_Test.php b/tests/WP/Inc/Meta_Test.php index 9875afb758c..10cd3a3c78e 100644 --- a/tests/WP/Inc/Meta_Test.php +++ b/tests/WP/Inc/Meta_Test.php @@ -288,11 +288,11 @@ public function test_validate_meta_robots_adv() { // String should be cleaned. $this->assertEquals( 'noarchive,nosnippet', - WPSEO_Meta::validate_meta_robots_adv( 'noarchive, nosnippet' ) + WPSEO_Meta::validate_meta_robots_adv( 'noarchive, nosnippet' ), ); $this->assertEquals( 'noarchive,nosnippet', - WPSEO_Meta::validate_meta_robots_adv( [ 'noarchive', 'nosnippet' ] ) + WPSEO_Meta::validate_meta_robots_adv( [ 'noarchive', 'nosnippet' ] ), ); } diff --git a/tests/WP/Inc/MyYoast_Api_Request_Test.php b/tests/WP/Inc/MyYoast_Api_Request_Test.php index 01121888a7f..4187ed1f84e 100644 --- a/tests/WP/Inc/MyYoast_Api_Request_Test.php +++ b/tests/WP/Inc/MyYoast_Api_Request_Test.php @@ -206,7 +206,7 @@ public function test_enrich_request_arguments() { ->willReturn( [ 'This is' => 'the request body', - ] + ], ); $instance @@ -215,7 +215,7 @@ public function test_enrich_request_arguments() { ->willReturn( [ 'yoast-seo-wordpress-premium' => '10.0', - ] + ], ); $this->assertEquals( @@ -227,7 +227,7 @@ public function test_enrich_request_arguments() { 'yoast-seo-wordpress-premium-version' => '10.0', ], ], - $instance->enrich_request_arguments( [] ) + $instance->enrich_request_arguments( [] ), ); } @@ -256,7 +256,7 @@ public function test_enrich_request_arguments_with_empty_request_body() { ->willReturn( [ 'yoast-seo-wordpress-premium' => '10.0', - ] + ], ); $this->assertEquals( @@ -265,7 +265,7 @@ public function test_enrich_request_arguments_with_empty_request_body() { 'yoast-seo-wordpress-premium-version' => '10.0', ], ], - $instance->enrich_request_arguments( [] ) + $instance->enrich_request_arguments( [] ), ); } diff --git a/tests/WP/Inc/Options/Taxonomy_Meta_Test.php b/tests/WP/Inc/Options/Taxonomy_Meta_Test.php index 6983edb2849..de37c0ee50f 100644 --- a/tests/WP/Inc/Options/Taxonomy_Meta_Test.php +++ b/tests/WP/Inc/Options/Taxonomy_Meta_Test.php @@ -35,7 +35,7 @@ public function test_get_meta_without_term_when_taxonomy_is_missing() { ->create_and_get( [ 'taxonomy' => null, - ] + ], ); $this->assertFalse( WPSEO_Taxonomy_Meta::get_meta_without_term( 'meta_field' ) ); @@ -54,7 +54,7 @@ public function test_get_meta_with_valid_term() { ->create_and_get( [ 'taxonomy' => 'category', - ] + ], ); $this->assertEquals( '', WPSEO_Taxonomy_Meta::get_meta_without_term( 'meta_field' ) ); @@ -87,7 +87,7 @@ public function test_validate_term_meta_data() { 'keyword' => '\\', 'score' => 'bad', ], - ] + ], ), 'wpseo_keywordsynonyms' => WPSEO_Utils::format_json_encode( [ '""TESTING""', '""""' ] ), 'wpseo_focuskw' => '"double quotes" and \backslashes\.', @@ -124,7 +124,7 @@ public function test_validation_of_term_meta_data() { 'keyword' => '\\', 'score' => 'bad', ], - ] + ], ), 'wpseo_keywordsynonyms' => WPSEO_Utils::format_json_encode( [ '""TESTING""', '""""' ] ), 'wpseo_focuskw' => '"double quotes" and \backslashes\.', @@ -148,7 +148,7 @@ public function test_validation_of_term_meta_data() { 'keyword' => '\\', 'score' => 'bad', ], - ] + ], ), 'wpseo_keywordsynonyms' => WPSEO_Utils::format_json_encode( [ '""TESTING""', '""""' ] ), 'wpseo_focuskw' => ' "double quotes" `><>`<`and \backslashes\. ', diff --git a/tests/WP/Inc/Post_Type_Test.php b/tests/WP/Inc/Post_Type_Test.php index 7be85137b4f..81f765596d6 100644 --- a/tests/WP/Inc/Post_Type_Test.php +++ b/tests/WP/Inc/Post_Type_Test.php @@ -64,7 +64,7 @@ public function test_get_accessible_post_types_with_a_custom_post_type_that_is_n [ 'public' => true, 'publicly_queryable' => false, - ] + ], ); $this->assertNotContains( 'hidden-post-type', WPSEO_Post_Type::get_accessible_post_types() ); @@ -188,8 +188,8 @@ public function test_filter_attachment_post_type() { [ 'post' => 'post', 'attachment' => 'attachment', - ] - ) + ], + ), ); } @@ -222,7 +222,7 @@ public function test_rest_enabled_post_types() { [ 'public' => true, 'show_in_rest' => true, - ] + ], ); $this->assertTrue( WPSEO_Post_Type::is_rest_enabled( 'custom-post-type-api' ) ); diff --git a/tests/WP/Inc/Rank_Test.php b/tests/WP/Inc/Rank_Test.php index c0b4e23d66a..676d80528bb 100644 --- a/tests/WP/Inc/Rank_Test.php +++ b/tests/WP/Inc/Rank_Test.php @@ -30,7 +30,7 @@ public function test_get_rank() { * @return void */ public function test_constructor() { - $rank_non_existant = new WPSEO_Rank( 100000 ); + $rank_non_existant = new WPSEO_Rank( 100_000 ); $this->assertEquals( WPSEO_Rank::BAD, $rank_non_existant->get_rank() ); } diff --git a/tests/WP/Inc/Upgrade_Test.php b/tests/WP/Inc/Upgrade_Test.php index 0f8940f90d4..dfd3a4ec700 100644 --- a/tests/WP/Inc/Upgrade_Test.php +++ b/tests/WP/Inc/Upgrade_Test.php @@ -259,8 +259,8 @@ public function test_upgrade_36() { FROM %i WHERE option_name LIKE %s AND autoload IN ('on', 'yes')", - [ $wpdb->options, 'wpseo_sitemap_%' ] - ) + [ $wpdb->options, 'wpseo_sitemap_%' ], + ), ); $number_of_sitemap_options_no_autoload = $wpdb->query( @@ -269,8 +269,8 @@ public function test_upgrade_36() { FROM %i WHERE option_name LIKE %s AND autoload IN ('off', 'no')", - [ $wpdb->options, 'wpseo_sitemap_%' ] - ) + [ $wpdb->options, 'wpseo_sitemap_%' ], + ), ); $this->assertEquals( 0, $number_of_sitemap_options ); $this->assertEquals( 1, $number_of_sitemap_options_no_autoload ); @@ -288,13 +288,13 @@ public function test_upgrade_49() { [ 'user_login' => 'User_Login', 'display_name' => 'User_Nicename', - ] + ], ); $other_user_id = $this->factory->user->create( [ 'user_login' => 'Other_User_Login', 'display_name' => 'Other_User_Nicename', - ] + ], ); $notifications = [ @@ -371,8 +371,8 @@ public function test_upgrade_50() { 'SELECT * FROM %i WHERE meta_key = "_yst_content_links_processed"', - [ $wpdb->postmeta ] - ) + [ $wpdb->postmeta ], + ), ); $this->assertEquals( 0, $number_of_rows ); @@ -398,8 +398,8 @@ public function test_upgrade_90() { 'SELECT * FROM %i WHERE option_name LIKE %s', - [ $wpdb->options, 'wpseo_sitemap_%' ] - ) + [ $wpdb->options, 'wpseo_sitemap_%' ], + ), ); $this->assertEquals( 0, $number_of_sitemap_options ); @@ -429,7 +429,7 @@ public function test_upgrade_125() { 'id' => 'wpseo-dismiss-wordpress-upgrade', 'capabilities' => 'wpseo_manage_options', 'priority' => 0.8, - ] + ], ); $center = Yoast_Notification_Center::get(); @@ -445,8 +445,8 @@ public function test_upgrade_125() { 'SELECT * FROM %i WHERE meta_key = %s', - [ $wpdb->usermeta, 'wp_yoast_promo_hide_premium_upsell_admin_block' ] - ) + [ $wpdb->usermeta, 'wp_yoast_promo_hide_premium_upsell_admin_block' ], + ), ); $this->assertEquals( 0, $number_of_rows ); @@ -472,13 +472,13 @@ public function test_clean_up_private_taxonomies_for_141() { $term_builder = new Indexable_Term_Builder( \YoastSEO()->helpers->taxonomy, \YoastSEO()->classes->get( Indexable_Builder_Versions::class ), - \YoastSEO()->helpers->post + \YoastSEO()->helpers->post, ); $term_builder->set_social_image_helpers( \YoastSEO()->helpers->image, \YoastSEO()->helpers->open_graph->image, - \YoastSEO()->helpers->twitter->image + \YoastSEO()->helpers->twitter->image, ); $indexable = new Indexable(); @@ -493,8 +493,8 @@ public function test_clean_up_private_taxonomies_for_141() { $wpdb->query( $wpdb->prepare( 'UPDATE %i SET is_public = false WHERE object_id = %d', - [ $this->indexables_table, $result->object_id ] - ) + [ $this->indexables_table, $result->object_id ], + ), ); $instance = $this->get_instance(); @@ -505,8 +505,8 @@ public function test_clean_up_private_taxonomies_for_141() { "SELECT id FROM %i WHERE object_type = 'term' AND object_sub_type = %s", - [ $this->indexables_table, $taxonomy ] - ) + [ $this->indexables_table, $taxonomy ], + ), ); $this->assertEmpty( $private_taxonomy_indexables ); @@ -532,8 +532,8 @@ public function test_upgrade_74() { 'SELECT * FROM %i WHERE option_name LIKE %s', - [ $wpdb->options, 'wpseo_sitemap%validator%' ] - ) + [ $wpdb->options, 'wpseo_sitemap%validator%' ], + ), ); $this->assertEquals( 0, $number_of_sitemap_validators ); @@ -556,13 +556,13 @@ public function test_remove_indexable_rows_for_non_public_post_types() { \YoastSEO()->helpers->post_type, \YoastSEO()->classes->get( Indexable_Builder_Versions::class ), \YoastSEO()->helpers->meta, - \YoastSEO()->helpers->permalink + \YoastSEO()->helpers->permalink, ); $post_builder->set_social_image_helpers( \YoastSEO()->helpers->image, \YoastSEO()->helpers->open_graph->image, - \YoastSEO()->helpers->twitter->image + \YoastSEO()->helpers->twitter->image, ); $indexable = new Indexable(); @@ -576,16 +576,16 @@ public function test_remove_indexable_rows_for_non_public_post_types() { "UPDATE %i SET object_sub_type = 'attachment' WHERE object_id = %s", - [ $this->indexables_table, $post_id ] - ) + [ $this->indexables_table, $post_id ], + ), ); $indexables_for_non_public_posts = $wpdb->get_results( $wpdb->prepare( 'SELECT * FROM %i WHERE object_id = %s', - [ $this->indexables_table, $post_id ] - ) + [ $this->indexables_table, $post_id ], + ), ); $instance = $this->get_instance(); $instance->remove_indexable_rows_for_non_public_post_types(); @@ -595,8 +595,8 @@ public function test_remove_indexable_rows_for_non_public_post_types() { 'SELECT * FROM %i WHERE object_id = %s', - [ $this->indexables_table, $post_id ] - ) + [ $this->indexables_table, $post_id ], + ), ); $this->assertEmpty( $indexables_for_non_public_posts ); @@ -619,13 +619,13 @@ public function test_remove_indexable_rows_for_non_public_post_types_when_no_pub \YoastSEO()->helpers->post_type, \YoastSEO()->classes->get( Indexable_Builder_Versions::class ), \YoastSEO()->helpers->meta, - \YoastSEO()->helpers->permalink + \YoastSEO()->helpers->permalink, ); $post_builder->set_social_image_helpers( \YoastSEO()->helpers->image, \YoastSEO()->helpers->open_graph->image, - \YoastSEO()->helpers->twitter->image + \YoastSEO()->helpers->twitter->image, ); $indexable = new Indexable(); @@ -643,8 +643,8 @@ public function test_remove_indexable_rows_for_non_public_post_types_when_no_pub 'SELECT * FROM %i WHERE object_id = %s', - [ $this->indexables_table, $post_id ] - ) + [ $this->indexables_table, $post_id ], + ), ); $this->assertEmpty( $indexables_for_non_public_posts ); @@ -669,13 +669,13 @@ public function test_remove_indexable_rows_for_non_public_taxonomies() { $term_builder = new Indexable_Term_Builder( \YoastSEO()->helpers->taxonomy, \YoastSEO()->classes->get( Indexable_Builder_Versions::class ), - \YoastSEO()->helpers->post + \YoastSEO()->helpers->post, ); $term_builder->set_social_image_helpers( \YoastSEO()->helpers->image, \YoastSEO()->helpers->open_graph->image, - \YoastSEO()->helpers->twitter->image + \YoastSEO()->helpers->twitter->image, ); $indexable = new Indexable(); @@ -693,8 +693,8 @@ public function test_remove_indexable_rows_for_non_public_taxonomies() { SET is_public = false WHERE object_type = 'term' AND object_sub_type = %s", - [ $this->indexables_table, $taxonomy ] - ) + [ $this->indexables_table, $taxonomy ], + ), ); $instance = $this->get_instance(); @@ -705,8 +705,8 @@ public function test_remove_indexable_rows_for_non_public_taxonomies() { "SELECT id FROM %i WHERE object_type = 'term' AND object_sub_type = %s", - [ $this->indexables_table, $taxonomy ] - ) + [ $this->indexables_table, $taxonomy ], + ), ); $this->assertEmpty( $private_taxonomy_indexables ); @@ -731,13 +731,13 @@ public function test_remove_indexable_rows_for_non_public_taxonomies_when_no_pub $term_builder = new Indexable_Term_Builder( \YoastSEO()->helpers->taxonomy, \YoastSEO()->classes->get( Indexable_Builder_Versions::class ), - \YoastSEO()->helpers->post + \YoastSEO()->helpers->post, ); $term_builder->set_social_image_helpers( \YoastSEO()->helpers->image, \YoastSEO()->helpers->open_graph->image, - \YoastSEO()->helpers->twitter->image + \YoastSEO()->helpers->twitter->image, ); $indexable = new Indexable(); @@ -757,8 +757,8 @@ public function test_remove_indexable_rows_for_non_public_taxonomies_when_no_pub SET is_public = false WHERE object_type = 'term' AND object_sub_type = %s", - [ $this->indexables_table, $taxonomy ] - ) + [ $this->indexables_table, $taxonomy ], + ), ); $instance = $this->get_instance(); @@ -769,8 +769,8 @@ public function test_remove_indexable_rows_for_non_public_taxonomies_when_no_pub "SELECT id FROM %i WHERE object_type = 'term' AND object_sub_type = %s", - [ $this->indexables_table, $taxonomy ] - ) + [ $this->indexables_table, $taxonomy ], + ), ); $this->assertEmpty( $private_taxonomy_indexables ); @@ -799,8 +799,8 @@ public function test_deduplicate_unindexed_indexable_rows() { (1, 'user', 'unindexed'), (1, 'user', 'unindexed'), (1, 'user', 'unindexed')", - [ $this->indexables_table ] - ) + [ $this->indexables_table ], + ), ); $instance = $this->get_instance(); @@ -813,8 +813,8 @@ public function test_deduplicate_unindexed_indexable_rows() { WHERE object_id = 1 AND object_type = 'post' AND post_status = 'unindexed'", - [ $this->indexables_table ] - ) + [ $this->indexables_table ], + ), ); $terms = $wpdb->query( $wpdb->prepare( @@ -823,8 +823,8 @@ public function test_deduplicate_unindexed_indexable_rows() { WHERE object_id = 1 AND object_type = 'user' AND post_status = 'unindexed'", - [ $this->indexables_table ] - ) + [ $this->indexables_table ], + ), ); $users = $wpdb->query( $wpdb->prepare( @@ -833,8 +833,8 @@ public function test_deduplicate_unindexed_indexable_rows() { WHERE object_id = 1 AND object_type = 'user' AND post_status = 'unindexed'", - [ $this->indexables_table ] - ) + [ $this->indexables_table ], + ), ); $this->assertEquals( 1, $posts ); $this->assertEquals( 1, $terms ); @@ -862,8 +862,8 @@ public function test_clean_unindexed_indexable_rows_with_no_object_id() { (1, 'post', 'unindexed'), (2, 'user', 'draft'), (3, 'system-page', 'unindexed')", - [ $this->indexables_table ] - ) + [ $this->indexables_table ], + ), ); $instance = $this->get_instance(); @@ -876,8 +876,8 @@ public function test_clean_unindexed_indexable_rows_with_no_object_id() { WHERE object_id IS NULL AND object_type IN ( 'post', 'term', 'user' ) AND post_status = 'unindexed'", - [ $this->indexables_table ] - ) + [ $this->indexables_table ], + ), ); $this->assertEquals( 0, $null_ids ); @@ -900,8 +900,8 @@ public function test_remove_indexable_rows_for_disabled_authors_archive() { (1, 'user', 'publish'), (2, 'user', 'publish'), (3, 'user', 'publish')", - [ $this->indexables_table ] - ) + [ $this->indexables_table ], + ), ); $options_helper->set( 'disable-author', true ); @@ -914,8 +914,8 @@ public function test_remove_indexable_rows_for_disabled_authors_archive() { "SELECT * FROM %i WHERE object_type = 'user'", - [ $this->indexables_table ] - ) + [ $this->indexables_table ], + ), ); $this->assertEquals( 0, $user_indexables ); @@ -948,8 +948,8 @@ public function test_get_indexable_deduplication_query_for_type() { (3, 'post', 'unindexed'), (3, 'post', 'unindexed'), (3, 'term', 'publish')", - [ $this->indexables_table ] - ) + [ $this->indexables_table ], + ), ); $duplicates = $wpdb->get_results( @@ -969,9 +969,9 @@ public function test_get_indexable_deduplication_query_for_type() { object_type HAVING count(*) > 1", - [ $this->indexables_table ] + [ $this->indexables_table ], ), - \ARRAY_A + \ARRAY_A, ); $posts_ids = \array_column( @@ -979,18 +979,18 @@ public function test_get_indexable_deduplication_query_for_type() { $duplicates, static function ( $duplicate ) { return $duplicate['object_type'] === 'post'; - } + }, ), - 'newest_id' + 'newest_id', ); $terms_ids = \array_column( \array_filter( $duplicates, static function ( $duplicate ) { return $duplicate['object_type'] === 'term'; - } + }, ), - 'newest_id' + 'newest_id', ); $users_ids = \array_column( @@ -998,9 +998,9 @@ static function ( $duplicate ) { $duplicates, static function ( $duplicate ) { return $duplicate['object_type'] === 'user'; - } + }, ), - 'newest_id' + 'newest_id', ); $instance = $this->get_instance(); $posts_query = $instance->get_indexable_deduplication_query_for_type( 'post', $duplicates, $wpdb ); @@ -1067,7 +1067,7 @@ private function set_option_in_database( $option_name, $option_value ) { // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize -- Reason: There's no security risk, because users don't interact with tests. 'option_value' => \serialize( $option_value ), ], - [ 'option_name' => $option_name ] + [ 'option_name' => $option_name ], ); } } diff --git a/tests/WP/Llms_Txt/Application/Available_Posts/Available_Posts_Repository_Test.php b/tests/WP/Llms_Txt/Application/Available_Posts/Available_Posts_Repository_Test.php index b5abbb1178e..b78500f89d9 100644 --- a/tests/WP/Llms_Txt/Application/Available_Posts/Available_Posts_Repository_Test.php +++ b/tests/WP/Llms_Txt/Application/Available_Posts/Available_Posts_Repository_Test.php @@ -121,7 +121,7 @@ private function create_pages( $number_of_pages ) { 'post_title' => 'Test Page ' . $i, 'post_type' => 'page', 'post_status' => 'publish', - ] + ], ); } @@ -155,7 +155,7 @@ private function sets_modification_dates( $pages_indexes_sorted_by_desc_modifica 'post_modified' => $date, 'post_modified_gmt' => $date, ], - [ 'ID' => $id_to_update ] + [ 'ID' => $id_to_update ], ); // Clean cache because of direct database tweaks above. diff --git a/tests/WP/Llms_Txt/Infrastructure/Automatic_Post_Collection_Test.php b/tests/WP/Llms_Txt/Infrastructure/Automatic_Post_Collection_Test.php index 57758c95d26..55505bc9a98 100644 --- a/tests/WP/Llms_Txt/Infrastructure/Automatic_Post_Collection_Test.php +++ b/tests/WP/Llms_Txt/Infrastructure/Automatic_Post_Collection_Test.php @@ -51,7 +51,7 @@ public function set_up() { \YoastSEO()->helpers->options, \YoastSEO()->classes->get( Indexable_Repository::class ), \YoastSEO()->meta, - \YoastSEO()->helpers->indexable + \YoastSEO()->helpers->indexable, ); $this->indexable_post_watcher = \YoastSEO()->classes->get( Indexable_Post_Watcher::class ); @@ -129,7 +129,7 @@ private function create_posts( $number_of_posts, $post_type, $posts_created_at ) 'post_type' => $post_type, 'post_status' => 'publish', 'post_date' => \gmdate( 'Y-m-d H:i:s', \strtotime( $posts_created_at ) ), - ] + ], ); } @@ -152,7 +152,7 @@ private function sets_cornerstone_posts( $cornerstone_posts_indexes, $post_ids ) 'meta_input' => [ '_yoast_wpseo_is_cornerstone' => '1', ], - ] + ], ); } } @@ -182,7 +182,7 @@ private function sets_modification_dates( $posts_indexes_sorted_by_desc_modifica 'post_modified' => \get_date_from_gmt( \gmdate( 'Y-m-d H:i:s', ( $now - $counter ) ) ), 'post_modified_gmt' => \get_date_from_gmt( \gmdate( 'Y-m-d H:i:s', ( $now - $counter ) ) ), ], - [ 'ID' => $id_to_update ] + [ 'ID' => $id_to_update ], ); // Clean cache because of direct database tweaks above. diff --git a/tests/WP/Notifications/Yoast_Notification_Center_Test.php b/tests/WP/Notifications/Yoast_Notification_Center_Test.php index 0b7b73b38b8..3087e2268a4 100644 --- a/tests/WP/Notifications/Yoast_Notification_Center_Test.php +++ b/tests/WP/Notifications/Yoast_Notification_Center_Test.php @@ -214,7 +214,7 @@ public function test_update_storage() { $notification = new Yoast_Notification( $message, - $options + $options, ); $subject = $this->get_notification_center(); @@ -499,7 +499,7 @@ public function test_update_nonce_on_re_add_notification() { [ 'nonce' => $old_nonce, 'id' => 'test', - ] + ], ); $new = new Yoast_Notification( 'new', [ 'id' => 'test' ] ); @@ -827,7 +827,7 @@ public function test_remove_notification_by_id_when_notification_is_found() { ->expects( $this->once() ) ->method( 'get_notification_by_id' ) ->willReturn( - new Yoast_Notification( 'message', [ 'id' => 'this-id-exists' ] ) + new Yoast_Notification( 'message', [ 'id' => 'this-id-exists' ] ), ); $notification_center->remove_notification_by_id( 'this-id-exists' ); @@ -882,7 +882,7 @@ public function test_add_notifications_for_multiple_users() { [ 'user_id' => $user_1->ID, 'capabilities' => [ 'wpseo_manage_options' ], - ] + ], ); $notification_for_user_2 = new Yoast_Notification( @@ -890,7 +890,7 @@ public function test_add_notifications_for_multiple_users() { [ 'user_id' => $user_2->ID, 'capabilities' => [ 'wpseo_manage_options' ], - ] + ], ); $instance->add_notification( $notification_for_user_1 ); @@ -926,7 +926,7 @@ public function test_add_notifications_only_once_for_user() { 'id' => 'Yoast_Notification_Test', 'user_id' => $user->ID, 'capabilities' => [ 'wpseo_manage_options' ], - ] + ], ); $instance->add_notification( $notification ); @@ -949,11 +949,11 @@ public function get_sample_notifications() { return [ new Yoast_Notification( 'notification', - [ 'id' => 'some_id' ] + [ 'id' => 'some_id' ], ), new Yoast_Notification( 'notification', - [ 'id' => 'another_id' ] + [ 'id' => 'another_id' ], ), ]; } diff --git a/tests/WP/Notifications/Yoast_Notification_Test.php b/tests/WP/Notifications/Yoast_Notification_Test.php index dbcfdaddc8f..16bc59fb4e2 100644 --- a/tests/WP/Notifications/Yoast_Notification_Test.php +++ b/tests/WP/Notifications/Yoast_Notification_Test.php @@ -75,7 +75,7 @@ public function test_set_defaults() { 'yoast_branding' => false, 'resolve_nonce' => '', ], - $test['options'] + $test['options'], ); } @@ -206,7 +206,7 @@ public function test_match_any_pass() { 'foo', ], 'capability_check' => 'any', - ] + ], ); $this->assertTrue( $subject->display_for_current_user() ); @@ -233,7 +233,7 @@ public function test_match_any_fail() { 'foo', ], 'capability_check' => 'any', - ] + ], ); $this->assertFalse( $subject->display_for_current_user() ); @@ -258,7 +258,7 @@ public function test_match_all_pass() { 'foo', ], 'capability_check' => 'all', - ] + ], ); $this->assertTrue( $subject->display_for_current_user() ); @@ -283,7 +283,7 @@ public function test_match_all_fail() { 'foo', ], 'capability_check' => 'all', - ] + ], ); $this->add_cap( 'bla' ); @@ -317,7 +317,7 @@ public function test_invalid_filter_return_values() { [ 'id' => 'id', 'capabilities' => 'not_an_array', - ] + ], ); $this->assertFalse( $subject->display_for_current_user() ); } diff --git a/tests/WP/Repositories/Primary_Term_Repository_Test.php b/tests/WP/Repositories/Primary_Term_Repository_Test.php index 2ee61ce37f4..a656a34345a 100644 --- a/tests/WP/Repositories/Primary_Term_Repository_Test.php +++ b/tests/WP/Repositories/Primary_Term_Repository_Test.php @@ -39,7 +39,7 @@ public function set_up(): void { 'created_at' => '2024-05-22 10:16:42', 'updated_at' => '2024-05-22 10:16:42', 'blog_id' => '1', - ] + ], ); $this->instance = new Primary_Term_Repository(); diff --git a/tests/WP/Repositories/SEO_Links_Repository_Test.php b/tests/WP/Repositories/SEO_Links_Repository_Test.php index ceeddee7ec8..58cc9c5d17b 100644 --- a/tests/WP/Repositories/SEO_Links_Repository_Test.php +++ b/tests/WP/Repositories/SEO_Links_Repository_Test.php @@ -39,7 +39,7 @@ public function set_up(): void { 'target_post_id' => '112', 'target_indexable_id' => '344', 'id' => '113', - ] + ], ); $this->instance = new SEO_Links_Repository(); @@ -104,7 +104,7 @@ public function test_find_all_by_post_id_with_result() { $this->assertContainsOnlyInstancesOf( SEO_Links::class, $result, - 'The result should only contain SEO_Links instances.' + 'The result should only contain SEO_Links instances.', ); $this->assertCount( 1, $result, 'The result should contain 1 items.' ); @@ -131,7 +131,7 @@ public function test_insert_many() { 'type' => 'external', 'indexable_id' => 1, 'post_id' => $post_id, - ] + ], ); $link_2 = $this->instance->query()->create( [ @@ -139,7 +139,7 @@ public function test_insert_many() { 'type' => 'internal', 'indexable_id' => 2, 'post_id' => $post_id, - ] + ], ); $links = [ $link_1, $link_2 ]; @@ -147,7 +147,7 @@ public function test_insert_many() { $this->instance->insert_many( $links ); $result = $wpdb->get_results( - $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}yoast_seo_links WHERE post_id = %d", $post_id ) + $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}yoast_seo_links WHERE post_id = %d", $post_id ), ); $this->assertCount( 2, $result, 'The result should contain 2 items.' ); @@ -225,7 +225,7 @@ public function test_find_all_by_target_post_id() { $this->assertContainsOnlyInstancesOf( SEO_Links::class, $result, - 'The result should only contain SEO_Links instances.' + 'The result should only contain SEO_Links instances.', ); $this->assertCount( 1, $result, 'The result should contain one item.' ); @@ -327,7 +327,7 @@ public function test_delete_all_by_post_id( $post_id, $expected_result ) { 'post_id' => '110', 'target_post_id' => '159', 'id' => '223', - ] + ], ); $result = $this->instance->delete_all_by_post_id( $post_id ); @@ -382,7 +382,7 @@ public function test_delete_all_by_post_id_where_indexable_id_null( $post_id, $e 'post_id' => '110', 'target_post_id' => '154', 'id' => '222', - ] + ], ); $wpdb->insert( $wpdb->prefix . 'yoast_seo_links', @@ -393,7 +393,7 @@ public function test_delete_all_by_post_id_where_indexable_id_null( $post_id, $e 'post_id' => '110', 'target_post_id' => '159', 'id' => '229', - ] + ], ); $result = $this->instance->delete_all_by_post_id_where_indexable_id_null( $post_id ); @@ -447,7 +447,7 @@ public function test_delete_all_by_indexable_id( $indexable_id, $expected_result 'post_id' => '110', 'target_post_id' => '154', 'id' => '222', - ] + ], ); $result = $this->instance->delete_all_by_indexable_id( $indexable_id ); @@ -519,7 +519,7 @@ public function test_get_incoming_link_counts_for_post_ids( $post_ids, $expected 'post_id' => '108', 'target_post_id' => '154', 'id' => '222', - ] + ], ); $result = $this->instance->get_incoming_link_counts_for_post_ids( $post_ids ); @@ -569,7 +569,7 @@ public function test_delete_many_by_id( $ids, $expected_result ) { 'post_id' => '108', 'target_post_id' => '154', 'id' => '222', - ] + ], ); $result = $this->instance->delete_many_by_id( $ids ); @@ -653,7 +653,7 @@ public function test_get_incoming_link_counts_for_indexable_ids( $indexable_ids, 'target_post_id' => '154', 'id' => '222', 'target_indexable_id' => '355', - ] + ], ); $result = $this->instance->get_incoming_link_counts_for_indexable_ids( $indexable_ids ); diff --git a/tests/WP/Routes/Indexables_Head_Route_Test.php b/tests/WP/Routes/Indexables_Head_Route_Test.php index 74fbecb4104..2e561ad05b1 100644 --- a/tests/WP/Routes/Indexables_Head_Route_Test.php +++ b/tests/WP/Routes/Indexables_Head_Route_Test.php @@ -47,13 +47,13 @@ public function test_get_head( $url, $valid_head_data ) { $this->assertInstanceOf( WP_REST_Response::class, $response, - 'get_head WP_REST_Response object' + 'get_head WP_REST_Response object', ); $this->assertEquals( $valid_head_data, \is_object( $response->data ) && \property_exists( $response->data, 'html' ) && \property_exists( $response->data, 'json' ), - 'get_head valid data' + 'get_head valid data', ); } diff --git a/tests/WP/Schema_Aggregator/Application/Enhancement/Article_Schema_Enhancer_Test.php b/tests/WP/Schema_Aggregator/Application/Enhancement/Article_Schema_Enhancer_Test.php index 5c203a0a10e..b1d03d8b1b0 100644 --- a/tests/WP/Schema_Aggregator/Application/Enhancement/Article_Schema_Enhancer_Test.php +++ b/tests/WP/Schema_Aggregator/Application/Enhancement/Article_Schema_Enhancer_Test.php @@ -85,7 +85,7 @@ public function test_enhance_adds_description_from_excerpt_for_article() { 'post_status' => 'publish', 'post_excerpt' => 'This is a test excerpt for the article.', 'post_content' => 'This is the full article content.', - ] + ], ); $indexable = \current( $this->get_indexables_for( $post ) ); @@ -136,7 +136,7 @@ public function test_enhance_adds_article_body_when_no_excerpt() { 'post_status' => 'publish', 'post_excerpt' => 'Test excerpt', 'post_content' => 'This is the full article content that should appear as articleBody.', - ] + ], ); $indexable = \current( $this->get_indexables_for( $post ) ); @@ -169,7 +169,7 @@ public function test_enhance_adds_keywords_from_tags() { 'post_title' => 'Test Article', 'post_type' => 'post', 'post_status' => 'publish', - ] + ], ); // Create and assign tags. @@ -206,7 +206,7 @@ public function test_enhance_adds_keywords_from_categories_when_enabled() { 'post_title' => 'Test Article', 'post_type' => 'post', 'post_status' => 'publish', - ] + ], ); // Create and assign category. @@ -243,7 +243,7 @@ public function test_enhance_works_with_news_article_type() { 'post_type' => 'post', 'post_status' => 'publish', 'post_excerpt' => 'Breaking news excerpt.', - ] + ], ); $indexable = \current( $this->get_indexables_for( $post ) ); @@ -273,7 +273,7 @@ public function test_enhance_works_with_blog_posting_type() { 'post_type' => 'post', 'post_status' => 'publish', 'post_excerpt' => 'Blog post excerpt.', - ] + ], ); $indexable = \current( $this->get_indexables_for( $post ) ); @@ -303,7 +303,7 @@ public function test_enhance_works_with_article_in_type_array() { 'post_type' => 'post', 'post_status' => 'publish', 'post_excerpt' => 'Article with multiple types.', - ] + ], ); $indexable = \current( $this->get_indexables_for( $post ) ); @@ -333,7 +333,7 @@ public function test_enhance_does_not_override_existing_description() { 'post_type' => 'post', 'post_status' => 'publish', 'post_excerpt' => 'This should not be used.', - ] + ], ); $indexable = \current( $this->get_indexables_for( $post ) ); @@ -363,7 +363,7 @@ public function test_enhance_does_not_override_existing_article_body() { 'post_type' => 'post', 'post_status' => 'publish', 'post_content' => 'This should not be used.', - ] + ], ); $indexable = \current( $this->get_indexables_for( $post ) ); @@ -392,7 +392,7 @@ public function test_enhance_does_not_override_existing_keywords() { 'post_title' => 'Test Article', 'post_type' => 'post', 'post_status' => 'publish', - ] + ], ); // Create and assign tags. @@ -425,7 +425,7 @@ public function test_enhance_returns_unchanged_when_no_enhancements_possible() { 'post_title' => 'Test Article', 'post_type' => 'post', 'post_status' => 'publish', - ] + ], ); $indexable = \current( $this->get_indexables_for( $post ) ); @@ -460,7 +460,7 @@ public function test_enhance_respects_disabled_enhancements() { 'post_status' => 'publish', 'post_excerpt' => 'This should not be added.', 'post_content' => 'This should not be added.', - ] + ], ); // Create and assign tags. diff --git a/tests/WP/Schema_Aggregator/Application/Enhancement/Person_Schema_Enhancer_Test.php b/tests/WP/Schema_Aggregator/Application/Enhancement/Person_Schema_Enhancer_Test.php index 3020fb2c46c..d077ea40fc9 100644 --- a/tests/WP/Schema_Aggregator/Application/Enhancement/Person_Schema_Enhancer_Test.php +++ b/tests/WP/Schema_Aggregator/Application/Enhancement/Person_Schema_Enhancer_Test.php @@ -81,7 +81,7 @@ public function test_enhance_adds_job_title_from_user_meta() { [ 'user_login' => 'testauthor', 'role' => 'author', - ] + ], ); \update_user_meta( $user_id, 'job_title', 'Senior Developer' ); @@ -92,7 +92,7 @@ public function test_enhance_adds_job_title_from_user_meta() { 'post_type' => 'post', 'post_status' => 'publish', 'post_author' => $user_id, - ] + ], ); $indexable = \current( $this->get_indexables_for( $post ) ); @@ -120,7 +120,7 @@ public function test_enhance_does_not_override_existing_job_title() { [ 'user_login' => 'testauthor', 'role' => 'author', - ] + ], ); \update_user_meta( $user_id, 'job_title', 'Senior Developer' ); @@ -131,7 +131,7 @@ public function test_enhance_does_not_override_existing_job_title() { 'post_type' => 'post', 'post_status' => 'publish', 'post_author' => $user_id, - ] + ], ); $indexable = \current( $this->get_indexables_for( $post ) ); @@ -159,7 +159,7 @@ public function test_enhance_does_not_add_job_title_when_empty() { [ 'user_login' => 'testauthor', 'role' => 'author', - ] + ], ); // Set empty job title. @@ -171,7 +171,7 @@ public function test_enhance_does_not_add_job_title_when_empty() { 'post_type' => 'post', 'post_status' => 'publish', 'post_author' => $user_id, - ] + ], ); $indexable = \current( $this->get_indexables_for( $post ) ); @@ -198,7 +198,7 @@ public function test_enhance_does_not_add_job_title_when_meta_not_exists() { [ 'user_login' => 'testauthor', 'role' => 'author', - ] + ], ); $post = $this->factory()->post->create_and_get( @@ -207,7 +207,7 @@ public function test_enhance_does_not_add_job_title_when_meta_not_exists() { 'post_type' => 'post', 'post_status' => 'publish', 'post_author' => $user_id, - ] + ], ); $indexable = \current( $this->get_indexables_for( $post ) ); @@ -234,7 +234,7 @@ public function test_enhance_trims_whitespace_from_job_title() { [ 'user_login' => 'testauthor', 'role' => 'author', - ] + ], ); \update_user_meta( $user_id, 'job_title', ' Senior Developer ' ); @@ -245,7 +245,7 @@ public function test_enhance_trims_whitespace_from_job_title() { 'post_type' => 'post', 'post_status' => 'publish', 'post_author' => $user_id, - ] + ], ); $indexable = \current( $this->get_indexables_for( $post ) ); @@ -273,7 +273,7 @@ public function test_enhance_ignores_non_person_types() { [ 'user_login' => 'testauthor', 'role' => 'author', - ] + ], ); \update_user_meta( $user_id, 'job_title', 'Senior Developer' ); @@ -284,7 +284,7 @@ public function test_enhance_ignores_non_person_types() { 'post_type' => 'post', 'post_status' => 'publish', 'post_author' => $user_id, - ] + ], ); $indexable = \current( $this->get_indexables_for( $post ) ); @@ -314,7 +314,7 @@ public function test_enhance_respects_disabled_enhancement() { [ 'user_login' => 'testauthor', 'role' => 'author', - ] + ], ); \update_user_meta( $user_id, 'job_title', 'Senior Developer' ); @@ -325,7 +325,7 @@ public function test_enhance_respects_disabled_enhancement() { 'post_type' => 'post', 'post_status' => 'publish', 'post_author' => $user_id, - ] + ], ); $indexable = \current( $this->get_indexables_for( $post ) ); diff --git a/tests/WP/Schema_Aggregator/Infrastructure/Indexable_Repository/WordPress_Query_Repository_Test.php b/tests/WP/Schema_Aggregator/Infrastructure/Indexable_Repository/WordPress_Query_Repository_Test.php index 102cbe8d463..da22ddb309e 100644 --- a/tests/WP/Schema_Aggregator/Infrastructure/Indexable_Repository/WordPress_Query_Repository_Test.php +++ b/tests/WP/Schema_Aggregator/Infrastructure/Indexable_Repository/WordPress_Query_Repository_Test.php @@ -115,7 +115,7 @@ public function test_get_pagination_returns_different_results(): void { $this->assertNotEquals( ( $page_1[0]->object_id ?? null ), ( $page_2[0]->object_id ?? null ), - 'Different pages should return different posts' + 'Different pages should return different posts', ); } @@ -183,7 +183,7 @@ private function create_test_content(): void { 'post_title' => 'Test Post', 'post_status' => 'publish', 'post_type' => 'post', - ] + ], ); $this->created_posts = \array_merge( $this->created_posts, $post_ids ); @@ -193,7 +193,7 @@ private function create_test_content(): void { 'post_title' => 'Test Page', 'post_status' => 'publish', 'post_type' => 'page', - ] + ], ); $this->created_posts = \array_merge( $this->created_posts, $page_ids ); } diff --git a/tests/WP/Schema_Aggregator/Infrastructure/Schema_Pieces/Edd_Schema_Piece_Repository/Collect_Test.php b/tests/WP/Schema_Aggregator/Infrastructure/Schema_Pieces/Edd_Schema_Piece_Repository/Collect_Test.php index 61beca13013..e39454f82c4 100644 --- a/tests/WP/Schema_Aggregator/Infrastructure/Schema_Pieces/Edd_Schema_Piece_Repository/Collect_Test.php +++ b/tests/WP/Schema_Aggregator/Infrastructure/Schema_Pieces/Edd_Schema_Piece_Repository/Collect_Test.php @@ -92,7 +92,7 @@ public function test_collect_returns_product_schema(): void { 'post_status' => 'publish', 'post_type' => 'download', 'post_excerpt' => 'A test digital download.', - ] + ], ); $this->created_posts[] = $post_id; @@ -122,7 +122,7 @@ public function test_collect_returns_empty_for_non_download_post(): void { 'post_title' => 'Regular Post', 'post_status' => 'publish', 'post_type' => 'post', - ] + ], ); $this->created_posts[] = $post_id; @@ -138,7 +138,7 @@ public function test_collect_returns_empty_for_non_download_post(): void { * @return void */ public function test_collect_returns_empty_for_non_existent_post(): void { - $result = $this->instance->collect( 999999 ); + $result = $this->instance->collect( 999_999 ); $this->assertIsArray( $result ); $this->assertEmpty( $result, 'Expected empty array for a non-existent post ID.' ); diff --git a/tests/WP/Schema_Aggregator/Infrastructure/Schema_Pieces/Schema_Piece_Repository/Get_Test.php b/tests/WP/Schema_Aggregator/Infrastructure/Schema_Pieces/Schema_Piece_Repository/Get_Test.php index 34b7e73156e..b4d5b894094 100644 --- a/tests/WP/Schema_Aggregator/Infrastructure/Schema_Pieces/Schema_Piece_Repository/Get_Test.php +++ b/tests/WP/Schema_Aggregator/Infrastructure/Schema_Pieces/Schema_Piece_Repository/Get_Test.php @@ -100,7 +100,7 @@ public function set_up(): void { $indexable_repository_factory, $wordpress_global_state_adapter, $edd_schema_piece_repository, - $woo_schema_piece_repository + $woo_schema_piece_repository, ); // Delete all indexables before each test to ensure a clean slate. @@ -158,7 +158,7 @@ public function test_get_with_results( $this->assertGreaterThanOrEqual( $min_expected_pieces, \count( $pieces ), - "Should return at least {$min_expected_pieces} schema pieces." + "Should return at least {$min_expected_pieces} schema pieces.", ); foreach ( $pieces as $piece ) { @@ -220,13 +220,13 @@ public function test_get_pagination_returns_different_schema_pieces( bool $enabl static function ( Schema_Piece $piece ) { return $piece->get_data(); }, - $page_1_pieces + $page_1_pieces, ); $page_2_data = \array_map( static function ( Schema_Piece $piece ) { return $piece->get_data(); }, - $page_2_pieces + $page_2_pieces, ); $this->assertNotEquals( $page_1_data, $page_2_data, 'Different pages should return different schema pieces.' ); @@ -350,7 +350,7 @@ private function create_test_content(): void { 'post_status' => 'publish', 'post_type' => 'post', 'post_content' => 'Test post content for schema aggregation.', - ] + ], ); $this->created_posts = \array_merge( $this->created_posts, $post_ids ); @@ -361,7 +361,7 @@ private function create_test_content(): void { 'post_status' => 'publish', 'post_type' => 'page', 'post_content' => 'Test page content for schema aggregation.', - ] + ], ); $this->created_posts = \array_merge( $this->created_posts, $page_ids ); } diff --git a/tests/WP/Schema_Aggregator/Infrastructure/Schema_Pieces/Woo_Schema_Piece_Repository/Collect_Test.php b/tests/WP/Schema_Aggregator/Infrastructure/Schema_Pieces/Woo_Schema_Piece_Repository/Collect_Test.php index 8af458c3c8a..4a7565756cd 100644 --- a/tests/WP/Schema_Aggregator/Infrastructure/Schema_Pieces/Woo_Schema_Piece_Repository/Collect_Test.php +++ b/tests/WP/Schema_Aggregator/Infrastructure/Schema_Pieces/Woo_Schema_Piece_Repository/Collect_Test.php @@ -66,7 +66,7 @@ public function set_up(): void { 'woocommerce_structured_data_product', static function ( $markup ) { return \apply_filters( 'wpseo_schema_product', $markup ); - } + }, ); $this->instance = new Woo_Schema_Piece_Repository( new WooCommerce_Conditional() ); @@ -125,7 +125,7 @@ public function test_collect_returns_empty_for_non_product_post(): void { 'post_title' => 'Regular Post', 'post_status' => 'publish', 'post_type' => 'post', - ] + ], ); $this->created_posts[] = $post_id; @@ -141,7 +141,7 @@ public function test_collect_returns_empty_for_non_product_post(): void { * @return void */ public function test_collect_returns_empty_for_non_existent_post(): void { - $result = $this->instance->collect( 999999 ); + $result = $this->instance->collect( 999_999 ); $this->assertIsArray( $result ); $this->assertEmpty( $result, 'Expected empty array for a non-existent post ID.' ); diff --git a/tests/WP/Sitemaps/Cache_Test.php b/tests/WP/Sitemaps/Cache_Test.php index 5736c1f20ab..24d7c0822f9 100644 --- a/tests/WP/Sitemaps/Cache_Test.php +++ b/tests/WP/Sitemaps/Cache_Test.php @@ -69,7 +69,7 @@ public function test_transient_cache_data_object() { * to do so ourselves. * As of PHP 7.4, the new serialization using magic methods is used. */ - if ( \PHP_VERSION_ID < 70400 ) { + if ( \PHP_VERSION_ID < 70_400 ) { // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_unserialize -- Reason: There's no security risk, because users don't interact with tests. $result = \unserialize( $result ); } @@ -135,7 +135,7 @@ public function test_retrieving_transient_stored_in_php_lt_74() { static function ( $pre_transient ) { $pre_transient = 'C:24:"WPSEO_Sitemap_Cache_Data":107:{a:2:{s:6:"status";s:2:"ok";s:3:"xml";s:61:"this is a wpseo_sitemap_cache_data object stored in PHP < 7.4";}}'; return \maybe_unserialize( $pre_transient ); - } + }, ); $cache = new WPSEO_Sitemaps_Cache(); @@ -184,13 +184,13 @@ public function test_retrieving_transient_stored_in_php_gte_74() { static function ( $pre_transient ) { $pre_transient = 'O:24:"WPSEO_Sitemap_Cache_Data":2:{s:6:"status";s:2:"ok";s:3:"xml";s:62:"this is a wpseo_sitemap_cache_data object stored in PHP >= 7.4";}'; return \maybe_unserialize( $pre_transient ); - } + }, ); $cache = new WPSEO_Sitemaps_Cache(); $result = $cache->get_sitemap_data( $type, $page ); - if ( \PHP_VERSION_ID >= 70400 ) { + if ( \PHP_VERSION_ID >= 70_400 ) { // PHP 7.4+. $this->assertInstanceOf( WPSEO_Sitemap_Cache_Data::class, $result ); $this->assertSame( $sitemap, $result->get_sitemap() ); @@ -279,7 +279,7 @@ public function test_clear_index_also_cleared() { * difference between the two generations we will end up with the same * cache invalidator, failing this test. */ - \usleep( 10000 ); + \usleep( 10_000 ); // Act. WPSEO_Sitemaps_Cache::clear( [ 'page' ] ); @@ -340,7 +340,7 @@ public function test_register_clear_on_option_update() { // Hook will be added on default priority. $has_action = \has_action( 'update_option', - [ WPSEO_Sitemaps_Cache::class, 'clear_on_option_update' ] + [ WPSEO_Sitemaps_Cache::class, 'clear_on_option_update' ], ); $this->assertEquals( 10, $has_action ); } @@ -399,7 +399,7 @@ public function test_clearing_author_sitemap_by_unknown_userid() { */ public function test_clearing_author_sitemap_by_userid() { $user_id = $this->factory->user->create( - [ 'role' => 'administrator' ] + [ 'role' => 'administrator' ], ); $this->assertTrue( WPSEO_Sitemaps_Cache::invalidate_author( $user_id ) ); @@ -414,7 +414,7 @@ public function test_clearing_author_sitemap_by_userid() { */ public function test_clearing_author_sitemap_by_userid_with_subscriber_role() { $user_id = $this->factory->user->create( - [ 'role' => 'subscriber' ] + [ 'role' => 'subscriber' ], ); $this->assertFalse( WPSEO_Sitemaps_Cache::invalidate_author( $user_id ) ); diff --git a/tests/WP/Sitemaps/Cache_Validator_Test.php b/tests/WP/Sitemaps/Cache_Validator_Test.php index b08e6f14ecc..776551e2713 100644 --- a/tests/WP/Sitemaps/Cache_Validator_Test.php +++ b/tests/WP/Sitemaps/Cache_Validator_Test.php @@ -120,7 +120,7 @@ public function test_base_10_to_base_61() { $this->assertEquals( '32', WPSEO_Sitemaps_Cache_Validator::convert_base10_to_base61( 123 ) ); // Check against PHP_INT_MAX on 32-bit systems. - $this->assertEquals( '3y75pX', WPSEO_Sitemaps_Cache_Validator::convert_base10_to_base61( 2147483647 ) ); + $this->assertEquals( '3y75pX', WPSEO_Sitemaps_Cache_Validator::convert_base10_to_base61( 2_147_483_647 ) ); } /** diff --git a/tests/WP/Sitemaps/Image_Parser_Test.php b/tests/WP/Sitemaps/Image_Parser_Test.php index 431361de713..3572c6dc91c 100644 --- a/tests/WP/Sitemaps/Image_Parser_Test.php +++ b/tests/WP/Sitemaps/Image_Parser_Test.php @@ -42,7 +42,7 @@ public function test_get_images() { $content_src = 'http://example.org/content-image.jpg'; $post_id = $this->factory->post->create( - [ 'post_content' => "jibberish" ] + [ 'post_content' => "jibberish" ], ); $images = self::$class_instance->get_images( \get_post( $post_id ) ); diff --git a/tests/WP/Sitemaps/Post_Type_Sitemap_Provider_Test.php b/tests/WP/Sitemaps/Post_Type_Sitemap_Provider_Test.php index c768615f2a2..8044e09ec4e 100644 --- a/tests/WP/Sitemaps/Post_Type_Sitemap_Provider_Test.php +++ b/tests/WP/Sitemaps/Post_Type_Sitemap_Provider_Test.php @@ -121,7 +121,7 @@ public function test_get_index_links_empty_bucket() { // Expect an empty list to be output. $this->expectOutputContains( - 'xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\r\n" . '' + 'xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\r\n" . '', ); // Remove the filter. @@ -331,14 +331,14 @@ public function test_password_protected_post() { $this->factory->post->create( [ 'post_password' => 'secret', - ] + ], ); // Expect the protected post should not be added. $this->assertCount( 0, self::$class_instance->get_sitemap_links( 'post', 100, 0 ), - 'Password protected posts should not be in the sitemap' + 'Password protected posts should not be in the sitemap', ); } @@ -357,7 +357,7 @@ public function test_regular_attachment() { $post_id = $this->factory->post->create( [ 'post_password' => '', - ] + ], ); $this->factory->post->create( @@ -365,7 +365,7 @@ public function test_regular_attachment() { 'post_parent' => $post_id, 'post_type' => 'attachment', 'post_status' => 'inherit', - ] + ], ); // Expect the attchment to be in the list. @@ -389,7 +389,7 @@ public function test_password_protected_post_parent_attachment() { $post_id = $this->factory->post->create( [ 'post_password' => 'secret', - ] + ], ); $this->factory->post->create( @@ -397,7 +397,7 @@ public function test_password_protected_post_parent_attachment() { 'post_parent' => $post_id, 'post_type' => 'attachment', 'post_status' => 'inherit', - ] + ], ); // Expect the attachment not to be added to the list. @@ -437,7 +437,7 @@ public function test_get_first_links() { [ 'post_type' => 'page', 'post_status' => 'publish', - ] + ], ); \update_option( 'page_on_front', $post_id ); diff --git a/tests/WP/Sitemaps/Provider_Overlap_Test.php b/tests/WP/Sitemaps/Provider_Overlap_Test.php index 772fc36bdd6..5168adab048 100644 --- a/tests/WP/Sitemaps/Provider_Overlap_Test.php +++ b/tests/WP/Sitemaps/Provider_Overlap_Test.php @@ -81,7 +81,7 @@ public function test_private_taxonomy_author_overlap() { // Expect the author-sitemap to be present in the index. $this->expectOutputContains( - '' . $url . '' + '' . $url . '', ); } @@ -103,7 +103,7 @@ public function test_private_taxonomy_author_overlap_author_in_sitemap() { // Expect the author-sitemap to be present in the index. $this->expectOutputContains( - '' . \get_author_posts_url( $user_id ) . '' + '' . \get_author_posts_url( $user_id ) . '', ); } } diff --git a/tests/WP/Sitemaps/Sitemaps_Test.php b/tests/WP/Sitemaps/Sitemaps_Test.php index e2cb0707711..bcb36ad57fa 100644 --- a/tests/WP/Sitemaps/Sitemaps_Test.php +++ b/tests/WP/Sitemaps/Sitemaps_Test.php @@ -125,7 +125,7 @@ static function ( $links ) { 'lastmod' => \date( '1' ), ]; return $links; - } + }, ); self::$class_instance->redirect( $GLOBALS['wp_the_query'] ); diff --git a/tests/WP/Statistics/Statistics_Service_Test.php b/tests/WP/Statistics/Statistics_Service_Test.php index b096965d683..b0e22874481 100644 --- a/tests/WP/Statistics/Statistics_Service_Test.php +++ b/tests/WP/Statistics/Statistics_Service_Test.php @@ -37,7 +37,7 @@ public function test_filter_zero_counts() { 'ok' => 10, 'na' => 0, 'bad' => 0, - ] + ], ); $class_instance = new WPSEO_Statistics_Service( $statistics ); @@ -61,7 +61,7 @@ public function test_seo_score_links() { 'ok' => 10, 'na' => 0, 'bad' => 0, - ] + ], ); $class_instance = new WPSEO_Statistics_Service( $statistics ); @@ -70,7 +70,7 @@ public function test_seo_score_links() { $this->assertEquals( \esc_url( \admin_url( 'edit.php?post_status=publish&post_type=post&seo_filter=ok&author=0' ) ), - $response_data['seo_scores'][0]['link'] + $response_data['seo_scores'][0]['link'], ); } @@ -90,7 +90,7 @@ public function test_admin_seo_score_links() { 'ok' => 10, 'na' => 0, 'bad' => 0, - ] + ], ); $class_instance = new WPSEO_Statistics_Service( $statistics ); @@ -99,7 +99,7 @@ public function test_admin_seo_score_links() { $this->assertEquals( \esc_url( \admin_url( 'edit.php?post_status=publish&post_type=post&seo_filter=ok' ) ), - $response_data['seo_scores'][0]['link'] + $response_data['seo_scores'][0]['link'], ); $user->remove_cap( 'edit_others_posts' ); @@ -118,7 +118,7 @@ public function test_page_counts() { 'ok' => 10, 'na' => 0, 'bad' => 0, - ] + ], ); $class_instance = new WPSEO_Statistics_Service( $statistics ); diff --git a/tests/WP/Taxonomy/Taxonomy_Fields_Presenter_Test.php b/tests/WP/Taxonomy/Taxonomy_Fields_Presenter_Test.php index c65eb8c3a41..c0f09f55cf8 100644 --- a/tests/WP/Taxonomy/Taxonomy_Fields_Presenter_Test.php +++ b/tests/WP/Taxonomy/Taxonomy_Fields_Presenter_Test.php @@ -52,7 +52,7 @@ public function test_display_fields() { 'description' => 'this is a test field', 'options' => '', ], - ] + ], ); $expected = '

    this is a test field

    '; @@ -77,7 +77,7 @@ public function test_display_fields_no_label() { 'description' => 'this is a test field', 'options' => '', ], - ] + ], ); $expected = '

    this is a test field

    '; @@ -102,7 +102,7 @@ public function test_display_fields_no_description() { 'description' => '', 'options' => [], ], - ] + ], ); $this->assertEquals( '', $output ); @@ -128,12 +128,12 @@ public function test_display_fields_select() { ], ], ], - ] + ], ); $this->assertStringContainsString( '', - $output + $output, ); } @@ -157,12 +157,12 @@ public function test_display_fields_checkbox() { ], ], ], - ] + ], ); $this->assertStringContainsString( '', - $output + $output, ); } @@ -182,12 +182,12 @@ public function test_display_fields_hidden() { 'description' => '', 'options' => '', ], - ] + ], ); $this->assertStringContainsString( '', - $output + $output, ); } @@ -207,12 +207,12 @@ public function test_display_fields_with_description() { 'description' => 'description for the field', 'options' => '', ], - ] + ], ); $this->assertStringContainsString( '

    description for the field

    ', - $output + $output, ); } } diff --git a/tests/WP/TestCase.php b/tests/WP/TestCase.php index e8bf4ac3003..b8efead3fd8 100644 --- a/tests/WP/TestCase.php +++ b/tests/WP/TestCase.php @@ -40,7 +40,7 @@ public function set_up() { if ( $this->prereq_plugin_include_failed === true ) { $this->markTestSkipped( - "\n" . 'Couldn\'t include the required plugin file(s): ' . $this->prereq_plugin_basename . '. Skipping all tests in class ' . static::class . '.' + "\n" . 'Couldn\'t include the required plugin file(s): ' . $this->prereq_plugin_basename . '. Skipping all tests in class ' . static::class . '.', ); } } diff --git a/tests/WP/bootstrap.php b/tests/WP/bootstrap.php index 29589b717f4..8284a97d95d 100644 --- a/tests/WP/bootstrap.php +++ b/tests/WP/bootstrap.php @@ -88,7 +88,7 @@ function yoast_seo_create_asset_files_for_tests() { */ static function () { require \dirname( __DIR__, 2 ) . '/wp-seo.php'; - } + }, ); // Overwrite the plugin URL to not include the full path. @@ -114,7 +114,7 @@ static function ( $url, $path, $plugin ) { return $url; }, 10, - 3 + 3, ); // Make sure the tests never register as being in development mode. diff --git a/wp-seo-main.php b/wp-seo-main.php index ea4dfda2cd7..88a9b621bbb 100644 --- a/wp-seo-main.php +++ b/wp-seo-main.php @@ -55,12 +55,10 @@ function wpseo_auto_load( $class_name ) { static $classes = null; - if ( $classes === null ) { - $classes = [ - 'wp_list_table' => ABSPATH . 'wp-admin/includes/class-wp-list-table.php', - 'walker_category' => ABSPATH . 'wp-includes/category-template.php', - ]; - } + $classes ??= [ + 'wp_list_table' => ABSPATH . 'wp-admin/includes/class-wp-list-table.php', + 'walker_category' => ABSPATH . 'wp-includes/category-template.php', + ]; $cn = strtolower( $class_name ); @@ -120,7 +118,7 @@ static function () use ( $yoast_autoloader ) { $yoast_autoloader->unregister(); $yoast_autoloader->register( true ); }, - 1 + 1, ); } @@ -566,7 +564,7 @@ function yoast_wpseo_activation_failed_notice( $message ) { $title = sprintf( /* translators: %s: Yoast SEO. */ esc_html__( '%s activation failed', 'wordpress-seo' ), - 'Yoast SEO' + 'Yoast SEO', ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- This function is only called in 3 places that are safe.