diff --git a/composer.json b/composer.json index e184bc3b..3e3a2859 100644 --- a/composer.json +++ b/composer.json @@ -25,6 +25,7 @@ "forum": "https://discourse.roots.io/category/bedrock" }, "repositories": [ + { "type": "git", "url": "https://github.com/generoi/wp-password-bcrypt.git" }, { "type": "composer", "url": "https://wpackagist.org" }, { "type": "composer", "url": "https://packagist.minasithil.genero.fi/" }, { "type": "composer", "url": "https://satispress.generodigital.com/satispress/" } @@ -35,7 +36,7 @@ "vlucas/phpdotenv": "^5.3.0", "roots/wordpress": "^6.0", "oscarotero/env": "^2.1.0", - "roots/wp-password-bcrypt": "^1.0", + "roots/wp-password-bcrypt": "dev-master", "roots/wp-config": "^1.0", "jjgrainger/posttypes": "~2.0", @@ -82,7 +83,12 @@ "brainmaestro/composer-git-hooks": "^3.0.0", "deployer/deployer": "^7.0", "generoi/deployer-genero": "^0.3", - "staabm/annotate-pull-request-from-checkstyle": "^1.5" + "staabm/annotate-pull-request-from-checkstyle": "^1.5", + "phpstan/phpstan": "^1.10", + "szepeviktor/phpstan-wordpress": "^1.3", + "wpsyntex/polylang-stubs": "^3.4", + "php-stubs/acf-pro-stubs": "^6.0", + "php-stubs/woocommerce-stubs": "^7.8" }, "config": { "optimize-autoloader": true, @@ -139,16 +145,23 @@ "patches": { "satispress/advanced-custom-fields-pro": { "Fix get_block_wrapper_attributes not working with ACF preview": "./config/patches/acf-get_block_wrapper_attributes.patch" + }, + "jjgrainger/posttypes": { + "fix docblock definition": "https://github.com/jjgrainger/PostTypes/pull/88/commits/70afd71587b9d1321ee25903c903ddadefa7d079.patch" } } }, "scripts": { "post-create-project-cmd": "Generoi\\Robo\\Composer\\ComposerScript::postCreateProject", "post-update-cmd": "php -r \"if (is_executable('vendor/bin/cghooks')) exec('vendor/bin/cghooks update');\"", - "test": "Generoi\\Robo\\Composer\\ComposerScript::test", + "test": [ + "Generoi\\Robo\\Composer\\ComposerScript::test", + "@php -d memory_limit=-1 vendor/bin/phpstan" + ], "ci": [ "composer validate --no-check-all", "vendor/bin/phpcs --report=checkstyle | vendor/bin/cs2pr", + "@php -d memory_limit=-1 vendor/bin/phpstan --error-format=checkstyle | vendor/bin/cs2pr", "(cd web/app/themes/gds; npm run ci:scripts --silent) | vendor/bin/cs2pr", "(cd web/app/themes/gds; npm run ci:styles --silent 2>&1) | vendor/bin/cs2pr" ], diff --git a/composer.lock b/composer.lock index 0f4a004c..55b88d58 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": "557dfeccc1a83381404ce3b212c395e5", + "content-hash": "64b656d535933e2f171dbb99ac42e336", "packages": [ { "name": "brick/math", @@ -2198,24 +2198,24 @@ }, { "name": "graham-campbell/result-type", - "version": "v1.1.2", + "version": "v1.1.3", "source": { "type": "git", "url": "https://github.com/GrahamCampbell/Result-Type.git", - "reference": "fbd48bce38f73f8a4ec8583362e732e4095e5862" + "reference": "3ba905c11371512af9d9bdd27d99b782216b6945" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/fbd48bce38f73f8a4ec8583362e732e4095e5862", - "reference": "fbd48bce38f73f8a4ec8583362e732e4095e5862", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/3ba905c11371512af9d9bdd27d99b782216b6945", + "reference": "3ba905c11371512af9d9bdd27d99b782216b6945", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.9.2" + "phpoption/phpoption": "^1.9.3" }, "require-dev": { - "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" + "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28" }, "type": "library", "autoload": { @@ -2244,7 +2244,7 @@ ], "support": { "issues": "https://github.com/GrahamCampbell/Result-Type/issues", - "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.2" + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.3" }, "funding": [ { @@ -2256,7 +2256,7 @@ "type": "tidelift" } ], - "time": "2023-11-12T22:16:48+00:00" + "time": "2024-07-20T21:45:45+00:00" }, { "name": "grasmash/expander", @@ -2312,16 +2312,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.9.0", + "version": "7.9.1", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "84ac2b2afc44e40d3e8e658a45d68d6d20437612" + "reference": "a629e5b69db96eb4939c1b34114130077dd4c6fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/84ac2b2afc44e40d3e8e658a45d68d6d20437612", - "reference": "84ac2b2afc44e40d3e8e658a45d68d6d20437612", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a629e5b69db96eb4939c1b34114130077dd4c6fc", + "reference": "a629e5b69db96eb4939c1b34114130077dd4c6fc", "shasum": "" }, "require": { @@ -2418,7 +2418,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.9.0" + "source": "https://github.com/guzzle/guzzle/tree/7.9.1" }, "funding": [ { @@ -2434,7 +2434,7 @@ "type": "tidelift" } ], - "time": "2024-07-18T11:52:56+00:00" + "time": "2024-07-19T16:19:57+00:00" }, { "name": "guzzlehttp/promises", @@ -5439,16 +5439,16 @@ }, { "name": "phpoption/phpoption", - "version": "1.9.2", + "version": "1.9.3", "source": { "type": "git", "url": "https://github.com/schmittjoh/php-option.git", - "reference": "80735db690fe4fc5c76dfa7f9b770634285fa820" + "reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/80735db690fe4fc5c76dfa7f9b770634285fa820", - "reference": "80735db690fe4fc5c76dfa7f9b770634285fa820", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/e3fac8b24f56113f7cb96af14958c0dd16330f54", + "reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54", "shasum": "" }, "require": { @@ -5456,13 +5456,13 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" + "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28" }, "type": "library", "extra": { "bamarni-bin": { "bin-links": true, - "forward-command": true + "forward-command": false }, "branch-alias": { "dev-master": "1.9-dev" @@ -5498,7 +5498,7 @@ ], "support": { "issues": "https://github.com/schmittjoh/php-option/issues", - "source": "https://github.com/schmittjoh/php-option/tree/1.9.2" + "source": "https://github.com/schmittjoh/php-option/tree/1.9.3" }, "funding": [ { @@ -5510,7 +5510,7 @@ "type": "tidelift" } ], - "time": "2023-11-12T21:59:55+00:00" + "time": "2024-07-20T21:41:07+00:00" }, { "name": "phpowermove/docblock", @@ -6740,17 +6740,11 @@ }, { "name": "roots/wp-password-bcrypt", - "version": "1.1.0", + "version": "dev-master", "source": { "type": "git", - "url": "https://github.com/roots/wp-password-bcrypt.git", - "reference": "15f0d8919fb3731f79a0cf2fb47e1baecb86cb26" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/roots/wp-password-bcrypt/zipball/15f0d8919fb3731f79a0cf2fb47e1baecb86cb26", - "reference": "15f0d8919fb3731f79a0cf2fb47e1baecb86cb26", - "shasum": "" + "url": "https://github.com/generoi/wp-password-bcrypt.git", + "reference": "0903a48363a1a6fce96b9815175ec1f1fee41ffc" }, "require": { "php": ">=5.6.0" @@ -6763,13 +6757,36 @@ "phpunit/phpunit": "<= 9.3", "squizlabs/php_codesniffer": "^3.5" }, - "type": "library", - "autoload": { - "files": [ - "wp-password-bcrypt.php" + "default-branch": true, + "type": "wordpress-muplugin", + "autoload-dev": { + "psr-4": { + "Roots\\PasswordBcrypt\\Tests\\": "tests/" + } + }, + "archive": { + "exclude": [ + ".editorconfig", + ".gitattributes", + ".gitignore", + ".github", + "CONTRIBUTING.md", + "phpcs.xml.dist", + "phpunit.xml.dist", + "tests" + ] + }, + "scripts": { + "test": [ + "phpunit" + ], + "lint": [ + "phpcs" + ], + "coverage": [ + "XDEBUG_MODE=coverage phpunit --coverage-text --coverage-html=coverage" ] }, - "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -6801,21 +6818,10 @@ "wordpress" ], "support": { - "forum": "https://discourse.roots.io/", "issues": "https://github.com/roots/wp-password-bcrypt/issues", - "source": "https://github.com/roots/wp-password-bcrypt/tree/1.1.0" + "forum": "https://discourse.roots.io/" }, - "funding": [ - { - "url": "https://github.com/roots", - "type": "github" - }, - { - "url": "https://www.patreon.com/rootsdev", - "type": "patreon" - } - ], - "time": "2021-10-31T01:18:58+00:00" + "time": "2023-07-13T11:38:29+00:00" }, { "name": "satispress/advanced-custom-fields-pro", @@ -9461,23 +9467,23 @@ }, { "name": "vlucas/phpdotenv", - "version": "v5.6.0", + "version": "v5.6.1", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4" + "reference": "a59a13791077fe3d44f90e7133eb68e7d22eaff2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4", - "reference": "2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/a59a13791077fe3d44f90e7133eb68e7d22eaff2", + "reference": "a59a13791077fe3d44f90e7133eb68e7d22eaff2", "shasum": "" }, "require": { "ext-pcre": "*", - "graham-campbell/result-type": "^1.1.2", + "graham-campbell/result-type": "^1.1.3", "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.9.2", + "phpoption/phpoption": "^1.9.3", "symfony/polyfill-ctype": "^1.24", "symfony/polyfill-mbstring": "^1.24", "symfony/polyfill-php80": "^1.24" @@ -9494,7 +9500,7 @@ "extra": { "bamarni-bin": { "bin-links": true, - "forward-command": true + "forward-command": false }, "branch-alias": { "dev-master": "5.6-dev" @@ -9529,7 +9535,7 @@ ], "support": { "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.0" + "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.1" }, "funding": [ { @@ -9541,7 +9547,7 @@ "type": "tidelift" } ], - "time": "2023-11-12T22:43:29+00:00" + "time": "2024-07-20T21:52:34+00:00" }, { "name": "voku/portable-ascii", @@ -11812,15 +11818,15 @@ }, { "name": "wpackagist-plugin/limit-login-attempts-reloaded", - "version": "2.26.11", + "version": "2.26.12", "source": { "type": "svn", "url": "https://plugins.svn.wordpress.org/limit-login-attempts-reloaded/", - "reference": "tags/2.26.11" + "reference": "tags/2.26.12" }, "dist": { "type": "zip", - "url": "https://downloads.wordpress.org/plugin/limit-login-attempts-reloaded.2.26.11.zip" + "url": "https://downloads.wordpress.org/plugin/limit-login-attempts-reloaded.2.26.12.zip" }, "require": { "composer/installers": "^1.0 || ^2.0" @@ -12155,18 +12161,213 @@ }, "time": "2024-02-18T03:01:06+00:00" }, + { + "name": "php-stubs/acf-pro-stubs", + "version": "v6.2.7", + "source": { + "type": "git", + "url": "https://github.com/php-stubs/acf-pro-stubs.git", + "reference": "ec36332a1211f8c0231ae8221994f38033232fa0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-stubs/acf-pro-stubs/zipball/ec36332a1211f8c0231ae8221994f38033232fa0", + "reference": "ec36332a1211f8c0231ae8221994f38033232fa0", + "shasum": "" + }, + "require": { + "php-stubs/wordpress-stubs": "^4.7 || ^5.0 || ^6.0" + }, + "require-dev": { + "php": "~7.1 || ^8.0", + "php-stubs/generator": "^0.8", + "phpdocumentor/reflection-docblock": "^5.3" + }, + "suggest": { + "symfony/polyfill-php73": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Advanced Custom Fields PRO stubs for static analysis.", + "homepage": "https://github.com/php-stubs/acf-pro-stubs", + "keywords": [ + "PHPStan", + "acf", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/php-stubs/acf-pro-stubs/issues", + "source": "https://github.com/php-stubs/acf-pro-stubs/tree/v6.2.7" + }, + "time": "2024-03-11T09:22:20+00:00" + }, + { + "name": "php-stubs/woocommerce-stubs", + "version": "v7.9.0", + "source": { + "type": "git", + "url": "https://github.com/php-stubs/woocommerce-stubs.git", + "reference": "3a2f522e29451490c357af550227795d2b0fc55a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/3a2f522e29451490c357af550227795d2b0fc55a", + "reference": "3a2f522e29451490c357af550227795d2b0fc55a", + "shasum": "" + }, + "require": { + "php-stubs/wordpress-stubs": "^5.3 || ^6.0" + }, + "require-dev": { + "php": "~7.1 || ~8.0", + "php-stubs/generator": "^0.8.0" + }, + "suggest": { + "symfony/polyfill-php73": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WooCommerce function and class declaration stubs for static analysis.", + "homepage": "https://github.com/php-stubs/woocommerce-stubs", + "keywords": [ + "PHPStan", + "static analysis", + "woocommerce", + "wordpress" + ], + "support": { + "issues": "https://github.com/php-stubs/woocommerce-stubs/issues", + "source": "https://github.com/php-stubs/woocommerce-stubs/tree/v7.9.0" + }, + "time": "2023-07-17T22:41:38+00:00" + }, + { + "name": "php-stubs/wordpress-stubs", + "version": "v6.6.0", + "source": { + "type": "git", + "url": "https://github.com/php-stubs/wordpress-stubs.git", + "reference": "86e8753e89d59849276dcdd91b9a7dd78bb4abe2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/86e8753e89d59849276dcdd91b9a7dd78bb4abe2", + "reference": "86e8753e89d59849276dcdd91b9a7dd78bb4abe2", + "shasum": "" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "nikic/php-parser": "^4.13", + "php": "^7.4 || ^8.0", + "php-stubs/generator": "^0.8.3", + "phpdocumentor/reflection-docblock": "^5.4.1", + "phpstan/phpstan": "^1.10.49", + "phpunit/phpunit": "^9.5", + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^1.0", + "wp-coding-standards/wpcs": "3.1.0 as 2.3.0" + }, + "suggest": { + "paragonie/sodium_compat": "Pure PHP implementation of libsodium", + "symfony/polyfill-php80": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WordPress function and class declaration stubs for static analysis.", + "homepage": "https://github.com/php-stubs/wordpress-stubs", + "keywords": [ + "PHPStan", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/php-stubs/wordpress-stubs/issues", + "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.6.0" + }, + "time": "2024-07-17T08:50:38+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "1.11.7", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "52d2bbfdcae7f895915629e4694e9497d0f8e28d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/52d2bbfdcae7f895915629e4694e9497d0f8e28d", + "reference": "52d2bbfdcae7f895915629e4694e9497d0f8e28d", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + } + ], + "time": "2024-07-06T11:17:41+00:00" + }, { "name": "squizlabs/php_codesniffer", - "version": "3.10.1", + "version": "3.10.2", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877" + "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/8f90f7a53ce271935282967f53d0894f8f1ff877", - "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/86e5f5dd9a840c46810ebe5ff1885581c42a3017", + "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017", "shasum": "" }, "require": { @@ -12233,7 +12434,7 @@ "type": "open_collective" } ], - "time": "2024-05-22T21:24:41+00:00" + "time": "2024-07-21T23:26:44+00:00" }, { "name": "staabm/annotate-pull-request-from-checkstyle", @@ -12286,11 +12487,109 @@ } ], "time": "2023-05-08T15:56:45+00:00" + }, + { + "name": "szepeviktor/phpstan-wordpress", + "version": "v1.3.5", + "source": { + "type": "git", + "url": "https://github.com/szepeviktor/phpstan-wordpress.git", + "reference": "7f8cfe992faa96b6a33bbd75c7bace98864161e7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/7f8cfe992faa96b6a33bbd75c7bace98864161e7", + "reference": "7f8cfe992faa96b6a33bbd75c7bace98864161e7", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "php-stubs/wordpress-stubs": "^4.7 || ^5.0 || ^6.0", + "phpstan/phpstan": "^1.10.31", + "symfony/polyfill-php73": "^1.12.0" + }, + "require-dev": { + "composer/composer": "^2.1.14", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpstan/phpstan-strict-rules": "^1.2", + "phpunit/phpunit": "^8.0 || ^9.0", + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^1.0", + "wp-coding-standards/wpcs": "3.1.0 as 2.3.0" + }, + "suggest": { + "swissspidy/phpstan-no-private": "Detect usage of internal core functions, classes and methods" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "SzepeViktor\\PHPStan\\WordPress\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WordPress extensions for PHPStan", + "keywords": [ + "PHPStan", + "code analyse", + "code analysis", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/szepeviktor/phpstan-wordpress/issues", + "source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v1.3.5" + }, + "time": "2024-06-28T22:27:19+00:00" + }, + { + "name": "wpsyntex/polylang-stubs", + "version": "3.6.2", + "source": { + "type": "git", + "url": "https://github.com/polylang/polylang-stubs.git", + "reference": "98f2646f64a487997ddaf7c4f532c4220d3b2e6f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/polylang/polylang-stubs/zipball/98f2646f64a487997ddaf7c4f532c4220d3b2e6f", + "reference": "98f2646f64a487997ddaf7c4f532c4220d3b2e6f", + "shasum": "" + }, + "require-dev": { + "php": "^7.3 || ^8.0", + "php-stubs/generator": "^0.8.4" + }, + "suggest": { + "wpsyntex/polylang-phpstan": "Polylang extension for PHPStan" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-or-later" + ], + "description": "Polylang and Polylang Pro function and class declaration stubs for static analysis.", + "homepage": "https://polylang.pro", + "support": { + "issues": "https://github.com/polylang/polylang-stubs/issues", + "source": "https://github.com/polylang/polylang-stubs/tree/3.6.2" + }, + "time": "2024-06-10T13:38:29+00:00" } ], "aliases": [], "minimum-stability": "dev", "stability-flags": { + "roots/wp-password-bcrypt": 20, "generoi/wp-image-resizer": 20, "generoi/sage-cachetags": 20 }, diff --git a/config/wp-cli/pre-ssh.php b/config/wp-cli/pre-ssh.php index 9c089296..29f862d0 100644 --- a/config/wp-cli/pre-ssh.php +++ b/config/wp-cli/pre-ssh.php @@ -17,23 +17,26 @@ * php_path: /usr/bin/php72 */ +use Symfony\Component\Yaml\Yaml; + WP_CLI::add_hook('before_ssh', function () { + $paths = []; $runner = WP_CLI::get_runner(); $runner->init_config(); $project_config = $runner->get_project_config_path(); - if ($runner->alias && $project_config) { - $config = Spyc::YAMLLoad($project_config)[$runner->alias] ?? []; + if (class_exists(Yaml::class) && $runner->alias && $project_config) { + $config = Yaml::parseFile($project_config)[$runner->alias] ?? []; + // Eg. /var/www/wordpress/web/wp + $wp_path = WP_CLI\Utils\parse_ssh_url($config['ssh'], PHP_URL_PATH); + // Eg. /var/www/wordpress + $project_root = dirname(dirname($wp_path)); + // Eg. /var/www/wordpress/vendor/bin + if (!empty($config['bin_path'])) { + $paths[] = $config['bin_path']; + } + $paths[] = "$project_root/vendor/bin"; } - // Eg. /var/www/wordpress/web/wp - $wp_path = WP_CLI\Utils\parse_ssh_url($config['ssh'], PHP_URL_PATH); - // Eg. /var/www/wordpress - $project_root = dirname(dirname($wp_path)); - // Eg. /var/www/wordpress/vendor/bin - if (!empty($config['bin_path'])) { - $paths[] = $config['bin_path']; - } - $paths[] = "$project_root/vendor/bin"; // Additionally add the users globally installed composer binaries. $paths[] = '$HOME/composer/vendor/bin'; $paths[] = '$HOME/.config/composer/vendor/bin'; diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 00000000..babfd17a --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,21 @@ +includes: + - vendor/szepeviktor/phpstan-wordpress/extension.neon + +parameters: + level: 5 + paths: + - config/ + - web/app/mu-plugins/ + - web/app/themes/gds/app/ + + excludePaths: + - web/app/mu-plugins/*/* + + bootstrapFiles: + - vendor/roots/acorn/src/Illuminate/Foundation/helpers.php + - vendor/roots/acorn/src/Roots/helpers.php + - vendor/php-stubs/wordpress-stubs/wordpress-stubs.php + - vendor/wp-cli/wp-cli/php/utils.php + - vendor/php-stubs/woocommerce-stubs/woocommerce-stubs.php + - vendor/php-stubs/acf-pro-stubs/acf-pro-stubs.php + - vendor/wpsyntex/polylang-stubs/polylang-stubs.php diff --git a/web/app/mu-plugins/defaults.php b/web/app/mu-plugins/defaults.php index 17bf8dab..7ee5ab15 100644 --- a/web/app/mu-plugins/defaults.php +++ b/web/app/mu-plugins/defaults.php @@ -206,7 +206,7 @@ add_action('wp_enqueue_scripts', __NAMESPACE__ . '\\shc_styling', 11); add_action('admin_enqueue_scripts', __NAMESPACE__ . '\\shc_styling', 11); -function shc_styling() +function shc_styling(): void { $styles = " #wpadminbar .ab-top-menu .shc-show-env.prod .ab-item, @@ -221,11 +221,12 @@ function shc_styling() wp_add_inline_style('shc-show-env', $styles); } -add_action('shc_show_env_id_env', function () { +add_filter('shc_show_env_id_env', function () { return match (wp_get_environment_type()) { 'local' => ['Local', 'dev'], 'development' => ['Dev', 'dev'], 'production' => ['Prod', 'prod'], 'staging' => ['Staging', 'staging'], + default => ['Unknown', 'dev'], }; }); diff --git a/web/app/mu-plugins/disable-admin-email-notifications-on-new-user-registration.php b/web/app/mu-plugins/disable-admin-email-notifications-on-new-user-registration.php index 2cd486e5..e2ae3e92 100644 --- a/web/app/mu-plugins/disable-admin-email-notifications-on-new-user-registration.php +++ b/web/app/mu-plugins/disable-admin-email-notifications-on-new-user-registration.php @@ -18,7 +18,7 @@ return; } -function sendNewUserNotifications($userId, $notify = 'both') +function sendNewUserNotifications(int $userId, string $notify = 'both'): void { if (empty($notify) || $notify === 'admin') { return; diff --git a/web/app/mu-plugins/disable-password-change-emails.php b/web/app/mu-plugins/disable-password-change-emails.php index 8d508d04..b4955cbe 100644 --- a/web/app/mu-plugins/disable-password-change-emails.php +++ b/web/app/mu-plugins/disable-password-change-emails.php @@ -20,7 +20,7 @@ * @see pluggable.php */ if (!function_exists('wp_password_change_notification')) { - function wp_password_change_notification($user) + function wp_password_change_notification(WP_User $user): void { return; } diff --git a/web/app/mu-plugins/post-types.php b/web/app/mu-plugins/post-types.php index aabbd536..a7c14e68 100644 --- a/web/app/mu-plugins/post-types.php +++ b/web/app/mu-plugins/post-types.php @@ -27,12 +27,9 @@ */ class PostTypes { - private static $instance = null; + private static ?PostTypes $instance = null; - /** @var array */ - public $postTypes = []; - - public static function getInstance() + public static function getInstance(): PostTypes { if (null === self::$instance) { self::$instance = new self(); @@ -50,15 +47,15 @@ public function __construct() * Register all post types and their taxonomies. * @note needs to run during `init`. */ - public function register() + public function register(): void { - $this->postTypes[] = $this->registerPost(); - $this->postTypes[] = $this->registerPage(); - // $this->postTypes[] = $this->registerProduct(); - // $this->postTypes[] = $this->registerPerson(); + $this->registerPost(); + $this->registerPage(); + // $this->registerProduct(); + // $this->registerPerson(); } - public function registerPost() + public function registerPost(): void { $post = new PostType('post'); $post->register(); @@ -73,11 +70,9 @@ public function registerPost() } return $args; }, 10, 2); - - return $post; } - public function registerPage() + public function registerPage(): void { $page = new PostType('page'); $page->register(); @@ -85,19 +80,15 @@ public function registerPage() add_action('init', function () { add_post_type_support('page', 'excerpt'); }); - - return $page; } - public function registerProduct() + public function registerProduct(): void { $product = new PostType('product'); $product->register(); - - return $product; } - public function registerPerson() + public function registerPerson(): void { $person = new PostType('person', [ 'has_archive' => false, @@ -116,11 +107,9 @@ public function registerPerson() $department = new Taxonomy('department'); $department->register(); - - return $person; } - public function adminHead() + public function adminHead(): void { echo '