From 9cf9151671a725e0e6b66c1d4ed3157bb4639500 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Mon, 14 Nov 2022 12:30:56 +0100 Subject: [PATCH] Fix recent PHPStan errors (#12677) --- composer.lock | 185 ++++++++++++----------- includes/Admin/TinyMCE.php | 2 +- includes/Assets.php | 4 +- includes/Embed_Base.php | 2 +- includes/KSES.php | 2 +- includes/Media/Media_Source_Taxonomy.php | 4 +- includes/Story_Revisions.php | 2 +- 7 files changed, 102 insertions(+), 99 deletions(-) diff --git a/composer.lock b/composer.lock index 0692ec5da2b4..fafe910c5dfa 100644 --- a/composer.lock +++ b/composer.lock @@ -87,12 +87,12 @@ "source": { "type": "git", "url": "https://github.com/ampproject/amp-wp", - "reference": "092b4b8a717c0ed7d7dc257fe5e042e6aab566f9" + "reference": "d5edeea27008fdf8fe7628ed55d0a7d41040c953" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ampproject/amp-wp/zipball/092b4b8a717c0ed7d7dc257fe5e042e6aab566f9", - "reference": "092b4b8a717c0ed7d7dc257fe5e042e6aab566f9", + "url": "https://api.github.com/repos/ampproject/amp-wp/zipball/d5edeea27008fdf8fe7628ed55d0a7d41040c953", + "reference": "d5edeea27008fdf8fe7628ed55d0a7d41040c953", "shasum": "" }, "require": { @@ -196,7 +196,7 @@ ], "description": "WordPress plugin for adding AMP support.", "homepage": "https://github.com/ampproject/amp-wp", - "time": "2022-11-01T18:05:06+00:00" + "time": "2022-11-11T23:19:16+00:00" }, { "name": "cweagans/composer-patches", @@ -457,16 +457,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", "shasum": "" }, "require": { @@ -481,7 +481,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -520,7 +520,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" }, "funding": [ { @@ -536,7 +536,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "willwashburn/stream", @@ -1959,16 +1959,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.1", + "version": "v4.15.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900" + "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", - "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", + "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", "shasum": "" }, "require": { @@ -2009,9 +2009,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.2" }, - "time": "2022-09-04T07:30:47+00:00" + "time": "2022-11-12T15:38:23+00:00" }, { "name": "pdepend/pdepend", @@ -2227,16 +2227,16 @@ }, { "name": "php-stubs/wordpress-stubs", - "version": "v6.0.2", + "version": "v6.1.0", "source": { "type": "git", "url": "https://github.com/php-stubs/wordpress-stubs.git", - "reference": "165b84f082db851e76ec51bebcde550d03976893" + "reference": "19e7966c8e70a99a4824b3e5d1526680a151f13b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/165b84f082db851e76ec51bebcde550d03976893", - "reference": "165b84f082db851e76ec51bebcde550d03976893", + "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/19e7966c8e70a99a4824b3e5d1526680a151f13b", + "reference": "19e7966c8e70a99a4824b3e5d1526680a151f13b", "shasum": "" }, "replace": { @@ -2268,9 +2268,9 @@ ], "support": { "issues": "https://github.com/php-stubs/wordpress-stubs/issues", - "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.0.2" + "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.1.0" }, - "time": "2022-09-30T17:46:11+00:00" + "time": "2022-11-09T05:33:25+00:00" }, { "name": "phpcompatibility/php-compatibility", @@ -2620,16 +2620,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.9.1", + "version": "1.9.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "a59c8b5bfd4a236f27efc8b5ce72c313c2b54b5f" + "reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/a59c8b5bfd4a236f27efc8b5ce72c313c2b54b5f", - "reference": "a59c8b5bfd4a236f27efc8b5ce72c313c2b54b5f", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d6fdf01c53978b6429f1393ba4afeca39cc68afa", + "reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa", "shasum": "" }, "require": { @@ -2659,7 +2659,7 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.9.1" + "source": "https://github.com/phpstan/phpstan/tree/1.9.2" }, "funding": [ { @@ -2675,7 +2675,7 @@ "type": "tidelift" } ], - "time": "2022-11-04T13:35:59+00:00" + "time": "2022-11-10T09:56:11+00:00" }, { "name": "phpunit/php-code-coverage", @@ -3251,12 +3251,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "964c5d9ca40d0ec72db203b3dd6382a30abef616" + "reference": "5317244268eb40e418f1cf8afa6d1d9df4e1f4a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/964c5d9ca40d0ec72db203b3dd6382a30abef616", - "reference": "964c5d9ca40d0ec72db203b3dd6382a30abef616", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/5317244268eb40e418f1cf8afa6d1d9df4e1f4a3", + "reference": "5317244268eb40e418f1cf8afa6d1d9df4e1f4a3", "shasum": "" }, "conflict": { @@ -3359,16 +3359,17 @@ "ezsystems/ezdemo-ls-extension": ">=5.4,<5.4.2.1", "ezsystems/ezfind-ls": ">=5.3,<5.3.6.1|>=5.4,<5.4.11.1|>=2017.12,<2017.12.0.1", "ezsystems/ezplatform": "<=1.13.6|>=2,<=2.5.24", - "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.6|>=1.5,<1.5.27", + "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.6|>=1.5,<1.5.29|>=2.3,<2.3.26", "ezsystems/ezplatform-admin-ui-assets": ">=4,<4.2.1|>=5,<5.0.1|>=5.1,<5.1.1", - "ezsystems/ezplatform-kernel": "<=1.2.5|>=1.3,<1.3.19", + "ezsystems/ezplatform-graphql": ">=1-rc.1,<1.0.13|>=2-beta.1,<2.3.12", + "ezsystems/ezplatform-kernel": "<=1.2.5|>=1.3,<1.3.26", "ezsystems/ezplatform-rest": ">=1.2,<=1.2.2|>=1.3,<1.3.8", "ezsystems/ezplatform-richtext": ">=2.3,<=2.3.7", "ezsystems/ezplatform-user": ">=1,<1.0.1", - "ezsystems/ezpublish-kernel": "<=6.13.8.1|>=7,<7.5.29", + "ezsystems/ezpublish-kernel": "<=6.13.8.1|>=7,<7.5.30", "ezsystems/ezpublish-legacy": "<=2017.12.7.3|>=2018.6,<=2019.3.5.1", "ezsystems/platform-ui-assets-bundle": ">=4.2,<4.2.3", - "ezsystems/repository-forms": ">=2.3,<2.3.2.1", + "ezsystems/repository-forms": ">=2.3,<2.3.2.1|>=2.5,<2.5.15", "ezyang/htmlpurifier": "<4.1.1", "facade/ignition": "<1.16.15|>=2,<2.4.2|>=2.5,<2.5.2", "facturascripts/facturascripts": "<=2022.8", @@ -3414,7 +3415,9 @@ "hjue/justwriting": "<=1", "hov/jobfair": "<1.0.13|>=2,<2.0.2", "hyn/multi-tenant": ">=5.6,<5.7.2", - "ibexa/core": ">=4,<4.0.7|>=4.1,<4.1.4", + "ibexa/admin-ui": ">=4.2,<4.2.3", + "ibexa/core": ">=4,<4.0.7|>=4.1,<4.1.4|>=4.2,<4.2.3", + "ibexa/graphql": ">=2.5,<2.5.31|>=3.3,<3.3.28|>=4.2,<4.2.3", "ibexa/post-install": "<=1.0.4", "icecoder/icecoder": "<=8.1", "idno/known": "<=1.3.1", @@ -3778,7 +3781,7 @@ "type": "tidelift" } ], - "time": "2022-11-04T21:04:09+00:00" + "time": "2022-11-11T00:18:57+00:00" }, { "name": "sebastian/cli-parser", @@ -4804,16 +4807,16 @@ }, { "name": "slevomat/coding-standard", - "version": "8.6.2", + "version": "8.6.3", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "080f592b16f021a3a8e43d95ca8f57b87ddcf4e6" + "reference": "94fd4f9263e65a5006444890b1615c025ff58f1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/080f592b16f021a3a8e43d95ca8f57b87ddcf4e6", - "reference": "080f592b16f021a3a8e43d95ca8f57b87ddcf4e6", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/94fd4f9263e65a5006444890b1615c025ff58f1a", + "reference": "94fd4f9263e65a5006444890b1615c025ff58f1a", "shasum": "" }, "require": { @@ -4825,11 +4828,11 @@ "require-dev": { "phing/phing": "2.17.4", "php-parallel-lint/php-parallel-lint": "1.3.2", - "phpstan/phpstan": "1.4.10|1.8.10", + "phpstan/phpstan": "1.4.10|1.9.0", "phpstan/phpstan-deprecation-rules": "1.0.0", - "phpstan/phpstan-phpunit": "1.0.0|1.1.1", + "phpstan/phpstan-phpunit": "1.0.0|1.2.2", "phpstan/phpstan-strict-rules": "1.4.4", - "phpunit/phpunit": "7.5.20|8.5.21|9.5.25" + "phpunit/phpunit": "7.5.20|8.5.21|9.5.26" }, "type": "phpcodesniffer-standard", "extra": { @@ -4853,7 +4856,7 @@ ], "support": { "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/8.6.2" + "source": "https://github.com/slevomat/coding-standard/tree/8.6.3" }, "funding": [ { @@ -4865,7 +4868,7 @@ "type": "tidelift" } ], - "time": "2022-10-22T15:42:49+00:00" + "time": "2022-11-10T15:24:40+00:00" }, { "name": "sniccowp/php-scoper-wordpress-excludes", @@ -5512,16 +5515,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", "shasum": "" }, "require": { @@ -5536,7 +5539,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -5574,7 +5577,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" }, "funding": [ { @@ -5590,20 +5593,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "433d05519ce6990bf3530fba6957499d327395c2" + "reference": "511a08c03c1960e08a883f4cffcacd219b758354" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2", - "reference": "433d05519ce6990bf3530fba6957499d327395c2", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", + "reference": "511a08c03c1960e08a883f4cffcacd219b758354", "shasum": "" }, "require": { @@ -5615,7 +5618,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -5655,7 +5658,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" }, "funding": [ { @@ -5671,20 +5674,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd" + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", "shasum": "" }, "require": { @@ -5696,7 +5699,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -5739,7 +5742,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" }, "funding": [ { @@ -5755,20 +5758,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", "shasum": "" }, "require": { @@ -5777,7 +5780,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -5822,7 +5825,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" }, "funding": [ { @@ -5838,20 +5841,20 @@ "type": "tidelift" } ], - "time": "2022-05-10T07:21:04+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1" + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/13f6d1271c663dc5ae9fb843a8f16521db7687a1", - "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", "shasum": "" }, "require": { @@ -5860,7 +5863,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -5901,7 +5904,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.27.0" }, "funding": [ { @@ -5917,7 +5920,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/service-contracts", @@ -6090,22 +6093,22 @@ }, { "name": "szepeviktor/phpstan-wordpress", - "version": "v1.1.3", + "version": "v1.1.5", "source": { "type": "git", "url": "https://github.com/szepeviktor/phpstan-wordpress.git", - "reference": "e644df734e1bbe95810e0f617d17df091048a94e" + "reference": "3934e622e8434092aef69761d684281812fef868" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/e644df734e1bbe95810e0f617d17df091048a94e", - "reference": "e644df734e1bbe95810e0f617d17df091048a94e", + "url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/3934e622e8434092aef69761d684281812fef868", + "reference": "3934e622e8434092aef69761d684281812fef868", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", "php-stubs/wordpress-stubs": "^4.7 || ^5.0 || ^6.0", - "phpstan/phpstan": "^1.6", + "phpstan/phpstan": "^1.8.7", "symfony/polyfill-php73": "^1.12.0" }, "require-dev": { @@ -6113,8 +6116,8 @@ "dealerdirect/phpcodesniffer-composer-installer": "^0.7", "php-parallel-lint/php-parallel-lint": "^1.1", "phpstan/phpstan-strict-rules": "^1.2", - "phpunit/phpunit": "^8 || ^9", - "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.6" + "phpunit/phpunit": "^8.0 || ^9.0", + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.6.1" }, "type": "phpstan-extension", "extra": { @@ -6143,7 +6146,7 @@ ], "support": { "issues": "https://github.com/szepeviktor/phpstan-wordpress/issues", - "source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v1.1.3" + "source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v1.1.5" }, "funding": [ { @@ -6155,7 +6158,7 @@ "type": "github" } ], - "time": "2022-09-22T13:14:50+00:00" + "time": "2022-11-12T15:03:29+00:00" }, { "name": "thecodingmachine/safe", diff --git a/includes/Admin/TinyMCE.php b/includes/Admin/TinyMCE.php index 73b73c09952d..1c666438a0a5 100644 --- a/includes/Admin/TinyMCE.php +++ b/includes/Admin/TinyMCE.php @@ -94,7 +94,7 @@ public function register(): void { add_filter( 'mce_buttons', [ $this, 'tinymce_web_stories_button' ] ); add_filter( 'mce_external_plugins', [ $this, 'web_stories_mce_plugin' ] ); add_action( 'admin_footer', [ $this, 'web_stories_tinymce_root_element' ] ); - add_action( 'script_loader_tag', [ $this, 'script_loader_tag' ], 10, 3 ); + add_filter( 'script_loader_tag', [ $this, 'script_loader_tag' ], 10, 3 ); } /** diff --git a/includes/Assets.php b/includes/Assets.php index 4e617b3af065..4de7c4f2626f 100644 --- a/includes/Assets.php +++ b/includes/Assets.php @@ -253,7 +253,7 @@ public function enqueue_style_asset( string $style_handle, array $style_dependen * @since 1.8.0 * * @param string $style_handle Name of the stylesheet. Should be unique. - * @param string|bool $src Full URL of the stylesheet, or path of the stylesheet relative to the WordPress root directory. + * @param string|false $src Full URL of the stylesheet, or path of the stylesheet relative to the WordPress root directory. * If source is set to false, stylesheet is an alias of other stylesheets it depends on. * @param string[] $deps Optional. An array of registered stylesheet handles this stylesheet depends on. Default empty array. * @param string|bool|null $ver Optional. String specifying stylesheet version number, if it has one, which is added to the URL @@ -281,7 +281,7 @@ public function register_style( string $style_handle, $src, array $deps = [], $v * @since 1.8.0 * * @param string $script_handle Name of the script. Should be unique. - * @param string|bool $src Full URL of the script, or path of the script relative to the WordPress root directory. + * @param string|false $src Full URL of the script, or path of the script relative to the WordPress root directory. * If source is set to false, script is an alias of other scripts it depends on. * @param string[] $deps Optional. An array of registered script handles this script depends on. Default empty array. * @param string|bool|null $ver Optional. String specifying script version number, if it has one, which is added to the URL diff --git a/includes/Embed_Base.php b/includes/Embed_Base.php index e08e10fcdde6..ad53155dc86e 100644 --- a/includes/Embed_Base.php +++ b/includes/Embed_Base.php @@ -82,7 +82,7 @@ public function register(): void { add_action( 'amp_post_template_css', [ $this, 'add_amp_post_template_css' ] ); } - add_filter( 'wp_kses_allowed_html', [ $this, 'filter_kses_allowed_html' ], 10, 2 ); + add_filter( 'wp_kses_allowed_html', [ $this, 'filter_kses_allowed_html' ] ); } /** diff --git a/includes/KSES.php b/includes/KSES.php index f07cb0e3ed14..3fc1a1d29785 100644 --- a/includes/KSES.php +++ b/includes/KSES.php @@ -179,7 +179,7 @@ public function filter_insert_post_data( $data, $postarr, $unsanitized_postarr ) if ( isset( $unsanitized_postarr['post_content'] ) ) { add_filter( 'safe_style_css', [ $this, 'filter_safe_style_css' ] ); - add_filter( 'wp_kses_allowed_html', [ $this, 'filter_kses_allowed_html' ], 10, 2 ); + add_filter( 'wp_kses_allowed_html', [ $this, 'filter_kses_allowed_html' ] ); $unsanitized_postarr['post_content'] = $this->filter_content_save_pre_before_kses( $unsanitized_postarr['post_content'] ); diff --git a/includes/Media/Media_Source_Taxonomy.php b/includes/Media/Media_Source_Taxonomy.php index f34d9d504716..7c2d5eef21fd 100644 --- a/includes/Media/Media_Source_Taxonomy.php +++ b/includes/Media/Media_Source_Taxonomy.php @@ -87,7 +87,7 @@ public function register(): void { // Hide video posters from Media grid view. add_filter( 'ajax_query_attachments_args', [ $this, 'filter_ajax_query_attachments_args' ] ); // Hide video posters from Media list view. - add_filter( 'pre_get_posts', [ $this, 'filter_generated_media_attachments' ] ); + add_action( 'pre_get_posts', [ $this, 'filter_generated_media_attachments' ] ); // Hide video posters from web-stories/v1/media REST API requests. add_filter( 'web_stories_rest_attachment_query', [ $this, 'filter_rest_generated_media_attachments' ] ); } @@ -285,7 +285,7 @@ public function filter_ajax_query_attachments_args( $args ) { * * @param WP_Query $query WP_Query instance, passed by reference. */ - public function filter_generated_media_attachments( &$query ): void { + public function filter_generated_media_attachments( WP_Query $query ): void { if ( is_admin() && $query->is_main_query() && $this->context->is_upload_screen() ) { $tax_query = $query->get( 'tax_query' ); diff --git a/includes/Story_Revisions.php b/includes/Story_Revisions.php index b9fda151bcc1..95f81d61029f 100644 --- a/includes/Story_Revisions.php +++ b/includes/Story_Revisions.php @@ -79,7 +79,7 @@ public function __construct( Story_Post_Type $story_post_type, Assets $assets ) */ public function register(): void { $post_type = $this->story_post_type->get_slug(); - add_action( "wp_{$post_type}_revisions_to_keep", [ $this, 'revisions_to_keep' ] ); + add_filter( "wp_{$post_type}_revisions_to_keep", [ $this, 'revisions_to_keep' ] ); add_filter( '_wp_post_revision_fields', [ $this, 'filter_revision_fields' ], 10, 2 ); add_filter( 'wp_get_revision_ui_diff', [ $this, 'filter_revision_ui_diff' ], 10, 3 );