From f823a1cb9553ebfa7885c8890f8629db2424c09e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2024 17:02:42 +0000 Subject: [PATCH 1/2] Bump php-stubs/wordpress-stubs from 6.5.3 to 6.6.2 Bumps [php-stubs/wordpress-stubs](https://github.com/php-stubs/wordpress-stubs) from 6.5.3 to 6.6.2. - [Release notes](https://github.com/php-stubs/wordpress-stubs/releases) - [Commits](https://github.com/php-stubs/wordpress-stubs/compare/v6.5.3...v6.6.2) --- updated-dependencies: - dependency-name: php-stubs/wordpress-stubs dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- composer.lock | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/composer.lock b/composer.lock index 406106a7bcc..056e890437e 100644 --- a/composer.lock +++ b/composer.lock @@ -2677,27 +2677,28 @@ }, { "name": "php-stubs/wordpress-stubs", - "version": "v6.5.3", + "version": "v6.6.2", "source": { "type": "git", "url": "https://github.com/php-stubs/wordpress-stubs.git", - "reference": "e611a83292d02055a25f83291a98fadd0c21e092" + "reference": "f50fd7ed45894d036e4fef9ab7e5bbbaff6a30cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/e611a83292d02055a25f83291a98fadd0c21e092", - "reference": "e611a83292d02055a25f83291a98fadd0c21e092", + "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/f50fd7ed45894d036e4fef9ab7e5bbbaff6a30cc", + "reference": "f50fd7ed45894d036e4fef9ab7e5bbbaff6a30cc", "shasum": "" }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^1.0", "nikic/php-parser": "^4.13", - "php": "^7.4 || ~8.0.0", + "php": "^7.4 || ^8.0", "php-stubs/generator": "^0.8.3", - "phpdocumentor/reflection-docblock": "5.3", + "phpdocumentor/reflection-docblock": "^5.4.1", "phpstan/phpstan": "^1.10.49", "phpunit/phpunit": "^9.5", - "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.11" + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^1.0", + "wp-coding-standards/wpcs": "3.1.0 as 2.3.0" }, "suggest": { "paragonie/sodium_compat": "Pure PHP implementation of libsodium", @@ -2718,9 +2719,9 @@ ], "support": { "issues": "https://github.com/php-stubs/wordpress-stubs/issues", - "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.5.3" + "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.6.2" }, - "time": "2024-05-08T02:12:31+00:00" + "time": "2024-09-30T07:10:48+00:00" }, { "name": "phpcompatibility/php-compatibility", From 1c1ded94ec126ab683812bee46b9f3db0c15f0b9 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Thu, 7 Nov 2024 09:23:32 -0800 Subject: [PATCH 2/2] Remove WP_Error from return types --- src/OptionsRESTController.php | 4 ++-- src/Validation/ScannableURLsRestController.php | 4 ++-- src/Validation/ValidationCountsRestController.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/OptionsRESTController.php b/src/OptionsRESTController.php index 4aebe8b22a6..914ed5ba738 100644 --- a/src/OptionsRESTController.php +++ b/src/OptionsRESTController.php @@ -162,7 +162,7 @@ public function get_items_permissions_check( $request ) { // phpcs:ignore Variab * Retrieves all AMP plugin options. * * @param WP_REST_Request $request Full details about the request. - * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. + * @return WP_REST_Response Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable $options = AMP_Options_Manager::get_options(); @@ -257,7 +257,7 @@ private function get_nested_supportable_templates( $supportable_templates, $pare * Updates AMP plugin options. * * @param WP_REST_Request $request Full details about the request. - * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. + * @return WP_REST_Response Response object on success, or WP_Error object on failure. */ public function update_items( $request ) { $params = $request->get_params(); diff --git a/src/Validation/ScannableURLsRestController.php b/src/Validation/ScannableURLsRestController.php index c3bf29b9552..03e737959ee 100644 --- a/src/Validation/ScannableURLsRestController.php +++ b/src/Validation/ScannableURLsRestController.php @@ -126,7 +126,7 @@ public function get_items_permissions_check( $request ) { * 'search') and a URL to a corresponding AMP page (`amp_url`). * * @param WP_REST_Request $request Full details about the request. - * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. + * @return WP_REST_Response Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable @@ -177,7 +177,7 @@ function ( $item ) use ( $request ) { * * @param array $item Scannable URL entry. * @param WP_REST_Request $request Request object. - * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. + * @return WP_REST_Response Response object on success, or WP_Error object on failure. */ public function prepare_item_for_response( $item, $request ) { $item = wp_array_slice_assoc( $item, [ 'url', 'type', 'label' ] ); diff --git a/src/Validation/ValidationCountsRestController.php b/src/Validation/ValidationCountsRestController.php index 010b830c10d..f088b5df988 100644 --- a/src/Validation/ValidationCountsRestController.php +++ b/src/Validation/ValidationCountsRestController.php @@ -94,7 +94,7 @@ public function get_items_permissions_check( $request ) { // phpcs:ignore Variab * Retrieves total unreviewed count for validation URLs and errors. * * @param WP_REST_Request $request Full details about the request. - * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. + * @return WP_REST_Response Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable $unreviewed_validated_url_count = AMP_Validated_URL_Post_Type::get_validation_error_urls_count();