From ade14efcd7700c56c3d29a30911f5b7d86c796b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 19:08:12 +0100 Subject: [PATCH 01/38] Added slevomat coding standard --- composer.json | 3 +- composer.lock | 67 ++++++++++++++++++++++++++++++- phpcs.xml | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 174 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 05aa860..650381c 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,8 @@ "squizlabs/php_codesniffer": "^3.0", "wp-coding-standards/wpcs": "^3.0", "phan/phan": "^5.0", - "phpstan/phpstan": "^1.4" + "phpstan/phpstan": "^1.4", + "slevomat/coding-standard": "^8.14" }, "scripts": { "phpcs": "phpcs", diff --git a/composer.lock b/composer.lock index 4f0092d..b8719d0 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": "c5c79d6ce6dcc949118d132820c7f43c", + "content-hash": "06f7131f675e16269d15df186389042e", "packages": [], "packages-dev": [ { @@ -1182,6 +1182,71 @@ }, "time": "2021-11-04T06:51:17+00:00" }, + { + "name": "slevomat/coding-standard", + "version": "8.14.1", + "source": { + "type": "git", + "url": "https://github.com/slevomat/coding-standard.git", + "reference": "fea1fd6f137cc84f9cba0ae30d549615dbc6a926" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/fea1fd6f137cc84f9cba0ae30d549615dbc6a926", + "reference": "fea1fd6f137cc84f9cba0ae30d549615dbc6a926", + "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.7.1" + }, + "require-dev": { + "phing/phing": "2.17.4", + "php-parallel-lint/php-parallel-lint": "1.3.2", + "phpstan/phpstan": "1.10.37", + "phpstan/phpstan-deprecation-rules": "1.1.4", + "phpstan/phpstan-phpunit": "1.3.14", + "phpstan/phpstan-strict-rules": "1.5.1", + "phpunit/phpunit": "8.5.21|9.6.8|10.3.5" + }, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "SlevomatCodingStandard\\": "SlevomatCodingStandard/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", + "keywords": [ + "dev", + "phpcs" + ], + "support": { + "issues": "https://github.com/slevomat/coding-standard/issues", + "source": "https://github.com/slevomat/coding-standard/tree/8.14.1" + }, + "funding": [ + { + "url": "https://github.com/kukulich", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard", + "type": "tidelift" + } + ], + "time": "2023-10-08T07:28:08+00:00" + }, { "name": "squizlabs/php_codesniffer", "version": "3.8.0", diff --git a/phpcs.xml b/phpcs.xml index baaadf6..246b013 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -26,4 +26,110 @@ + + + + + + + + + + + + + + From 1f9709f882ad27447644deea7779c8f90db3bb32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 19:29:41 +0100 Subject: [PATCH 02/38] Temporarily disabled slevomat rules --- phpcs.xml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/phpcs.xml b/phpcs.xml index 246b013..2aa73b6 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -63,6 +63,41 @@ --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - From 3e5d15f51e8cb1be9578a07c400b3f6a3fff8d99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 19:39:11 +0100 Subject: [PATCH 04/38] Enabled SlevomatCodingStandard.Attributes.AttributesOrder --- phpcs.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/phpcs.xml b/phpcs.xml index fdfa43b..2cc6eee 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -65,7 +65,6 @@ --> - @@ -99,6 +98,12 @@ + + + + + + - diff --git a/stubs/WordPress/class-wp-http.php b/stubs/WordPress/class-wp-http.php index 838324f..e0845d1 100644 --- a/stubs/WordPress/class-wp-http.php +++ b/stubs/WordPress/class-wp-http.php @@ -42,32 +42,6 @@ class WP_Http { */ public function get( $url, $args = array() ) { } - /** - * @param string|array $headers - * @param string $url - * - * @return array{response: array{code: int, message: string}, newheaders: string|array, cookies: array} { - * @type array{code: int, message: string} $response { - * @type int $code - * @type string $message - * } - * @type string|array $newheaders - * @type array $cookies - * } - */ - public static function processHeaders( $headers, $url = '' ) { - } - - /** - * @param string $strResponse - * - * @return array{headers: string, body: string} { - * @type string $headers - * @type string $body - * } - */ - public static function processResponse( $strResponse ) { - } /** * @param string $url @@ -105,4 +79,31 @@ public static function processResponse( $strResponse ) { */ public function request( $url, $args = array() ) { } + + /** + * @param string|array $headers + * @param string $url + * + * @return array{response: array{code: int, message: string}, newheaders: string|array, cookies: array} { + * @type array{code: int, message: string} $response { + * @type int $code + * @type string $message + * } + * @type string|array $newheaders + * @type array $cookies + * } + */ + public static function processHeaders( $headers, $url = '' ) { + } + + /** + * @param string $strResponse + * + * @return array{headers: string, body: string} { + * @type string $headers + * @type string $body + * } + */ + public static function processResponse( $strResponse ) { + } } From cdafdc8fd904b223de077b3ddc76ff46d55fdd17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 19:52:10 +0100 Subject: [PATCH 06/38] Enabled SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces.NoEmptyLineAfterOpeningBrace --- phpcs.xml | 1 - stubs/PHPUnit/Framework/class-assert.php | 1 + stubs/PHPUnit/Framework/class-testcase.php | 1 + stubs/WordPress-test/class-wp-unittestcase-base.php | 1 + stubs/WordPress-test/class-wp-unittestcase.php | 1 + stubs/WordPress/class-requests-cookie-jar.php | 1 + stubs/WordPress/class-requests-exception.php | 1 + stubs/WordPress/class-requests-response.php | 1 + .../class-requests-utility-caseinsensitivedictionary.php | 1 + stubs/WordPress/class-requests.php | 1 + stubs/WordPress/class-wp-admin-bar.php | 1 + stubs/WordPress/class-wp-block-type.php | 1 + stubs/WordPress/class-wp-comment-query.php | 1 + stubs/WordPress/class-wp-customize-color-control.php | 1 + stubs/WordPress/class-wp-customize-control.php | 1 + stubs/WordPress/class-wp-customize-image-control.php | 1 + stubs/WordPress/class-wp-customize-manager.php | 1 + stubs/WordPress/class-wp-customize-media-control.php | 1 + stubs/WordPress/class-wp-customize-panel.php | 1 + stubs/WordPress/class-wp-customize-partial.php | 1 + stubs/WordPress/class-wp-customize-section.php | 1 + stubs/WordPress/class-wp-customize-selective-refresh.php | 1 + stubs/WordPress/class-wp-customize-setting.php | 1 + stubs/WordPress/class-wp-customize-upload-control.php | 1 + stubs/WordPress/class-wp-error.php | 1 + stubs/WordPress/class-wp-http-cookie.php | 1 + stubs/WordPress/class-wp-http-requests-response.php | 1 + stubs/WordPress/class-wp-http-response.php | 1 + stubs/WordPress/class-wp-http.php | 1 + stubs/WordPress/class-wp-locale-switcher.php | 1 + stubs/WordPress/class-wp-post-type.php | 1 + stubs/WordPress/class-wp-post.php | 1 + stubs/WordPress/class-wp-query.php | 1 + stubs/WordPress/class-wp-roles.php | 1 + stubs/WordPress/class-wp-screen.php | 1 + stubs/WordPress/class-wp-theme.php | 1 + stubs/WordPress/class-wp-user-query.php | 1 + stubs/WordPress/class-wp-user.php | 1 + stubs/WordPress/class-wp-widget.php | 1 + stubs/WordPress/interface-requests-auth.php | 1 + stubs/WordPress/interface-requests-hooker.php | 1 + stubs/WordPress/interface-requests-proxy.php | 1 + stubs/WordPress/interface-requests-transport.php | 1 + 43 files changed, 42 insertions(+), 1 deletion(-) diff --git a/phpcs.xml b/phpcs.xml index c5d7a3a..cf82967 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -65,7 +65,6 @@ --> - diff --git a/stubs/PHPUnit/Framework/class-assert.php b/stubs/PHPUnit/Framework/class-assert.php index 820b71a..9187942 100644 --- a/stubs/PHPUnit/Framework/class-assert.php +++ b/stubs/PHPUnit/Framework/class-assert.php @@ -6,6 +6,7 @@ namespace PHPUnit\Framework; class Assert { + /** * @param string $expected * @param mixed $actual diff --git a/stubs/PHPUnit/Framework/class-testcase.php b/stubs/PHPUnit/Framework/class-testcase.php index 1dee963..e6ac094 100644 --- a/stubs/PHPUnit/Framework/class-testcase.php +++ b/stubs/PHPUnit/Framework/class-testcase.php @@ -6,4 +6,5 @@ namespace PHPUnit\Framework; class TestCase extends Assert { + } diff --git a/stubs/WordPress-test/class-wp-unittestcase-base.php b/stubs/WordPress-test/class-wp-unittestcase-base.php index 512e4b8..08e296a 100644 --- a/stubs/WordPress-test/class-wp-unittestcase-base.php +++ b/stubs/WordPress-test/class-wp-unittestcase-base.php @@ -6,4 +6,5 @@ /** */ class WP_UnitTestCase_Base extends PHPUnit\Framework\TestCase { + } diff --git a/stubs/WordPress-test/class-wp-unittestcase.php b/stubs/WordPress-test/class-wp-unittestcase.php index 80b1efb..4cb2885 100644 --- a/stubs/WordPress-test/class-wp-unittestcase.php +++ b/stubs/WordPress-test/class-wp-unittestcase.php @@ -6,4 +6,5 @@ /** */ class WP_UnitTestCase extends WP_UnitTestCase_Base { + } diff --git a/stubs/WordPress/class-requests-cookie-jar.php b/stubs/WordPress/class-requests-cookie-jar.php index 41aef6d..bad8964 100644 --- a/stubs/WordPress/class-requests-cookie-jar.php +++ b/stubs/WordPress/class-requests-cookie-jar.php @@ -8,6 +8,7 @@ * @implements IteratorAggregate */ class Requests_Cookie_Jar implements ArrayAccess, IteratorAggregate { + /** * @param string $key * diff --git a/stubs/WordPress/class-requests-exception.php b/stubs/WordPress/class-requests-exception.php index b5874a3..7ea41fa 100644 --- a/stubs/WordPress/class-requests-exception.php +++ b/stubs/WordPress/class-requests-exception.php @@ -6,4 +6,5 @@ /** */ class Requests_Exception extends Exception { + } diff --git a/stubs/WordPress/class-requests-response.php b/stubs/WordPress/class-requests-response.php index b62f67a..d35b9ad 100644 --- a/stubs/WordPress/class-requests-response.php +++ b/stubs/WordPress/class-requests-response.php @@ -6,6 +6,7 @@ /** */ class Requests_Response { + /** * @var string */ diff --git a/stubs/WordPress/class-requests-utility-caseinsensitivedictionary.php b/stubs/WordPress/class-requests-utility-caseinsensitivedictionary.php index 2038eb7..037f864 100644 --- a/stubs/WordPress/class-requests-utility-caseinsensitivedictionary.php +++ b/stubs/WordPress/class-requests-utility-caseinsensitivedictionary.php @@ -8,6 +8,7 @@ * @implements IteratorAggregate */ class Requests_Utility_CaseInsensitiveDictionary implements ArrayAccess, IteratorAggregate { + /** * @param string $key * diff --git a/stubs/WordPress/class-requests.php b/stubs/WordPress/class-requests.php index 4d3ab0c..8372632 100644 --- a/stubs/WordPress/class-requests.php +++ b/stubs/WordPress/class-requests.php @@ -6,6 +6,7 @@ /** */ class Requests { + /** * @param array, data?: array|string, type?: string, cookies?: array|Requests_Cookie_Jar}> $requests * @param array{timeout?: float, connect_timeout?: float, useragent?: string, follow_redirects?: bool, redirects?: int, blocking?: bool, filename?: string|bool, auth?: Requests_Auth|array|bool, proxy?: Requests_Proxy|array|string|bool, max_bytes?: int|bool, idn?: bool, transport?: string|Requests_Transport, hooks?: Requests_Hooker, verify?: string|bool, verifyname?: bool, data_format?: string, complete?: callable} $options { diff --git a/stubs/WordPress/class-wp-admin-bar.php b/stubs/WordPress/class-wp-admin-bar.php index 9919651..19e97c7 100644 --- a/stubs/WordPress/class-wp-admin-bar.php +++ b/stubs/WordPress/class-wp-admin-bar.php @@ -6,6 +6,7 @@ /** */ class WP_Admin_Bar { + /** * @param array{id: string, title?: string, parent?: string, href?: string, group?: bool, meta?: array{html?: string, class?: string, rel?: string, onclick?: string, target?: string, title?: string, tabindex?: string}} $node { * @type string $id diff --git a/stubs/WordPress/class-wp-block-type.php b/stubs/WordPress/class-wp-block-type.php index e4809da..b745b94 100644 --- a/stubs/WordPress/class-wp-block-type.php +++ b/stubs/WordPress/class-wp-block-type.php @@ -6,4 +6,5 @@ /** */ class WP_Block_Type { + } diff --git a/stubs/WordPress/class-wp-comment-query.php b/stubs/WordPress/class-wp-comment-query.php index 7ff6937..5029029 100644 --- a/stubs/WordPress/class-wp-comment-query.php +++ b/stubs/WordPress/class-wp-comment-query.php @@ -6,6 +6,7 @@ /** */ class WP_Comment_Query { + /** * @var array{author_email?: string, author_url?: string, author__in?: array, author__not_in?: array, comment__in?: array, comment__not_in: array, count?: bool, date_query?: array, fields?: string, ID?: int, include_unapproved?: array, karma?: int, meta_key?: string|array, meta_value?: string|array, meta_compare?: string, meta_compare_key?: string, meta_type?: string, meta_type_key?: string, meta_query?: array, number?: int, paged?: int, offset?: int, no_found_rows?: bool, orderby?: string|array, order: string, parent?: int, parent__in?: array, parent__not_in?: array, post_author__in?: array, post_author__not_in?: array, post_ID?: int, post_id?: int, post__in: array, post__not_in?: array, post_author?: int, post_status?: string|array, post_type?: string|array, post_name?: string, post_parent?: int, search?: string, status?: string|array, tape?: string|array, type__in?: array, type__not_in?: array, hierarchical?: bool|string, cache_domain?: string, update_comment_meta_cache?: bool, update_comment_post_cache?: bool} { * @type string $author_email diff --git a/stubs/WordPress/class-wp-customize-color-control.php b/stubs/WordPress/class-wp-customize-color-control.php index bcaea5e..db82cdb 100644 --- a/stubs/WordPress/class-wp-customize-color-control.php +++ b/stubs/WordPress/class-wp-customize-color-control.php @@ -6,6 +6,7 @@ /** */ class WP_Customize_Color_Control extends WP_Customize_Control { + /** * @param WP_Customize_Manager $manager * @param string $id diff --git a/stubs/WordPress/class-wp-customize-control.php b/stubs/WordPress/class-wp-customize-control.php index b7f3192..26af8d2 100644 --- a/stubs/WordPress/class-wp-customize-control.php +++ b/stubs/WordPress/class-wp-customize-control.php @@ -6,6 +6,7 @@ /** */ class WP_Customize_Control { + /** * @var array */ diff --git a/stubs/WordPress/class-wp-customize-image-control.php b/stubs/WordPress/class-wp-customize-image-control.php index 4b84dff..5f385ef 100644 --- a/stubs/WordPress/class-wp-customize-image-control.php +++ b/stubs/WordPress/class-wp-customize-image-control.php @@ -6,6 +6,7 @@ /** */ class WP_Customize_Image_Control extends WP_Customize_Upload_Control { + /** * @param WP_Customize_Manager $manager * @param string $id diff --git a/stubs/WordPress/class-wp-customize-manager.php b/stubs/WordPress/class-wp-customize-manager.php index 7d442b2..9c90f44 100644 --- a/stubs/WordPress/class-wp-customize-manager.php +++ b/stubs/WordPress/class-wp-customize-manager.php @@ -6,6 +6,7 @@ /** */ class WP_Customize_Manager { + /** * @var WP_Customize_Selective_Refresh */ diff --git a/stubs/WordPress/class-wp-customize-media-control.php b/stubs/WordPress/class-wp-customize-media-control.php index de7996c..07340aa 100644 --- a/stubs/WordPress/class-wp-customize-media-control.php +++ b/stubs/WordPress/class-wp-customize-media-control.php @@ -6,4 +6,5 @@ /** */ class WP_Customize_Media_Control extends WP_Customize_Control { + } diff --git a/stubs/WordPress/class-wp-customize-panel.php b/stubs/WordPress/class-wp-customize-panel.php index e0c3044..71f1d4e 100644 --- a/stubs/WordPress/class-wp-customize-panel.php +++ b/stubs/WordPress/class-wp-customize-panel.php @@ -6,4 +6,5 @@ /** */ class WP_Customize_Panel { + } diff --git a/stubs/WordPress/class-wp-customize-partial.php b/stubs/WordPress/class-wp-customize-partial.php index 889dbba..c9011e3 100644 --- a/stubs/WordPress/class-wp-customize-partial.php +++ b/stubs/WordPress/class-wp-customize-partial.php @@ -6,4 +6,5 @@ /** */ class WP_Customize_Partial { + } diff --git a/stubs/WordPress/class-wp-customize-section.php b/stubs/WordPress/class-wp-customize-section.php index 4df9c16..8424f3f 100644 --- a/stubs/WordPress/class-wp-customize-section.php +++ b/stubs/WordPress/class-wp-customize-section.php @@ -6,4 +6,5 @@ /** */ class WP_Customize_Section { + } diff --git a/stubs/WordPress/class-wp-customize-selective-refresh.php b/stubs/WordPress/class-wp-customize-selective-refresh.php index 0cc0cae..4da5bcc 100644 --- a/stubs/WordPress/class-wp-customize-selective-refresh.php +++ b/stubs/WordPress/class-wp-customize-selective-refresh.php @@ -6,6 +6,7 @@ /** */ class WP_Customize_Selective_Refresh { + /** * @param WP_Customize_Partial|string $id * @param array{type?: string, selector?: string, settings?: array, primary_setting?: string, capability?: string, render_callback?: callable, container_inclusive?: bool, fallback_refresh?: bool} $args { diff --git a/stubs/WordPress/class-wp-customize-setting.php b/stubs/WordPress/class-wp-customize-setting.php index 6e4e266..54151f6 100644 --- a/stubs/WordPress/class-wp-customize-setting.php +++ b/stubs/WordPress/class-wp-customize-setting.php @@ -6,4 +6,5 @@ /** */ class WP_Customize_Setting { + } diff --git a/stubs/WordPress/class-wp-customize-upload-control.php b/stubs/WordPress/class-wp-customize-upload-control.php index 7dc1cff..e6422ac 100644 --- a/stubs/WordPress/class-wp-customize-upload-control.php +++ b/stubs/WordPress/class-wp-customize-upload-control.php @@ -6,4 +6,5 @@ /** */ class WP_Customize_Upload_Control extends WP_Customize_Media_Control { + } diff --git a/stubs/WordPress/class-wp-error.php b/stubs/WordPress/class-wp-error.php index 2236ba9..2968abe 100644 --- a/stubs/WordPress/class-wp-error.php +++ b/stubs/WordPress/class-wp-error.php @@ -6,6 +6,7 @@ /** */ class WP_Error { + /** * @var array */ diff --git a/stubs/WordPress/class-wp-http-cookie.php b/stubs/WordPress/class-wp-http-cookie.php index 10da701..f57e0e7 100644 --- a/stubs/WordPress/class-wp-http-cookie.php +++ b/stubs/WordPress/class-wp-http-cookie.php @@ -6,4 +6,5 @@ /** */ class WP_Http_Cookie { + } diff --git a/stubs/WordPress/class-wp-http-requests-response.php b/stubs/WordPress/class-wp-http-requests-response.php index 6d23ec7..6ff931f 100644 --- a/stubs/WordPress/class-wp-http-requests-response.php +++ b/stubs/WordPress/class-wp-http-requests-response.php @@ -6,4 +6,5 @@ /** */ class WP_HTTP_Requests_Response extends WP_HTTP_Response { + } diff --git a/stubs/WordPress/class-wp-http-response.php b/stubs/WordPress/class-wp-http-response.php index f74afd6..68b5d4a 100644 --- a/stubs/WordPress/class-wp-http-response.php +++ b/stubs/WordPress/class-wp-http-response.php @@ -6,4 +6,5 @@ /** */ class WP_HTTP_Response { + } diff --git a/stubs/WordPress/class-wp-http.php b/stubs/WordPress/class-wp-http.php index e0845d1..7e7598d 100644 --- a/stubs/WordPress/class-wp-http.php +++ b/stubs/WordPress/class-wp-http.php @@ -6,6 +6,7 @@ /** */ class WP_Http { + /** * @param string $url * @param string|array{method?: string, timeout?: int, redirection?: int, httpversion?: string, user-agent?: string, reject_unsafe_urls?: bool, blocking?: bool, headers?: string|array, cookies?: array, body?: string|array, compress?: bool, decompress?: bool, sslverify?: bool, sslcertificates?: string, stream?: bool, filename?: string, limit_response_size?: int} $args { diff --git a/stubs/WordPress/class-wp-locale-switcher.php b/stubs/WordPress/class-wp-locale-switcher.php index 9d3059d..ac9b2a6 100644 --- a/stubs/WordPress/class-wp-locale-switcher.php +++ b/stubs/WordPress/class-wp-locale-switcher.php @@ -6,6 +6,7 @@ /** */ class WP_Locale_Switcher { + /** * @return void */ diff --git a/stubs/WordPress/class-wp-post-type.php b/stubs/WordPress/class-wp-post-type.php index 3078081..a8acece 100644 --- a/stubs/WordPress/class-wp-post-type.php +++ b/stubs/WordPress/class-wp-post-type.php @@ -6,6 +6,7 @@ /** */ final class WP_Post_Type { + /** * @var string */ diff --git a/stubs/WordPress/class-wp-post.php b/stubs/WordPress/class-wp-post.php index daee2a6..23dd675 100644 --- a/stubs/WordPress/class-wp-post.php +++ b/stubs/WordPress/class-wp-post.php @@ -6,6 +6,7 @@ /** */ final class WP_Post { + /** * @var int */ diff --git a/stubs/WordPress/class-wp-query.php b/stubs/WordPress/class-wp-query.php index 8e75a3b..eb78183 100644 --- a/stubs/WordPress/class-wp-query.php +++ b/stubs/WordPress/class-wp-query.php @@ -6,6 +6,7 @@ /** */ class WP_Query { + /** * @var array|array */ diff --git a/stubs/WordPress/class-wp-roles.php b/stubs/WordPress/class-wp-roles.php index e2fcf7d..699260f 100644 --- a/stubs/WordPress/class-wp-roles.php +++ b/stubs/WordPress/class-wp-roles.php @@ -6,6 +6,7 @@ /** */ class WP_Roles { + /** * @param string $role * diff --git a/stubs/WordPress/class-wp-screen.php b/stubs/WordPress/class-wp-screen.php index 1bdf323..8e1267e 100644 --- a/stubs/WordPress/class-wp-screen.php +++ b/stubs/WordPress/class-wp-screen.php @@ -6,6 +6,7 @@ /** */ final class WP_Screen { + /** * @var string */ diff --git a/stubs/WordPress/class-wp-theme.php b/stubs/WordPress/class-wp-theme.php index bd036a5..f915b0c 100644 --- a/stubs/WordPress/class-wp-theme.php +++ b/stubs/WordPress/class-wp-theme.php @@ -7,6 +7,7 @@ * @implements ArrayAccess */ class WP_Theme implements ArrayAccess { + /** * @var string */ diff --git a/stubs/WordPress/class-wp-user-query.php b/stubs/WordPress/class-wp-user-query.php index de3f4d8..aabd59f 100644 --- a/stubs/WordPress/class-wp-user-query.php +++ b/stubs/WordPress/class-wp-user-query.php @@ -6,6 +6,7 @@ /** */ class WP_User_Query { + /** * @param string|null|array{blog_id?: int, role?: string|array, role__in?: array, role__not_in?: array, meta_key?: string|array, meta_value?: string|array, meta_compare?: string, meta_compare_key?: string, meta_type?: string, meta_type_key?: string, meta_query?: array, capability?: string, capability__in?: array, capability__not_in?: array, include?: array, exclude?: array, search?: string, search_columns?: array, orderby?: string|array|array, order?: string, offset?: int, number?: int, paged?: int, count_total?: bool, fields?: string|array, who?: string, has_published_posts?: bool|array, nicename?: string, nicename__in?: array, nicename__not_in?: array, login?: string, login__in?: array, login__not_in?: array} $query { * @type int $blog_id diff --git a/stubs/WordPress/class-wp-user.php b/stubs/WordPress/class-wp-user.php index 675cb2d..0f21c9b 100644 --- a/stubs/WordPress/class-wp-user.php +++ b/stubs/WordPress/class-wp-user.php @@ -6,6 +6,7 @@ /** */ class WP_User { + /** * @var stdClass */ diff --git a/stubs/WordPress/class-wp-widget.php b/stubs/WordPress/class-wp-widget.php index e6a9030..d21ac6a 100644 --- a/stubs/WordPress/class-wp-widget.php +++ b/stubs/WordPress/class-wp-widget.php @@ -6,6 +6,7 @@ /** */ class WP_Widget { + /** * @param string $id_base * @param string $name diff --git a/stubs/WordPress/interface-requests-auth.php b/stubs/WordPress/interface-requests-auth.php index f55384e..7c53940 100644 --- a/stubs/WordPress/interface-requests-auth.php +++ b/stubs/WordPress/interface-requests-auth.php @@ -6,4 +6,5 @@ /** */ interface Requests_Auth { + } diff --git a/stubs/WordPress/interface-requests-hooker.php b/stubs/WordPress/interface-requests-hooker.php index fef1ae2..44eb2d8 100644 --- a/stubs/WordPress/interface-requests-hooker.php +++ b/stubs/WordPress/interface-requests-hooker.php @@ -6,4 +6,5 @@ /** */ interface Requests_Hooker { + } diff --git a/stubs/WordPress/interface-requests-proxy.php b/stubs/WordPress/interface-requests-proxy.php index 62d08c0..d554c3f 100644 --- a/stubs/WordPress/interface-requests-proxy.php +++ b/stubs/WordPress/interface-requests-proxy.php @@ -6,4 +6,5 @@ /** */ interface Requests_Proxy { + } diff --git a/stubs/WordPress/interface-requests-transport.php b/stubs/WordPress/interface-requests-transport.php index 1d7050d..49a21cb 100644 --- a/stubs/WordPress/interface-requests-transport.php +++ b/stubs/WordPress/interface-requests-transport.php @@ -6,4 +6,5 @@ /** */ interface Requests_Transport { + } From 57da89d77bc22b4305f4e2d3a9e92380ab59eb4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 19:53:08 +0100 Subject: [PATCH 07/38] Permanently disabled SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces.NoEmptyLineBeforeClosingBrace --- phpcs.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/phpcs.xml b/phpcs.xml index cf82967..da73b6f 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -29,8 +29,8 @@ - - From bc8d46b4a5c6fe77327a5303dda362fa402cbc0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 19:54:23 +0100 Subject: [PATCH 08/38] Permanently disabled SlevomatCodingStandard.Classes.ForbiddenPublicProperty.ForbiddenPublicProperty --- phpcs.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpcs.xml b/phpcs.xml index da73b6f..49f4eb5 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -44,6 +44,9 @@ + + + - From 3b0b4a92b620e3510b5a50a7129bb9a339d01c75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 19:55:21 +0100 Subject: [PATCH 09/38] Enabled SlevomatCodingStandard.Classes.MethodSpacing.IncorrectLinesCountBetweenMethods --- phpcs.xml | 1 - stubs/WordPress/class-wp-user-query.php | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/phpcs.xml b/phpcs.xml index 49f4eb5..73d9ab4 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -68,7 +68,6 @@ --> - diff --git a/stubs/WordPress/class-wp-user-query.php b/stubs/WordPress/class-wp-user-query.php index aabd59f..ccffc21 100644 --- a/stubs/WordPress/class-wp-user-query.php +++ b/stubs/WordPress/class-wp-user-query.php @@ -46,6 +46,7 @@ class WP_User_Query { */ public function __construct( $query = null ) { } + /** * @return array */ From 41adf948fafbb9ff396117e18d8fd29e38b547ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 19:56:08 +0100 Subject: [PATCH 10/38] Permanently disabled SlevomatCodingStandard.Classes.RequireAbstractOrFinal.ClassNeitherAbstractNorFinal --- phpcs.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpcs.xml b/phpcs.xml index 73d9ab4..865b004 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -46,6 +46,7 @@ + - From f7fc6405cb36b6c822c1ef1c6e099d4cec69f889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 19:57:02 +0100 Subject: [PATCH 11/38] Permanently disabled SlevomatCodingStandard.Classes.SuperfluousErrorNaming.SuperfluousSuffix --- phpcs.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpcs.xml b/phpcs.xml index 865b004..ee96ef0 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -47,6 +47,7 @@ + - From a246d24e0b5dce3969677e1632c77b6d6d0b7255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 19:57:46 +0100 Subject: [PATCH 12/38] Permanently disabled SlevomatCodingStandard.Classes.SuperfluousExceptionNaming.SuperfluousSuffix --- phpcs.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/phpcs.xml b/phpcs.xml index ee96ef0..1c11178 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -48,12 +48,12 @@ + - From 20daa663faa2f3403585a29f81c8b4ef4ed7f240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 19:58:39 +0100 Subject: [PATCH 13/38] Enabled SlevomatCodingStandard.Commenting.DisallowCommentAfterCode.DisallowedCommentAfterCode --- .phan/config.php | 3 ++- phpcs.xml | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.phan/config.php b/.phan/config.php index 535f5f6..511bc14 100644 --- a/.phan/config.php +++ b/.phan/config.php @@ -6,7 +6,8 @@ */ return array( - 'backward_compatibility_checks' => false, // Covered by PHPCS. + // Covered by PHPCS. + 'backward_compatibility_checks' => false, 'directory_list' => array( 'stubs', '.phan', diff --git a/phpcs.xml b/phpcs.xml index 1c11178..00af07c 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -70,7 +70,6 @@ --> - From b79ddb41a87cc6a80876f1ac27dcd0d5a24ca30c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 21:51:28 +0100 Subject: [PATCH 14/38] Permanently disabled SlevomatCodingStandard.Commenting.DocCommentSpacing.IncorrectLinesCountBetweenDifferentAnnotationsTypes --- phpcs.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpcs.xml b/phpcs.xml index 00af07c..2caefd2 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -51,6 +51,7 @@ + - From d28ea32f84f5eb852547a6f5f268ffaae0b68b4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 21:53:00 +0100 Subject: [PATCH 15/38] Postponed a rule --- phpcs.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpcs.xml b/phpcs.xml index 2caefd2..1cb3a0c 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -71,7 +71,6 @@ --> - @@ -92,6 +91,7 @@ + From e802c3192dd8b439a4d5816bfe61bb39fdcc0d02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 22:42:07 +0100 Subject: [PATCH 16/38] Permanently disabled SlevomatCodingStandard.Commenting.RequireOneLineDocComment.MultiLineDocComment --- phpcs.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpcs.xml b/phpcs.xml index 1cb3a0c..747b8d0 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -52,6 +52,7 @@ + - From 9a3382049f9c4ec5ea0e93311295f6f192f148c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 22:44:13 +0100 Subject: [PATCH 17/38] Permanently disabled SlevomatCodingStandard.Commenting.RequireOneLinePropertyDocComment.MultiLinePropertyComment --- phpcs.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpcs.xml b/phpcs.xml index 747b8d0..1e9ef49 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -53,6 +53,7 @@ + - From bb1be349c88fde30d62529b75fd034de8de2e193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 22:45:06 +0100 Subject: [PATCH 18/38] Permanently disabled SlevomatCodingStandard.Files.FileLength.FileTooLong --- phpcs.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpcs.xml b/phpcs.xml index 1e9ef49..72031b1 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -54,6 +54,7 @@ + - From 15816ce73346e61cc906ed62261c7c32827e3834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 22:48:42 +0100 Subject: [PATCH 19/38] Enabled SlevomatCodingStandard.Files.LineLength.LineTooLong --- phpcs.xml | 5 +++-- stubs/WordPress/functions.php | 20 ++++++++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/phpcs.xml b/phpcs.xml index 72031b1..1e5ade8 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -55,12 +55,12 @@ + - @@ -146,6 +145,7 @@ + --> @@ -153,6 +153,7 @@ + + @@ -74,7 +74,6 @@ --> - From 540b9b7d936246c276887156f892d97dedc312e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 22:51:01 +0100 Subject: [PATCH 21/38] Permanently disabled SlevomatCodingStandard.Functions.DisallowEmptyFunction.EmptyFunction --- phpcs.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpcs.xml b/phpcs.xml index de40efc..21c18f0 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -49,6 +49,7 @@ + @@ -74,7 +75,6 @@ --> - From 15f568fb77bebb963565fe831af299ff6d1c9c8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 22:51:25 +0100 Subject: [PATCH 22/38] Permanently disabled SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter --- phpcs.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpcs.xml b/phpcs.xml index 21c18f0..d509e6a 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -50,6 +50,7 @@ + @@ -75,7 +76,6 @@ --> - From c82a7eeaa7c1210732c591007873b03256442597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 22:52:30 +0100 Subject: [PATCH 23/38] Permanently disabled SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation.NonFullyQualifiedClassName --- phpcs.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/phpcs.xml b/phpcs.xml index d509e6a..b85d43f 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -58,13 +58,13 @@ + - From 2ca93549b9281d0818d01784079eeded6719dabd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 22:53:26 +0100 Subject: [PATCH 24/38] Permanently disabled SlevomatCodingStandard.Namespaces.FullyQualifiedExceptions.NonFullyQualifiedException --- phpcs.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/phpcs.xml b/phpcs.xml index b85d43f..2294235 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -59,13 +59,13 @@ + - From 16d94edf360aed8d88cf1209cccdd2667ddc1504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 22:55:28 +0100 Subject: [PATCH 25/38] Enabled SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName --- phpcs.xml | 2 +- stubs/WordPress-test/class-wp-unittestcase-base.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/phpcs.xml b/phpcs.xml index 2294235..56fd1c0 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -76,8 +76,8 @@ --> - + diff --git a/stubs/WordPress-test/class-wp-unittestcase-base.php b/stubs/WordPress-test/class-wp-unittestcase-base.php index 08e296a..1f4ea11 100644 --- a/stubs/WordPress-test/class-wp-unittestcase-base.php +++ b/stubs/WordPress-test/class-wp-unittestcase-base.php @@ -3,8 +3,10 @@ * @package wordpress-stubs */ +use PHPUnit\Framework\TestCase; + /** */ -class WP_UnitTestCase_Base extends PHPUnit\Framework\TestCase { +class WP_UnitTestCase_Base extends TestCase { } From 2491fe84d72faa7bd25537f055c504f40509d4cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 22:58:28 +0100 Subject: [PATCH 26/38] Enabled SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedNameWithoutNamespace --- phpcs.xml | 1 - stubs/WordPress/class-requests-cookie-jar.php | 10 +++++----- ...lass-requests-utility-caseinsensitivedictionary.php | 10 +++++----- stubs/WordPress/class-wp-theme.php | 8 ++++---- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/phpcs.xml b/phpcs.xml index 56fd1c0..73a11c4 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -76,7 +76,6 @@ --> - diff --git a/stubs/WordPress/class-requests-cookie-jar.php b/stubs/WordPress/class-requests-cookie-jar.php index bad8964..f46ebf1 100644 --- a/stubs/WordPress/class-requests-cookie-jar.php +++ b/stubs/WordPress/class-requests-cookie-jar.php @@ -14,7 +14,7 @@ class Requests_Cookie_Jar implements ArrayAccess, IteratorAggregate { * * @return bool */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists( $key ) { } @@ -23,7 +23,7 @@ public function offsetExists( $key ) { * * @return string|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet( $key ) { } @@ -33,7 +33,7 @@ public function offsetGet( $key ) { * * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet( $key, $value ) { } @@ -42,14 +42,14 @@ public function offsetSet( $key, $value ) { * * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset( $key ) { } /** * @return ArrayIterator */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function getIterator() { } } diff --git a/stubs/WordPress/class-requests-utility-caseinsensitivedictionary.php b/stubs/WordPress/class-requests-utility-caseinsensitivedictionary.php index 037f864..4e87701 100644 --- a/stubs/WordPress/class-requests-utility-caseinsensitivedictionary.php +++ b/stubs/WordPress/class-requests-utility-caseinsensitivedictionary.php @@ -14,7 +14,7 @@ class Requests_Utility_CaseInsensitiveDictionary implements ArrayAccess, Iterato * * @return bool */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists( $key ) { } @@ -23,7 +23,7 @@ public function offsetExists( $key ) { * * @return string|null */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet( $key ) { } @@ -33,7 +33,7 @@ public function offsetGet( $key ) { * * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet( $key, $value ) { } @@ -42,14 +42,14 @@ public function offsetSet( $key, $value ) { * * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset( $key ) { } /** * @return ArrayIterator */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function getIterator() { } } diff --git a/stubs/WordPress/class-wp-theme.php b/stubs/WordPress/class-wp-theme.php index f915b0c..c3f11a0 100644 --- a/stubs/WordPress/class-wp-theme.php +++ b/stubs/WordPress/class-wp-theme.php @@ -18,7 +18,7 @@ class WP_Theme implements ArrayAccess { * * @return bool */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetExists( $offset ) { } @@ -27,7 +27,7 @@ public function offsetExists( $offset ) { * * @return mixed */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetGet( $offset ) { } @@ -37,7 +37,7 @@ public function offsetGet( $offset ) { * * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetSet( $offset, $value ) { } @@ -46,7 +46,7 @@ public function offsetSet( $offset, $value ) { * * @return void */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function offsetUnset( $offset ) { } } From 01d05b1116b0a25cb6bb1883608fb226e7479855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 22:59:11 +0100 Subject: [PATCH 27/38] Permanently disabled SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces.NonFullyQualified --- phpcs.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/phpcs.xml b/phpcs.xml index 73a11c4..e6e2f99 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -60,6 +60,7 @@ + - From f5d1e47de590fdd4a2ea7146f55015b31a133b46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 23:12:47 +0100 Subject: [PATCH 28/38] Enabled SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing --- .phan/config.php | 2 ++ phpcs.xml | 1 - stubs/PHPUnit/Framework/class-assert.php | 2 ++ stubs/PHPUnit/Framework/class-testcase.php | 2 ++ stubs/WordPress-test/class-wp-unittestcase-base.php | 2 ++ stubs/WordPress-test/class-wp-unittestcase.php | 4 ++-- stubs/WordPress-test/functions.php | 2 ++ stubs/WordPress/class-requests-cookie-jar.php | 2 ++ stubs/WordPress/class-requests-exception.php | 4 ++-- stubs/WordPress/class-requests-response.php | 4 ++-- .../class-requests-utility-caseinsensitivedictionary.php | 2 ++ stubs/WordPress/class-requests.php | 4 ++-- stubs/WordPress/class-wp-admin-bar.php | 4 ++-- stubs/WordPress/class-wp-block-type.php | 4 ++-- stubs/WordPress/class-wp-comment-query.php | 4 ++-- stubs/WordPress/class-wp-customize-color-control.php | 4 ++-- stubs/WordPress/class-wp-customize-control.php | 4 ++-- stubs/WordPress/class-wp-customize-image-control.php | 4 ++-- stubs/WordPress/class-wp-customize-manager.php | 4 ++-- stubs/WordPress/class-wp-customize-media-control.php | 4 ++-- stubs/WordPress/class-wp-customize-panel.php | 4 ++-- stubs/WordPress/class-wp-customize-partial.php | 4 ++-- stubs/WordPress/class-wp-customize-section.php | 4 ++-- stubs/WordPress/class-wp-customize-selective-refresh.php | 4 ++-- stubs/WordPress/class-wp-customize-setting.php | 4 ++-- stubs/WordPress/class-wp-customize-upload-control.php | 4 ++-- stubs/WordPress/class-wp-error.php | 4 ++-- stubs/WordPress/class-wp-http-cookie.php | 4 ++-- stubs/WordPress/class-wp-http-requests-response.php | 4 ++-- stubs/WordPress/class-wp-http-response.php | 4 ++-- stubs/WordPress/class-wp-http.php | 4 ++-- stubs/WordPress/class-wp-locale-switcher.php | 4 ++-- stubs/WordPress/class-wp-post-type.php | 4 ++-- stubs/WordPress/class-wp-post.php | 4 ++-- stubs/WordPress/class-wp-query.php | 4 ++-- stubs/WordPress/class-wp-roles.php | 4 ++-- stubs/WordPress/class-wp-screen.php | 4 ++-- stubs/WordPress/class-wp-theme.php | 2 ++ stubs/WordPress/class-wp-user-query.php | 4 ++-- stubs/WordPress/class-wp-user.php | 4 ++-- stubs/WordPress/class-wp-widget.php | 4 ++-- stubs/WordPress/functions.php | 2 ++ stubs/WordPress/interface-requests-auth.php | 4 ++-- stubs/WordPress/interface-requests-hooker.php | 4 ++-- stubs/WordPress/interface-requests-proxy.php | 4 ++-- stubs/WordPress/interface-requests-transport.php | 4 ++-- 46 files changed, 90 insertions(+), 73 deletions(-) diff --git a/.phan/config.php b/.phan/config.php index 511bc14..ff4004d 100644 --- a/.phan/config.php +++ b/.phan/config.php @@ -5,6 +5,8 @@ * @package wordpress-stubs */ +declare(strict_types = 1); + return array( // Covered by PHPCS. 'backward_compatibility_checks' => false, diff --git a/phpcs.xml b/phpcs.xml index e6e2f99..840b4ea 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -76,7 +76,6 @@ --> - diff --git a/stubs/PHPUnit/Framework/class-assert.php b/stubs/PHPUnit/Framework/class-assert.php index 9187942..25c5288 100644 --- a/stubs/PHPUnit/Framework/class-assert.php +++ b/stubs/PHPUnit/Framework/class-assert.php @@ -3,6 +3,8 @@ * @package wordpress-stubs */ +declare(strict_types = 1); + namespace PHPUnit\Framework; class Assert { diff --git a/stubs/PHPUnit/Framework/class-testcase.php b/stubs/PHPUnit/Framework/class-testcase.php index e6ac094..6c721f0 100644 --- a/stubs/PHPUnit/Framework/class-testcase.php +++ b/stubs/PHPUnit/Framework/class-testcase.php @@ -3,6 +3,8 @@ * @package wordpress-stubs */ +declare(strict_types = 1); + namespace PHPUnit\Framework; class TestCase extends Assert { diff --git a/stubs/WordPress-test/class-wp-unittestcase-base.php b/stubs/WordPress-test/class-wp-unittestcase-base.php index 1f4ea11..e40a66f 100644 --- a/stubs/WordPress-test/class-wp-unittestcase-base.php +++ b/stubs/WordPress-test/class-wp-unittestcase-base.php @@ -3,6 +3,8 @@ * @package wordpress-stubs */ +declare(strict_types = 1); + use PHPUnit\Framework\TestCase; /** diff --git a/stubs/WordPress-test/class-wp-unittestcase.php b/stubs/WordPress-test/class-wp-unittestcase.php index 4cb2885..5e45009 100644 --- a/stubs/WordPress-test/class-wp-unittestcase.php +++ b/stubs/WordPress-test/class-wp-unittestcase.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_UnitTestCase extends WP_UnitTestCase_Base { } diff --git a/stubs/WordPress-test/functions.php b/stubs/WordPress-test/functions.php index 1eec149..1735ac3 100644 --- a/stubs/WordPress-test/functions.php +++ b/stubs/WordPress-test/functions.php @@ -3,6 +3,8 @@ * @package wordpress-stubs */ +declare(strict_types = 1); + /** * @param string $tag * @param callable $function_to_add diff --git a/stubs/WordPress/class-requests-cookie-jar.php b/stubs/WordPress/class-requests-cookie-jar.php index f46ebf1..397449e 100644 --- a/stubs/WordPress/class-requests-cookie-jar.php +++ b/stubs/WordPress/class-requests-cookie-jar.php @@ -3,6 +3,8 @@ * @package wordpress-stubs */ +declare(strict_types = 1); + /** * @implements ArrayAccess * @implements IteratorAggregate diff --git a/stubs/WordPress/class-requests-exception.php b/stubs/WordPress/class-requests-exception.php index 7ea41fa..c38ecb7 100644 --- a/stubs/WordPress/class-requests-exception.php +++ b/stubs/WordPress/class-requests-exception.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class Requests_Exception extends Exception { } diff --git a/stubs/WordPress/class-requests-response.php b/stubs/WordPress/class-requests-response.php index d35b9ad..2c78528 100644 --- a/stubs/WordPress/class-requests-response.php +++ b/stubs/WordPress/class-requests-response.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class Requests_Response { /** diff --git a/stubs/WordPress/class-requests-utility-caseinsensitivedictionary.php b/stubs/WordPress/class-requests-utility-caseinsensitivedictionary.php index 4e87701..8637b05 100644 --- a/stubs/WordPress/class-requests-utility-caseinsensitivedictionary.php +++ b/stubs/WordPress/class-requests-utility-caseinsensitivedictionary.php @@ -3,6 +3,8 @@ * @package wordpress-stubs */ +declare(strict_types = 1); + /** * @implements ArrayAccess * @implements IteratorAggregate diff --git a/stubs/WordPress/class-requests.php b/stubs/WordPress/class-requests.php index 8372632..e7f2e0b 100644 --- a/stubs/WordPress/class-requests.php +++ b/stubs/WordPress/class-requests.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class Requests { /** diff --git a/stubs/WordPress/class-wp-admin-bar.php b/stubs/WordPress/class-wp-admin-bar.php index 19e97c7..00d537c 100644 --- a/stubs/WordPress/class-wp-admin-bar.php +++ b/stubs/WordPress/class-wp-admin-bar.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_Admin_Bar { /** diff --git a/stubs/WordPress/class-wp-block-type.php b/stubs/WordPress/class-wp-block-type.php index b745b94..84f5593 100644 --- a/stubs/WordPress/class-wp-block-type.php +++ b/stubs/WordPress/class-wp-block-type.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_Block_Type { } diff --git a/stubs/WordPress/class-wp-comment-query.php b/stubs/WordPress/class-wp-comment-query.php index 5029029..f78d918 100644 --- a/stubs/WordPress/class-wp-comment-query.php +++ b/stubs/WordPress/class-wp-comment-query.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_Comment_Query { /** diff --git a/stubs/WordPress/class-wp-customize-color-control.php b/stubs/WordPress/class-wp-customize-color-control.php index db82cdb..e673dc5 100644 --- a/stubs/WordPress/class-wp-customize-color-control.php +++ b/stubs/WordPress/class-wp-customize-color-control.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_Customize_Color_Control extends WP_Customize_Control { /** diff --git a/stubs/WordPress/class-wp-customize-control.php b/stubs/WordPress/class-wp-customize-control.php index 26af8d2..1cd8eda 100644 --- a/stubs/WordPress/class-wp-customize-control.php +++ b/stubs/WordPress/class-wp-customize-control.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_Customize_Control { /** diff --git a/stubs/WordPress/class-wp-customize-image-control.php b/stubs/WordPress/class-wp-customize-image-control.php index 5f385ef..061ad46 100644 --- a/stubs/WordPress/class-wp-customize-image-control.php +++ b/stubs/WordPress/class-wp-customize-image-control.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_Customize_Image_Control extends WP_Customize_Upload_Control { /** diff --git a/stubs/WordPress/class-wp-customize-manager.php b/stubs/WordPress/class-wp-customize-manager.php index 9c90f44..71a970c 100644 --- a/stubs/WordPress/class-wp-customize-manager.php +++ b/stubs/WordPress/class-wp-customize-manager.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_Customize_Manager { /** diff --git a/stubs/WordPress/class-wp-customize-media-control.php b/stubs/WordPress/class-wp-customize-media-control.php index 07340aa..634deb6 100644 --- a/stubs/WordPress/class-wp-customize-media-control.php +++ b/stubs/WordPress/class-wp-customize-media-control.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_Customize_Media_Control extends WP_Customize_Control { } diff --git a/stubs/WordPress/class-wp-customize-panel.php b/stubs/WordPress/class-wp-customize-panel.php index 71f1d4e..8f3998f 100644 --- a/stubs/WordPress/class-wp-customize-panel.php +++ b/stubs/WordPress/class-wp-customize-panel.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_Customize_Panel { } diff --git a/stubs/WordPress/class-wp-customize-partial.php b/stubs/WordPress/class-wp-customize-partial.php index c9011e3..3f43c31 100644 --- a/stubs/WordPress/class-wp-customize-partial.php +++ b/stubs/WordPress/class-wp-customize-partial.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_Customize_Partial { } diff --git a/stubs/WordPress/class-wp-customize-section.php b/stubs/WordPress/class-wp-customize-section.php index 8424f3f..0e4ae67 100644 --- a/stubs/WordPress/class-wp-customize-section.php +++ b/stubs/WordPress/class-wp-customize-section.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_Customize_Section { } diff --git a/stubs/WordPress/class-wp-customize-selective-refresh.php b/stubs/WordPress/class-wp-customize-selective-refresh.php index 4da5bcc..5fa1172 100644 --- a/stubs/WordPress/class-wp-customize-selective-refresh.php +++ b/stubs/WordPress/class-wp-customize-selective-refresh.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_Customize_Selective_Refresh { /** diff --git a/stubs/WordPress/class-wp-customize-setting.php b/stubs/WordPress/class-wp-customize-setting.php index 54151f6..a41f49c 100644 --- a/stubs/WordPress/class-wp-customize-setting.php +++ b/stubs/WordPress/class-wp-customize-setting.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_Customize_Setting { } diff --git a/stubs/WordPress/class-wp-customize-upload-control.php b/stubs/WordPress/class-wp-customize-upload-control.php index e6422ac..026703b 100644 --- a/stubs/WordPress/class-wp-customize-upload-control.php +++ b/stubs/WordPress/class-wp-customize-upload-control.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_Customize_Upload_Control extends WP_Customize_Media_Control { } diff --git a/stubs/WordPress/class-wp-error.php b/stubs/WordPress/class-wp-error.php index 2968abe..814829e 100644 --- a/stubs/WordPress/class-wp-error.php +++ b/stubs/WordPress/class-wp-error.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_Error { /** diff --git a/stubs/WordPress/class-wp-http-cookie.php b/stubs/WordPress/class-wp-http-cookie.php index f57e0e7..a272e9f 100644 --- a/stubs/WordPress/class-wp-http-cookie.php +++ b/stubs/WordPress/class-wp-http-cookie.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_Http_Cookie { } diff --git a/stubs/WordPress/class-wp-http-requests-response.php b/stubs/WordPress/class-wp-http-requests-response.php index 6ff931f..7613d24 100644 --- a/stubs/WordPress/class-wp-http-requests-response.php +++ b/stubs/WordPress/class-wp-http-requests-response.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_HTTP_Requests_Response extends WP_HTTP_Response { } diff --git a/stubs/WordPress/class-wp-http-response.php b/stubs/WordPress/class-wp-http-response.php index 68b5d4a..463166c 100644 --- a/stubs/WordPress/class-wp-http-response.php +++ b/stubs/WordPress/class-wp-http-response.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_HTTP_Response { } diff --git a/stubs/WordPress/class-wp-http.php b/stubs/WordPress/class-wp-http.php index 7e7598d..a942904 100644 --- a/stubs/WordPress/class-wp-http.php +++ b/stubs/WordPress/class-wp-http.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_Http { /** diff --git a/stubs/WordPress/class-wp-locale-switcher.php b/stubs/WordPress/class-wp-locale-switcher.php index ac9b2a6..3a67d2c 100644 --- a/stubs/WordPress/class-wp-locale-switcher.php +++ b/stubs/WordPress/class-wp-locale-switcher.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_Locale_Switcher { /** diff --git a/stubs/WordPress/class-wp-post-type.php b/stubs/WordPress/class-wp-post-type.php index a8acece..1165d12 100644 --- a/stubs/WordPress/class-wp-post-type.php +++ b/stubs/WordPress/class-wp-post-type.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + final class WP_Post_Type { /** diff --git a/stubs/WordPress/class-wp-post.php b/stubs/WordPress/class-wp-post.php index 23dd675..8848993 100644 --- a/stubs/WordPress/class-wp-post.php +++ b/stubs/WordPress/class-wp-post.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + final class WP_Post { /** diff --git a/stubs/WordPress/class-wp-query.php b/stubs/WordPress/class-wp-query.php index eb78183..68614be 100644 --- a/stubs/WordPress/class-wp-query.php +++ b/stubs/WordPress/class-wp-query.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_Query { /** diff --git a/stubs/WordPress/class-wp-roles.php b/stubs/WordPress/class-wp-roles.php index 699260f..988f009 100644 --- a/stubs/WordPress/class-wp-roles.php +++ b/stubs/WordPress/class-wp-roles.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_Roles { /** diff --git a/stubs/WordPress/class-wp-screen.php b/stubs/WordPress/class-wp-screen.php index 8e1267e..037adbf 100644 --- a/stubs/WordPress/class-wp-screen.php +++ b/stubs/WordPress/class-wp-screen.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + final class WP_Screen { /** diff --git a/stubs/WordPress/class-wp-theme.php b/stubs/WordPress/class-wp-theme.php index c3f11a0..5761c8c 100644 --- a/stubs/WordPress/class-wp-theme.php +++ b/stubs/WordPress/class-wp-theme.php @@ -3,6 +3,8 @@ * @package wordpress-stubs */ +declare(strict_types = 1); + /** * @implements ArrayAccess */ diff --git a/stubs/WordPress/class-wp-user-query.php b/stubs/WordPress/class-wp-user-query.php index ccffc21..a3795d0 100644 --- a/stubs/WordPress/class-wp-user-query.php +++ b/stubs/WordPress/class-wp-user-query.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_User_Query { /** diff --git a/stubs/WordPress/class-wp-user.php b/stubs/WordPress/class-wp-user.php index 0f21c9b..0d4e68e 100644 --- a/stubs/WordPress/class-wp-user.php +++ b/stubs/WordPress/class-wp-user.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_User { /** diff --git a/stubs/WordPress/class-wp-widget.php b/stubs/WordPress/class-wp-widget.php index d21ac6a..e8c91e5 100644 --- a/stubs/WordPress/class-wp-widget.php +++ b/stubs/WordPress/class-wp-widget.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + class WP_Widget { /** diff --git a/stubs/WordPress/functions.php b/stubs/WordPress/functions.php index b017239..d73635d 100644 --- a/stubs/WordPress/functions.php +++ b/stubs/WordPress/functions.php @@ -3,6 +3,8 @@ * @package wordpress-stubs */ +declare(strict_types = 1); + /** * @var string */ diff --git a/stubs/WordPress/interface-requests-auth.php b/stubs/WordPress/interface-requests-auth.php index 7c53940..a7db687 100644 --- a/stubs/WordPress/interface-requests-auth.php +++ b/stubs/WordPress/interface-requests-auth.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + interface Requests_Auth { } diff --git a/stubs/WordPress/interface-requests-hooker.php b/stubs/WordPress/interface-requests-hooker.php index 44eb2d8..42fb951 100644 --- a/stubs/WordPress/interface-requests-hooker.php +++ b/stubs/WordPress/interface-requests-hooker.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + interface Requests_Hooker { } diff --git a/stubs/WordPress/interface-requests-proxy.php b/stubs/WordPress/interface-requests-proxy.php index d554c3f..d54e866 100644 --- a/stubs/WordPress/interface-requests-proxy.php +++ b/stubs/WordPress/interface-requests-proxy.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + interface Requests_Proxy { } diff --git a/stubs/WordPress/interface-requests-transport.php b/stubs/WordPress/interface-requests-transport.php index 49a21cb..d69410e 100644 --- a/stubs/WordPress/interface-requests-transport.php +++ b/stubs/WordPress/interface-requests-transport.php @@ -3,8 +3,8 @@ * @package wordpress-stubs */ -/** - */ +declare(strict_types = 1); + interface Requests_Transport { } From 97fbff0c4e19371071ae695c01e546889fe24f8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 23:13:37 +0100 Subject: [PATCH 29/38] Permanently disabled SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint.DisallowedMixedTypeHint --- phpcs.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/phpcs.xml b/phpcs.xml index 840b4ea..98fb713 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -61,6 +61,7 @@ + - From e3fafca94633bfef27888601c549c445867a31cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 23:14:38 +0100 Subject: [PATCH 30/38] Enabled SlevomatCodingStandard.TypeHints.LongTypeHints.UsedLongTypeHint --- phpcs.xml | 1 - stubs/WordPress/functions.php | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/phpcs.xml b/phpcs.xml index 98fb713..6a6b558 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -76,7 +76,6 @@ --> - diff --git a/stubs/WordPress/functions.php b/stubs/WordPress/functions.php index d73635d..aaeed14 100644 --- a/stubs/WordPress/functions.php +++ b/stubs/WordPress/functions.php @@ -638,8 +638,8 @@ function get_query_var( $var, $default = '' ) { } /** - * @param string $setting - * @param boolean $sanitize + * @param string $setting + * @param bool $sanitize * * @return array */ From 7fb767d10de60bc1eddc258e43400eb4492ec446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 23:16:46 +0100 Subject: [PATCH 31/38] Enabled SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition.NullTypeHintNotOnLastPosition --- phpcs.xml | 1 - stubs/WordPress/class-wp-user-query.php | 2 +- stubs/WordPress/functions.php | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/phpcs.xml b/phpcs.xml index 6a6b558..cebfd9b 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -76,7 +76,6 @@ --> - diff --git a/stubs/WordPress/class-wp-user-query.php b/stubs/WordPress/class-wp-user-query.php index a3795d0..740132d 100644 --- a/stubs/WordPress/class-wp-user-query.php +++ b/stubs/WordPress/class-wp-user-query.php @@ -8,7 +8,7 @@ class WP_User_Query { /** - * @param string|null|array{blog_id?: int, role?: string|array, role__in?: array, role__not_in?: array, meta_key?: string|array, meta_value?: string|array, meta_compare?: string, meta_compare_key?: string, meta_type?: string, meta_type_key?: string, meta_query?: array, capability?: string, capability__in?: array, capability__not_in?: array, include?: array, exclude?: array, search?: string, search_columns?: array, orderby?: string|array|array, order?: string, offset?: int, number?: int, paged?: int, count_total?: bool, fields?: string|array, who?: string, has_published_posts?: bool|array, nicename?: string, nicename__in?: array, nicename__not_in?: array, login?: string, login__in?: array, login__not_in?: array} $query { + * @param string|array{blog_id?: int, role?: string|array, role__in?: array, role__not_in?: array, meta_key?: string|array, meta_value?: string|array, meta_compare?: string, meta_compare_key?: string, meta_type?: string, meta_type_key?: string, meta_query?: array, capability?: string, capability__in?: array, capability__not_in?: array, include?: array, exclude?: array, search?: string, search_columns?: array, orderby?: string|array|array, order?: string, offset?: int, number?: int, paged?: int, count_total?: bool, fields?: string|array, who?: string, has_published_posts?: bool|array, nicename?: string, nicename__in?: array, nicename__not_in?: array, login?: string, login__in?: array, login__not_in?: array}|null $query { * @type int $blog_id * @type string|array $role * @type array $role__in diff --git a/stubs/WordPress/functions.php b/stubs/WordPress/functions.php index aaeed14..f66e1ee 100644 --- a/stubs/WordPress/functions.php +++ b/stubs/WordPress/functions.php @@ -587,7 +587,7 @@ function get_permalink( $post, $leavename = false ) { * @param string $output * @param string $filter * - * @return WP_Post|null|array{ID: int, post_author: string|int, post_date: string, post_date_gmt: string, post_content: string, post_title: string, post_excerpt: string, post_status: string, comment_status: string, ping_status: string, post_password: string, post_name: string, to_ping: string, pinged: string, post_modified: string, post_modified_gmt: string, post_content_filtered: string, post_parent: int, guid: string, menu_order: int, post_type: string, post_mime_type: string, comment_count: string|int, filter?: string}|array + * @return WP_Post|array{ID: int, post_author: string|int, post_date: string, post_date_gmt: string, post_content: string, post_title: string, post_excerpt: string, post_status: string, comment_status: string, ping_status: string, post_password: string, post_name: string, to_ping: string, pinged: string, post_modified: string, post_modified_gmt: string, post_content_filtered: string, post_parent: int, guid: string, menu_order: int, post_type: string, post_mime_type: string, comment_count: string|int, filter?: string}|array|null */ function get_post( $post = null, $output = '', $filter = '' ) { } @@ -925,7 +925,7 @@ function register_activation_hook( $file, $function ) { /** * @param string|WP_Block_Type $name - * @param array{api_version?: string, title?: string, category?: string|null, parent?: array|null, icon?: string|null, description?: string, keywords?: array, textdomain?: string|null, styles?: array, variations?: array, source?: string, selector?: string, attribute?: string, multiline?: string, query?: mixed, default?: string}>, innerBlocks?: array, example?: array{attributes?: array, source?: string, selector?: string, attribute?: string, multiline?: string, query?: mixed, default?: string}>, innerBlocks?: array, viewportWidth?: int}, scope?: array, keywords?: array, isActive?: array}>, supports?: null|array{align?: bool|array, alignWide?: bool, className?: bool, color?: array{background?: bool, gradients?: bool, link?: bool, text?: bool}, customClassName?: bool, defaultStylePicker?: bool, html?: bool, inserter?: bool, multiple?: bool, reusable?: bool, lock?: bool, spacing?: array{margin?: bool|array, padding?: bool|array}, typography?: array{fontSize?: bool, lineHeight?: bool}}, example?: null|array{attributes?: array, source?: string, selector?: string, attribute?: string, multiline?: string, query?: mixed, default?: string}>, innerBlocks?: array, viewportWidth?: int}, render_callback?: callable|null, attributes?: null|array, source?: string, selector?: string, attribute?: string, multiline?: string, query?: mixed, default?: string}>, uses_context?: array, provides_context?: array|null, editor_script?: string|null, script?: string|null, view_script?: string|null, editor_style?: string|null, style?: string|null} $args { + * @param array{api_version?: string, title?: string, category?: string|null, parent?: array|null, icon?: string|null, description?: string, keywords?: array, textdomain?: string|null, styles?: array, variations?: array, source?: string, selector?: string, attribute?: string, multiline?: string, query?: mixed, default?: string}>, innerBlocks?: array, example?: array{attributes?: array, source?: string, selector?: string, attribute?: string, multiline?: string, query?: mixed, default?: string}>, innerBlocks?: array, viewportWidth?: int}, scope?: array, keywords?: array, isActive?: array}>, supports?: array{align?: bool|array, alignWide?: bool, className?: bool, color?: array{background?: bool, gradients?: bool, link?: bool, text?: bool}, customClassName?: bool, defaultStylePicker?: bool, html?: bool, inserter?: bool, multiple?: bool, reusable?: bool, lock?: bool, spacing?: array{margin?: bool|array, padding?: bool|array}, typography?: array{fontSize?: bool, lineHeight?: bool}}|null, example?: array{attributes?: array, source?: string, selector?: string, attribute?: string, multiline?: string, query?: mixed, default?: string}>, innerBlocks?: array, viewportWidth?: int}|null, render_callback?: callable|null, attributes?: array, source?: string, selector?: string, attribute?: string, multiline?: string, query?: mixed, default?: string}>|null, uses_context?: array, provides_context?: array|null, editor_script?: string|null, script?: string|null, view_script?: string|null, editor_style?: string|null, style?: string|null} $args { * @type string $api_version * @type string $title * @type string|null $category From 27fb756789fe480b10524982cf8d50252fb9bc73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 23:18:05 +0100 Subject: [PATCH 32/38] Permanently disabled SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint --- phpcs.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpcs.xml b/phpcs.xml index cebfd9b..98bec59 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -28,6 +28,9 @@ + + + @@ -76,7 +79,6 @@ --> - From 8e9aab6aaa8daf044b844d887234ad14908a5ab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 23:18:40 +0100 Subject: [PATCH 33/38] Permanently disabled SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint --- phpcs.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpcs.xml b/phpcs.xml index 98bec59..9f36fde 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -30,6 +30,7 @@ + @@ -79,7 +80,6 @@ --> - From 768aeaed219728b12c35e260062a83abd1d1cfc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 23:18:51 +0100 Subject: [PATCH 34/38] Permanently disabled SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint --- phpcs.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpcs.xml b/phpcs.xml index 9f36fde..c91f698 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -31,6 +31,7 @@ + @@ -80,7 +81,6 @@ --> - From 59b3045ac1cb55e8653abcdeffcf7695b3cb0c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 23:19:40 +0100 Subject: [PATCH 35/38] Permanently disabled SlevomatCodingStandard.TypeHints.UselessConstantTypeHint.UselessDocComment --- phpcs.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpcs.xml b/phpcs.xml index c91f698..2f0240d 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -56,6 +56,7 @@ + @@ -81,7 +82,6 @@ --> - From 10892a1df34009c090b89483a1051cc52b6eee65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 23:20:27 +0100 Subject: [PATCH 36/38] Permanently disabled SlevomatCodingStandard.Whitespaces.DuplicateSpaces.DuplicateSpaces --- phpcs.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/phpcs.xml b/phpcs.xml index 2f0240d..b2da795 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -36,13 +36,13 @@ + @@ -82,7 +82,6 @@ --> - From 9324b105c8c8d6f398aca105429b4f459eae905a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 23:21:00 +0100 Subject: [PATCH 37/38] Enabled SlevomatCodingStandard.Commenting.EmptyComment.EmptyComment --- phpcs.xml | 3 --- stubs/WordPress-test/class-wp-unittestcase-base.php | 2 -- 2 files changed, 5 deletions(-) diff --git a/phpcs.xml b/phpcs.xml index b2da795..f5d237b 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -80,9 +80,6 @@ --> - - - diff --git a/stubs/WordPress-test/class-wp-unittestcase-base.php b/stubs/WordPress-test/class-wp-unittestcase-base.php index e40a66f..ea11c2c 100644 --- a/stubs/WordPress-test/class-wp-unittestcase-base.php +++ b/stubs/WordPress-test/class-wp-unittestcase-base.php @@ -7,8 +7,6 @@ use PHPUnit\Framework\TestCase; -/** - */ class WP_UnitTestCase_Base extends TestCase { } From b63957bc3ed11279c1d27022645afaf1adffd42a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Sat, 23 Dec 2023 23:24:36 +0100 Subject: [PATCH 38/38] Cleaned up PHPCS config --- phpcs.xml | 83 ------------------------------------------------------- 1 file changed, 83 deletions(-) diff --git a/phpcs.xml b/phpcs.xml index f5d237b..c24aa95 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -37,13 +37,6 @@ - @@ -68,18 +61,6 @@ - @@ -88,73 +69,9 @@ - - - -