From e96c77096eeee332de22c86c636bc035b7440056 Mon Sep 17 00:00:00 2001 From: Nico Mollet Date: Fri, 17 May 2024 17:06:01 +0200 Subject: [PATCH 01/24] gitignore IDE --- .gitignore | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c500eb8..16eabe2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ - .DS_Store -/vendor/ \ No newline at end of file +/vendor/ +src/Dependencies +.lando.yml +package-lock.json +.idea \ No newline at end of file From 3a6675a5ece17657b9bc0e288858df27f847f772 Mon Sep 17 00:00:00 2001 From: Nico Mollet Date: Fri, 17 May 2024 17:06:22 +0200 Subject: [PATCH 02/24] Starting migration to Launchpad --- composer.json | 35 +- composer.lock | 2858 +++++++++++------ configs/parameters.php | 11 + configs/providers.php | 12 + .../RocketLazyloadRequirementsCheck.php | 0 main.php | 9 - rocket-lazy-load.php | 9 +- src/Admin/AdminPage.php | 46 +- .../Argument/ArgumentResolverInterface.php | 18 +- .../Argument/ArgumentResolverTrait.php | 98 +- .../League/Container/Argument/RawArgument.php | 6 +- .../Argument/RawArgumentInterface.php | 2 +- .../League/Container/Container.php | 337 +- .../Container/ContainerAwareInterface.php | 30 +- .../League/Container/ContainerAwareTrait.php | 58 +- .../League/Container/ContainerInterface.php | 59 - .../Definition/AbstractDefinition.php | 62 - .../Definition/CallableDefinition.php | 23 - .../Container/Definition/ClassDefinition.php | 67 - .../Definition/ClassDefinitionInterface.php | 23 - .../Definition/DefinitionFactory.php | 28 - .../Definition/DefinitionFactoryInterface.php | 17 - .../Definition/DefinitionInterface.php | 112 +- .../Container/Exception/NotFoundException.php | 2 +- .../ImmutableContainerAwareInterface.php | 22 - .../ImmutableContainerAwareTrait.php | 36 - .../Container/ImmutableContainerInterface.php | 10 - .../League/Container/Inflector/Inflector.php | 84 +- .../Inflector/InflectorAggregate.php | 45 +- .../Inflector/InflectorAggregateInterface.php | 16 +- .../League/Container/ReflectionContainer.php | 86 +- .../AbstractServiceProvider.php | 31 +- .../AbstractSignatureServiceProvider.php | 31 - .../BootableServiceProviderInterface.php | 2 +- .../ServiceProviderAggregate.php | 76 +- .../ServiceProviderAggregateInterface.php | 22 +- .../ServiceProviderInterface.php | 30 +- .../SignatureServiceProviderInterface.php | 24 - src/Dependencies/RocketLazyload/Assets.php | 89 +- src/Dependencies/RocketLazyload/Iframe.php | 9 +- src/Dependencies/RocketLazyload/Image.php | 147 +- src/EventManagement/EventManager.php | 145 - .../EventManagerAwareSubscriberInterface.php | 21 - src/EventManagement/SubscriberInterface.php | 5 +- src/Options/AbstractOptions.php | 69 - src/Options/OptionArray.php | 111 - src/Options/Options.php | 106 - src/Plugin.php | 96 - src/ServiceProvider/AdminServiceProvider.php | 42 +- .../ImagifyNoticeServiceProvider.php | 42 +- .../LazyloadServiceProvider.php | 37 +- src/ServiceProvider/OptionServiceProvider.php | 40 +- .../SubscribersServiceProvider.php | 105 +- src/Subscriber/AdminPageSubscriber.php | 12 +- src/Subscriber/ImagifyNoticeSubscriber.php | 7 +- src/Subscriber/LazyloadSubscriber.php | 45 +- src/Subscriber/ThirdParty/AMPSubscriber.php | 8 +- 57 files changed, 2959 insertions(+), 2614 deletions(-) create mode 100644 configs/parameters.php create mode 100644 configs/providers.php rename src/rocket-lazyload-requirements-check.php => includes/RocketLazyloadRequirementsCheck.php (100%) delete mode 100644 main.php delete mode 100644 src/Dependencies/League/Container/ContainerInterface.php delete mode 100644 src/Dependencies/League/Container/Definition/AbstractDefinition.php delete mode 100644 src/Dependencies/League/Container/Definition/CallableDefinition.php delete mode 100644 src/Dependencies/League/Container/Definition/ClassDefinition.php delete mode 100644 src/Dependencies/League/Container/Definition/ClassDefinitionInterface.php delete mode 100644 src/Dependencies/League/Container/Definition/DefinitionFactory.php delete mode 100644 src/Dependencies/League/Container/Definition/DefinitionFactoryInterface.php delete mode 100644 src/Dependencies/League/Container/ImmutableContainerAwareInterface.php delete mode 100644 src/Dependencies/League/Container/ImmutableContainerAwareTrait.php delete mode 100644 src/Dependencies/League/Container/ImmutableContainerInterface.php delete mode 100644 src/Dependencies/League/Container/ServiceProvider/AbstractSignatureServiceProvider.php delete mode 100644 src/Dependencies/League/Container/ServiceProvider/SignatureServiceProviderInterface.php delete mode 100644 src/EventManagement/EventManager.php delete mode 100644 src/EventManagement/EventManagerAwareSubscriberInterface.php delete mode 100644 src/Options/AbstractOptions.php delete mode 100644 src/Options/OptionArray.php delete mode 100644 src/Options/Options.php delete mode 100644 src/Plugin.php diff --git a/composer.json b/composer.json index 66b273b..2f1e9b8 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,11 @@ ], "type": "wordpress-plugin", "config": { - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "composer/installers": true, + "dealerdirect/phpcodesniffer-composer-installer": true + } }, "support": { "issues": "https://github.com/wp-media/rocket-lazy-load/issues", @@ -34,18 +38,21 @@ } }, "require": { - "php": ">=5.6", - "composer/installers": "~1.0", - "wp-media/rocket-lazyload-common": "^2.0" + "php": ">=7.4", + "composer/installers": "^1.0 || ^2.0", + "wp-media/rocket-lazyload-common": "^3.0" }, "require-dev": { - "league/container": "^2.4", + "psr/container": "1.0.0", "brain/monkey": "^2.0", - "coenjacobs/mozart": "^0.5.1", - "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", + "coenjacobs/mozart": "^0.7.0", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "phpcompatibility/phpcompatibility-wp": "^2.0", - "phpunit/phpunit": "^5.7", - "wp-coding-standards/wpcs": "^2.0.0" + "phpunit/phpunit": "^7.5 || ^8 || ^9", + "wp-coding-standards/wpcs": "^2.0.0", + "wp-launchpad/core": "^0.2.6", + "wp-launchpad/framework-options": "^0.1.2", + "wp-media/phpunit": "^3.0" }, "extra": { "mozart": { @@ -55,7 +62,9 @@ "classmap_prefix": "RLLP_", "packages": [ "wp-media/rocket-lazyload-common", - "league/container" + "league/container", + "wp-launchpad/core", + "wp-launchpad/framework-options" ], "delete_vendor_directories": true } @@ -64,12 +73,12 @@ "test-unit":"\"vendor/bin/phpunit\" --testsuite unit --colors=always", "test-integration": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist", "post-install-cmd": [ - "[ $COMPOSER_DEV_MODE -eq 0 ] || \"vendor/bin/mozart\" compose", + "\"vendor/bin/mozart\" compose", "composer dump-autoload" ], "post-update-cmd": [ - "[ $COMPOSER_DEV_MODE -eq 0 ] || \"vendor/bin/mozart\" compose", + "\"vendor/bin/mozart\" compose", "composer dump-autoload" ] - } + } } diff --git a/composer.lock b/composer.lock index 495f87e..39deea3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,42 +4,41 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "88f049697a5890a4956ddbb51aa9f870", + "content-hash": "625de99d98d749e10e03afc9a9b428c1", "packages": [ { "name": "composer/installers", - "version": "v1.9.0", + "version": "v2.2.0", "source": { "type": "git", "url": "https://github.com/composer/installers.git", - "reference": "b93bcf0fa1fccb0b7d176b0967d969691cd74cca" + "reference": "c29dc4b93137acb82734f672c37e029dfbd95b35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/b93bcf0fa1fccb0b7d176b0967d969691cd74cca", - "reference": "b93bcf0fa1fccb0b7d176b0967d969691cd74cca", + "url": "https://api.github.com/repos/composer/installers/zipball/c29dc4b93137acb82734f672c37e029dfbd95b35", + "reference": "c29dc4b93137acb82734f672c37e029dfbd95b35", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0 || ^2.0" - }, - "replace": { - "roundcube/plugin-installer": "*", - "shama/baton": "*" + "composer-plugin-api": "^1.0 || ^2.0", + "php": "^7.2 || ^8.0" }, "require-dev": { - "composer/composer": "1.6.* || 2.0.*@dev", - "composer/semver": "1.0.* || 2.0.*@dev", - "phpunit/phpunit": "^4.8.36", - "sebastian/comparator": "^1.2.4", - "symfony/process": "^2.3" + "composer/composer": "1.6.* || ^2.0", + "composer/semver": "^1 || ^3", + "phpstan/phpstan": "^0.12.55", + "phpstan/phpstan-phpunit": "^0.12.16", + "symfony/phpunit-bridge": "^5.3", + "symfony/process": "^5" }, "type": "composer-plugin", "extra": { "class": "Composer\\Installers\\Plugin", "branch-alias": { - "dev-master": "1.0-dev" - } + "dev-main": "2.x-dev" + }, + "plugin-modifies-install-path": true }, "autoload": { "psr-4": { @@ -60,7 +59,6 @@ "description": "A multi-framework Composer library installer", "homepage": "https://composer.github.io/installers/", "keywords": [ - "Craft", "Dolibarr", "Eliasis", "Hurad", @@ -76,11 +74,11 @@ "Porto", "RadPHP", "SMF", + "Starbug", "Thelia", "Whmcs", "WolfCMS", "agl", - "aimeos", "annotatecms", "attogram", "bitrix", @@ -99,7 +97,6 @@ "grav", "installer", "itop", - "joomla", "known", "kohana", "laravel", @@ -108,14 +105,18 @@ "magento", "majima", "mako", + "matomo", "mediawiki", + "miaoxing", "modulework", "modx", "moodle", "osclass", + "pantheon", "phpbb", "piwik", "ppi", + "processwire", "puppet", "pxcms", "reindex", @@ -124,58 +125,62 @@ "silverstripe", "sydes", "sylius", - "symfony", - "typo3", + "tastyigniter", "wordpress", "yawik", "zend", "zikula" ], + "support": { + "issues": "https://github.com/composer/installers/issues", + "source": "https://github.com/composer/installers/tree/v2.2.0" + }, "funding": [ { "url": "https://packagist.com", "type": "custom" }, + { + "url": "https://github.com/composer", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/composer/composer", "type": "tidelift" } ], - "time": "2020-04-07T06:57:05+00:00" + "time": "2022-08-20T06:45:11+00:00" }, { "name": "wp-media/rocket-lazyload-common", - "version": "v2.5.12", + "version": "v3.0.11", "source": { "type": "git", "url": "https://github.com/wp-media/rocket-lazyload-common.git", - "reference": "09bdc9a550b8bd1197c155a98e17c45adcb190af" + "reference": "df4369bdb0b8777bca7a7375e3d956c5794d844c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/09bdc9a550b8bd1197c155a98e17c45adcb190af", - "reference": "09bdc9a550b8bd1197c155a98e17c45adcb190af", + "url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/df4369bdb0b8777bca7a7375e3d956c5794d844c", + "reference": "df4369bdb0b8777bca7a7375e3d956c5794d844c", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=7.0" }, "require-dev": { - "brain/monkey": "^2.0", - "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", - "doctrine/instantiator": "1.0.*", - "myclabs/deep-copy": "1.6.*", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "php": ">=7.0", "phpcompatibility/phpcompatibility-wp": "^2.0", - "phpdocumentor/reflection-docblock": "^3.3", - "phpunit/php-token-stream": "^1.4", - "phpunit/phpunit": "^5.7", - "symfony/yaml": "2.8.*", - "wp-coding-standards/wpcs": "^2.0.0" + "phpunit/phpunit": "^7.5 || ^8 || ^9", + "szepeviktor/phpstan-wordpress": "^0.7.0", + "wp-coding-standards/wpcs": "^2.0", + "wp-media/phpunit": "^3.0" }, "type": "library", "autoload": { "psr-4": { - "RocketLazyload\\": "src" + "RocketLazyload\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -189,22 +194,26 @@ } ], "description": "Common Code between WP Rocket and Lazyload by WP Rocket", - "time": "2020-07-10T18:41:12+00:00" + "support": { + "issues": "https://github.com/wp-media/rocket-lazyload-common/issues", + "source": "https://github.com/wp-media/rocket-lazyload-common" + }, + "time": "2023-04-20T06:44:58+00:00" } ], "packages-dev": [ { "name": "antecedent/patchwork", - "version": "2.1.12", + "version": "2.1.28", "source": { "type": "git", "url": "https://github.com/antecedent/patchwork.git", - "reference": "b98e046dd4c0acc34a0846604f06f6111654d9ea" + "reference": "6b30aff81ebadf0f2feb9268d3e08385cebcc08d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/antecedent/patchwork/zipball/b98e046dd4c0acc34a0846604f06f6111654d9ea", - "reference": "b98e046dd4c0acc34a0846604f06f6111654d9ea", + "url": "https://api.github.com/repos/antecedent/patchwork/zipball/6b30aff81ebadf0f2feb9268d3e08385cebcc08d", + "reference": "6b30aff81ebadf0f2feb9268d3e08385cebcc08d", "shasum": "" }, "require": { @@ -225,7 +234,7 @@ } ], "description": "Method redefinition (monkey-patching) functionality for PHP.", - "homepage": "http://patchwork2.org/", + "homepage": "https://antecedent.github.io/patchwork/", "keywords": [ "aop", "aspect", @@ -235,31 +244,35 @@ "runkit", "testing" ], - "time": "2019-12-22T17:52:09+00:00" + "support": { + "issues": "https://github.com/antecedent/patchwork/issues", + "source": "https://github.com/antecedent/patchwork/tree/2.1.28" + }, + "time": "2024-02-06T09:26:11+00:00" }, { "name": "brain/monkey", - "version": "2.4.0", + "version": "2.6.1", "source": { "type": "git", "url": "https://github.com/Brain-WP/BrainMonkey.git", - "reference": "b3ce8b619c26db6abd01b9dcfd6a2c0254060956" + "reference": "a31c84515bb0d49be9310f52ef1733980ea8ffbb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/b3ce8b619c26db6abd01b9dcfd6a2c0254060956", - "reference": "b3ce8b619c26db6abd01b9dcfd6a2c0254060956", + "url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/a31c84515bb0d49be9310f52ef1733980ea8ffbb", + "reference": "a31c84515bb0d49be9310f52ef1733980ea8ffbb", "shasum": "" }, "require": { - "antecedent/patchwork": "^2.0", - "mockery/mockery": ">=0.9 <2", + "antecedent/patchwork": "^2.1.17", + "mockery/mockery": "^1.3.5 || ^1.4.4", "php": ">=5.6.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.4", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", "phpcompatibility/php-compatibility": "^9.3.0", - "phpunit/phpunit": "^5.7.9 || ^6.0 || ^7.0" + "phpunit/phpunit": "^5.7.26 || ^6.0 || ^7.0 || >=8.0 <8.5.12 || ^8.5.14 || ^9.0" }, "type": "library", "extra": { @@ -269,12 +282,12 @@ } }, "autoload": { - "psr-4": { - "Brain\\Monkey\\": "src/" - }, "files": [ "inc/api.php" - ] + ], + "psr-4": { + "Brain\\Monkey\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -301,30 +314,37 @@ "test", "testing" ], - "time": "2019-11-24T16:03:21+00:00" + "support": { + "issues": "https://github.com/Brain-WP/BrainMonkey/issues", + "source": "https://github.com/Brain-WP/BrainMonkey" + }, + "time": "2021-11-11T15:53:55+00:00" }, { "name": "coenjacobs/mozart", - "version": "0.5.1", + "version": "0.7.1", "source": { "type": "git", "url": "https://github.com/coenjacobs/mozart.git", - "reference": "4bdde231f3309d9299c87b2246166e87acc93653" + "reference": "dbcdeb992d20d9c8914eef090f9a0d684bb1102c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/coenjacobs/mozart/zipball/4bdde231f3309d9299c87b2246166e87acc93653", - "reference": "4bdde231f3309d9299c87b2246166e87acc93653", + "url": "https://api.github.com/repos/coenjacobs/mozart/zipball/dbcdeb992d20d9c8914eef090f9a0d684bb1102c", + "reference": "dbcdeb992d20d9c8914eef090f9a0d684bb1102c", "shasum": "" }, "require": { "league/flysystem": "^1.0", - "php": "^7.2", + "php": "^7.3|^8.0", "symfony/console": "^4|^5", "symfony/finder": "^4|^5" }, "require-dev": { - "phpunit/phpunit": "^8.5" + "mheap/phpunit-github-actions-printer": "^1.4", + "phpunit/phpunit": "^8.5", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.4" }, "bin": [ "bin/mozart" @@ -346,63 +366,41 @@ } ], "description": "Composes all dependencies as a package inside a WordPress plugin", - "time": "2019-12-23T12:24:56+00:00" - }, - { - "name": "container-interop/container-interop", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/container-interop/container-interop.git", - "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", - "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", - "shasum": "" - }, - "require": { - "psr/container": "^1.0" + "support": { + "issues": "https://github.com/coenjacobs/mozart/issues", + "source": "https://github.com/coenjacobs/mozart/tree/0.7.1" }, - "type": "library", - "autoload": { - "psr-4": { - "Interop\\Container\\": "src/Interop/Container/" + "funding": [ + { + "url": "https://github.com/coenjacobs", + "type": "github" } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" ], - "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", - "homepage": "https://github.com/container-interop/container-interop", - "abandoned": "psr/container", - "time": "2017-02-14T19:40:03+00:00" + "time": "2021-02-02T21:37:03+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.5.0", + "version": "v0.7.2", "source": { "type": "git", "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "e749410375ff6fb7a040a68878c656c2e610b132" + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e749410375ff6fb7a040a68878c656c2e610b132", - "reference": "e749410375ff6fb7a040a68878c656c2e610b132", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0", - "php": "^5.3|^7", - "squizlabs/php_codesniffer": "^2|^3" + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" }, "require-dev": { "composer/composer": "*", - "phpcompatibility/php-compatibility": "^9.0", - "sensiolabs/security-checker": "^4.1.0" + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.0" }, "type": "composer-plugin", "extra": { @@ -423,6 +421,10 @@ "email": "franck.nijhof@dealerdirect.com", "homepage": "http://www.frenck.nl", "role": "Developer / IT Manager" + }, + { + "name": "Contributors", + "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", @@ -434,6 +436,7 @@ "codesniffer", "composer", "installer", + "phpcbf", "phpcs", "plugin", "qa", @@ -444,40 +447,40 @@ "stylecheck", "tests" ], - "time": "2018-10-26T13:21:45+00:00" + "support": { + "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", + "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" + }, + "time": "2022-02-04T12:51:07+00:00" }, { "name": "doctrine/instantiator", - "version": "1.3.1", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "f350df0268e904597e3bd9c4685c53e0e333feea" + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f350df0268e904597e3bd9c4685c53e0e333feea", - "reference": "f350df0268e904597e3bd9c4685c53e0e333feea", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0", + "doctrine/coding-standard": "^9 || ^11", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.13", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-shim": "^0.11", - "phpunit/phpunit": "^7.0" + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.30 || ^5.4" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" @@ -491,7 +494,7 @@ { "name": "Marco Pivetta", "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "homepage": "https://ocramius.github.io/" } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", @@ -500,6 +503,10 @@ "constructor", "instantiate" ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -514,7 +521,7 @@ "type": "tidelift" } ], - "time": "2020-05-29T17:27:14+00:00" + "time": "2022-12-30T00:15:36+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -561,39 +568,47 @@ "keywords": [ "test" ], + "support": { + "issues": "https://github.com/hamcrest/hamcrest-php/issues", + "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.0.1" + }, "time": "2020-07-09T08:09:16+00:00" }, { "name": "league/container", - "version": "2.4.1", + "version": "3.4.1", "source": { "type": "git", "url": "https://github.com/thephpleague/container.git", - "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0" + "reference": "84ecbc2dbecc31bd23faf759a0e329ee49abddbd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/container/zipball/43f35abd03a12977a60ffd7095efd6a7808488c0", - "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0", + "url": "https://api.github.com/repos/thephpleague/container/zipball/84ecbc2dbecc31bd23faf759a0e329ee49abddbd", + "reference": "84ecbc2dbecc31bd23faf759a0e329ee49abddbd", "shasum": "" }, "require": { - "container-interop/container-interop": "^1.2", - "php": "^5.4.0 || ^7.0" + "php": "^7.0 || ^8.0", + "psr/container": "^1.0.0" }, "provide": { - "container-interop/container-interop-implementation": "^1.2", "psr/container-implementation": "^1.0" }, "replace": { "orno/di": "~2.0" }, "require-dev": { - "phpunit/phpunit": "4.*" + "phpunit/phpunit": "^6.0 || ^7.0", + "roave/security-advisories": "dev-latest", + "scrutinizer/ocular": "^1.8", + "squizlabs/php_codesniffer": "^3.5" }, "type": "library", "extra": { "branch-alias": { + "dev-master": "3.x-dev", + "dev-3.x": "3.x-dev", "dev-2.x": "2.x-dev", "dev-1.x": "1.x-dev" } @@ -626,20 +641,30 @@ "provider", "service" ], - "time": "2017-05-10T09:20:27+00:00" + "support": { + "issues": "https://github.com/thephpleague/container/issues", + "source": "https://github.com/thephpleague/container/tree/3.4.1" + }, + "funding": [ + { + "url": "https://github.com/philipobenito", + "type": "github" + } + ], + "time": "2021-07-09T08:23:52+00:00" }, { "name": "league/flysystem", - "version": "1.1.4", + "version": "1.1.10", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "f3ad69181b8afed2c9edf7be5a2918144ff4ea32" + "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f3ad69181b8afed2c9edf7be5a2918144ff4ea32", - "reference": "f3ad69181b8afed2c9edf7be5a2918144ff4ea32", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1", + "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1", "shasum": "" }, "require": { @@ -710,36 +735,40 @@ "sftp", "storage" ], + "support": { + "issues": "https://github.com/thephpleague/flysystem/issues", + "source": "https://github.com/thephpleague/flysystem/tree/1.1.10" + }, "funding": [ { "url": "https://offset.earth/frankdejonge", "type": "other" } ], - "time": "2021-06-23T21:56:05+00:00" + "time": "2022-10-04T09:16:37+00:00" }, { "name": "league/mime-type-detection", - "version": "1.7.0", + "version": "1.15.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3" + "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3", - "reference": "3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", + "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", "shasum": "" }, "require": { "ext-fileinfo": "*", - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.18", + "friendsofphp/php-cs-fixer": "^3.2", "phpstan/phpstan": "^0.12.68", - "phpunit/phpunit": "^8.5.8 || ^9.3" + "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0" }, "type": "library", "autoload": { @@ -758,6 +787,10 @@ } ], "description": "Mime-type detection for Flysystem", + "support": { + "issues": "https://github.com/thephpleague/mime-type-detection/issues", + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.15.0" + }, "funding": [ { "url": "https://github.com/frankdejonge", @@ -768,39 +801,93 @@ "type": "tidelift" } ], - "time": "2021-01-18T20:58:21+00:00" + "time": "2024-01-28T23:22:08+00:00" }, { - "name": "mockery/mockery", - "version": "1.3.3", + "name": "mikey179/vfsstream", + "version": "v1.6.11", "source": { "type": "git", - "url": "https://github.com/mockery/mockery.git", - "reference": "60fa2f67f6e4d3634bb4a45ff3171fa52215800d" + "url": "https://github.com/bovigo/vfsStream.git", + "reference": "17d16a85e6c26ce1f3e2fa9ceeacdc2855db1e9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/60fa2f67f6e4d3634bb4a45ff3171fa52215800d", - "reference": "60fa2f67f6e4d3634bb4a45ff3171fa52215800d", + "url": "https://api.github.com/repos/bovigo/vfsStream/zipball/17d16a85e6c26ce1f3e2fa9ceeacdc2855db1e9f", + "reference": "17d16a85e6c26ce1f3e2fa9ceeacdc2855db1e9f", "shasum": "" }, "require": { - "hamcrest/hamcrest-php": "^2.0.1", - "lib-pcre": ">=7.0", - "php": ">=5.6.0" + "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "^5.7.10|^6.5|^7.5|^8.5|^9.3" + "phpunit/phpunit": "^4.5|^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { "psr-0": { - "Mockery": "library/" + "org\\bovigo\\vfs\\": "src/main/php" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Frank Kleine", + "homepage": "http://frankkleine.de/", + "role": "Developer" + } + ], + "description": "Virtual file system to mock the real file system in unit tests.", + "homepage": "http://vfs.bovigo.org/", + "support": { + "issues": "https://github.com/bovigo/vfsStream/issues", + "source": "https://github.com/bovigo/vfsStream/tree/master", + "wiki": "https://github.com/bovigo/vfsStream/wiki" + }, + "time": "2022-02-23T02:02:42+00:00" + }, + { + "name": "mockery/mockery", + "version": "1.6.12", + "source": { + "type": "git", + "url": "https://github.com/mockery/mockery.git", + "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mockery/mockery/zipball/1f4efdd7d3beafe9807b08156dfcb176d18f1699", + "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699", + "shasum": "" + }, + "require": { + "hamcrest/hamcrest-php": "^2.0.1", + "lib-pcre": ">=7.0", + "php": ">=7.3" + }, + "conflict": { + "phpunit/phpunit": "<8.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.5 || ^9.6.17", + "symplify/easy-coding-standard": "^12.1.14" + }, + "type": "library", + "autoload": { + "files": [ + "library/helpers.php", + "library/Mockery.php" + ], + "psr-4": { + "Mockery\\": "library/Mockery" } }, "notification-url": "https://packagist.org/downloads/", @@ -811,12 +898,20 @@ { "name": "Pádraic Brady", "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" + "homepage": "https://github.com/padraic", + "role": "Author" }, { "name": "Dave Marshall", "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" + "homepage": "https://davedevelopment.co.uk", + "role": "Developer" + }, + { + "name": "Nathanael Esayeas", + "email": "nathanael.esayeas@protonmail.com", + "homepage": "https://github.com/ghostwriter", + "role": "Lead Developer" } ], "description": "Mockery is a simple yet flexible PHP mock object framework", @@ -833,41 +928,49 @@ "test double", "testing" ], - "time": "2020-08-11T18:10:21+00:00" + "support": { + "docs": "https://docs.mockery.io/", + "issues": "https://github.com/mockery/mockery/issues", + "rss": "https://github.com/mockery/mockery/releases.atom", + "security": "https://github.com/mockery/mockery/security/advisories", + "source": "https://github.com/mockery/mockery" + }, + "time": "2024-05-16T03:13:13+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.10.1", + "version": "1.11.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5" + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", - "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, - "replace": { - "myclabs/deep-copy": "self.version" + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" }, "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, "files": [ "src/DeepCopy/deep_copy.php" - ] + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -881,13 +984,193 @@ "object", "object graph" ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + }, "funding": [ { "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", "type": "tidelift" } ], - "time": "2020-06-29T13:22:24+00:00" + "time": "2023-03-08T13:26:56+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v5.0.2", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" + }, + "time": "2024-03-05T20:51:40+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" }, { "name": "phpcompatibility/php-compatibility", @@ -945,32 +1228,36 @@ "phpcs", "standards" ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibility" + }, "time": "2019-12-27T09:44:58+00:00" }, { "name": "phpcompatibility/phpcompatibility-paragonie", - "version": "1.3.0", + "version": "1.3.3", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", - "reference": "b862bc32f7e860d0b164b199bd995e690b4b191c" + "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/b862bc32f7e860d0b164b199bd995e690b4b191c", - "reference": "b862bc32f7e860d0b164b199bd995e690b4b191c", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/293975b465e0e709b571cbf0c957c6c0a7b9a2ac", + "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac", "shasum": "" }, "require": { "phpcompatibility/php-compatibility": "^9.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", "paragonie/random_compat": "dev-master", "paragonie/sodium_compat": "dev-master" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, "type": "phpcodesniffer-standard", @@ -995,22 +1282,42 @@ "paragonie", "phpcs", "polyfill", - "standards" + "standards", + "static analysis" ], - "time": "2019-11-04T15:17:54+00:00" - }, - { - "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.0", - "source": { - "type": "git", + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" + }, + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-04-24T21:30:46+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-wp", + "version": "2.1.5", + "source": { + "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "41bef18ba688af638b7310666db28e1ea9158b2f" + "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/41bef18ba688af638b7310666db28e1ea9158b2f", - "reference": "41bef18ba688af638b7310666db28e1ea9158b2f", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/01c1ff2704a58e46f0cb1ca9d06aee07b3589082", + "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082", "shasum": "" }, "require": { @@ -1018,10 +1325,10 @@ "phpcompatibility/phpcompatibility-paragonie": "^1.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5" + "dealerdirect/phpcodesniffer-composer-installer": "^1.0" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, "type": "phpcodesniffer-standard", @@ -1045,255 +1352,314 @@ "compatibility", "phpcs", "standards", + "static analysis", "wordpress" ], - "time": "2019-08-28T14:22:28+00:00" + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityWP/security/policy", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" + }, + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-04-24T21:37:59+00:00" }, { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", + "name": "phpunit/php-code-coverage", + "version": "9.2.31", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", "extra": { "branch-alias": { - "dev-2.x": "2.x-dev" + "dev-master": "9.2-dev" } }, "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2020-06-27T09:03:43+00:00" + "time": "2024-03-02T06:37:42+00:00" }, { - "name": "phpdocumentor/reflection-docblock", - "version": "5.2.1", + "name": "phpunit/php-file-iterator", + "version": "3.0.6", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d870572532cd70bc3fab58f2e23ad423c8404c44" + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d870572532cd70bc3fab58f2e23ad423c8404c44", - "reference": "d870572532cd70bc3fab58f2e23ad423c8404c44", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", "shasum": "" }, "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" + "php": ">=7.3" }, "require-dev": { - "mockery/mockery": "~1.3.2" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, + "funding": [ { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2020-08-15T11:14:08+00:00" + "time": "2021-12-02T12:48:52+00:00" }, { - "name": "phpdocumentor/type-resolver", - "version": "1.3.0", + "name": "phpunit/php-invoker", + "version": "3.1.1", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "e878a14a65245fbe78f8080eba03b47c3b705651" + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e878a14a65245fbe78f8080eba03b47c3b705651", - "reference": "e878a14a65245fbe78f8080eba03b47c3b705651", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" + "php": ">=7.3" }, "require-dev": { - "ext-tokenizer": "*" + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-1.x": "1.x-dev" + "dev-master": "3.1-dev" } }, "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2020-06-27T10:12:23+00:00" + "time": "2020-09-28T05:58:55+00:00" }, { - "name": "phpspec/prophecy", - "version": "v1.10.3", + "name": "phpunit/php-text-template", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "451c3cd1418cf640de218914901e51b064abb093" + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", - "reference": "451c3cd1418cf640de218914901e51b064abb093", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" + "php": ">=7.3" }, "require-dev": { - "phpspec/phpspec": "^2.5 || ^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.10.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2020-03-05T15:02:03+00:00" + "time": "2020-10-26T05:33:50+00:00" }, { - "name": "phpunit/php-code-coverage", - "version": "4.0.8", + "name": "phpunit/php-timer", + "version": "5.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^5.6 || ^7.0", - "phpunit/php-file-iterator": "^1.3", - "phpunit/php-text-template": "^1.2", - "phpunit/php-token-stream": "^1.4.2 || ^2.0", - "sebastian/code-unit-reverse-lookup": "^1.0", - "sebastian/environment": "^1.3.2 || ^2.0", - "sebastian/version": "^1.0 || ^2.0" + "php": ">=7.3" }, "require-dev": { - "ext-xdebug": "^2.1.4", - "phpunit/phpunit": "^5.7" - }, - "suggest": { - "ext-xdebug": "^2.5.1" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -1308,43 +1674,87 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", "keywords": [ - "coverage", - "testing", - "xunit" + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2017-04-02T07:44:40+00:00" + "time": "2020-10-26T13:16:10+00:00" }, { - "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "name": "phpunit/phpunit", + "version": "9.6.19", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1a54a473501ef4cdeaae4e06891674114d79db8", + "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8", "shasum": "" }, "require": { - "php": ">=5.3.3" + "doctrine/instantiator": "^1.3.1 || ^2", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpunit/php-code-coverage": "^9.2.28", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.8", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.5", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^3.2", + "sebastian/version": "^3.0.2" + }, + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, + "bin": [ + "phpunit" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "9.6-dev" } }, "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], "classmap": [ "src/" ] @@ -1356,78 +1766,110 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", "keywords": [ - "filesystem", - "iterator" + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.19" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } ], - "time": "2017-11-27T13:52:08+00:00" + "time": "2024-04-05T04:35:58+00:00" }, { - "name": "phpunit/php-text-template", - "version": "1.2.1", + "name": "psr/container", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Psr\\Container\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", "keywords": [ - "template" + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" ], - "time": "2015-06-21T13:50:34+00:00" + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/master" + }, + "time": "2017-02-14T16:28:37+00:00" }, { - "name": "phpunit/php-timer", - "version": "1.0.9", + "name": "sebastian/cli-parser", + "version": "1.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -1447,42 +1889,48 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2024-03-02T06:27:43+00:00" }, { - "name": "phpunit/php-token-stream", - "version": "2.0.2", + "name": "sebastian/code-unit", + "version": "1.0.8", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "791198a2c6254db10131eecfe8c06670700904db" + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", - "reference": "791198a2c6254db10131eecfe8c06670700904db", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": "^7.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^6.2.4" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -1497,72 +1945,48 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "abandoned": true, - "time": "2017-11-27T05:48:46+00:00" + "time": "2020-10-26T13:08:54+00:00" }, { - "name": "phpunit/phpunit", - "version": "5.7.27", + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.6.2", - "phpunit/php-code-coverage": "^4.0.4", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "^1.2.4", - "sebastian/diff": "^1.4.3", - "sebastian/environment": "^1.3.4 || ^2.0", - "sebastian/exporter": "~2.0", - "sebastian/global-state": "^1.1", - "sebastian/object-enumerator": "~2.0", - "sebastian/resource-operations": "~1.0", - "sebastian/version": "^1.0.6|^2.0.1", - "symfony/yaml": "~2.1|~3.0|~4.0" - }, - "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2" + "php": ">=7.3" }, "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-xdebug": "*", - "phpunit/php-invoker": "~1.1" + "phpunit/phpunit": "^9.3" }, - "bin": [ - "phpunit" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "5.7.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1577,52 +2001,49 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2018-02-01T05:50:59+00:00" + "time": "2020-09-28T05:30:19+00:00" }, { - "name": "phpunit/phpunit-mock-objects", - "version": "3.4.4", + "name": "sebastian/comparator", + "version": "4.0.8", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.6 || ^7.0", - "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2 || ^2.0" - }, - "conflict": { - "phpunit/phpunit": "<5.4.0" + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^5.4" - }, - "suggest": { - "ext-soap": "*" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1637,92 +2058,65 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" } ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ - "mock", - "xunit" + "comparator", + "compare", + "equality" ], - "abandoned": true, - "time": "2017-06-30T09:13:00+00:00" - }, - { - "name": "psr/container", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ + "funding": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "time": "2017-02-14T16:28:37+00:00" + "time": "2022-09-14T12:41:17+00:00" }, { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", + "name": "sebastian/complexity", + "version": "2.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1737,101 +2131,49 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" - }, - { - "name": "sebastian/comparator", - "version": "1.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, + "funding": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2017-01-29T09:50:25+00:00" + "time": "2023-12-22T06:19:30+00:00" }, { "name": "sebastian/diff", - "version": "1.4.3", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1844,46 +2186,62 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" } ], "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "diff" + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2017-05-22T07:24:03+00:00" + "time": "2024-03-02T06:30:58+00:00" }, { "name": "sebastian/environment", - "version": "2.0.0", + "version": "5.1.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^5.0" + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -1908,34 +2266,44 @@ "environment", "hhvm" ], - "time": "2016-11-26T07:53:53+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:03:51+00:00" }, { "name": "sebastian/exporter", - "version": "2.0.0", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~2.0" + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1948,6 +2316,10 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" @@ -1956,46 +2328,55 @@ "name": "Volker Dusch", "email": "github@wallbash.com" }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, { "name": "Adam Harvey", "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", + "homepage": "https://www.github.com/sebastianbergmann/exporter", "keywords": [ "export", "exporter" ], - "time": "2016-11-19T08:54:04+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:33:00+00:00" }, { "name": "sebastian/global-state", - "version": "1.1.1", + "version": "5.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "ext-dom": "*", + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-uopz": "*" @@ -2003,7 +2384,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -2026,33 +2407,43 @@ "keywords": [ "global state" ], - "time": "2015-10-12T03:26:01+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:35:11+00:00" }, { - "name": "sebastian/object-enumerator", - "version": "2.0.1", + "name": "sebastian/lines-of-code", + "version": "1.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", "shasum": "" }, "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~2.0" + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "~5" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -2067,37 +2458,50 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-02-18T15:18:39+00:00" + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:20:34+00:00" }, { - "name": "sebastian/recursion-context", - "version": "2.0.0", + "name": "sebastian/object-enumerator", + "version": "4.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -2110,44 +2514,167 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" } ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-11-19T07:33:16+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "1.0.0", + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:07:39+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", "shasum": "" }, "require": { - "php": ">=5.6.0" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -2167,29 +2694,94 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" + "support": { + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-14T16:00:52+00:00" + }, + { + "name": "sebastian/type", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:13:03+00:00" }, { "name": "sebastian/version", - "version": "2.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + "reference": "c6c1022351a901512170118436c764e473f6de8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=7.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -2210,20 +2802,30 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.5.6", + "version": "3.9.2", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "e97627871a7eab2f70e59166072a6b767d5834e0" + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "aac1f6f347a5c5ac6bc98ad395007df00990f480" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/e97627871a7eab2f70e59166072a6b767d5834e0", - "reference": "e97627871a7eab2f70e59166072a6b767d5834e0", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/aac1f6f347a5c5ac6bc98ad395007df00990f480", + "reference": "aac1f6f347a5c5ac6bc98ad395007df00990f480", "shasum": "" }, "require": { @@ -2233,11 +2835,11 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "bin/phpcbf", + "bin/phpcs" ], "type": "library", "extra": { @@ -2252,40 +2854,71 @@ "authors": [ { "name": "Greg Sherwood", - "role": "lead" + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", "keywords": [ "phpcs", - "standards" + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" + }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } ], - "time": "2020-08-10T04:50:15+00:00" + "time": "2024-04-23T20:25:34+00:00" }, { "name": "symfony/console", - "version": "v5.1.3", + "version": "v5.4.39", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "2226c68009627934b8cfc01260b4d287eab070df" + "reference": "f3e591c48688a0cfa1a3296205926c05e84b22b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/2226c68009627934b8cfc01260b4d287eab070df", - "reference": "2226c68009627934b8cfc01260b4d287eab070df", + "url": "https://api.github.com/repos/symfony/console/zipball/f3e591c48688a0cfa1a3296205926c05e84b22b1", + "reference": "f3e591c48688a0cfa1a3296205926c05e84b22b1", "shasum": "" }, "require": { "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.15", - "symfony/service-contracts": "^1.1|^2", - "symfony/string": "^5.1" + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" }, "conflict": { + "psr/log": ">=3", "symfony/dependency-injection": "<4.4", "symfony/dotenv": "<5.1", "symfony/event-dispatcher": "<4.4", @@ -2293,16 +2926,16 @@ "symfony/process": "<4.4" }, "provide": { - "psr/log-implementation": "1.0" + "psr/log-implementation": "1.0|2.0" }, "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/event-dispatcher": "^4.4|^5.0", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^4.4|^5.0", - "symfony/var-dumper": "^4.4|^5.0" + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" }, "suggest": { "psr/log": "For using the console logger", @@ -2311,11 +2944,6 @@ "symfony/process": "" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Console\\": "" @@ -2338,8 +2966,17 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Console Component", + "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.4.39" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -2354,37 +2991,38 @@ "type": "tidelift" } ], - "time": "2020-07-06T13:23:11+00:00" + "time": "2024-04-18T08:26:06+00:00" }, { - "name": "symfony/finder", - "version": "v5.1.3", + "name": "symfony/deprecation-contracts", + "version": "v2.5.3", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "4298870062bfc667cb78d2b379be4bf5dec5f187" + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "80d075412b557d41002320b96a096ca65aa2c98d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/4298870062bfc667cb78d2b379be4bf5dec5f187", - "reference": "4298870062bfc667cb78d2b379be4bf5dec5f187", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d", + "reference": "80d075412b557d41002320b96a096ca65aa2c98d", "shasum": "" }, "require": { - "php": ">=7.2.5" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "function.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2393,16 +3031,19 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Finder Component", + "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.3" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -2417,44 +3058,34 @@ "type": "tidelift" } ], - "time": "2020-05-20T17:43:50+00:00" + "time": "2023-01-24T14:02:46+00:00" }, { - "name": "symfony/polyfill-ctype", - "version": "v1.18.1", + "name": "symfony/finder", + "version": "v5.4.39", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "1c302646f6efc070cd46856e600e5e0684d6b454" + "url": "https://github.com/symfony/finder.git", + "reference": "f6a96e4fcd468a25fede16ee665f50ced856bd0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454", - "reference": "1c302646f6efc070cd46856e600e5e0684d6b454", + "url": "https://api.github.com/repos/symfony/finder/zipball/f6a96e4fcd468a25fede16ee665f50ced856bd0a", + "reference": "f6a96e4fcd468a25fede16ee665f50ced856bd0a", "shasum": "" }, "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-ctype": "For best performance" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.18-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" + "Symfony\\Component\\Finder\\": "" }, - "files": [ - "bootstrap.php" + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2463,22 +3094,19 @@ ], "authors": [ { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for ctype functions", + "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], + "support": { + "source": "https://github.com/symfony/finder/tree/v5.4.39" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -2493,47 +3121,123 @@ "type": "tidelift" } ], - "time": "2020-07-14T12:35:20+00:00" + "time": "2024-04-18T08:26:06+00:00" }, { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.18.1", + "name": "symfony/polyfill-ctype", + "version": "v1.29.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "b740103edbdcc39602239ee8860f0f45a8eb9aa5" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b740103edbdcc39602239ee8860f0f45a8eb9aa5", - "reference": "b740103edbdcc39602239ee8860f0f45a8eb9aa5", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" }, "suggest": { - "ext-intl": "For best performance" + "ext-ctype": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.18-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - }, "files": [ "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2557,6 +3261,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -2571,45 +3278,42 @@ "type": "tidelift" } ], - "time": "2020-07-14T12:35:20+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.18.1", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e" + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e", - "reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "suggest": { "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.18-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -2638,6 +3342,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -2652,45 +3359,45 @@ "type": "tidelift" } ], - "time": "2020-07-14T12:35:20+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.18.1", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", - "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" }, "suggest": { "ext-mbstring": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.18-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2715,6 +3422,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -2729,42 +3439,39 @@ "type": "tidelift" } ], - "time": "2020-07-14T12:35:20+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.18.1", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fffa1a52a023e782cdcc221d781fe1ec8f87fcca" + "reference": "21bd091060673a1177ae842c0ef8fe30893114d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fffa1a52a023e782cdcc221d781fe1ec8f87fcca", - "reference": "fffa1a52a023e782cdcc221d781fe1ec8f87fcca", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/21bd091060673a1177ae842c0ef8fe30893114d2", + "reference": "21bd091060673a1177ae842c0ef8fe30893114d2", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.18-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -2791,6 +3498,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.29.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -2805,42 +3515,39 @@ "type": "tidelift" } ], - "time": "2020-07-14T12:35:20+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.18.1", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981" + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/d87d5766cbf48d72388a9f6b85f280c8ad51f981", - "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", "shasum": "" }, "require": { - "php": ">=7.0.8" + "php": ">=7.1" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.18-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -2871,6 +3578,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -2885,20 +3595,20 @@ "type": "tidelift" } ], - "time": "2020-07-14T12:35:20+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.1.3", + "version": "v2.2.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "58c7475e5457c5492c26cc740cc0ad7464be9442" + "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/58c7475e5457c5492c26cc740cc0ad7464be9442", - "reference": "58c7475e5457c5492c26cc740cc0ad7464be9442", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1", + "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1", "shasum": "" }, "require": { @@ -2911,7 +3621,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-master": "2.2-dev" }, "thanks": { "name": "symfony/contracts", @@ -2947,6 +3657,9 @@ "interoperability", "standards" ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/master" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -2961,20 +3674,20 @@ "type": "tidelift" } ], - "time": "2020-07-06T13:23:11+00:00" + "time": "2020-09-07T11:33:47+00:00" }, { "name": "symfony/string", - "version": "v5.1.3", + "version": "v5.4.39", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "f629ba9b611c76224feb21fe2bcbf0b6f992300b" + "reference": "495e71bae5862308051b9e63cc3e34078eed83ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/f629ba9b611c76224feb21fe2bcbf0b6f992300b", - "reference": "f629ba9b611c76224feb21fe2bcbf0b6f992300b", + "url": "https://api.github.com/repos/symfony/string/zipball/495e71bae5862308051b9e63cc3e34078eed83ef", + "reference": "495e71bae5862308051b9e63cc3e34078eed83ef", "shasum": "" }, "require": { @@ -2985,25 +3698,23 @@ "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php80": "~1.15" }, + "conflict": { + "symfony/translation-contracts": ">=3.0" + }, "require-dev": { - "symfony/error-handler": "^4.4|^5.0", - "symfony/http-client": "^4.4|^5.0", + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0" + "symfony/var-exporter": "^4.4|^5.0|^6.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { - "psr-4": { - "Symfony\\Component\\String\\": "" - }, "files": [ "Resources/functions.php" ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, "exclude-from-classmap": [ "/Tests/" ] @@ -3022,7 +3733,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony String component", + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", "homepage": "https://symfony.com", "keywords": [ "grapheme", @@ -3032,6 +3743,9 @@ "utf-8", "utf8" ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.4.39" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3046,175 +3760,455 @@ "type": "tidelift" } ], - "time": "2020-07-08T08:27:49+00:00" + "time": "2024-04-18T08:26:06+00:00" }, { - "name": "symfony/yaml", - "version": "v4.4.11", + "name": "theseer/tokenizer", + "version": "1.2.3", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "c2d2cc66e892322cfcc03f8f12f8340dbd7a3f8a" + "url": "https://github.com/theseer/tokenizer.git", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/c2d2cc66e892322cfcc03f8f12f8340dbd7a3f8a", - "reference": "c2d2cc66e892322cfcc03f8f12f8340dbd7a3f8a", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { - "php": ">=7.1.3", - "symfony/polyfill-ctype": "~1.8" + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" }, - "conflict": { - "symfony/console": "<3.4" + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:36:25+00:00" + }, + { + "name": "wp-coding-standards/wpcs", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", + "reference": "7da1894633f168fe244afc6de00d141f27517b62" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62", + "reference": "7da1894633f168fe244afc6de00d141f27517b62", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "squizlabs/php_codesniffer": "^3.3.1" }, "require-dev": { - "symfony/console": "^3.4|^4.0|^5.0" + "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6", + "phpcompatibility/php-compatibility": "^9.0", + "phpcsstandards/phpcsdevtools": "^1.0", + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "suggest": { - "symfony/console": "For validating YAML files using the lint command" + "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Contributors", + "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" } + ], + "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", + "keywords": [ + "phpcs", + "standards", + "wordpress" + ], + "support": { + "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues", + "source": "https://github.com/WordPress/WordPress-Coding-Standards", + "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" }, + "time": "2020-05-13T23:57:56+00:00" + }, + { + "name": "wp-launchpad/core", + "version": "v0.2.6", + "source": { + "type": "git", + "url": "https://github.com/wp-launchpad/core.git", + "reference": "563ee994bd5d058341368ecd053e7a3145791d26" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-launchpad/core/zipball/563ee994bd5d058341368ecd053e7a3145791d26", + "reference": "563ee994bd5d058341368ecd053e7a3145791d26", + "shasum": "" + }, + "require": { + "league/container": "^3.3", + "php": ">=7.1", + "wp-launchpad/dispatcher": "^1.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "phpcompatibility/phpcompatibility-wp": "^2.0", + "phpstan/phpstan": "^1.10", + "szepeviktor/phpstan-wordpress": "^1.3", + "wp-coding-standards/wpcs": "^3", + "wp-launchpad/cli": "^1.0.2", + "wp-launchpad/phpunit-wp-hooks": "^1.0", + "wp-media/phpunit": "^3.0" + }, + "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "LaunchpadCore\\": "inc/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "GPL-2.0-or-later" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "CrochetFeve0251" } ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, + "description": "Core from Launchpad", + "keywords": [ + "wordpress" + ], + "support": { + "issues": "https://github.com/wp-launchpad/core/issues", + "source": "https://github.com/wp-launchpad/core/tree/v0.2.6" + }, + "time": "2024-05-13T10:50:45+00:00" + }, + { + "name": "wp-launchpad/dispatcher", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/wp-launchpad/dispatcher.git", + "reference": "76d6b61c5324f2aa750a86b1acb692723a3b368f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-launchpad/dispatcher/zipball/76d6b61c5324f2aa750a86b1acb692723a3b368f", + "reference": "76d6b61c5324f2aa750a86b1acb692723a3b368f", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "wp-launchpad/cli": "^1.0.2", + "wp-launchpad/phpunit-wp-hooks": "^1.0", + "wp-media/phpunit": "^3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "LaunchpadDispatcher\\": "inc/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" + "name": "CrochetFeve0251" } ], - "time": "2020-05-20T08:37:50+00:00" + "description": "Dispatcher library for Launchpad framework", + "keywords": [ + "wordpress" + ], + "support": { + "issues": "https://github.com/wp-launchpad/dispatcher/issues", + "source": "https://github.com/wp-launchpad/dispatcher/tree/v1.0.0" + }, + "time": "2024-04-13T15:05:16+00:00" }, { - "name": "webmozart/assert", - "version": "1.9.1", + "name": "wp-launchpad/framework-options", + "version": "v0.1.2", "source": { "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" + "url": "https://github.com/wp-launchpad/framework-options.git", + "reference": "0941149bc7ba628a1c4fdf380eeef69969ed5ced" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", + "url": "https://api.github.com/repos/wp-launchpad/framework-options/zipball/0941149bc7ba628a1c4fdf380eeef69969ed5ced", + "reference": "0941149bc7ba628a1c4fdf380eeef69969ed5ced", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0 || ^8.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<3.9.1" + "php": ">=7.0", + "wp-launchpad/core": "^0.2.4", + "wp-launchpad/options": "^0.1" }, "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" + "wp-media/phpunit": "^3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "LaunchpadFrameworkOptions\\": "inc/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "description": "Options library for the framework Launchpad", + "support": { + "issues": "https://github.com/wp-launchpad/framework-options/issues", + "source": "https://github.com/wp-launchpad/framework-options/tree/v0.1.2" + }, + "time": "2024-05-09T13:30:49+00:00" + }, + { + "name": "wp-launchpad/options", + "version": "v0.1.2", + "source": { + "type": "git", + "url": "https://github.com/wp-launchpad/options.git", + "reference": "fd55e0a440e819a1bb77d9140491b1c5faf648f6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-launchpad/options/zipball/fd55e0a440e819a1bb77d9140491b1c5faf648f6", + "reference": "fd55e0a440e819a1bb77d9140491b1c5faf648f6", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "LaunchpadOptions\\": "inc/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "description": "Options library for Launchpad", + "support": { + "issues": "https://github.com/wp-launchpad/options/issues", + "source": "https://github.com/wp-launchpad/options/tree/v0.1.2" }, + "time": "2024-05-09T13:05:37+00:00" + }, + { + "name": "wp-media/phpunit", + "version": "v3.0.3", + "source": { + "type": "git", + "url": "https://github.com/wp-media/phpunit.git", + "reference": "29a596a83c4d3893f63ea6ae21301bee8be41251" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-media/phpunit/zipball/29a596a83c4d3893f63ea6ae21301bee8be41251", + "reference": "29a596a83c4d3893f63ea6ae21301bee8be41251", + "shasum": "" + }, + "require": { + "mikey179/vfsstream": "^1.6", + "php": "^7 || ^8", + "yoast/wp-test-utils": "^1.0.0" + }, + "bin": [ + "wpmedia-phpunit" + ], "type": "library", "autoload": { "psr-4": { - "Webmozart\\Assert\\": "src/" + "WPMedia\\PHPUnit\\": "." } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "GPL-2.0+" ], "authors": [ { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" + "name": "WP Media", + "email": "contact@wp-media.me", + "homepage": "https://wp-media.me" + } + ], + "description": "PHPUnit extender for bootstrapping unit and WordPress integration test suites.", + "homepage": "https://github.com/wp-media/phpunit", + "support": { + "issues": "https://github.com/wp-media/phpunit/issues", + "source": "https://github.com/wp-media/phpunit" + }, + "time": "2023-05-10T15:56:16+00:00" + }, + { + "name": "yoast/phpunit-polyfills", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/Yoast/PHPUnit-Polyfills.git", + "reference": "a0f7d708794a738f328d7b6c94380fd1d6c40446" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/a0f7d708794a738f328d7b6c94380fd1d6c40446", + "reference": "a0f7d708794a738f328d7b6c94380fd1d6c40446", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + }, + "require-dev": { + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "yoast/yoastcs": "^3.1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.x-dev" + } + }, + "autoload": { + "files": [ + "phpunitpolyfills-autoload.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Team Yoast", + "email": "support@yoast.com", + "homepage": "https://yoast.com" + }, + { + "name": "Contributors", + "homepage": "https://github.com/Yoast/PHPUnit-Polyfills/graphs/contributors" } ], - "description": "Assertions to validate method input/output with nice error messages.", + "description": "Set of polyfills for changed PHPUnit functionality to allow for creating PHPUnit cross-version compatible tests", + "homepage": "https://github.com/Yoast/PHPUnit-Polyfills", "keywords": [ - "assert", - "check", - "validate" + "phpunit", + "polyfill", + "testing" ], - "time": "2020-07-08T17:02:28+00:00" + "support": { + "issues": "https://github.com/Yoast/PHPUnit-Polyfills/issues", + "security": "https://github.com/Yoast/PHPUnit-Polyfills/security/policy", + "source": "https://github.com/Yoast/PHPUnit-Polyfills" + }, + "time": "2024-04-05T16:01:51+00:00" }, { - "name": "wp-coding-standards/wpcs", - "version": "2.3.0", + "name": "yoast/wp-test-utils", + "version": "1.2.0", "source": { "type": "git", - "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "7da1894633f168fe244afc6de00d141f27517b62" + "url": "https://github.com/Yoast/wp-test-utils.git", + "reference": "2e0f62e0281e4859707c5f13b7da1422aa1c8f7b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62", - "reference": "7da1894633f168fe244afc6de00d141f27517b62", + "url": "https://api.github.com/repos/Yoast/wp-test-utils/zipball/2e0f62e0281e4859707c5f13b7da1422aa1c8f7b", + "reference": "2e0f62e0281e4859707c5f13b7da1422aa1c8f7b", "shasum": "" }, "require": { - "php": ">=5.4", - "squizlabs/php_codesniffer": "^3.3.1" + "brain/monkey": "^2.6.1", + "php": ">=5.6", + "yoast/phpunit-polyfills": "^1.1.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6", - "phpcompatibility/php-compatibility": "^9.0", - "phpcsstandards/phpcsdevtools": "^1.0", - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "yoast/yoastcs": "^2.3.1" }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." + "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "1.x-dev", + "dev-main": "1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ], + "exclude-from-classmap": [ + "/src/WPIntegration/TestCase.php", + "/src/WPIntegration/TestCaseNoPolyfills.php" + ] }, - "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ + { + "name": "Team Yoast", + "email": "support@yoast.com", + "homepage": "https://yoast.com" + }, { "name": "Contributors", - "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" + "homepage": "https://github.com/Yoast/wp-test-utils/graphs/contributors" } ], - "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", + "description": "PHPUnit cross-version compatibility layer for testing plugins and themes build for WordPress", + "homepage": "https://github.com/Yoast/wp-test-utils/", "keywords": [ - "phpcs", - "standards", + "brainmonkey", + "integration-testing", + "phpunit", + "testing", + "unit-testing", "wordpress" ], - "time": "2020-05-13T23:57:56+00:00" + "support": { + "issues": "https://github.com/Yoast/wp-test-utils/issues", + "source": "https://github.com/Yoast/wp-test-utils" + }, + "time": "2023-09-27T10:25:08+00:00" } ], "aliases": [], @@ -3223,8 +4217,8 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=5.6" + "php": ">=7.4" }, "platform-dev": [], - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.2.0" } diff --git a/configs/parameters.php b/configs/parameters.php new file mode 100644 index 0000000..69b4235 --- /dev/null +++ b/configs/parameters.php @@ -0,0 +1,11 @@ + sanitize_key( 'Rocket Lazy Load' ), + 'plugin_basename' => ROCKET_LL_BASENAME, + 'template_path' => realpath( plugin_dir_path( __DIR__ ) ) . '/views/', + 'assets_baseurl' => plugin_dir_url( __DIR__ ) . 'assets/', + 'is_mu_plugin' => false, + 'translation_key' => 'rocket-lazy-load', + 'prefix' => 'RLL_' +]; \ No newline at end of file diff --git a/configs/providers.php b/configs/providers.php new file mode 100644 index 0000000..0a4f843 --- /dev/null +++ b/configs/providers.php @@ -0,0 +1,12 @@ +check() ) { - require ROCKET_LL_PATH . 'main.php'; + require __DIR__ . '/src/Dependencies/LaunchpadCore/boot.php'; + + boot( __FILE__ ); } + unset( $rocket_lazyload_requirement_checks ); diff --git a/src/Admin/AdminPage.php b/src/Admin/AdminPage.php index 79d3294..a89ae19 100644 --- a/src/Admin/AdminPage.php +++ b/src/Admin/AdminPage.php @@ -9,8 +9,8 @@ defined('ABSPATH') || die('Cheatin\' uh?'); -use RocketLazyLoadPlugin\Options\Options; -use RocketLazyLoadPlugin\Options\OptionArray; +use RocketLazyLoadPlugin\Dependencies\LaunchpadFrameworkOptions\Interfaces\OptionsAwareInterface; +use RocketLazyLoadPlugin\Dependencies\LaunchpadFrameworkOptions\Traits\OptionsAwareTrait; /** * Admin page configuration @@ -18,8 +18,10 @@ * @since 2.0 * @author Remy Perona */ -class AdminPage +class AdminPage implements OptionsAwareInterface { + use OptionsAwareTrait; + /** * Plugin slug * @@ -28,27 +30,7 @@ class AdminPage * * @var string */ - private $slug = 'rocket_lazyload'; - - /** - * Options instance - * - * @since 2.0 - * @author Remy Perona - * - * @var Options - */ - private $options; - - /** - * OptionArray instance - * - * @since 2.0 - * @author Remy Perona - * - * @var OptionArray - */ - private $option_array; + private string $slug = 'rocket_lazyload'; /** * Template path @@ -58,22 +40,20 @@ class AdminPage * * @var string */ - private $template_path; + private string $template_path; /** * Constructor * - * @since 2.0 + * @param string $template_path Template path. + * * @author Remy Perona * - * @param Options $options Options instance. - * @param OptionArray $option_array OptionArray instance. - * @param string $template_path Template path. + * @since 2.0 */ - public function __construct(Options $options, OptionArray $option_array, $template_path) + public function __construct( string $template_path) { - $this->options = $options; - $this->option_array = $option_array; + error_log(__METHOD__); $this->template_path = $template_path; } @@ -87,7 +67,7 @@ public function __construct(Options $options, OptionArray $option_array, $templa */ public function configure() { - register_setting($this->getSlug(), $this->options->getOptionName('_options')); + register_setting($this->getSlug(), $this->options->get('_options')); } /** diff --git a/src/Dependencies/League/Container/Argument/ArgumentResolverInterface.php b/src/Dependencies/League/Container/Argument/ArgumentResolverInterface.php index b449386..74041a8 100644 --- a/src/Dependencies/League/Container/Argument/ArgumentResolverInterface.php +++ b/src/Dependencies/League/Container/Argument/ArgumentResolverInterface.php @@ -1,26 +1,28 @@ -getValue(); - continue; + return array_map(function ($argument) { + $justStringValue = false; + + if ($argument instanceof RawArgumentInterface) { + return $argument->getValue(); + } elseif ($argument instanceof ClassNameInterface) { + $id = $argument->getClassName(); + } elseif (!is_string($argument)) { + return $argument; + } else { + $justStringValue = true; + $id = $argument; } - if (! is_string($arg)) { - continue; - } - - $container = $this->getContainer(); + $container = null; - if (is_null($container) && $this instanceof ReflectionContainer) { - $container = $this; + try { + $container = $this->getLeagueContainer(); + } catch (ContainerException $e) { + if ($this instanceof ReflectionContainer) { + $container = $this; + } } - if (! is_null($container) && $container->has($arg)) { - $arg = $container->get($arg); + if ($container !== null) { + try { + return $container->get($id); + } catch (NotFoundException $exception) { + if ($argument instanceof ClassNameWithOptionalValue) { + return $argument->getOptionalValue(); + } + + if ($justStringValue) { + return $id; + } - if ($arg instanceof RawArgumentInterface) { - $arg = $arg->getValue(); + throw $exception; } + } - continue; + if ($argument instanceof ClassNameWithOptionalValue) { + return $argument->getOptionalValue(); } - } - return $arguments; + // Just a string value. + return $id; + }, $arguments); } /** * {@inheritdoc} */ - public function reflectArguments(ReflectionFunctionAbstract $method, array $args = []) + public function reflectArguments(ReflectionFunctionAbstract $method, array $args = []) : array { $arguments = array_map(function (ReflectionParameter $param) use ($method, $args) { - $name = $param->getName(); - $class = $param->getClass(); + $name = $param->getName(); + $type = $param->getType(); if (array_key_exists($name, $args)) { - return $args[$name]; + return new RawArgument($args[$name]); } - if (! is_null($class)) { - return $class->getName(); + if ($type) { + if (PHP_VERSION_ID >= 70100) { + $typeName = $type->getName(); + } else { + $typeName = (string) $type; + } + + $typeName = ltrim($typeName, '?'); + + if ($param->isDefaultValueAvailable()) { + return new ClassNameWithOptionalValue($typeName, $param->getDefaultValue()); + } + + return new ClassName($typeName); } if ($param->isDefaultValueAvailable()) { - return $param->getDefaultValue(); + return new RawArgument($param->getDefaultValue()); } throw new NotFoundException(sprintf( @@ -76,7 +109,12 @@ public function reflectArguments(ReflectionFunctionAbstract $method, array $args } /** - * @return \RocketLazyLoadPlugin\Dependencies\League\Container\ContainerInterface + * @return ContainerInterface + */ + abstract public function getContainer() : ContainerInterface; + + /** + * @return Container */ - abstract public function getContainer(); + abstract public function getLeagueContainer() : Container; } diff --git a/src/Dependencies/League/Container/Argument/RawArgument.php b/src/Dependencies/League/Container/Argument/RawArgument.php index 128cf1b..f61fcbd 100644 --- a/src/Dependencies/League/Container/Argument/RawArgument.php +++ b/src/Dependencies/League/Container/Argument/RawArgument.php @@ -1,4 +1,4 @@ -providers = (is_null($providers)) - ? (new ServiceProviderAggregate)->setContainer($this) - : $providers->setContainer($this); - - $this->inflectors = (is_null($inflectors)) - ? (new InflectorAggregate)->setContainer($this) - : $inflectors->setContainer($this); - - $this->definitionFactory = (is_null($definitionFactory)) - ? (new DefinitionFactory)->setContainer($this) - : $definitionFactory->setContainer($this); - } - - /** - * {@inheritdoc} - */ - public function get($alias, array $args = []) - { - try { - return $this->getFromThisContainer($alias, $args); - } catch (NotFoundException $exception) { - if ($this->providers->provides($alias)) { - $this->providers->register($alias); + $this->definitions = $definitions ?? new DefinitionAggregate; + $this->providers = $providers ?? new ServiceProviderAggregate; + $this->inflectors = $inflectors ?? new InflectorAggregate; - return $this->getFromThisContainer($alias, $args); - } + if ($this->definitions instanceof ContainerAwareInterface) { + $this->definitions->setLeagueContainer($this); + } - $resolved = $this->getFromDelegate($alias, $args); + if ($this->providers instanceof ContainerAwareInterface) { + $this->providers->setLeagueContainer($this); + } - return $this->inflectors->inflect($resolved); + if ($this->inflectors instanceof ContainerAwareInterface) { + $this->inflectors->setLeagueContainer($this); } } /** - * {@inheritdoc} + * Add an item to the container. + * + * @param string $id + * @param mixed $concrete + * @param boolean $shared + * + * @return DefinitionInterface */ - public function has($alias) + public function add(string $id, $concrete = null, bool $shared = null) : DefinitionInterface { - if (array_key_exists($alias, $this->definitions) || $this->hasShared($alias)) { - return true; - } - - if ($this->providers->provides($alias)) { - return true; - } + $concrete = $concrete ?? $id; + $shared = $shared ?? $this->defaultToShared; - return $this->hasInDelegate($alias); + return $this->definitions->add($id, $concrete, $shared); } /** - * Returns a boolean to determine if the container has a shared instance of an alias. + * Proxy to add with shared as true. + * + * @param string $id + * @param mixed $concrete * - * @param string $alias - * @param boolean $resolved - * @return boolean + * @return DefinitionInterface */ - public function hasShared($alias, $resolved = false) + public function share(string $id, $concrete = null) : DefinitionInterface { - $shared = ($resolved === false) ? array_merge($this->shared, $this->sharedDefinitions) : $this->shared; - - return (array_key_exists($alias, $shared)); + return $this->add($id, $concrete, true); } /** - * {@inheritdoc} + * Whether the container should default to defining shared definitions. + * + * @param boolean $shared + * + * @return self */ - public function add($alias, $concrete = null, $share = false) + public function defaultToShared(bool $shared = true) : ContainerInterface { - unset($this->shared[$alias]); - unset($this->definitions[$alias]); - unset($this->sharedDefinitions[$alias]); - - if (is_null($concrete)) { - $concrete = $alias; - } - - $definition = $this->definitionFactory->getDefinition($alias, $concrete); + $this->defaultToShared = $shared; - if ($definition instanceof DefinitionInterface) { - if ($share === false) { - $this->definitions[$alias] = $definition; - } else { - $this->sharedDefinitions[$alias] = $definition; - } - - return $definition; - } - - // dealing with a value that cannot build a definition - $this->shared[$alias] = $concrete; + return $this; } /** - * {@inheritdoc} + * Get a definition to extend. + * + * @param string $id [description] + * + * @return DefinitionInterface */ - public function share($alias, $concrete = null) + public function extend(string $id) : DefinitionInterface { - return $this->add($alias, $concrete, true); + if ($this->providers->provides($id)) { + $this->providers->register($id); + } + + if ($this->definitions->has($id)) { + return $this->definitions->getDefinition($id); + } + + throw new NotFoundException( + sprintf('Unable to extend alias (%s) as it is not being managed as a definition', $id) + ); } /** - * {@inheritdoc} + * Add a service provider. + * + * @param ServiceProviderInterface|string $provider + * + * @return self */ - public function addServiceProvider($provider) + public function addServiceProvider($provider) : self { $this->providers->add($provider); @@ -176,69 +151,62 @@ public function addServiceProvider($provider) /** * {@inheritdoc} */ - public function extend($alias) + public function get($id, bool $new = false) { - if ($this->providers->provides($alias)) { - $this->providers->register($alias); + if ($this->definitions->has($id)) { + $resolved = $this->definitions->resolve($id, $new); + return $this->inflectors->inflect($resolved); } - if (array_key_exists($alias, $this->definitions)) { - return $this->definitions[$alias]; + if ($this->definitions->hasTag($id)) { + $arrayOf = $this->definitions->resolveTagged($id, $new); + + array_walk($arrayOf, function (&$resolved) { + $resolved = $this->inflectors->inflect($resolved); + }); + + return $arrayOf; } - if (array_key_exists($alias, $this->sharedDefinitions)) { - return $this->sharedDefinitions[$alias]; + if ($this->providers->provides($id)) { + $this->providers->register($id); + + if (!$this->definitions->has($id) && !$this->definitions->hasTag($id)) { + throw new ContainerException(sprintf('Service provider lied about providing (%s) service', $id)); + } + + return $this->get($id, $new); } - throw new NotFoundException( - sprintf('Unable to extend alias (%s) as it is not being managed as a definition', $alias) - ); - } + foreach ($this->delegates as $delegate) { + if ($delegate->has($id)) { + $resolved = $delegate->get($id); + return $this->inflectors->inflect($resolved); + } + } - /** - * {@inheritdoc} - */ - public function inflector($type, callable $callback = null) - { - return $this->inflectors->add($type, $callback); + throw new NotFoundException(sprintf('Alias (%s) is not being managed by the container or delegates', $id)); } /** * {@inheritdoc} */ - public function call(callable $callable, array $args = []) + public function has($id) { - return (new ReflectionContainer)->setContainer($this)->call($callable, $args); - } - - /** - * Delegate a backup container to be checked for services if it - * cannot be resolved via this container. - * - * @param \RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface $container - * @return $this - */ - public function delegate(InteropContainerInterface $container) - { - $this->delegates[] = $container; + if ($this->definitions->has($id)) { + return true; + } - if ($container instanceof ImmutableContainerAwareInterface) { - $container->setContainer($this); + if ($this->definitions->hasTag($id)) { + return true; } - return $this; - } + if ($this->providers->provides($id)) { + return true; + } - /** - * Returns true if service is registered in one of the delegated backup containers. - * - * @param string $alias - * @return boolean - */ - public function hasInDelegate($alias) - { - foreach ($this->delegates as $container) { - if ($container->has($alias)) { + foreach ($this->delegates as $delegate) { + if ($delegate->has($id)) { return true; } } @@ -247,59 +215,34 @@ public function hasInDelegate($alias) } /** - * Attempt to get a service from the stack of delegated backup containers. + * Allows for manipulation of specific types on resolution. + * + * @param string $type + * @param callable|null $callback * - * @param string $alias - * @param array $args - * @return mixed + * @return InflectorInterface */ - protected function getFromDelegate($alias, array $args = []) + public function inflector(string $type, callable $callback = null) : InflectorInterface { - foreach ($this->delegates as $container) { - if ($container->has($alias)) { - return $container->get($alias, $args); - } - - continue; - } - - throw new NotFoundException( - sprintf('Alias (%s) is not being managed by the container', $alias) - ); - + return $this->inflectors->add($type, $callback); } /** - * Get a service that has been registered in this container. + * Delegate a backup container to be checked for services if it + * cannot be resolved via this container. * - * @param string $alias - * @param array $args - * @return mixed + * @param ContainerInterface $container + * + * @return self */ - protected function getFromThisContainer($alias, array $args = []) + public function delegate(ContainerInterface $container) : self { - if ($this->hasShared($alias, true)) { - $shared = $this->inflectors->inflect($this->shared[$alias]); - if ($shared instanceof RawArgumentInterface) { - return $shared->getValue(); - } - return $shared; - } - - if (array_key_exists($alias, $this->sharedDefinitions)) { - $shared = $this->inflectors->inflect($this->sharedDefinitions[$alias]->build()); - $this->shared[$alias] = $shared; - return $shared; - } + $this->delegates[] = $container; - if (array_key_exists($alias, $this->definitions)) { - return $this->inflectors->inflect( - $this->definitions[$alias]->build($args) - ); + if ($container instanceof ContainerAwareInterface) { + $container->setLeagueContainer($this); } - throw new NotFoundException( - sprintf('Alias (%s) is not being managed by the container', $alias) - ); + return $this; } } diff --git a/src/Dependencies/League/Container/ContainerAwareInterface.php b/src/Dependencies/League/Container/ContainerAwareInterface.php index c165bc7..f261731 100644 --- a/src/Dependencies/League/Container/ContainerAwareInterface.php +++ b/src/Dependencies/League/Container/ContainerAwareInterface.php @@ -1,20 +1,40 @@ -container = $container; @@ -25,10 +34,43 @@ public function setContainer(ContainerInterface $container) /** * Get the container. * - * @return \RocketLazyLoadPlugin\Dependencies\League\Container\ContainerInterface + * @return ContainerInterface */ - public function getContainer() + public function getContainer() : ContainerInterface { - return $this->container; + if ($this->container instanceof ContainerInterface) { + return $this->container; + } + + throw new ContainerException('No container implementation has been set.'); + } + + /** + * Set a container. + * + * @param Container $container + * + * @return self + */ + public function setLeagueContainer(Container $container) : ContainerAwareInterface + { + $this->container = $container; + $this->leagueContainer = $container; + + return $this; + } + + /** + * Get the container. + * + * @return Container + */ + public function getLeagueContainer() : Container + { + if ($this->leagueContainer instanceof Container) { + return $this->leagueContainer; + } + + throw new ContainerException('No container implementation has been set.'); } } diff --git a/src/Dependencies/League/Container/ContainerInterface.php b/src/Dependencies/League/Container/ContainerInterface.php deleted file mode 100644 index e03a796..0000000 --- a/src/Dependencies/League/Container/ContainerInterface.php +++ /dev/null @@ -1,59 +0,0 @@ -alias = $alias; - $this->concrete = $concrete; - } - - /** - * {@inheritdoc} - */ - public function withArgument($arg) - { - $this->arguments[] = $arg; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function withArguments(array $args) - { - foreach ($args as $arg) { - $this->withArgument($arg); - } - - return $this; - } -} diff --git a/src/Dependencies/League/Container/Definition/CallableDefinition.php b/src/Dependencies/League/Container/Definition/CallableDefinition.php deleted file mode 100644 index eb2dfe5..0000000 --- a/src/Dependencies/League/Container/Definition/CallableDefinition.php +++ /dev/null @@ -1,23 +0,0 @@ -arguments : $args; - $resolved = $this->resolveArguments($args); - - if (is_array($this->concrete) && is_string($this->concrete[0])) { - $this->concrete[0] = ($this->getContainer()->has($this->concrete[0])) - ? $this->getContainer()->get($this->concrete[0]) - : $this->concrete[0]; - } - - return call_user_func_array($this->concrete, $resolved); - } -} diff --git a/src/Dependencies/League/Container/Definition/ClassDefinition.php b/src/Dependencies/League/Container/Definition/ClassDefinition.php deleted file mode 100644 index 2c7627e..0000000 --- a/src/Dependencies/League/Container/Definition/ClassDefinition.php +++ /dev/null @@ -1,67 +0,0 @@ -methods[] = [ - 'method' => $method, - 'arguments' => $args - ]; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function withMethodCalls(array $methods = []) - { - foreach ($methods as $method => $args) { - $this->withMethodCall($method, $args); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function build(array $args = []) - { - $args = (empty($args)) ? $this->arguments : $args; - $resolved = $this->resolveArguments($args); - $reflection = new ReflectionClass($this->concrete); - $instance = $reflection->newInstanceArgs($resolved); - - return $this->invokeMethods($instance); - } - - /** - * Invoke methods on resolved instance. - * - * @param object $instance - * @return object - */ - protected function invokeMethods($instance) - { - foreach ($this->methods as $method) { - $args = $this->resolveArguments($method['arguments']); - call_user_func_array([$instance, $method['method']], $args); - } - - return $instance; - } -} diff --git a/src/Dependencies/League/Container/Definition/ClassDefinitionInterface.php b/src/Dependencies/League/Container/Definition/ClassDefinitionInterface.php deleted file mode 100644 index e8a8c8d..0000000 --- a/src/Dependencies/League/Container/Definition/ClassDefinitionInterface.php +++ /dev/null @@ -1,23 +0,0 @@ -setContainer($this->getContainer()); - } - - if (is_string($concrete) && class_exists($concrete)) { - return (new ClassDefinition($alias, $concrete))->setContainer($this->getContainer()); - } - - // if the item is not definable we just return the value to be stored - // in the container as an arbitrary value/instance - return $concrete; - } -} diff --git a/src/Dependencies/League/Container/Definition/DefinitionFactoryInterface.php b/src/Dependencies/League/Container/Definition/DefinitionFactoryInterface.php deleted file mode 100644 index d11fa8f..0000000 --- a/src/Dependencies/League/Container/Definition/DefinitionFactoryInterface.php +++ /dev/null @@ -1,17 +0,0 @@ -container = $container; - - return $this; - } - - /** - * Get the container. - * - * @return \RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerInterface - */ - public function getContainer() - { - return $this->container; - } -} diff --git a/src/Dependencies/League/Container/ImmutableContainerInterface.php b/src/Dependencies/League/Container/ImmutableContainerInterface.php deleted file mode 100644 index 43d5610..0000000 --- a/src/Dependencies/League/Container/ImmutableContainerInterface.php +++ /dev/null @@ -1,10 +0,0 @@ -type = $type; + $this->callback = $callback; + } + + /** + * {@inheritdoc} + */ + public function getType() : string + { + return $this->type; + } + + /** + * {@inheritdoc} + */ + public function invokeMethod(string $name, array $args) : InflectorInterface { $this->methods[$name] = $args; @@ -36,12 +62,9 @@ public function invokeMethod($name, array $args) } /** - * Defines multiple methods to be invoked on the subject object. - * - * @param array $methods - * @return $this + * {@inheritdoc} */ - public function invokeMethods(array $methods) + public function invokeMethods(array $methods) : InflectorInterface { foreach ($methods as $name => $args) { $this->invokeMethod($name, $args); @@ -51,26 +74,19 @@ public function invokeMethods(array $methods) } /** - * Defines a property to be set on the subject object. - * - * @param string $property - * @param mixed $value - * @return $this + * {@inheritdoc} */ - public function setProperty($property, $value) + public function setProperty(string $property, $value) : InflectorInterface { - $this->properties[$property] = $value; + $this->properties[$property] = $this->resolveArguments([$value])[0]; return $this; } /** - * Defines multiple properties to be set on the subject object. - * - * @param array $properties - * @return $this + * {@inheritdoc} */ - public function setProperties(array $properties) + public function setProperties(array $properties) : InflectorInterface { foreach ($properties as $property => $value) { $this->setProperty($property, $value); @@ -80,24 +96,28 @@ public function setProperties(array $properties) } /** - * Apply inflections to an object. - * - * @param object $object - * @return void + * {@inheritdoc} */ public function inflect($object) { $properties = $this->resolveArguments(array_values($this->properties)); $properties = array_combine(array_keys($this->properties), $properties); - foreach ($properties as $property => $value) { + // array_combine() can technically return false + foreach ($properties ?: [] as $property => $value) { $object->{$property} = $value; } foreach ($this->methods as $method => $args) { $args = $this->resolveArguments($args); - call_user_func_array([$object, $method], $args); + /** @var callable $callable */ + $callable = [$object, $method]; + call_user_func_array($callable, $args); + } + + if ($this->callback !== null) { + call_user_func($this->callback, $object); } } } diff --git a/src/Dependencies/League/Container/Inflector/InflectorAggregate.php b/src/Dependencies/League/Container/Inflector/InflectorAggregate.php index e6d4cc1..8f99aab 100644 --- a/src/Dependencies/League/Container/Inflector/InflectorAggregate.php +++ b/src/Dependencies/League/Container/Inflector/InflectorAggregate.php @@ -1,31 +1,40 @@ -inflectors[$type] = $inflector; + $inflector = new Inflector($type, $callback); + $this->inflectors[] = $inflector; - return $inflector; - } + return $inflector; + } + + /** + * {@inheritdoc} + */ + public function getIterator() : Generator + { + $count = count($this->inflectors); - $this->inflectors[$type] = $callback; + for ($i = 0; $i < $count; $i++) { + yield $this->inflectors[$i]; + } } /** @@ -33,19 +42,15 @@ public function add($type, callable $callback = null) */ public function inflect($object) { - foreach ($this->inflectors as $type => $inflector) { - if (! $object instanceof $type) { - continue; - } + foreach ($this->getIterator() as $inflector) { + $type = $inflector->getType(); - if ($inflector instanceof Inflector) { - $inflector->setContainer($this->getContainer()); - $inflector->inflect($object); + if (! $object instanceof $type) { continue; } - // must be dealing with a callable as the inflector - call_user_func_array($inflector, [$object]); + $inflector->setLeagueContainer($this->getLeagueContainer()); + $inflector->inflect($object); } return $object; diff --git a/src/Dependencies/League/Container/Inflector/InflectorAggregateInterface.php b/src/Dependencies/League/Container/Inflector/InflectorAggregateInterface.php index 33247c6..13f15db 100644 --- a/src/Dependencies/League/Container/Inflector/InflectorAggregateInterface.php +++ b/src/Dependencies/League/Container/Inflector/InflectorAggregateInterface.php @@ -1,19 +1,21 @@ -has($alias)) { + if ($this->cacheResolutions === true && array_key_exists($id, $this->cache)) { + return $this->cache[$id]; + } + + if (! $this->has($id)) { throw new NotFoundException( - sprintf('Alias (%s) is not an existing class and therefore cannot be resolved', $alias) + sprintf('Alias (%s) is not an existing class and therefore cannot be resolved', $id) ); } - $reflector = new ReflectionClass($alias); + $reflector = new ReflectionClass($id); $construct = $reflector->getConstructor(); - if ($construct === null) { - return new $alias; + if ($construct && !$construct->isPublic()) { + throw new NotFoundException( + sprintf('Alias (%s) has a non-public constructor and therefore cannot be instantiated', $id) + ); } - return $reflector->newInstanceArgs( - $this->reflectArguments($construct, $args) - ); + $resolution = $construct === null + ? new $id + : $resolution = $reflector->newInstanceArgs($this->reflectArguments($construct, $args)) + ; + + if ($this->cacheResolutions === true) { + $this->cache[$id] = $resolution; + } + + return $resolution; } /** * {@inheritdoc} */ - public function has($alias) + public function has($id) { - return class_exists($alias); + return class_exists($id); } /** * Invoke a callable via the container. * - * @param callable $callable - * @param array $args + * @param callable $callable + * @param array $args + * * @return mixed + * + * @throws ReflectionException */ public function call(callable $callable, array $args = []) { @@ -80,8 +109,23 @@ public function call(callable $callable, array $args = []) return $reflection->invokeArgs($callable, $this->reflectArguments($reflection, $args)); } - $reflection = new ReflectionFunction($callable); + $reflection = new ReflectionFunction(\Closure::fromCallable($callable)); return $reflection->invokeArgs($this->reflectArguments($reflection, $args)); } + + /** + * Whether the container should default to caching resolutions and returning + * the cache on following calls. + * + * @param boolean $option + * + * @return self + */ + public function cacheResolutions(bool $option = true) : ContainerInterface + { + $this->cacheResolutions = $option; + + return $this; + } } diff --git a/src/Dependencies/League/Container/ServiceProvider/AbstractServiceProvider.php b/src/Dependencies/League/Container/ServiceProvider/AbstractServiceProvider.php index 2ed2866..7374fba 100644 --- a/src/Dependencies/League/Container/ServiceProvider/AbstractServiceProvider.php +++ b/src/Dependencies/League/Container/ServiceProvider/AbstractServiceProvider.php @@ -1,4 +1,4 @@ -provides)); - } + return in_array($alias, $this->provides, true); + } - return $this->provides; + /** + * {@inheritdoc} + */ + public function setIdentifier(string $id) : ServiceProviderInterface + { + $this->identifier = $id; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getIdentifier() : string + { + return $this->identifier ?? get_class($this); } } diff --git a/src/Dependencies/League/Container/ServiceProvider/AbstractSignatureServiceProvider.php b/src/Dependencies/League/Container/ServiceProvider/AbstractSignatureServiceProvider.php deleted file mode 100644 index 029c367..0000000 --- a/src/Dependencies/League/Container/ServiceProvider/AbstractSignatureServiceProvider.php +++ /dev/null @@ -1,31 +0,0 @@ -signature = $signature; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getSignature() - { - return (is_null($this->signature)) ? get_class($this) : $this->signature; - } -} diff --git a/src/Dependencies/League/Container/ServiceProvider/BootableServiceProviderInterface.php b/src/Dependencies/League/Container/ServiceProvider/BootableServiceProviderInterface.php index e730c6f..72f2876 100644 --- a/src/Dependencies/League/Container/ServiceProvider/BootableServiceProviderInterface.php +++ b/src/Dependencies/League/Container/ServiceProvider/BootableServiceProviderInterface.php @@ -1,4 +1,4 @@ -getContainer()->has($provider)) { + $provider = $this->getContainer()->get($provider); + } elseif (is_string($provider) && class_exists($provider)) { $provider = new $provider; } + if (in_array($provider, $this->providers, true)) { + return $this; + } + if ($provider instanceof ContainerAwareInterface) { - $provider->setContainer($this->getContainer()); + $provider->setLeagueContainer($this->getLeagueContainer()); } if ($provider instanceof BootableServiceProviderInterface) { @@ -37,14 +44,12 @@ public function add($provider) } if ($provider instanceof ServiceProviderInterface) { - foreach ($provider->provides() as $service) { - $this->providers[$service] = $provider; - } + $this->providers[] = $provider; return $this; } - throw new \InvalidArgumentException( + throw new ContainerException( 'A service provider must be a fully qualified class name or instance ' . 'of (\RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\ServiceProviderInterface)' ); @@ -53,36 +58,49 @@ public function add($provider) /** * {@inheritdoc} */ - public function provides($service) + public function provides(string $service) : bool { - return array_key_exists($service, $this->providers); + foreach ($this->getIterator() as $provider) { + if ($provider->provides($service)) { + return true; + } + } + + return false; } /** * {@inheritdoc} */ - public function register($service) + public function getIterator() : Generator { - if (! array_key_exists($service, $this->providers)) { - throw new \InvalidArgumentException( - sprintf('(%s) is not provided by a service provider', $service) - ); - } + $count = count($this->providers); - $provider = $this->providers[$service]; - $signature = get_class($provider); - - if ($provider instanceof SignatureServiceProviderInterface) { - $signature = $provider->getSignature(); + for ($i = 0; $i < $count; $i++) { + yield $this->providers[$i]; } + } - // ensure that the provider hasn't already been invoked by any other service request - if (in_array($signature, $this->registered)) { - return; + /** + * {@inheritdoc} + */ + public function register(string $service) + { + if (false === $this->provides($service)) { + throw new ContainerException( + sprintf('(%s) is not provided by a service provider', $service) + ); } - $provider->register(); + foreach ($this->getIterator() as $provider) { + if (in_array($provider->getIdentifier(), $this->registered, true)) { + continue; + } - $this->registered[] = $signature; + if ($provider->provides($service)) { + $this->registered[] = $provider->getIdentifier(); + $provider->register(); + } + } } } diff --git a/src/Dependencies/League/Container/ServiceProvider/ServiceProviderAggregateInterface.php b/src/Dependencies/League/Container/ServiceProvider/ServiceProviderAggregateInterface.php index 0165d69..d765286 100644 --- a/src/Dependencies/League/Container/ServiceProvider/ServiceProviderAggregateInterface.php +++ b/src/Dependencies/League/Container/ServiceProvider/ServiceProviderAggregateInterface.php @@ -1,32 +1,36 @@ -container property or the `getContainer` method + * protected $this->leagueContainer property or the `getLeagueContainer` method * from the ContainerAwareTrait. * * @return void */ public function register(); + + /** + * Set a custom id for the service provider. This enables + * registering the same service provider multiple times. + * + * @param string $id + * + * @return self + */ + public function setIdentifier(string $id) : ServiceProviderInterface; + + /** + * The id of the service provider uniquely identifies it, so + * that we can quickly determine if it has already been registered. + * Defaults to get_class($provider). + * + * @return string + */ + public function getIdentifier() : string; } diff --git a/src/Dependencies/League/Container/ServiceProvider/SignatureServiceProviderInterface.php b/src/Dependencies/League/Container/ServiceProvider/SignatureServiceProviderInterface.php deleted file mode 100644 index 273b0ad..0000000 --- a/src/Dependencies/League/Container/ServiceProvider/SignatureServiceProviderInterface.php +++ /dev/null @@ -1,24 +0,0 @@ -getLazyloadScript( $args ); + echo $this->getLazyloadScript( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** @@ -31,7 +33,6 @@ public function insertLazyloadScript( $args = [] ) { public function getInlineLazyloadScript( $args = [] ) { $defaults = [ 'elements' => [ - 'img', 'iframe', ], 'threshold' => 300, @@ -42,13 +43,24 @@ public function getInlineLazyloadScript( $args = [] ) { 'container' => 1, 'thresholds' => 1, 'data_bg' => 1, + 'data_bg_hidpi' => 1, + 'data_bg_multi' => 1, + 'data_bg_multi_hidpi' => 1, + 'data_poster' => 1, + 'class_applied' => 1, 'class_error' => 1, + 'class_entered' => 1, + 'class_exited' => 1, 'cancel_on_exit' => 1, + 'unobserve_entered' => 1, 'unobserve_completed' => 1, 'callback_enter' => 1, 'callback_exit' => 1, 'callback_loading' => 1, + 'callback_cancel' => 1, + 'callback_loaded' => 1, 'callback_error' => 1, + 'callback_applied' => 1, 'callback_finish' => 1, 'use_native' => 1, ]; @@ -57,8 +69,13 @@ public function getInlineLazyloadScript( $args = [] ) { $script = ''; $args['options'] = array_intersect_key( $args['options'], $allowed_options ); + $script .= 'window.lazyLoadOptions = '; + + if ( isset( $args['elements']['background_image'] ) ) { + $script .= '['; + } - $script .= 'window.lazyLoadOptions = { + $script .= '{ elements_selector: "' . esc_attr( implode( ',', $args['elements'] ) ) . '", data_src: "lazy-src", data_srcset: "lazy-srcset", @@ -88,7 +105,19 @@ class_loaded: "lazyloaded", $script = rtrim( $script, ',' ); } - $script .= '};'; + if ( isset( $args['elements']['background_image'] ) ) { + $script .= '},{ + elements_selector: "' . esc_attr( $args['elements']['background_image'] ) . '", + data_src: "lazy-src", + data_srcset: "lazy-srcset", + data_sizes: "lazy-sizes", + class_loading: "lazyloading", + class_loaded: "lazyloaded", + threshold: ' . esc_attr( $args['threshold'] ) . ', + }];'; + } else { + $script .= '};'; + } $script .= ' window.addEventListener(\'LazyLoad::Initialized\', function (e) { @@ -101,13 +130,13 @@ class_loaded: "lazyloaded", var rocketlazy_count = 0; mutations.forEach(function(mutation) { - for (i = 0; i < mutation.addedNodes.length; i++) { + for (var i = 0; i < mutation.addedNodes.length; i++) { if (typeof mutation.addedNodes[i].getElementsByTagName !== \'function\') { - return; + continue; } - if (typeof mutation.addedNodes[i].getElementsByClassName !== \'function\') { - return; + if (typeof mutation.addedNodes[i].getElementsByClassName !== \'function\') { + continue; } images = mutation.addedNodes[i].getElementsByTagName(\'img\'); @@ -155,16 +184,10 @@ public function getLazyloadScript( $args = [] ) { $defaults = [ 'base_url' => '', 'version' => '', - 'polyfill' => false, ]; - $args = wp_parse_args( $args, $defaults ); - $min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; - $script = ''; - - if ( isset( $args['polyfill'] ) && $args['polyfill'] ) { - $script .= ''; - } + $args = wp_parse_args( $args, $defaults ); + $min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; /** * Filters the script tag for the lazyload script @@ -173,9 +196,7 @@ public function getLazyloadScript( $args = [] ) { * * @param $script_tag HTML tag for the lazyload script. */ - $script .= apply_filters( 'rocket_lazyload_script_tag', '' ); - - return $script; + return apply_filters( 'rocket_lazyload_script_tag', '' ); // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript } /** @@ -185,7 +206,7 @@ public function getLazyloadScript( $args = [] ) { * @return void */ public function insertYoutubeThumbnailScript( $args = [] ) { - echo $this->getYoutubeThumbnailScript( $args ); + echo $this->getYoutubeThumbnailScript( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** @@ -198,6 +219,8 @@ public function getYoutubeThumbnailScript( $args = [] ) { $defaults = [ 'resolution' => 'hqdefault', 'lazy_image' => false, + 'native' => true, + 'extension' => 'jpg', ]; $allowed_resolutions = [ @@ -228,13 +251,23 @@ public function getYoutubeThumbnailScript( $args = [] ) { $args = wp_parse_args( $args, $defaults ); - $image = ''; + $extension_uri = 'webp' === $args['extension'] ? 'vi_webp' : 'vi'; + + $image_url = 'https://i.ytimg.com/' . $extension_uri . '/ID/' . $args['resolution'] . '.' . $args['extension']; + + $image = ''; if ( isset( $args['lazy_image'] ) && $args['lazy_image'] ) { - $image = ''; + $attributes = 'alt="" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '"'; + + $image = ''; + + if ( $args['native'] ) { + $image = ''; + } } - return ""; + return ""; } /** @@ -244,7 +277,7 @@ public function getYoutubeThumbnailScript( $args = [] ) { * @return void */ public function insertYoutubeThumbnailCSS( $args = [] ) { - wp_register_style( 'rocket-lazyload', false ); + wp_register_style( 'rocket-lazyload', false ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion wp_enqueue_style( 'rocket-lazyload' ); wp_add_inline_style( 'rocket-lazyload', $this->getYoutubeThumbnailCSS( $args ) ); } @@ -263,10 +296,10 @@ public function getYoutubeThumbnailCSS( $args = [] ) { $args = wp_parse_args( $args, $defaults ); - $css = '.rll-youtube-player{position:relative;padding-bottom:56.23%;height:0;overflow:hidden;max-width:100%;}.rll-youtube-player iframe{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;background:0 0}.rll-youtube-player img{bottom:0;display:block;left:0;margin:auto;max-width:100%;width:100%;position:absolute;right:0;top:0;border:none;height:auto;cursor:pointer;-webkit-transition:.4s all;-moz-transition:.4s all;transition:.4s all}.rll-youtube-player img:hover{-webkit-filter:brightness(75%)}.rll-youtube-player .play{height:72px;width:72px;left:50%;top:50%;margin-left:-36px;margin-top:-36px;position:absolute;background:url(' . $args['base_url'] . 'img/youtube.png) no-repeat;cursor:pointer}'; + $css = '.rll-youtube-player{position:relative;padding-bottom:56.23%;height:0;overflow:hidden;max-width:100%;}.rll-youtube-player:focus-within{outline: 2px solid currentColor;outline-offset: 5px;}.rll-youtube-player iframe{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;background:0 0}.rll-youtube-player img{bottom:0;display:block;left:0;margin:auto;max-width:100%;width:100%;position:absolute;right:0;top:0;border:none;height:auto;-webkit-transition:.4s all;-moz-transition:.4s all;transition:.4s all}.rll-youtube-player img:hover{-webkit-filter:brightness(75%)}.rll-youtube-player .play{height:100%;width:100%;left:0;top:0;position:absolute;background:url(' . $args['base_url'] . 'img/youtube.png) no-repeat center;background-color: transparent !important;cursor:pointer;border:none;}'; if ( $args['responsive_embeds'] ) { - $css .= '.wp-has-aspect-ratio .rll-youtube-player{position:absolute;padding-bottom:0;width:100%;height:100%;top:0;bottom:0;left:0;right:0}'; + $css .= '.wp-embed-responsive .wp-has-aspect-ratio .rll-youtube-player{position:absolute;padding-bottom:0;width:100%;height:100%;top:0;bottom:0;left:0;right:0}'; } return $css; @@ -276,7 +309,7 @@ public function getYoutubeThumbnailCSS( $args = [] ) { * Inserts the CSS needed when Javascript is not enabled to keep the display correct */ public function insertNoJSCSS() { - echo $this->getNoJSCSS(); + echo $this->getNoJSCSS(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** diff --git a/src/Dependencies/RocketLazyload/Iframe.php b/src/Dependencies/RocketLazyload/Iframe.php index a4fc295..a4b369a 100644 --- a/src/Dependencies/RocketLazyload/Iframe.php +++ b/src/Dependencies/RocketLazyload/Iframe.php @@ -2,7 +2,7 @@ /** * Handles lazyloading of iframes * - * @package RocketLazyload + * @package RocketLazyLoadPlugin\Dependencies\RocketLazyload */ namespace RocketLazyLoadPlugin\Dependencies\RocketLazyload; @@ -106,6 +106,7 @@ private function getExcludedPatterns() { 'loading="eager"', 'data-skip-lazy', 'skip-lazy', + 'google_ads_iframe_', ] ); } @@ -163,6 +164,10 @@ private function replaceYoutubeThumbnail( $iframe ) { $youtube_url = $this->changeYoutubeUrlForYoutuDotBe( $iframe['src'] ); $youtube_url = $this->cleanYoutubeUrl( $iframe['src'] ); + + preg_match( '@\s*title\s*=\s*(\'|")(?.*)\1@iUs', $iframe['atts'], $atts ); + + $title = $atts['title'] ?? ''; /** * Filter the LazyLoad HTML output on Youtube iframes * @@ -170,7 +175,7 @@ private function replaceYoutubeThumbnail( $iframe ) { * * @param array $html Output that will be printed. */ - $youtube_lazyload = apply_filters( 'rocket_lazyload_youtube_html', '<div class="rll-youtube-player" data-src="' . esc_attr( $youtube_url ) . '" data-id="' . esc_attr( $youtube_id ) . '" data-query="' . esc_attr( $query ) . '"></div>' ); + $youtube_lazyload = apply_filters( 'rocket_lazyload_youtube_html', '<div class="rll-youtube-player" data-src="' . esc_attr( $youtube_url ) . '" data-id="' . esc_attr( $youtube_id ) . '" data-query="' . esc_attr( $query ) . '" data-alt="' . esc_attr( $title ) . '"></div>' ); $youtube_lazyload .= '<noscript>' . $iframe[0] . '</noscript>'; return $youtube_lazyload; diff --git a/src/Dependencies/RocketLazyload/Image.php b/src/Dependencies/RocketLazyload/Image.php index bf09538..e86a80c 100644 --- a/src/Dependencies/RocketLazyload/Image.php +++ b/src/Dependencies/RocketLazyload/Image.php @@ -1,8 +1,10 @@ <?php +declare(strict_types=1); + /** * Handles lazyloading of images * - * @package RocketLazyload + * @package RocketLazyLoadPlugin\Dependencies\RocketLazyload */ namespace RocketLazyLoadPlugin\Dependencies\RocketLazyload; @@ -17,12 +19,11 @@ class Image { * * @param string $html Original HTML. * @param string $buffer Content to parse. + * @param bool $use_native Use native lazyload. * @return string */ - public function lazyloadImages( $html, $buffer ) { - $clean_buffer = preg_replace( '/<script\b(?:[^>]*)>(?:.+)?<\/script>/Umsi', '', $html ); - $clean_buffer = preg_replace( '#<noscript>(?:.+)</noscript>#Umsi', '', $clean_buffer ); - if (! preg_match_all('#<img(?<atts>\s.+)\s?/?>#iUs', $clean_buffer, $images, PREG_SET_ORDER)) { + public function lazyloadImages( $html, $buffer, $use_native = true ) { + if ( ! preg_match_all( '#<img(?<atts>\s.+)\s?/?>#iUs', $buffer, $images, PREG_SET_ORDER ) ) { return $html; } @@ -35,9 +36,13 @@ public function lazyloadImages( $html, $buffer ) { continue; } - $image_lazyload = $this->replaceImage( $image ); - $image_lazyload .= $this->noscript( $image[0] ); - $html = str_replace( $image[0], $image_lazyload, $html ); + $image_lazyload = $this->replaceImage( $image, $use_native ); + + if ( ! $use_native ) { + $image_lazyload .= $this->noscript( $image[0] ); + } + + $html = str_replace( $image[0], $image_lazyload, $html ); unset( $image_lazyload ); } @@ -62,17 +67,34 @@ public function lazyloadBackgroundImages( $html, $buffer ) { continue; } - if ( ! preg_match( '#background-image\s*:\s*(?<attr>\s*url\s*\((?<url>[^)]+)\))\s*;?#is', $element['styles'], $url ) ) { + /** + * Regex to detect bg images inside CSS. + * + * @param string $regex regex to detect. + * @return string + */ + $regex = apply_filters( 'rocket_lazyload_bg_images_regex', 'background-image\s*:\s*(?<attr>\s*url\s*\((?<url>[^)]+)\))\s*;?' ); + + if ( @preg_match( "#$regex#is", '' ) === false ) {// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + $regex = 'background-image\s*:\s*(?<attr>\s*url\s*\((?<url>[^)]+)\))\s*;?'; + } + + if ( ! preg_match( "#$regex#is", $element['styles'], $url ) ) { continue; } + if ( preg_match( '#data:image#is', $url['url'], $img ) ) { + continue; + } $url['url'] = esc_url( trim( - strip_tags( + wp_strip_all_tags( html_entity_decode( - $url['url'], ENT_QUOTES|ENT_HTML5 + $url['url'], + ENT_QUOTES | ENT_HTML5 ) - ), '\'" ' + ), + '\'" ' ) ); @@ -99,7 +121,7 @@ public function lazyloadBackgroundImages( $html, $buffer ) { */ private function addLazyClass( $element ) { $class = $this->getClasses( $element ); - if ( empty( $class ) ) { + if ( empty( $class ) ) { return preg_replace( '#<(img|div|figure|section|li|span|a)([^>]*)>#is', '<\1 class="rocket-lazyload"\2>', $element ); } @@ -132,7 +154,7 @@ private function addLazyClass( $element ) { */ private function getAttributeQuotes( $attribute_value ) { $attribute_value = trim( $attribute_value ); - $first_char = $attribute_value[0]; + $first_char = $attribute_value[0]; if ( '"' === $first_char || "'" === $first_char ) { return $first_char; @@ -230,7 +252,7 @@ private function stringToArray( $string, $delimiter = ' ' ) { } $array = explode( $delimiter, $string ); - $array = array_map('trim', $array ); + $array = array_map( 'trim', $array ); // Remove empties. return array_filter( $array ); @@ -253,25 +275,40 @@ public function lazyloadPictures( $html, $buffer ) { foreach ( $pictures as $picture ) { if ( $this->isExcluded( $picture[0], $excluded ) ) { + if ( ! preg_match( '#<img(?<atts>\s.+)\s?/?>#iUs', $picture[0], $img ) ) { + continue; + } + + $img = $this->canLazyload( $img ); + + if ( ! $img ) { + continue; + } + + $nolazy_picture = str_replace( '<img', '<img data-no-lazy=""', $picture[0] ); + $html = str_replace( $picture[0], $nolazy_picture, $html ); + continue; } if ( preg_match_all( '#<source(?<atts>\s.+)>#iUs', $picture['sources'], $sources, PREG_SET_ORDER ) ) { - $sources = array_unique( $sources, SORT_REGULAR ); - $lazy_sources = 0; + $sources = array_unique( $sources, SORT_REGULAR ); + $lazy_picture = $picture[0]; foreach ( $sources as $source ) { $lazyload_srcset = preg_replace( '/([\s"\'])srcset/i', '\1data-lazy-srcset', $source[0] ); - $html = str_replace( $source[0], $lazyload_srcset, $html ); + $lazy_picture = str_replace( $source[0], $lazyload_srcset, $lazy_picture ); unset( $lazyload_srcset ); $lazy_sources++; } - } - if ( 0 === $lazy_sources ) { - continue; + if ( 0 === $lazy_sources ) { + continue; + } + + $html = str_replace( $picture[0], $lazy_picture, $html ); } if ( ! preg_match( '#<img(?<atts>\s.+)\s?/?>#iUs', $picture[0], $img ) ) { @@ -284,10 +321,10 @@ public function lazyloadPictures( $html, $buffer ) { continue; } - $img_lazy = $this->replaceImage( $img ); + $img_lazy = $this->replaceImage( $img, false ); $img_lazy .= $this->noscript( $img[0] ); - $safe_img = str_replace('/', '\/', preg_quote( $img[0], '#' )); - $html = preg_replace( '#<noscript[^>]*>.*' . $safe_img . '.*<\/noscript>(*SKIP)(*FAIL)|' . $safe_img . '#iU', $img_lazy, $html ); + $safe_img = str_replace( '/', '\/', preg_quote( $img[0], '#' ) ); + $html = preg_replace( '#<noscript[^>]*>.*' . $safe_img . '.*<\/noscript>(*SKIP)(*FAIL)|' . $safe_img . '#i', $img_lazy, $html ); unset( $img_lazy ); } @@ -321,13 +358,6 @@ private function canLazyload( $image ) { return false; } - // Don't apply LazyLoad on images from WP Retina x2. - if ( function_exists( 'wr2x_picture_rewrite' ) ) { - if ( wr2x_get_retina( trailingslashit( ABSPATH ) . wr2x_get_pathinfo_from_image_src( trim( $image['src'], '"' ) ) ) ) { - return false; - } - } - return $image; } @@ -340,7 +370,7 @@ private function canLazyload( $image ) { */ public function isExcluded( $string, $excluded_values ) { if ( ! is_array( $excluded_values ) ) { - (array) $excluded_values; + $excluded_values = (array) $excluded_values; } if ( empty( $excluded_values ) ) { @@ -366,7 +396,6 @@ public function getExcludedAttributes() { * Filters the attributes used to prevent lazylad from being applied * * @since 1.0 - * @author Remy Perona * * @param array $excluded_attributes An array of excluded attributes. */ @@ -394,6 +423,7 @@ public function getExcludedAttributes() { 'avia-bg-style-fixed', 'data-skip-lazy', 'skip-lazy', + 'image-compare__', ] ); } @@ -408,7 +438,6 @@ public function getExcludedSrc() { * Filters the src used to prevent lazylad from being applied * * @since 1.0 - * @author Remy Perona * * @param array $excluded_src An array of excluded src. */ @@ -426,26 +455,43 @@ public function getExcludedSrc() { * Replaces the original image by the lazyload one * * @param array $image Array of matches elements. + * @param bool $use_native Use native lazyload. + * * @return string */ - private function replaceImage( $image ) { - $width = 0; - $height = 0; - - if ( preg_match( '@[\s"\']width\s*=\s*(\'|")(?<width>.*)\1@iUs', $image['atts'], $atts ) ) { - $width = absint( $atts['width'] ); - } - - if ( preg_match( '@[\s"\']height\s*=\s*(\'|")(?<height>.*)\1@iUs', $image['atts'], $atts ) ) { - $height = absint( $atts['height'] ); + private function replaceImage( $image, $use_native = true ) { + if ( empty( $image ) ) { + return ''; } - $placeholder_atts = preg_replace( '@\ssrc\s*=\s*(\'|")(?<src>.*)\1@iUs', ' src="' . $this->getPlaceholder( $width, $height ) . '"', $image['atts'] ); + $native_pattern = '@\sloading\s*=\s*(\'|")(?:lazy|auto)\1@i'; + $image_lazyload = $image[0]; - $image_lazyload = str_replace( $image['atts'], $placeholder_atts . ' data-lazy-src="' . $image['src'] . '"', $image[0] ); + if ( $use_native ) { + if ( preg_match( $native_pattern, $image[0] ) ) { + return $image[0]; + } - if ( ! preg_match( '@\sloading\s*=\s*(\'|")(?:lazy|auto)\1@i', $image_lazyload ) && apply_filters( 'rocket_use_native_lazyload', false ) ) { $image_lazyload = str_replace( '<img', '<img loading="lazy"', $image_lazyload ); + } else { + $width = 0; + $height = 0; + + if ( preg_match( '@[\s"\']width\s*=\s*(\'|")(?<width>.*)\1@iUs', $image['atts'], $atts ) ) { + $width = absint( $atts['width'] ); + } + + if ( preg_match( '@[\s"\']height\s*=\s*(\'|")(?<height>.*)\1@iUs', $image['atts'], $atts ) ) { + $height = absint( $atts['height'] ); + } + + $placeholder_atts = preg_replace( '@\ssrc\s*=\s*(\'|")(?<src>.*)\1@iUs', ' src="' . $this->getPlaceholder( $width, $height ) . '"', $image['atts'] ); + + $image_lazyload = str_replace( $image['atts'], $placeholder_atts . ' data-lazy-src="' . $image['src'] . '"', $image_lazyload ); + + if ( preg_match( $native_pattern, $image_lazyload ) ) { + $image_lazyload = preg_replace( $native_pattern, '', $image_lazyload ); + } } /** @@ -492,6 +538,10 @@ public function lazyloadResponsiveAttributes( $html ) { public function convertSmilies( $text ) { global $wp_smiliessearch; + if ( empty( $text ) || ! is_string( $text ) ) { + return $text; + } + if ( ! get_option( 'use_smilies' ) || empty( $wp_smiliessearch ) ) { return $text; } @@ -563,7 +613,7 @@ private function translateSmiley( $matches ) { * @param string $img Filename for the smiley image. * @param string $site_url Site URL, as returned by site_url(). */ - $src_url = apply_filters( 'smilies_src', includes_url( "images/smilies/$img" ), $img, site_url() ); + $src_url = apply_filters( 'smilies_src', includes_url( "images/smilies/$img" ), $img, site_url() ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound // Don't LazyLoad if process is stopped for these reasons. if ( is_feed() || is_preview() ) { @@ -577,7 +627,6 @@ private function translateSmiley( $matches ) { * Returns the placeholder for the src attribute * * @since 1.2 - * @author Remy Perona * * @param int $width Width of the placeholder image. Default 0. * @param int $height Height of the placeholder image. Default 0. diff --git a/src/EventManagement/EventManager.php b/src/EventManagement/EventManager.php deleted file mode 100644 index 3b696bd..0000000 --- a/src/EventManagement/EventManager.php +++ /dev/null @@ -1,145 +0,0 @@ -<?php -/** - * Event Manager to interact with the WP plugin API - * - * @package RocketLazyload - */ - -namespace RocketLazyLoadPlugin\EventManagement; - -defined('ABSPATH') || die('Cheatin\' uh?'); - -/** - * The event manager manages events using the WordPress plugin API. - * - * @since 3.1 - * @author Carl Alexander <contact@carlalexander.ca> - */ -class EventManager -{ - /** - * Adds a callback to a specific hook of the WordPress plugin API. - * - * @uses add_filter() - * - * @param string $hook_name Name of the hook. - * @param callable $callback Callback function. - * @param int $priority Priority. - * @param int $accepted_args Number of arguments. - */ - public function addCallback($hook_name, $callback, $priority = 10, $accepted_args = 1) - { - add_filter($hook_name, $callback, $priority, $accepted_args); - } - - /** - * Add an event subscriber. - * - * The event manager registers all the hooks that the given subscriber - * wants to register with the WordPress Plugin API. - * - * @param SubscriberInterface $subscriber SubscriberInterface implementation. - */ - public function addSubscriber(SubscriberInterface $subscriber) - { - if ($subscriber instanceof EventManagerAwareSubscriberInterface) { - $subscriber->setEventManager($this); - } - - foreach ($subscriber->getSubscribedEvents() as $hook_name => $parameters) { - $this->addSubscriberCallback($subscriber, $hook_name, $parameters); - } - } - - /** - * Checks the WordPress plugin API to see if the given hook has - * the given callback. The priority of the callback will be returned - * or false. If no callback is given will return true or false if - * there's any callbacks registered to the hook. - * - * @uses has_filter() - * - * @param string $hook_name Hook name. - * @param mixed $callback Callback. - * - * @return bool|int - */ - public function hasCallback($hook_name, $callback = false) - { - return has_filter($hook_name, $callback); - } - - /** - * Removes the given callback from the given hook. The WordPress plugin API only - * removes the hook if the callback and priority match a registered hook. - * - * @uses remove_filter() - * - * @param string $hook_name Hook name. - * @param callable $callback Callback. - * @param int $priority Priority. - * - * @return bool - */ - public function removeCallback($hook_name, $callback, $priority = 10) - { - return remove_filter($hook_name, $callback, $priority); - } - - /** - * Remove an event subscriber. - * - * The event manager removes all the hooks that the given subscriber - * wants to register with the WordPress Plugin API. - * - * @param SubscriberInterface $subscriber SubscriberInterface implementation. - */ - public function removeSubscriber(SubscriberInterface $subscriber) - { - foreach ($subscriber->getSubscribedEvents() as $hook_name => $parameters) { - $this->removeSubscriberCallback($subscriber, $hook_name, $parameters); - } - } - - /** - * Adds the given subscriber's callback to a specific hook - * of the WordPress plugin API. - * - * @param SubscriberInterface $subscriber SubscriberInterface implementation. - * @param string $hook_name Hook name. - * @param mixed $parameters Parameters, can be a string, an array or a multidimensional array. - */ - private function addSubscriberCallback(SubscriberInterface $subscriber, $hook_name, $parameters) - { - if (is_string($parameters)) { - $this->addCallback($hook_name, [ $subscriber, $parameters ]); - } elseif (is_array($parameters) && count($parameters) !== count($parameters, COUNT_RECURSIVE)) { - foreach ($parameters as $parameter) { - $this->addSubscriberCallback($subscriber, $hook_name, $parameter); - } - } elseif (is_array($parameters) && isset($parameters[0])) { - $this->addCallback($hook_name, [ $subscriber, $parameters[0] ], isset($parameters[1]) ? $parameters[1] : 10, isset($parameters[2]) ? $parameters[2] : 1); - } - } - - /** - * Removes the given subscriber's callback to a specific hook - * of the WordPress plugin API. - * - * @param SubscriberInterface $subscriber SubscriberInterface implementation. - * @param string $hook_name Hook name. - * @param mixed $parameters Parameters, can be a string, an array or a multidimensional array. - */ - private function removeSubscriberCallback(SubscriberInterface $subscriber, $hook_name, $parameters) - { - if (is_string($parameters)) { - $this->removeCallback($hook_name, [ $subscriber, $parameters ]); - } elseif (is_array($parameters) && count($parameters) !== count($parameters, COUNT_RECURSIVE)) { - foreach ($parameters as $parameter) { - $this->removeSubscriberCallback($subscriber, $hook_name, $parameter); - } - } elseif (is_array($parameters) && isset($parameters[0])) { - $this->removeCallback($hook_name, [ $subscriber, $parameters[0] ], isset($parameters[1]) ? $parameters[1] : 10); - } - } -} diff --git a/src/EventManagement/EventManagerAwareSubscriberInterface.php b/src/EventManagement/EventManagerAwareSubscriberInterface.php deleted file mode 100644 index 2b5b2a1..0000000 --- a/src/EventManagement/EventManagerAwareSubscriberInterface.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php -/** - * Interface for subscribers who need access to the event manager object - * - * @package RocketLazyload - */ - -namespace RocketLazyLoadPlugin\EventManagement; - -interface EventManagerAwareSubscriberInterface extends SubscriberInterface -{ - /** - * Set the WordPress event manager for the subscriber. - * - * @since 3.1 - * @author Remy Perona - * - * @param EventManager $event_manager EventManager instance. - */ - public function setEventManager(EventManager $event_manager); -} diff --git a/src/EventManagement/SubscriberInterface.php b/src/EventManagement/SubscriberInterface.php index 0612c77..b1f7b03 100644 --- a/src/EventManagement/SubscriberInterface.php +++ b/src/EventManagement/SubscriberInterface.php @@ -6,6 +6,7 @@ */ namespace RocketLazyLoadPlugin\EventManagement; +use RocketLazyLoadPlugin\Dependencies\LaunchpadCore\EventManagement\OptimizedSubscriberInterface; /** * A Subscriber knows what specific WordPress events it wants to listen to. @@ -15,7 +16,7 @@ * * @author Carl Alexander <contact@carlalexander.ca> */ -interface SubscriberInterface +interface SubscriberInterface extends OptimizedSubscriberInterface { /** * Returns an array of events that this subscriber wants to listen to. @@ -35,5 +36,5 @@ interface SubscriberInterface * * @return array */ - public function getSubscribedEvents(); + public static function get_subscribed_events(); } diff --git a/src/Options/AbstractOptions.php b/src/Options/AbstractOptions.php deleted file mode 100644 index 8cdf555..0000000 --- a/src/Options/AbstractOptions.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php -/** - * Abstract class to interact with the WP options API - * - * @package RocketLazyloadPlugin - */ - -namespace RocketLazyLoadPlugin\Options; - -/** - * Manages options using the WordPress options API. - * - * @since 2.0 - * @author Remy Perona - */ -abstract class AbstractOptions -{ - /** - * Gets the option for the given name. Returns the default value if the value does not exist. - * - * @since 2.0 - * @author Remy Perona - * - * @param string $name Name of the option to get. - * @param mixed $default Default value to return if the value does not exist. - * - * @return mixed - */ - abstract public function get($name, $default = null); - - /** - * Sets the value of an option. Update the value if the option for the given name already exists. - * - * @since 2.0 - * @author Remy Perona - * @param string $name Name of the option to set. - * @param mixed $value Value to set for the option. - * - * @return void - */ - abstract public function set($name, $value); - - /** - * Deletes the option with the given name. - * - * @since 2.0 - * @author Remy Perona - * - * @param string $name Name of the option to delete. - * - * @return void - */ - abstract public function delete($name); - - /** - * Checks if the option with the given name exists. - * - * @since 2.0 - * @author Remy Perona - * - * @param string $name Name of the option to check. - * - * @return boolean True if the option exists, false otherwise - */ - public function has($name) - { - return null !== $this->get($name); - } -} diff --git a/src/Options/OptionArray.php b/src/Options/OptionArray.php deleted file mode 100644 index 6b647a4..0000000 --- a/src/Options/OptionArray.php +++ /dev/null @@ -1,111 +0,0 @@ -<?php -/** - * Manages the plugin options data - * - * @package RocketLazyloadPlugin - */ - -namespace RocketLazyLoadPlugin\Options; - -/** - * Manages the data inside an option. - * - * @since 2.0 - * @author Remy Perona - */ -class OptionArray -{ - /** - * Option data - * - * @var Array Array of data inside the option - */ - private $options; - - /** - * Constructor - * - * @param Array $options Array of data coming from an option. - */ - public function __construct($options) - { - $this->options = $options; - } - - /** - * Checks if the provided key exists in the option data array. - * - * @since 2.0 - * @author Remy Perona - * - * @param string $key key name. - * @return boolean - */ - public function has($key) - { - return isset($this->options[ $key ]); - } - - /** - * Gets the value associated with a specific key. - * - * @since 2.0 - * @author Remy Perona - * - * @param string $key key name. - * @param mixed $default default value to return if key doesn't exist. - * @return mixed - */ - public function get($key, $default = '') - { - if (! $this->has($key)) { - return $default; - } - - return $this->options[ $key ]; - } - - /** - * Sets the value associated with a specific key. - * - * @since 2.0 - * @author Remy Perona - * - * @param string $key key name. - * @param mixed $value Value to set. - * @return void - */ - public function set($key, $value) - { - $this->options[ $key ] = $value; - } - - /** - * Sets multiple values. - * - * @since 2.0 - * @author Remy Perona - * - * @param array $options An array of key/value pairs to set. - * @return void - */ - public function setValues($options) - { - foreach ($options as $key => $value) { - $this->set($key, $value); - } - } - - /** - * Gets the option array. - * - * @since 2.0 - * @author Remy Perona - * - * @return array - */ - public function getOptions() - { - return $this->options; - } -} diff --git a/src/Options/Options.php b/src/Options/Options.php deleted file mode 100644 index b942643..0000000 --- a/src/Options/Options.php +++ /dev/null @@ -1,106 +0,0 @@ -<?php -/** - * Options Class - * - * @package RocketLazyloadPlugin - */ - -namespace RocketLazyLoadPlugin\Options; - -defined('ABSPATH') || die('Cheatin\' uh?'); - -/** - * Interact with the WordPress Options API - */ -class Options extends AbstractOptions -{ - /** - * The prefix used by Rocket Lazyload options. - * - * @since 2.0 - * @author Remy Perona - * - * @var string - */ - private $prefix; - - /** - * Constructor - * - * @since 2.0 - * @author Remy Perona - * - * @param string $prefix options prefix. - */ - public function __construct($prefix = '') - { - $this->prefix = $prefix; - } - - /** - * Gets the option name used to store the option in the WordPress database. - * - * @since 2.0 - * @author Remy Perona - * - * @param string $name Unprefixed name of the option. - * - * @return string - */ - public function getOptionName($name) - { - return $this->prefix . $name; - } - - /** - * Gets the option for the given name. Returns the default value if the value does not exist. - * - * @since 2.0 - * @author Remy Perona - * - * @param string $name Name of the option to get. - * @param mixed $default Default value to return if the value does not exist. - * - * @return mixed - */ - public function get($name, $default = null) - { - $option = get_option($this->getOptionName($name), $default); - - if (is_array($default) && ! is_array($option)) { - $option = (array) $option; - } - - return $option; - } - - /** - * Sets the value of an option. Update the value if the option for the given name already exists. - * - * @since 2.0 - * @author Remy Perona - * @param string $name Name of the option to set. - * @param mixed $value Value to set for the option. - * - * @return void - */ - public function set($name, $value) - { - update_option($this->getOptionName($name), $value); - } - - /** - * Deletes the option with the given name. - * - * @since 2.0 - * @author Remy Perona - * - * @param string $name Name of the option to delete. - * - * @return void - */ - public function delete($name) - { - delete_option($this->getOptionName($name)); - } -} diff --git a/src/Plugin.php b/src/Plugin.php deleted file mode 100644 index 49bba68..0000000 --- a/src/Plugin.php +++ /dev/null @@ -1,96 +0,0 @@ -<?php - -namespace RocketLazyLoadPlugin; - -use RocketLazyLoadPlugin\Dependencies\League\Container\Container; -use RocketLazyLoadPlugin\EventManagement\EventManager; -use RocketLazyLoadPlugin\Options\Options; - -/** - * Plugin initialize - * - * @since 2.0 - * @author Remy Perona - */ -class Plugin { - - /** - * Is the plugin loaded - * - * @since 2.0 - * @author Remy Perona - * - * @var boolean - */ - private $loaded = false; - - /** - * Checks if the plugin is loaded - * - * @since 2.0 - * @author Remy Perona - * - * @return boolean - */ - private function isLoaded() { - return $this->loaded; - } - - /** - * Loads the plugin in WordPress - * - * @since 2.0 - * @author Remy Perona - * - * @return void - */ - public function load() { - if ( $this->isLoaded() ) { - return; - } - - $container = new Container(); - - $container->add( 'template_path', \ROCKET_LL_PATH . 'views/' ); - $container->add( 'plugin_basename', \ROCKET_LL_BASENAME ); - - $container->add( - 'options', - function () { - return new Options( 'rocket_lazyload' ); - } - ); - - $container->add( - 'event_manager', - function () { - return new EventManager(); - } - ); - - $service_providers = [ - 'RocketLazyLoadPlugin\ServiceProvider\OptionServiceProvider', - 'RocketLazyLoadPlugin\ServiceProvider\AdminServiceProvider', - 'RocketLazyLoadPlugin\ServiceProvider\ImagifyNoticeServiceProvider', - 'RocketLazyLoadPlugin\ServiceProvider\LazyloadServiceProvider', - 'RocketLazyLoadPlugin\ServiceProvider\SubscribersServiceProvider', - ]; - - foreach ( $service_providers as $service ) { - $container->addServiceProvider( $service ); - } - - $subscribers = [ - 'RocketLazyLoadPlugin\Subscriber\ThirdParty\AMPSubscriber', - 'RocketLazyLoadPlugin\Subscriber\AdminPageSubscriber', - 'RocketLazyLoadPlugin\Subscriber\ImagifyNoticeSubscriber', - 'RocketLazyLoadPlugin\Subscriber\LazyloadSubscriber', - ]; - - foreach ( $subscribers as $subscriber ) { - $container->get( 'event_manager' )->addSubscriber( $container->get( $subscriber ) ); - } - - $this->loaded = true; - } -} diff --git a/src/ServiceProvider/AdminServiceProvider.php b/src/ServiceProvider/AdminServiceProvider.php index caa9842..161e145 100644 --- a/src/ServiceProvider/AdminServiceProvider.php +++ b/src/ServiceProvider/AdminServiceProvider.php @@ -7,7 +7,9 @@ namespace RocketLazyLoadPlugin\ServiceProvider; -use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider; +use RocketLazyLoadPlugin\Admin\AdminPage; +use RocketLazyLoadPlugin\Dependencies\LaunchpadCore\Container\AbstractServiceProvider; +use RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface; /** * Adds the admin page to the container @@ -17,31 +19,15 @@ */ class AdminServiceProvider extends AbstractServiceProvider { - /** - * Data provided by the service provider - * - * @since 2.0 - * @author Remy Perona - * - * @var array - */ - protected $provides = [ - 'RocketLazyLoadPlugin\Admin\AdminPage', - ]; - /** - * Registers the admin page in the container - * - * @since 2.0 - * @author Remy Perona - * - * @return void - */ - public function register() - { - $this->getContainer()->add('RocketLazyLoadPlugin\Admin\AdminPage') - ->withArgument($this->getContainer()->get('options')) - ->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Options\OptionArray')) - ->withArgument($this->getContainer()->get('template_path')); - } -} + public function define() + { + error_log(__METHOD__); + $this->register_service( AdminPage::class) + ->set_definition(function (DefinitionInterface $instance) { + $instance->addArguments( [ + 'template_path' + ] ); + }); + } +} \ No newline at end of file diff --git a/src/ServiceProvider/ImagifyNoticeServiceProvider.php b/src/ServiceProvider/ImagifyNoticeServiceProvider.php index 6277ebc..e275c32 100644 --- a/src/ServiceProvider/ImagifyNoticeServiceProvider.php +++ b/src/ServiceProvider/ImagifyNoticeServiceProvider.php @@ -7,39 +7,21 @@ namespace RocketLazyLoadPlugin\ServiceProvider; -use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider; +use RocketLazyLoadPlugin\Dependencies\LaunchpadCore\Container\AbstractServiceProvider; +use RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface; + /** * Adds the Imagify notice to the container - * - * @since 2.0 - * @author Remy Perona */ -class ImagifyNoticeServiceProvider extends AbstractServiceProvider -{ - /** - * Data provided by the service provider - * - * @since 2.0 - * @author Remy Perona - * - * @var array - */ - protected $provides = [ - 'RocketLazyLoadPlugin\Admin\ImagifyNotice', - ]; +class ImagifyNoticeServiceProvider extends AbstractServiceProvider { - /** - * Registers the Imagify notice in the container - * - * @since 2.0 - * @author Remy Perona - * - * @return void - */ - public function register() - { - $this->getContainer()->add('RocketLazyLoadPlugin\Admin\ImagifyNotice') - ->withArgument($this->getContainer()->get('template_path')); - } + public function define() { + $this->register_service( \RocketLazyLoadPlugin\Admin\ImagifyNotice::class ) + ->set_definition( function ( DefinitionInterface $instance ) { + $instance->addArguments( [ + 'template_path', + ] ); + } ); + } } diff --git a/src/ServiceProvider/LazyloadServiceProvider.php b/src/ServiceProvider/LazyloadServiceProvider.php index 6c68f0b..d044a1d 100644 --- a/src/ServiceProvider/LazyloadServiceProvider.php +++ b/src/ServiceProvider/LazyloadServiceProvider.php @@ -7,7 +7,7 @@ namespace RocketLazyLoadPlugin\ServiceProvider; -use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider; +use RocketLazyLoadPlugin\Dependencies\LaunchpadCore\Container\AbstractServiceProvider; /** * Adds the lazyload library to the container @@ -15,34 +15,11 @@ * @since 2.0 * @author Remy Perona */ -class LazyloadServiceProvider extends AbstractServiceProvider -{ - /** - * Data provided by the service provider - * - * @since 2.0 - * @author Remy Perona - * - * @var array - */ - protected $provides = [ - 'RocketLazyLoadPlugin\Dependencies\RocketLazyload\Assets', - 'RocketLazyLoadPlugin\Dependencies\RocketLazyload\Image', - 'RocketLazyLoadPlugin\Dependencies\RocketLazyload\Iframe', - ]; +class LazyloadServiceProvider extends AbstractServiceProvider { - /** - * Registers the lazyload library in the container - * - * @since 2.0 - * @author Remy Perona - * - * @return void - */ - public function register() - { - $this->getContainer()->add('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Assets'); - $this->getContainer()->add('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Image'); - $this->getContainer()->add('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Iframe'); - } + public function define() { + $this->register_service( \RocketLazyLoadPlugin\Dependencies\RocketLazyload\Assets::class ); + $this->register_service( \RocketLazyLoadPlugin\Dependencies\RocketLazyload\Image::class ); + $this->register_service( \RocketLazyLoadPlugin\Dependencies\RocketLazyload\Iframe::class ); + } } diff --git a/src/ServiceProvider/OptionServiceProvider.php b/src/ServiceProvider/OptionServiceProvider.php index 99953a6..b515c8e 100644 --- a/src/ServiceProvider/OptionServiceProvider.php +++ b/src/ServiceProvider/OptionServiceProvider.php @@ -7,7 +7,10 @@ namespace RocketLazyLoadPlugin\ServiceProvider; -use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider; +use RocketLazyLoadPlugin\Dependencies\LaunchpadCore\Container\AbstractServiceProvider; +use RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface; +use RocketLazyLoadPlugin\Options\OptionArray; + /** * Adds the option array to the container @@ -17,29 +20,14 @@ */ class OptionServiceProvider extends AbstractServiceProvider { - /** - * Data provided by the service provider - * - * @since 2.0 - * @author Remy Perona - * - * @var array - */ - protected $provides = [ - 'RocketLazyLoadPlugin\Options\OptionArray', - ]; - - /** - * Registers the option array in the container - * - * @since 2.0 - * @author Remy Perona - * - * @return void - */ - public function register() - { - $this->getContainer()->add('RocketLazyLoadPlugin\Options\OptionArray') - ->withArgument($this->getContainer()->get('options')->get('_options')); - } + public function define() + { + // TODO how to ->get('_options') + $this->register_service( OptionArray::class) + ->set_definition(function (DefinitionInterface $instance) { + $instance->addArguments( [ + 'options', + ] ); + }); + } } diff --git a/src/ServiceProvider/SubscribersServiceProvider.php b/src/ServiceProvider/SubscribersServiceProvider.php index 6fcc15a..e779e3e 100644 --- a/src/ServiceProvider/SubscribersServiceProvider.php +++ b/src/ServiceProvider/SubscribersServiceProvider.php @@ -7,54 +7,61 @@ namespace RocketLazyLoadPlugin\ServiceProvider; -use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider; +use RocketLazyLoadPlugin\Admin\AdminPage; +use RocketLazyLoadPlugin\Admin\ImagifyNotice; +use RocketLazyLoadPlugin\Dependencies\LaunchpadCore\Container\AbstractServiceProvider; + +use RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface; +use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Assets; +use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Iframe; +use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Image; +use RocketLazyLoadPlugin\Subscriber\AdminPageSubscriber; +use RocketLazyLoadPlugin\Subscriber\ImagifyNoticeSubscriber; +use RocketLazyLoadPlugin\Subscriber\LazyloadSubscriber; +use RocketLazyLoadPlugin\Subscriber\ThirdParty\AMPSubscriber; + +class SubscribersServiceProvider extends AbstractServiceProvider { + + public function get_common_subscribers(): array { + return [ + AMPSubscriber::class, + AdminPageSubscriber::class, + ImagifyNoticeSubscriber::class, + LazyloadSubscriber::class + ]; + } + + public function define() { + error_log(__METHOD__); + $this->register_service( AMPSubscriber::class ) + ->share(); + + $this->register_service( AdminPageSubscriber::class ) + ->share() + ->set_definition( function ( DefinitionInterface $instance ) { + $instance->addArguments( [ + AdminPage::class, + 'plugin_basename' + ] ); + } ); + + $this->register_service( ImagifyNoticeSubscriber::class ) + ->share() + ->set_definition( function ( DefinitionInterface $instance ) { + $instance->addArgument( ImagifyNotice::class ); + } ); + + $this->register_service( LazyloadSubscriber::class ) + ->share() + ->set_definition( function ( DefinitionInterface $instance ) { + $instance->addArguments( [ + Assets::class, + Image::class, + Iframe::class + ] + ); + } + ); + } -/** - * Adds the subscribers to the container - * - * @since 2.0 - * @author Remy Perona - */ -class SubscribersServiceProvider extends AbstractServiceProvider -{ - /** - * Data provided by the service provider - * - * @since 2.0 - * @author Remy Perona - * - * @var array - */ - protected $provides = [ - 'RocketLazyLoadPlugin\Subscriber\ThirdParty\AMPSubscriber', - 'RocketLazyLoadPlugin\Subscriber\AdminPageSubscriber', - 'RocketLazyLoadPlugin\Subscriber\ImagifyNoticeSubscriber', - 'RocketLazyLoadPlugin\Subscriber\LazyloadSubscriber', - ]; - - /** - * Registers the subscribers in the container - * - * @since 2.0 - * @author Remy Perona - * - * @return void - */ - public function register() - { - $this->getContainer()->share('RocketLazyLoadPlugin\Subscriber\ThirdParty\AMPSubscriber'); - - $this->getContainer()->share('RocketLazyLoadPlugin\Subscriber\AdminPageSubscriber') - ->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Admin\AdminPage')) - ->withArgument($this->getContainer()->get('plugin_basename')); - - $this->getContainer()->share('RocketLazyLoadPlugin\Subscriber\ImagifyNoticeSubscriber') - ->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Admin\ImagifyNotice')); - - $this->getContainer()->share('RocketLazyLoadPlugin\Subscriber\LazyloadSubscriber') - ->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Options\OptionArray')) - ->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Assets')) - ->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Image')) - ->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Iframe')); - } } diff --git a/src/Subscriber/AdminPageSubscriber.php b/src/Subscriber/AdminPageSubscriber.php index 09de84d..14f31da 100644 --- a/src/Subscriber/AdminPageSubscriber.php +++ b/src/Subscriber/AdminPageSubscriber.php @@ -31,7 +31,7 @@ class AdminPageSubscriber implements SubscriberInterface { * * @var string */ - private $plugin_basename; + private static string $plugin_basename; /** * Constructor @@ -43,8 +43,10 @@ class AdminPageSubscriber implements SubscriberInterface { * @param string $plugin_basename Plugin basename. */ public function __construct( AdminPage $page, $plugin_basename ) { + error_log(__METHOD__); $this->page = $page; - $this->plugin_basename = $plugin_basename; + self::$plugin_basename = $plugin_basename; + error_log('$plugin_basename: '.self::$plugin_basename); } /** @@ -52,11 +54,12 @@ public function __construct( AdminPage $page, $plugin_basename ) { * * @return array */ - public function getSubscribedEvents() { + public static function get_subscribed_events(): array { + error_log(__METHOD__); return [ 'admin_init' => 'configure', 'admin_menu' => 'addAdminPage', - "plugin_action_links_{$this->plugin_basename}" => 'addPluginPageLink', + "plugin_action_links_".self::$plugin_basename => 'addPluginPageLink', 'admin_enqueue_scripts' => 'enqueueAdminStyle', ]; } @@ -70,6 +73,7 @@ public function getSubscribedEvents() { * @return void */ public function configure() { + error_log(__METHOD__); $this->page->configure(); } diff --git a/src/Subscriber/ImagifyNoticeSubscriber.php b/src/Subscriber/ImagifyNoticeSubscriber.php index c056b77..7d8304a 100644 --- a/src/Subscriber/ImagifyNoticeSubscriber.php +++ b/src/Subscriber/ImagifyNoticeSubscriber.php @@ -46,8 +46,7 @@ public function __construct(ImagifyNotice $imagify_notice) /** * @inheritDoc */ - public function getSubscribedEvents() - { + public static function get_subscribed_events(): array { return [ 'admin_notices' => 'imagifyNotice', 'admin_footer-settings_page_rocket_lazyload' => 'dismissNoticeJS', @@ -71,9 +70,9 @@ public function imagifyNotice() if ('admin_notices' === current_filter() && ( isset($current_screen) && 'settings_page_rocket_lazyload' !== $current_screen->base )) { return; } - + $boxes = get_user_meta(get_current_user_id(), 'rocket_lazyload_boxes', true); - + if (defined('IMAGIFY_VERSION') || in_array('rocket_lazyload_imagify_notice', (array) $boxes, true) || 1 === get_option('rocket_lazyload_dismiss_imagify_notice') || ! current_user_can('manage_options')) { return; } diff --git a/src/Subscriber/LazyloadSubscriber.php b/src/Subscriber/LazyloadSubscriber.php index 8bba72b..86dda40 100644 --- a/src/Subscriber/LazyloadSubscriber.php +++ b/src/Subscriber/LazyloadSubscriber.php @@ -2,29 +2,24 @@ namespace RocketLazyLoadPlugin\Subscriber; +use RocketLazyLoadPlugin\Dependencies\LaunchpadFrameworkOptions\Interfaces\OptionsAwareInterface; use RocketLazyLoadPlugin\EventManagement\SubscriberInterface; -use RocketLazyLoadPlugin\Options\OptionArray; use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Assets; use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Image; use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Iframe; +use RocketLazyLoadPlugin\Dependencies\LaunchpadFrameworkOptions\Traits\OptionsAwareTrait; + /** * Lazyload Subscriber * * @since 2.0 * @author Remy Perona */ -class LazyloadSubscriber implements SubscriberInterface { +class LazyloadSubscriber implements SubscriberInterface, OptionsAwareInterface +{ - /** - * OptionArray instance - * - * @since 2.0 - * @author Remy Perona - * - * @var OptionArray - */ - private $option_array; + use OptionsAwareTrait; /** * Assets instance @@ -62,13 +57,11 @@ class LazyloadSubscriber implements SubscriberInterface { * @since 2.0 * @author Remy Perona * - * @param OptionArray $option_array OptionArray instance. * @param Assets $assets Assets instance. * @param Image $image Image instance. * @param Iframe $iframe Iframe instance. */ - public function __construct( OptionArray $option_array, Assets $assets, Image $image, Iframe $iframe ) { - $this->option_array = $option_array; + public function __construct( Assets $assets, Image $image, Iframe $iframe ) { $this->assets = $assets; $this->image = $image; $this->iframe = $iframe; @@ -79,7 +72,7 @@ public function __construct( OptionArray $option_array, Assets $assets, Image $i * * @return array */ - public function getSubscribedEvents() { + public static function get_subscribed_events(): array { return [ 'wp_footer' => [ [ 'insertLazyloadScript', \ROCKET_LL_INT_MAX ], @@ -102,7 +95,7 @@ public function getSubscribedEvents() { * @return void */ public function insertLazyloadScript() { - if ( ! $this->option_array->get( 'images' ) && ! $this->option_array->get( 'iframes' ) ) { + if ( ! $this->options->get( 'images' ) && ! $this->options->get( 'iframes' ) ) { return; } @@ -152,7 +145,7 @@ public function insertLazyloadScript() { ]; } - if ( $this->option_array->get( 'images' ) || $this->option_array->get( 'iframes' ) ) { + if ( $this->options->get( 'images' ) || $this->options->get( 'iframes' ) ) { // This filter is documented in src/Subscriber/LazyloadSubscriber.php. if ( apply_filters( 'rocket_use_native_lazyload', false ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals $inline_args['elements'] = isset( $inline_args['elements'] ) ? $inline_args['elements'] : []; @@ -160,13 +153,13 @@ public function insertLazyloadScript() { } } - if ( $this->option_array->get( 'images' ) ) { + if ( $this->options->get( 'images' ) ) { $inline_args['elements'] = isset( $inline_args['elements'] ) ? $inline_args['elements'] : []; $inline_args['elements']['image'] = 'img[data-lazy-src]'; $inline_args['elements']['background_image'] = '.rocket-lazyload'; } - if ( $this->option_array->get( 'iframes' ) ) { + if ( $this->options->get( 'iframes' ) ) { $inline_args['elements'] = isset( $inline_args['elements'] ) ? $inline_args['elements'] : []; $inline_args['elements']['iframe'] = 'iframe[data-lazy-src]'; } @@ -194,7 +187,7 @@ public function insertLazyloadScript() { * @return void */ public function insertYoutubeThumbnailScript() { - if ( ! $this->option_array->get( 'youtube' ) ) { + if ( ! $this->options->get( 'youtube' ) ) { return; } @@ -215,7 +208,7 @@ public function insertYoutubeThumbnailScript() { $this->assets->insertYoutubeThumbnailScript( [ 'resolution' => $thumbnail_resolution, - 'lazy_image' => (bool) $this->option_array->get( 'images' ), + 'lazy_image' => (bool) $this->options->get( 'images' ), ] ); } @@ -245,7 +238,7 @@ public function insertNoJSStyle() { * @return void */ public function insertYoutubeThumbnailStyle() { - if ( ! $this->option_array->get( 'youtube' ) ) { + if ( ! $this->options->get( 'youtube' ) ) { return; } @@ -347,15 +340,15 @@ public function lazyloadBuffer( $html ) { $buffer = $this->ignoreScripts( $html ); $buffer = $this->ignoreNoscripts( $buffer ); - if ( $this->option_array->get( 'images' ) ) { + if ( $this->options->get( 'images' ) ) { $html = $this->image->lazyloadImages( $html, $buffer ); $html = $this->image->lazyloadPictures( $html, $buffer ); $html = $this->image->lazyloadBackgroundImages( $html, $buffer ); } - if ( $this->option_array->get( 'iframes' ) ) { + if ( $this->options->get( 'iframes' ) ) { $args = [ - 'youtube' => $this->option_array->get( 'youtube' ), + 'youtube' => $this->options->get( 'youtube' ), ]; $html = $this->iframe->lazyloadIframes( $html, $buffer, $args ); @@ -390,7 +383,7 @@ public function lazyloadSmilies() { return; } - if ( ! $this->option_array->get( 'images' ) ) { + if ( ! $this->options->get( 'images' ) ) { return; } diff --git a/src/Subscriber/ThirdParty/AMPSubscriber.php b/src/Subscriber/ThirdParty/AMPSubscriber.php index 04016df..9a6e167 100644 --- a/src/Subscriber/ThirdParty/AMPSubscriber.php +++ b/src/Subscriber/ThirdParty/AMPSubscriber.php @@ -2,8 +2,8 @@ namespace RocketLazyLoadPlugin\Subscriber\ThirdParty; -use RocketLazyLoadPlugin\EventManagement\EventManager; -use RocketLazyLoadPlugin\EventManagement\EventManagerAwareSubscriberInterface; +use RocketLazyLoadPlugin\Dependencies\LaunchpadCore\EventManagement\EventManagerAwareSubscriberInterface; +use RocketLazyLoadPlugin\Dependencies\LaunchpadCore\EventManagement\EventManager; /** * Manages compatibility with the AMP plugin @@ -25,7 +25,7 @@ class AMPSubscriber implements EventManagerAwareSubscriberInterface { * * @return array */ - public function getSubscribedEvents() { + public static function get_subscribed_events() { return [ 'wp' => 'disableIfAMP', ]; @@ -37,7 +37,7 @@ public function getSubscribedEvents() { * @param EventManager $event_manager EventManager instance. * @return void */ - public function setEventManager( EventManager $event_manager ) { + public function set_event_manager( EventManager $event_manager ) { $this->event_manager = $event_manager; } From f020809c42882ccb3d130a9f94b25efb85d57060 Mon Sep 17 00:00:00 2001 From: Nico Mollet <nico.mollet@gmail.com> Date: Tue, 21 May 2024 17:47:50 +0200 Subject: [PATCH 03/24] Saving options --- configs/parameters.php | 2 +- configs/providers.php | 3 +- src/Admin/AdminPage.php | 4 +-- src/ServiceProvider/AdminServiceProvider.php | 34 ++++++++++++++----- src/ServiceProvider/OptionServiceProvider.php | 33 ------------------ .../SubscribersServiceProvider.php | 10 ------ src/Subscriber/AdminPageSubscriber.php | 4 --- views/admin-page.php | 6 ++-- 8 files changed, 34 insertions(+), 62 deletions(-) delete mode 100644 src/ServiceProvider/OptionServiceProvider.php diff --git a/configs/parameters.php b/configs/parameters.php index 69b4235..0e611c9 100644 --- a/configs/parameters.php +++ b/configs/parameters.php @@ -7,5 +7,5 @@ 'assets_baseurl' => plugin_dir_url( __DIR__ ) . 'assets/', 'is_mu_plugin' => false, 'translation_key' => 'rocket-lazy-load', - 'prefix' => 'RLL_' + 'prefix' => 'rocket_lazyload_' ]; \ No newline at end of file diff --git a/configs/providers.php b/configs/providers.php index 0a4f843..119144c 100644 --- a/configs/providers.php +++ b/configs/providers.php @@ -1,12 +1,11 @@ <?php defined( 'ABSPATH' ) || exit; -error_log('providers.php'); + return [ \RocketLazyLoadPlugin\Dependencies\LaunchpadFrameworkOptions\ServiceProvider::class, \RocketLazyLoadPlugin\ServiceProvider\SubscribersServiceProvider::class, \RocketLazyLoadPlugin\ServiceProvider\AdminServiceProvider::class, \RocketLazyLoadPlugin\ServiceProvider\ImagifyNoticeServiceProvider::class, \RocketLazyLoadPlugin\ServiceProvider\LazyloadServiceProvider::class, - \RocketLazyLoadPlugin\ServiceProvider\OptionServiceProvider::class, ]; \ No newline at end of file diff --git a/src/Admin/AdminPage.php b/src/Admin/AdminPage.php index a89ae19..4ca75eb 100644 --- a/src/Admin/AdminPage.php +++ b/src/Admin/AdminPage.php @@ -12,6 +12,7 @@ use RocketLazyLoadPlugin\Dependencies\LaunchpadFrameworkOptions\Interfaces\OptionsAwareInterface; use RocketLazyLoadPlugin\Dependencies\LaunchpadFrameworkOptions\Traits\OptionsAwareTrait; + /** * Admin page configuration * @@ -53,7 +54,6 @@ class AdminPage implements OptionsAwareInterface */ public function __construct( string $template_path) { - error_log(__METHOD__); $this->template_path = $template_path; } @@ -67,7 +67,7 @@ public function __construct( string $template_path) */ public function configure() { - register_setting($this->getSlug(), $this->options->get('_options')); + register_setting($this->getSlug(), $this->getSlug() . '_options'); } /** diff --git a/src/ServiceProvider/AdminServiceProvider.php b/src/ServiceProvider/AdminServiceProvider.php index 161e145..a982a66 100644 --- a/src/ServiceProvider/AdminServiceProvider.php +++ b/src/ServiceProvider/AdminServiceProvider.php @@ -10,6 +10,11 @@ use RocketLazyLoadPlugin\Admin\AdminPage; use RocketLazyLoadPlugin\Dependencies\LaunchpadCore\Container\AbstractServiceProvider; use RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface; +use RocketLazyLoadPlugin\Subscriber\AdminPageSubscriber; +use RocketLazyLoadPlugin\Dependencies\LaunchpadOptions\Interfaces\OptionsInterface; +use RocketLazyLoadPlugin\Subscriber\ImagifyNoticeSubscriber; +use RocketLazyLoadPlugin\Subscriber\LazyloadSubscriber; +use RocketLazyLoadPlugin\Subscriber\ThirdParty\AMPSubscriber; /** * Adds the admin page to the container @@ -17,17 +22,30 @@ * @since 2.0 * @author Remy Perona */ -class AdminServiceProvider extends AbstractServiceProvider -{ +class AdminServiceProvider extends AbstractServiceProvider { - public function define() - { - error_log(__METHOD__); - $this->register_service( AdminPage::class) - ->set_definition(function (DefinitionInterface $instance) { + public function get_common_subscribers(): array { + return [ + AdminPageSubscriber::class, + ]; + } + + public function define() { + $this->register_service( AdminPage::class ) + ->set_definition( function ( DefinitionInterface $instance ) { $instance->addArguments( [ 'template_path' ] ); - }); + } ); + + $this->register_service( AdminPageSubscriber::class ) + ->share() + ->set_definition( function ( DefinitionInterface $instance ) { + $instance->addArguments( [ + AdminPage::class, + 'plugin_basename' + ] + ); + } ); } } \ No newline at end of file diff --git a/src/ServiceProvider/OptionServiceProvider.php b/src/ServiceProvider/OptionServiceProvider.php deleted file mode 100644 index b515c8e..0000000 --- a/src/ServiceProvider/OptionServiceProvider.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php -/** - * Service Provider for the plugin options - * - * @package RocketLazyload - */ - -namespace RocketLazyLoadPlugin\ServiceProvider; - -use RocketLazyLoadPlugin\Dependencies\LaunchpadCore\Container\AbstractServiceProvider; -use RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface; -use RocketLazyLoadPlugin\Options\OptionArray; - - -/** - * Adds the option array to the container - * - * @since 2.0 - * @author Remy Perona - */ -class OptionServiceProvider extends AbstractServiceProvider -{ - public function define() - { - // TODO how to ->get('_options') - $this->register_service( OptionArray::class) - ->set_definition(function (DefinitionInterface $instance) { - $instance->addArguments( [ - 'options', - ] ); - }); - } -} diff --git a/src/ServiceProvider/SubscribersServiceProvider.php b/src/ServiceProvider/SubscribersServiceProvider.php index e779e3e..5d8e1de 100644 --- a/src/ServiceProvider/SubscribersServiceProvider.php +++ b/src/ServiceProvider/SubscribersServiceProvider.php @@ -32,19 +32,9 @@ public function get_common_subscribers(): array { } public function define() { - error_log(__METHOD__); $this->register_service( AMPSubscriber::class ) ->share(); - $this->register_service( AdminPageSubscriber::class ) - ->share() - ->set_definition( function ( DefinitionInterface $instance ) { - $instance->addArguments( [ - AdminPage::class, - 'plugin_basename' - ] ); - } ); - $this->register_service( ImagifyNoticeSubscriber::class ) ->share() ->set_definition( function ( DefinitionInterface $instance ) { diff --git a/src/Subscriber/AdminPageSubscriber.php b/src/Subscriber/AdminPageSubscriber.php index 14f31da..0aef520 100644 --- a/src/Subscriber/AdminPageSubscriber.php +++ b/src/Subscriber/AdminPageSubscriber.php @@ -43,10 +43,8 @@ class AdminPageSubscriber implements SubscriberInterface { * @param string $plugin_basename Plugin basename. */ public function __construct( AdminPage $page, $plugin_basename ) { - error_log(__METHOD__); $this->page = $page; self::$plugin_basename = $plugin_basename; - error_log('$plugin_basename: '.self::$plugin_basename); } /** @@ -55,7 +53,6 @@ public function __construct( AdminPage $page, $plugin_basename ) { * @return array */ public static function get_subscribed_events(): array { - error_log(__METHOD__); return [ 'admin_init' => 'configure', 'admin_menu' => 'addAdminPage', @@ -73,7 +70,6 @@ public static function get_subscribed_events(): array { * @return void */ public function configure() { - error_log(__METHOD__); $this->page->configure(); } diff --git a/views/admin-page.php b/views/admin-page.php index d1a1a66..1f6688c 100644 --- a/views/admin-page.php +++ b/views/admin-page.php @@ -48,9 +48,11 @@ <p><?php esc_html_e('LazyLoad displays images, iframes and videos on a page only when they are visible to the user.', 'rocket-lazy-load'); ?></p> <p><?php esc_html_e('This mechanism reduces the number of HTTP requests and improves the loading time.', 'rocket-lazy-load'); ?></p> <ul class="rocket-lazyload-options"> - <?php foreach ($options as $slug => $infos) : ?> + <?php + $options_values = $this->options->get('options'); + foreach ($options as $slug => $infos) : ?> <li class="rocket-lazyload-option"> - <input type="checkbox" value="1" id="lazyload-<?php echo esc_attr($slug); ?>" name="rocket_lazyload_options[<?php echo esc_attr($slug); ?>]" <?php checked($this->option_array->get($slug, 0), 1); ?> aria-labelledby="describe-lazyload-<?php echo esc_attr($slug); ?>"> + <input type="checkbox" value="1" id="lazyload-<?php echo esc_attr($slug); ?>" name="rocket_lazyload_options[<?php echo esc_attr($slug); ?>]" <?php checked($options_values[$slug] ?? 0, 1); ?> aria-labelledby="describe-lazyload-<?php echo esc_attr($slug); ?>"> <label for="lazyload-<?php echo esc_attr($slug); ?>"> <span id="describe-lazyload-<?php echo esc_attr($slug); ?>" class="rocket-lazyload-label-description"><?php echo esc_html($infos['label']); ?></span> </label> From ae7d292e29486f4769b17fda852ea3ecec01b1a0 Mon Sep 17 00:00:00 2001 From: Nico Mollet <nico.mollet@gmail.com> Date: Mon, 1 Jul 2024 15:24:18 +0200 Subject: [PATCH 04/24] Removed unnecessary AdminpageSubscriber that was loaded twice --- src/ServiceProvider/SubscribersServiceProvider.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ServiceProvider/SubscribersServiceProvider.php b/src/ServiceProvider/SubscribersServiceProvider.php index 5d8e1de..d5f94a3 100644 --- a/src/ServiceProvider/SubscribersServiceProvider.php +++ b/src/ServiceProvider/SubscribersServiceProvider.php @@ -25,7 +25,6 @@ class SubscribersServiceProvider extends AbstractServiceProvider { public function get_common_subscribers(): array { return [ AMPSubscriber::class, - AdminPageSubscriber::class, ImagifyNoticeSubscriber::class, LazyloadSubscriber::class ]; From 0ebda48890b95db8c3a7dbab874c526e9b218427 Mon Sep 17 00:00:00 2001 From: Nico Mollet <nico.mollet@gmail.com> Date: Mon, 1 Jul 2024 15:51:11 +0200 Subject: [PATCH 05/24] Change access to options values --- src/Subscriber/LazyloadSubscriber.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Subscriber/LazyloadSubscriber.php b/src/Subscriber/LazyloadSubscriber.php index 672c6d6..e91654b 100644 --- a/src/Subscriber/LazyloadSubscriber.php +++ b/src/Subscriber/LazyloadSubscriber.php @@ -95,7 +95,7 @@ public static function get_subscribed_events(): array { * @return void */ public function insertLazyloadScript() { - if ( ! $this->options->get( 'images' ) && ! $this->options->get( 'iframes' ) ) { + if ( ! $this->options->get('options')['images'] && ! $this->options->get('options')['iframes'] ) { return; } @@ -135,7 +135,7 @@ public function insertLazyloadScript() { ]; } - if ( $this->options->get( 'images' ) || $this->options->get( 'iframes' ) ) { + if ( $this->options->get('options')['images'] || $this->options->get('options')['iframes'] ) { // This filter is documented in src/Subscriber/LazyloadSubscriber.php. if ( apply_filters( 'rocket_use_native_lazyload', false ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals $inline_args['elements'] = isset( $inline_args['elements'] ) ? $inline_args['elements'] : []; @@ -143,13 +143,13 @@ public function insertLazyloadScript() { } } - if ( $this->options->get( 'images' ) ) { + if ( $this->options->get('options')['images'] ) { $inline_args['elements'] = isset( $inline_args['elements'] ) ? $inline_args['elements'] : []; $inline_args['elements']['image'] = 'img[data-lazy-src]'; $inline_args['elements']['background_image'] = '.rocket-lazyload'; } - if ( $this->options->get( 'iframes' ) ) { + if ( $this->options->get('options')['iframes'] ) { $inline_args['elements'] = isset( $inline_args['elements'] ) ? $inline_args['elements'] : []; $inline_args['elements']['iframe'] = 'iframe[data-lazy-src]'; } @@ -177,7 +177,7 @@ public function insertLazyloadScript() { * @return void */ public function insertYoutubeThumbnailScript() { - if ( ! $this->options->get( 'youtube' ) ) { + if ( ! $this->options->get('options')['youtube'] ) { return; } @@ -198,7 +198,7 @@ public function insertYoutubeThumbnailScript() { $this->assets->insertYoutubeThumbnailScript( [ 'resolution' => $thumbnail_resolution, - 'lazy_image' => (bool) $this->options->get( 'images' ), + 'lazy_image' => (bool) $this->options->get('options')['images'], ] ); } @@ -228,7 +228,7 @@ public function insertNoJSStyle() { * @return void */ public function insertYoutubeThumbnailStyle() { - if ( ! $this->options->get( 'youtube' ) ) { + if ( ! $this->options->get('options')['youtube'] ) { return; } @@ -330,15 +330,15 @@ public function lazyloadBuffer( $html ) { $buffer = $this->ignoreScripts( $html ); $buffer = $this->ignoreNoscripts( $buffer ); - if ( $this->options->get( 'images' ) ) { + if ( $this->options->get('options')['images']) { $html = $this->image->lazyloadImages( $html, $buffer ); $html = $this->image->lazyloadPictures( $html, $buffer ); $html = $this->image->lazyloadBackgroundImages( $html, $buffer ); } - if ( $this->options->get( 'iframes' ) ) { + if ( $this->options->get('options')['iframes'] ) { $args = [ - 'youtube' => $this->options->get( 'youtube' ), + 'youtube' => $this->options->get('options')['youtube'], ]; $html = $this->iframe->lazyloadIframes( $html, $buffer, $args ); @@ -373,7 +373,7 @@ public function lazyloadSmilies() { return; } - if ( ! $this->options->get( 'images' ) ) { + if ( ! $this->options->get('options')['images'] ) { return; } From e35f757a7d38cc243ab62f2bc0f47a427e6adfd5 Mon Sep 17 00:00:00 2001 From: Nico Mollet <nico.mollet@gmail.com> Date: Mon, 1 Jul 2024 16:29:29 +0200 Subject: [PATCH 06/24] Deps update --- composer.lock | 170 +++++++++++---------- src/Dependencies/RocketLazyload/Assets.php | 5 +- 2 files changed, 88 insertions(+), 87 deletions(-) diff --git a/composer.lock b/composer.lock index 39deea3..3f91f0e 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "composer/installers", - "version": "v2.2.0", + "version": "v2.3.0", "source": { "type": "git", "url": "https://github.com/composer/installers.git", - "reference": "c29dc4b93137acb82734f672c37e029dfbd95b35" + "reference": "12fb2dfe5e16183de69e784a7b84046c43d97e8e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/c29dc4b93137acb82734f672c37e029dfbd95b35", - "reference": "c29dc4b93137acb82734f672c37e029dfbd95b35", + "url": "https://api.github.com/repos/composer/installers/zipball/12fb2dfe5e16183de69e784a7b84046c43d97e8e", + "reference": "12fb2dfe5e16183de69e784a7b84046c43d97e8e", "shasum": "" }, "require": { @@ -25,12 +25,12 @@ "php": "^7.2 || ^8.0" }, "require-dev": { - "composer/composer": "1.6.* || ^2.0", - "composer/semver": "^1 || ^3", - "phpstan/phpstan": "^0.12.55", - "phpstan/phpstan-phpunit": "^0.12.16", - "symfony/phpunit-bridge": "^5.3", - "symfony/process": "^5" + "composer/composer": "^1.10.27 || ^2.7", + "composer/semver": "^1.7.2 || ^3.4.0", + "phpstan/phpstan": "^1.11", + "phpstan/phpstan-phpunit": "^1", + "symfony/phpunit-bridge": "^7.1.1", + "symfony/process": "^5 || ^6 || ^7" }, "type": "composer-plugin", "extra": { @@ -87,6 +87,7 @@ "cockpit", "codeigniter", "concrete5", + "concreteCMS", "croogo", "dokuwiki", "drupal", @@ -133,7 +134,7 @@ ], "support": { "issues": "https://github.com/composer/installers/issues", - "source": "https://github.com/composer/installers/tree/v2.2.0" + "source": "https://github.com/composer/installers/tree/v2.3.0" }, "funding": [ { @@ -149,7 +150,7 @@ "type": "tidelift" } ], - "time": "2022-08-20T06:45:11+00:00" + "time": "2024-06-24T20:46:46+00:00" }, { "name": "wp-media/rocket-lazyload-common", @@ -939,16 +940,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.1", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", "shasum": "" }, "require": { @@ -956,11 +957,12 @@ }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", @@ -986,7 +988,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" }, "funding": [ { @@ -994,7 +996,7 @@ "type": "tidelift" } ], - "time": "2023-03-08T13:26:56+00:00" + "time": "2024-06-12T14:39:25+00:00" }, { "name": "nikic/php-parser", @@ -2816,16 +2818,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.9.2", + "version": "3.10.1", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "aac1f6f347a5c5ac6bc98ad395007df00990f480" + "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/aac1f6f347a5c5ac6bc98ad395007df00990f480", - "reference": "aac1f6f347a5c5ac6bc98ad395007df00990f480", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/8f90f7a53ce271935282967f53d0894f8f1ff877", + "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877", "shasum": "" }, "require": { @@ -2892,20 +2894,20 @@ "type": "open_collective" } ], - "time": "2024-04-23T20:25:34+00:00" + "time": "2024-05-22T21:24:41+00:00" }, { "name": "symfony/console", - "version": "v5.4.39", + "version": "v5.4.41", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "f3e591c48688a0cfa1a3296205926c05e84b22b1" + "reference": "6473d441a913cb997123b59ff2dbe3d1cf9e11ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/f3e591c48688a0cfa1a3296205926c05e84b22b1", - "reference": "f3e591c48688a0cfa1a3296205926c05e84b22b1", + "url": "https://api.github.com/repos/symfony/console/zipball/6473d441a913cb997123b59ff2dbe3d1cf9e11ba", + "reference": "6473d441a913cb997123b59ff2dbe3d1cf9e11ba", "shasum": "" }, "require": { @@ -2975,7 +2977,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.39" + "source": "https://github.com/symfony/console/tree/v5.4.41" }, "funding": [ { @@ -2991,7 +2993,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T08:26:06+00:00" + "time": "2024-06-28T07:48:55+00:00" }, { "name": "symfony/deprecation-contracts", @@ -3062,16 +3064,16 @@ }, { "name": "symfony/finder", - "version": "v5.4.39", + "version": "v5.4.40", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "f6a96e4fcd468a25fede16ee665f50ced856bd0a" + "reference": "f51cff4687547641c7d8180d74932ab40b2205ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/f6a96e4fcd468a25fede16ee665f50ced856bd0a", - "reference": "f6a96e4fcd468a25fede16ee665f50ced856bd0a", + "url": "https://api.github.com/repos/symfony/finder/zipball/f51cff4687547641c7d8180d74932ab40b2205ce", + "reference": "f51cff4687547641c7d8180d74932ab40b2205ce", "shasum": "" }, "require": { @@ -3105,7 +3107,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.39" + "source": "https://github.com/symfony/finder/tree/v5.4.40" }, "funding": [ { @@ -3121,20 +3123,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T08:26:06+00:00" + "time": "2024-05-31T14:33:22+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" + "reference": "0424dff1c58f028c451efff2045f5d92410bd540" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540", "shasum": "" }, "require": { @@ -3184,7 +3186,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" }, "funding": [ { @@ -3200,20 +3202,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", - "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/64647a7c30b2283f5d49b874d84a18fc22054b7a", + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a", "shasum": "" }, "require": { @@ -3262,7 +3264,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.30.0" }, "funding": [ { @@ -3278,20 +3280,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", "shasum": "" }, "require": { @@ -3343,7 +3345,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0" }, "funding": [ { @@ -3359,20 +3361,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", "shasum": "" }, "require": { @@ -3423,7 +3425,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" }, "funding": [ { @@ -3439,20 +3441,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-06-19T12:30:46+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "21bd091060673a1177ae842c0ef8fe30893114d2" + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/21bd091060673a1177ae842c0ef8fe30893114d2", - "reference": "21bd091060673a1177ae842c0ef8fe30893114d2", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/ec444d3f3f6505bb28d11afa41e75faadebc10a1", + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1", "shasum": "" }, "require": { @@ -3499,7 +3501,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.30.0" }, "funding": [ { @@ -3515,20 +3517,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", "shasum": "" }, "require": { @@ -3579,7 +3581,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" }, "funding": [ { @@ -3595,7 +3597,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/service-contracts", @@ -3678,16 +3680,16 @@ }, { "name": "symfony/string", - "version": "v5.4.39", + "version": "v5.4.41", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "495e71bae5862308051b9e63cc3e34078eed83ef" + "reference": "065a9611e0b1fd2197a867e1fb7f2238191b7096" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/495e71bae5862308051b9e63cc3e34078eed83ef", - "reference": "495e71bae5862308051b9e63cc3e34078eed83ef", + "url": "https://api.github.com/repos/symfony/string/zipball/065a9611e0b1fd2197a867e1fb7f2238191b7096", + "reference": "065a9611e0b1fd2197a867e1fb7f2238191b7096", "shasum": "" }, "require": { @@ -3744,7 +3746,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.39" + "source": "https://github.com/symfony/string/tree/v5.4.41" }, "funding": [ { @@ -3760,7 +3762,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T08:26:06+00:00" + "time": "2024-06-28T09:20:55+00:00" }, { "name": "theseer/tokenizer", @@ -4002,16 +4004,16 @@ }, { "name": "wp-launchpad/options", - "version": "v0.1.2", + "version": "v0.1.3", "source": { "type": "git", "url": "https://github.com/wp-launchpad/options.git", - "reference": "fd55e0a440e819a1bb77d9140491b1c5faf648f6" + "reference": "22a6c3c5c73feac79be61fa6cd6f7ca3e034623a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-launchpad/options/zipball/fd55e0a440e819a1bb77d9140491b1c5faf648f6", - "reference": "fd55e0a440e819a1bb77d9140491b1c5faf648f6", + "url": "https://api.github.com/repos/wp-launchpad/options/zipball/22a6c3c5c73feac79be61fa6cd6f7ca3e034623a", + "reference": "22a6c3c5c73feac79be61fa6cd6f7ca3e034623a", "shasum": "" }, "require": { @@ -4027,9 +4029,9 @@ "description": "Options library for Launchpad", "support": { "issues": "https://github.com/wp-launchpad/options/issues", - "source": "https://github.com/wp-launchpad/options/tree/v0.1.2" + "source": "https://github.com/wp-launchpad/options/tree/v0.1.3" }, - "time": "2024-05-09T13:05:37+00:00" + "time": "2024-05-21T18:28:15+00:00" }, { "name": "wp-media/phpunit", diff --git a/src/Dependencies/RocketLazyload/Assets.php b/src/Dependencies/RocketLazyload/Assets.php index 1d3ff2d..f102b33 100644 --- a/src/Dependencies/RocketLazyload/Assets.php +++ b/src/Dependencies/RocketLazyload/Assets.php @@ -186,9 +186,8 @@ public function getLazyloadScript( $args = [] ) { 'version' => '', ]; - $args = wp_parse_args( $args, $defaults ); - $min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; - $script = ''; + $args = wp_parse_args( $args, $defaults ); + $min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; /** * Filters the script tag for the lazyload script From 1880848309055fdda5ad0c3dff3e34d6f3053e67 Mon Sep 17 00:00:00 2001 From: Nico Mollet <nico.mollet@gmail.com> Date: Mon, 1 Jul 2024 16:35:07 +0200 Subject: [PATCH 07/24] Version number 2.3.8 + changelog updated --- readme.txt | 9 ++++++--- rocket-lazy-load.php | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/readme.txt b/readme.txt index ae09558..4a81dcd 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: lazyload, lazy load, images, iframes, thumbnail, thumbnails, smiley, smili Requires at least: 4.7 Tested up to: 6.3 Requires PHP: 5.6 -Stable tag: 2.3.7 +Stable tag: 2.3.8 Tags: lazy load, lazy loading, defer offscreen images, lazy load plugin, lazy load images, image lazy loading, iframe lazy load, video lazy load The best free lazy load plugin for WordPress. Lazy load images, videos, and iframes to improve performance and Core Web Vitals scores. @@ -100,8 +100,8 @@ You can also apply it manually. The element you want to apply lazy load on must The element must have the class `rocket-lazyload`, and a `data-bg` attribute, which value is the CSS url for the image. -= Where do I report security bugs found in this plugin? = - += Where do I report security bugs found in this plugin? = + You can report any security bugs found in the source code of the site-reviews plugin through the [Patchstack Vulnerability Disclosure Program](https://patchstack.com/database/vdp/rocket-lazy-load). The Patchstack team will assist you with verification, CVE assignment and take care of notifying the developers of this plugin. = Related Plugins = @@ -113,6 +113,9 @@ You can report any security bugs found in the source code of the site-reviews pl * [Increase Max upload file size](https://wordpress.org/plugins/upload-max-file-size/) is the best plugin to increase the upload file size limit to any value with one click. == Changelog == += 2.3.8 = +Enhancement: Launchpad compatibility (see https://github.com/wp-launchpad) + = 2.3.7 = Bugfix: Removed `rocket_lazyload_polyfill` filter due to a vulnerability on polyfill diff --git a/rocket-lazy-load.php b/rocket-lazy-load.php index cce6560..304dbbb 100644 --- a/rocket-lazy-load.php +++ b/rocket-lazy-load.php @@ -3,7 +3,7 @@ * Plugin Name: Lazy Load - Optimize Images * Plugin URI: http://wordpress.org/plugins/rocket-lazy-load/ * Description: The tiny Lazy Load script for WordPress without jQuery or others libraries. - * Version: 2.3.7 + * Version: 2.3.8 * Requires PHP: 5.6 * Author: WP Rocket * Author URI: https://wp-rocket.me @@ -30,7 +30,7 @@ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' ); -define( 'ROCKET_LL_VERSION', '2.3.7' ); +define( 'ROCKET_LL_VERSION', '2.3.8' ); define( 'ROCKET_LL_WP_VERSION', '4.9' ); define( 'ROCKET_LL_PHP_VERSION', '5.6' ); define( 'ROCKET_LL_BASENAME', plugin_basename( __FILE__ ) ); From 45eea4601974abfa9b7eef1dd20b986a50b0170c Mon Sep 17 00:00:00 2001 From: Nico Mollet <nico.mollet@gmail.com> Date: Tue, 2 Jul 2024 12:11:15 +0200 Subject: [PATCH 08/24] Use settings instead of options --- configs/parameters.php | 15 ++++++++------- src/Admin/AdminPage.php | 8 ++++---- src/ServiceProvider/AdminServiceProvider.php | 4 ---- .../SubscribersServiceProvider.php | 2 -- views/admin-page.php | 6 ++++-- 5 files changed, 16 insertions(+), 19 deletions(-) diff --git a/configs/parameters.php b/configs/parameters.php index 0e611c9..90e1abe 100644 --- a/configs/parameters.php +++ b/configs/parameters.php @@ -1,11 +1,12 @@ <?php return [ - 'plugin_name' => sanitize_key( 'Rocket Lazy Load' ), - 'plugin_basename' => ROCKET_LL_BASENAME, - 'template_path' => realpath( plugin_dir_path( __DIR__ ) ) . '/views/', - 'assets_baseurl' => plugin_dir_url( __DIR__ ) . 'assets/', - 'is_mu_plugin' => false, - 'translation_key' => 'rocket-lazy-load', - 'prefix' => 'rocket_lazyload_' + 'plugin_name' => sanitize_key( 'Rocket Lazy Load' ), + 'plugin_basename' => ROCKET_LL_BASENAME, + 'template_path' => realpath( plugin_dir_path( __DIR__ ) ) . '/views/', + 'assets_baseurl' => plugin_dir_url( __DIR__ ) . 'assets/', + 'is_mu_plugin' => false, + 'translation_key' => 'rocket-lazy-load', + 'prefix' => 'rocket_lazyload_', + 'rocket_lazyload__settings' => 'options' ]; \ No newline at end of file diff --git a/src/Admin/AdminPage.php b/src/Admin/AdminPage.php index 4ca75eb..3e7def0 100644 --- a/src/Admin/AdminPage.php +++ b/src/Admin/AdminPage.php @@ -9,8 +9,8 @@ defined('ABSPATH') || die('Cheatin\' uh?'); -use RocketLazyLoadPlugin\Dependencies\LaunchpadFrameworkOptions\Interfaces\OptionsAwareInterface; -use RocketLazyLoadPlugin\Dependencies\LaunchpadFrameworkOptions\Traits\OptionsAwareTrait; +use RocketLazyLoadPlugin\Dependencies\LaunchpadFrameworkOptions\Interfaces\SettingsAwareInterface; +use RocketLazyLoadPlugin\Dependencies\LaunchpadFrameworkOptions\Traits\SettingsAwareTrait; /** @@ -19,9 +19,9 @@ * @since 2.0 * @author Remy Perona */ -class AdminPage implements OptionsAwareInterface +class AdminPage implements SettingsAwareInterface { - use OptionsAwareTrait; + use SettingsAwareTrait; /** * Plugin slug diff --git a/src/ServiceProvider/AdminServiceProvider.php b/src/ServiceProvider/AdminServiceProvider.php index a982a66..7f8a4c8 100644 --- a/src/ServiceProvider/AdminServiceProvider.php +++ b/src/ServiceProvider/AdminServiceProvider.php @@ -11,10 +11,6 @@ use RocketLazyLoadPlugin\Dependencies\LaunchpadCore\Container\AbstractServiceProvider; use RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface; use RocketLazyLoadPlugin\Subscriber\AdminPageSubscriber; -use RocketLazyLoadPlugin\Dependencies\LaunchpadOptions\Interfaces\OptionsInterface; -use RocketLazyLoadPlugin\Subscriber\ImagifyNoticeSubscriber; -use RocketLazyLoadPlugin\Subscriber\LazyloadSubscriber; -use RocketLazyLoadPlugin\Subscriber\ThirdParty\AMPSubscriber; /** * Adds the admin page to the container diff --git a/src/ServiceProvider/SubscribersServiceProvider.php b/src/ServiceProvider/SubscribersServiceProvider.php index d5f94a3..9db7bfa 100644 --- a/src/ServiceProvider/SubscribersServiceProvider.php +++ b/src/ServiceProvider/SubscribersServiceProvider.php @@ -7,7 +7,6 @@ namespace RocketLazyLoadPlugin\ServiceProvider; -use RocketLazyLoadPlugin\Admin\AdminPage; use RocketLazyLoadPlugin\Admin\ImagifyNotice; use RocketLazyLoadPlugin\Dependencies\LaunchpadCore\Container\AbstractServiceProvider; @@ -15,7 +14,6 @@ use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Assets; use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Iframe; use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Image; -use RocketLazyLoadPlugin\Subscriber\AdminPageSubscriber; use RocketLazyLoadPlugin\Subscriber\ImagifyNoticeSubscriber; use RocketLazyLoadPlugin\Subscriber\LazyloadSubscriber; use RocketLazyLoadPlugin\Subscriber\ThirdParty\AMPSubscriber; diff --git a/views/admin-page.php b/views/admin-page.php index 1f6688c..6dc7f3a 100644 --- a/views/admin-page.php +++ b/views/admin-page.php @@ -12,12 +12,15 @@ $options = [ 'images' => [ 'label' => __('Images', 'rocket-lazy-load'), + 'value' => $this->settings->get('images'), ], 'iframes' => [ 'label' => __('Iframes & Videos', 'rocket-lazy-load'), + 'value' => $this->settings->get('iframes'), ], 'youtube' => [ 'label' => __('Replace Youtube videos by thumbnail', 'rocket-lazy-load'), + 'value' => $this->settings->get('youtube'), ], ]; @@ -49,10 +52,9 @@ <p><?php esc_html_e('This mechanism reduces the number of HTTP requests and improves the loading time.', 'rocket-lazy-load'); ?></p> <ul class="rocket-lazyload-options"> <?php - $options_values = $this->options->get('options'); foreach ($options as $slug => $infos) : ?> <li class="rocket-lazyload-option"> - <input type="checkbox" value="1" id="lazyload-<?php echo esc_attr($slug); ?>" name="rocket_lazyload_options[<?php echo esc_attr($slug); ?>]" <?php checked($options_values[$slug] ?? 0, 1); ?> aria-labelledby="describe-lazyload-<?php echo esc_attr($slug); ?>"> + <input type="checkbox" value="1" id="lazyload-<?php echo esc_attr($slug); ?>" name="rocket_lazyload_options[<?php echo esc_attr($slug); ?>]" <?php checked($infos['value'] ?? 0, 1); ?> aria-labelledby="describe-lazyload-<?php echo esc_attr($slug); ?>"> <label for="lazyload-<?php echo esc_attr($slug); ?>"> <span id="describe-lazyload-<?php echo esc_attr($slug); ?>" class="rocket-lazyload-label-description"><?php echo esc_html($infos['label']); ?></span> </label> From 381c07f8d225ccea706684d480dac4ddbab5addd Mon Sep 17 00:00:00 2001 From: Nico Mollet <nico.mollet@gmail.com> Date: Tue, 2 Jul 2024 12:15:00 +0200 Subject: [PATCH 09/24] Adapt AMP subscriber --- src/Subscriber/ThirdParty/AMPSubscriber.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Subscriber/ThirdParty/AMPSubscriber.php b/src/Subscriber/ThirdParty/AMPSubscriber.php index 9a6e167..dc5cc39 100644 --- a/src/Subscriber/ThirdParty/AMPSubscriber.php +++ b/src/Subscriber/ThirdParty/AMPSubscriber.php @@ -51,8 +51,8 @@ public function set_event_manager( EventManager $event_manager ) { */ public function disableIfAMP() { if ( $this->isAmpEndpoint() ) { - $this->event_manager->addCallback( 'do_rocket_lazyload', '__return_false' ); - $this->event_manager->addCallback( 'do_rocket_lazyload_iframes', '__return_false' ); + $this->event_manager->add_callback( 'do_rocket_lazyload', '__return_false' ); + $this->event_manager->add_callback( 'do_rocket_lazyload_iframes', '__return_false' ); } } From 644a0c7057e68ab6410856c7a2342481a4d70d79 Mon Sep 17 00:00:00 2001 From: Nico Mollet <nico.mollet@gmail.com> Date: Tue, 2 Jul 2024 12:20:06 +0200 Subject: [PATCH 10/24] Updated compatibility with PHP >= 7.3 --- phpcs.xml | 2 +- readme.txt | 3 ++- rocket-lazy-load.php | 4 ++-- tests/Integration/bootstrap.php | 4 ++-- tests/Unit/boostrap.php | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/phpcs.xml b/phpcs.xml index a4bde2c..e05ad75 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -21,7 +21,7 @@ <!-- Rules: Check PHP version compatibility - see https://github.com/PHPCompatibility/PHPCompatibilityWP --> <rule ref="PHPCompatibility"/> - <config name="testVersion" value="5.6-"/> + <config name="testVersion" value="7.3-"/> <config name="minimum_supported_wp_version" value="4.9"/> <rule ref="WordPress"> diff --git a/readme.txt b/readme.txt index 4a81dcd..a111a02 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: wp_rocket, wp_media Tags: lazyload, lazy load, images, iframes, thumbnail, thumbnails, smiley, smilies, avatar, gravatar, youtube Requires at least: 4.7 Tested up to: 6.3 -Requires PHP: 5.6 +Requires PHP: 7.3 Stable tag: 2.3.8 Tags: lazy load, lazy loading, defer offscreen images, lazy load plugin, lazy load images, image lazy loading, iframe lazy load, video lazy load @@ -115,6 +115,7 @@ You can report any security bugs found in the source code of the site-reviews pl == Changelog == = 2.3.8 = Enhancement: Launchpad compatibility (see https://github.com/wp-launchpad) +Enhancement: Raised compatibility with PHP > 7.3 = 2.3.7 = Bugfix: Removed `rocket_lazyload_polyfill` filter due to a vulnerability on polyfill diff --git a/rocket-lazy-load.php b/rocket-lazy-load.php index 304dbbb..ad43c5e 100644 --- a/rocket-lazy-load.php +++ b/rocket-lazy-load.php @@ -4,7 +4,7 @@ * Plugin URI: http://wordpress.org/plugins/rocket-lazy-load/ * Description: The tiny Lazy Load script for WordPress without jQuery or others libraries. * Version: 2.3.8 - * Requires PHP: 5.6 + * Requires PHP: 7.3 * Author: WP Rocket * Author URI: https://wp-rocket.me * Text Domain: rocket-lazy-load @@ -32,7 +32,7 @@ define( 'ROCKET_LL_VERSION', '2.3.8' ); define( 'ROCKET_LL_WP_VERSION', '4.9' ); -define( 'ROCKET_LL_PHP_VERSION', '5.6' ); +define( 'ROCKET_LL_PHP_VERSION', '7.3' ); define( 'ROCKET_LL_BASENAME', plugin_basename( __FILE__ ) ); define( 'ROCKET_LL_PATH', realpath( plugin_dir_path( __FILE__ ) ) . '/' ); define( 'ROCKET_LL_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets/' ); diff --git a/tests/Integration/bootstrap.php b/tests/Integration/bootstrap.php index a1f8175..4e45159 100644 --- a/tests/Integration/bootstrap.php +++ b/tests/Integration/bootstrap.php @@ -5,8 +5,8 @@ * @package RocketlazyloadPlugin\Tests\Integration */ -if (version_compare(phpversion(), '5.6.0', '<')) { - die('Rocket Lazyload Plugin Integration Tests require PHP 5.6 or higher.'); +if (version_compare(phpversion(), '7.3.0', '<')) { + die('Rocket Lazyload Plugin Integration Tests require PHP 7.3 or higher.'); } // Define testing constants. diff --git a/tests/Unit/boostrap.php b/tests/Unit/boostrap.php index 742a274..b4004df 100644 --- a/tests/Unit/boostrap.php +++ b/tests/Unit/boostrap.php @@ -5,8 +5,8 @@ * @package RocketLazyload\Tests\Unit */ -if (version_compare(phpversion(), '5.6.0', '<')) { - die('Rocket Lazyload Plugin Unit Tests require PHP 5.6 or higher.'); +if (version_compare(phpversion(), '7.3.0', '<')) { + die('Rocket Lazyload Plugin Unit Tests require PHP 7.3 or higher.'); } define('RLL_PLUGIN_TESTS_ROOT', __DIR__); From b8ebddfdde58b2b89750887bbf72b7ded35e6676 Mon Sep 17 00:00:00 2001 From: Nico Mollet <nico.mollet@gmail.com> Date: Tue, 2 Jul 2024 12:21:44 +0200 Subject: [PATCH 11/24] Renamed boostrap to bootstrap --- tests/Unit/{boostrap.php => bootstrap.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/Unit/{boostrap.php => bootstrap.php} (100%) diff --git a/tests/Unit/boostrap.php b/tests/Unit/bootstrap.php similarity index 100% rename from tests/Unit/boostrap.php rename to tests/Unit/bootstrap.php From 9bf662d708c595a1b7547a924a88108bddc5b4e4 Mon Sep 17 00:00:00 2001 From: Nico Mollet <nico.mollet@gmail.com> Date: Tue, 2 Jul 2024 12:26:42 +0200 Subject: [PATCH 12/24] Updated consistency for WP required at least: 4.9 Updated WP tested up to: 6.5.5 --- readme.txt | 4 ++-- rocket-lazy-load.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/readme.txt b/readme.txt index a111a02..51908af 100644 --- a/readme.txt +++ b/readme.txt @@ -1,8 +1,8 @@ === LazyLoad Plugin – Lazy Load Images, Videos, and Iframes === Contributors: wp_rocket, wp_media Tags: lazyload, lazy load, images, iframes, thumbnail, thumbnails, smiley, smilies, avatar, gravatar, youtube -Requires at least: 4.7 -Tested up to: 6.3 +Requires at least: 4.9 +Tested up to: 6.5.5 Requires PHP: 7.3 Stable tag: 2.3.8 Tags: lazy load, lazy loading, defer offscreen images, lazy load plugin, lazy load images, image lazy loading, iframe lazy load, video lazy load diff --git a/rocket-lazy-load.php b/rocket-lazy-load.php index ad43c5e..5b83ae1 100644 --- a/rocket-lazy-load.php +++ b/rocket-lazy-load.php @@ -4,6 +4,7 @@ * Plugin URI: http://wordpress.org/plugins/rocket-lazy-load/ * Description: The tiny Lazy Load script for WordPress without jQuery or others libraries. * Version: 2.3.8 + * Requires at least: 4.9 * Requires PHP: 7.3 * Author: WP Rocket * Author URI: https://wp-rocket.me From cb6a3c97fde7f2cc35c5162bdba946bea96e29cd Mon Sep 17 00:00:00 2001 From: Nico Mollet <nico.mollet@gmail.com> Date: Tue, 2 Jul 2024 12:27:20 +0200 Subject: [PATCH 13/24] Updated copyright date --- rocket-lazy-load.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rocket-lazy-load.php b/rocket-lazy-load.php index 5b83ae1..bc74a2c 100644 --- a/rocket-lazy-load.php +++ b/rocket-lazy-load.php @@ -13,7 +13,7 @@ * * @package RocketLazyloadPlugin * - * Copyright 2015-2019 WP Media + * Copyright 2015-2024 WP Media * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From cfe7da816d2cb86e009f7f557cc4506006f0e94e Mon Sep 17 00:00:00 2001 From: Nico Mollet <nico.mollet@gmail.com> Date: Tue, 2 Jul 2024 16:27:38 +0200 Subject: [PATCH 14/24] LazyloadSubscriber use settings instead of options --- src/Subscriber/LazyloadSubscriber.php | 31 +++++++++++++-------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/Subscriber/LazyloadSubscriber.php b/src/Subscriber/LazyloadSubscriber.php index e91654b..599e4f0 100644 --- a/src/Subscriber/LazyloadSubscriber.php +++ b/src/Subscriber/LazyloadSubscriber.php @@ -2,24 +2,23 @@ namespace RocketLazyLoadPlugin\Subscriber; -use RocketLazyLoadPlugin\Dependencies\LaunchpadFrameworkOptions\Interfaces\OptionsAwareInterface; +use RocketLazyLoadPlugin\Dependencies\LaunchpadFrameworkOptions\Interfaces\SettingsAwareInterface; +use RocketLazyLoadPlugin\Dependencies\LaunchpadFrameworkOptions\Traits\SettingsAwareTrait; use RocketLazyLoadPlugin\EventManagement\SubscriberInterface; use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Assets; use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Image; use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Iframe; -use RocketLazyLoadPlugin\Dependencies\LaunchpadFrameworkOptions\Traits\OptionsAwareTrait; - /** * Lazyload Subscriber * * @since 2.0 * @author Remy Perona */ -class LazyloadSubscriber implements SubscriberInterface, OptionsAwareInterface +class LazyloadSubscriber implements SubscriberInterface, SettingsAwareInterface { - use OptionsAwareTrait; + use SettingsAwareTrait; /** * Assets instance @@ -95,7 +94,7 @@ public static function get_subscribed_events(): array { * @return void */ public function insertLazyloadScript() { - if ( ! $this->options->get('options')['images'] && ! $this->options->get('options')['iframes'] ) { + if ( ! $this->settings->get('images') && ! $this->settings->get('iframes') ) { return; } @@ -135,7 +134,7 @@ public function insertLazyloadScript() { ]; } - if ( $this->options->get('options')['images'] || $this->options->get('options')['iframes'] ) { + if ( $this->settings->get('images') || $this->settings->get('iframes') ) { // This filter is documented in src/Subscriber/LazyloadSubscriber.php. if ( apply_filters( 'rocket_use_native_lazyload', false ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals $inline_args['elements'] = isset( $inline_args['elements'] ) ? $inline_args['elements'] : []; @@ -143,13 +142,13 @@ public function insertLazyloadScript() { } } - if ( $this->options->get('options')['images'] ) { + if ( $this->settings->get('images') ) { $inline_args['elements'] = isset( $inline_args['elements'] ) ? $inline_args['elements'] : []; $inline_args['elements']['image'] = 'img[data-lazy-src]'; $inline_args['elements']['background_image'] = '.rocket-lazyload'; } - if ( $this->options->get('options')['iframes'] ) { + if ( $this->settings->get('iframes') ) { $inline_args['elements'] = isset( $inline_args['elements'] ) ? $inline_args['elements'] : []; $inline_args['elements']['iframe'] = 'iframe[data-lazy-src]'; } @@ -177,7 +176,7 @@ public function insertLazyloadScript() { * @return void */ public function insertYoutubeThumbnailScript() { - if ( ! $this->options->get('options')['youtube'] ) { + if ( ! $this->settings->get('youtube') ) { return; } @@ -198,7 +197,7 @@ public function insertYoutubeThumbnailScript() { $this->assets->insertYoutubeThumbnailScript( [ 'resolution' => $thumbnail_resolution, - 'lazy_image' => (bool) $this->options->get('options')['images'], + 'lazy_image' => (bool) $this->settings->get('images'), ] ); } @@ -228,7 +227,7 @@ public function insertNoJSStyle() { * @return void */ public function insertYoutubeThumbnailStyle() { - if ( ! $this->options->get('options')['youtube'] ) { + if ( ! $this->settings->get('youtube') ) { return; } @@ -330,15 +329,15 @@ public function lazyloadBuffer( $html ) { $buffer = $this->ignoreScripts( $html ); $buffer = $this->ignoreNoscripts( $buffer ); - if ( $this->options->get('options')['images']) { + if ( $this->settings->get('images')) { $html = $this->image->lazyloadImages( $html, $buffer ); $html = $this->image->lazyloadPictures( $html, $buffer ); $html = $this->image->lazyloadBackgroundImages( $html, $buffer ); } - if ( $this->options->get('options')['iframes'] ) { + if ( $this->settings->get('iframes') ) { $args = [ - 'youtube' => $this->options->get('options')['youtube'], + 'youtube' => $this->settings->get('youtube'), ]; $html = $this->iframe->lazyloadIframes( $html, $buffer, $args ); @@ -373,7 +372,7 @@ public function lazyloadSmilies() { return; } - if ( ! $this->options->get('options')['images'] ) { + if ( ! $this->settings->get('images') ) { return; } From 070c5c153c9dd0f10aada2852eed2cf50320d4dc Mon Sep 17 00:00:00 2001 From: Nico Mollet <nico.mollet@gmail.com> Date: Wed, 3 Jul 2024 10:00:06 +0200 Subject: [PATCH 15/24] Use Launchpad ClassicSubscriberInterface instead of OptimizedSubscriberInterface --- src/Admin/AdminPage.php | 4 ++-- src/Subscriber/AdminPageSubscriber.php | 8 ++++---- src/Subscriber/ImagifyNoticeSubscriber.php | 6 +++--- src/Subscriber/LazyloadSubscriber.php | 6 +++--- src/Subscriber/ThirdParty/AMPSubscriber.php | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Admin/AdminPage.php b/src/Admin/AdminPage.php index 3e7def0..1ebd2a6 100644 --- a/src/Admin/AdminPage.php +++ b/src/Admin/AdminPage.php @@ -31,7 +31,7 @@ class AdminPage implements SettingsAwareInterface * * @var string */ - private string $slug = 'rocket_lazyload'; + private $slug = 'rocket_lazyload'; /** * Template path @@ -41,7 +41,7 @@ class AdminPage implements SettingsAwareInterface * * @var string */ - private string $template_path; + private $template_path; /** * Constructor diff --git a/src/Subscriber/AdminPageSubscriber.php b/src/Subscriber/AdminPageSubscriber.php index 0aef520..a888686 100644 --- a/src/Subscriber/AdminPageSubscriber.php +++ b/src/Subscriber/AdminPageSubscriber.php @@ -2,7 +2,7 @@ namespace RocketLazyLoadPlugin\Subscriber; -use RocketLazyLoadPlugin\EventManagement\SubscriberInterface; +use RocketLazyLoadPlugin\Dependencies\LaunchpadCore\EventManagement\ClassicSubscriberInterface; use RocketLazyLoadPlugin\Admin\AdminPage; /** @@ -11,7 +11,7 @@ * @since 2.0 * @author Remy Perona */ -class AdminPageSubscriber implements SubscriberInterface { +class AdminPageSubscriber implements ClassicSubscriberInterface { /** * AdminPage instance @@ -31,7 +31,7 @@ class AdminPageSubscriber implements SubscriberInterface { * * @var string */ - private static string $plugin_basename; + private static $plugin_basename; /** * Constructor @@ -52,7 +52,7 @@ public function __construct( AdminPage $page, $plugin_basename ) { * * @return array */ - public static function get_subscribed_events(): array { + public function get_subscribed_events(): array { return [ 'admin_init' => 'configure', 'admin_menu' => 'addAdminPage', diff --git a/src/Subscriber/ImagifyNoticeSubscriber.php b/src/Subscriber/ImagifyNoticeSubscriber.php index 7d8304a..9e9b7c6 100644 --- a/src/Subscriber/ImagifyNoticeSubscriber.php +++ b/src/Subscriber/ImagifyNoticeSubscriber.php @@ -9,7 +9,7 @@ defined('ABSPATH') || die('Cheatin\' uh?'); -use RocketLazyLoadPlugin\EventManagement\SubscriberInterface; +use RocketLazyLoadPlugin\Dependencies\LaunchpadCore\EventManagement\ClassicSubscriberInterface; use RocketLazyLoadPlugin\Admin\ImagifyNotice; /** @@ -18,7 +18,7 @@ * @since 2.0 * @author Remy Perona */ -class ImagifyNoticeSubscriber implements SubscriberInterface +class ImagifyNoticeSubscriber implements ClassicSubscriberInterface { /** * ImagifyNotice instance @@ -46,7 +46,7 @@ public function __construct(ImagifyNotice $imagify_notice) /** * @inheritDoc */ - public static function get_subscribed_events(): array { + public function get_subscribed_events(): array { return [ 'admin_notices' => 'imagifyNotice', 'admin_footer-settings_page_rocket_lazyload' => 'dismissNoticeJS', diff --git a/src/Subscriber/LazyloadSubscriber.php b/src/Subscriber/LazyloadSubscriber.php index 599e4f0..6ac331d 100644 --- a/src/Subscriber/LazyloadSubscriber.php +++ b/src/Subscriber/LazyloadSubscriber.php @@ -2,9 +2,9 @@ namespace RocketLazyLoadPlugin\Subscriber; +use RocketLazyLoadPlugin\Dependencies\LaunchpadCore\EventManagement\ClassicSubscriberInterface; use RocketLazyLoadPlugin\Dependencies\LaunchpadFrameworkOptions\Interfaces\SettingsAwareInterface; use RocketLazyLoadPlugin\Dependencies\LaunchpadFrameworkOptions\Traits\SettingsAwareTrait; -use RocketLazyLoadPlugin\EventManagement\SubscriberInterface; use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Assets; use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Image; use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Iframe; @@ -15,7 +15,7 @@ * @since 2.0 * @author Remy Perona */ -class LazyloadSubscriber implements SubscriberInterface, SettingsAwareInterface +class LazyloadSubscriber implements ClassicSubscriberInterface, SettingsAwareInterface { use SettingsAwareTrait; @@ -71,7 +71,7 @@ public function __construct( Assets $assets, Image $image, Iframe $iframe ) { * * @return array */ - public static function get_subscribed_events(): array { + public function get_subscribed_events(): array { return [ 'wp_footer' => [ [ 'insertLazyloadScript', \ROCKET_LL_INT_MAX ], diff --git a/src/Subscriber/ThirdParty/AMPSubscriber.php b/src/Subscriber/ThirdParty/AMPSubscriber.php index dc5cc39..d3d93ef 100644 --- a/src/Subscriber/ThirdParty/AMPSubscriber.php +++ b/src/Subscriber/ThirdParty/AMPSubscriber.php @@ -25,7 +25,7 @@ class AMPSubscriber implements EventManagerAwareSubscriberInterface { * * @return array */ - public static function get_subscribed_events() { + public function get_subscribed_events() { return [ 'wp' => 'disableIfAMP', ]; From 65861e0f14296488dc37ca883d3e24a26e855f55 Mon Sep 17 00:00:00 2001 From: Nico Mollet <nico.mollet@gmail.com> Date: Wed, 3 Jul 2024 10:38:09 +0200 Subject: [PATCH 16/24] Format --- src/Admin/AdminPage.php | 258 ++++++++++---------- src/Admin/ImagifyNotice.php | 100 ++++---- src/Subscriber/AdminPageSubscriber.php | 31 +-- src/Subscriber/ImagifyNoticeSubscriber.php | 242 +++++++++--------- src/Subscriber/LazyloadSubscriber.php | 107 ++++---- src/Subscriber/ThirdParty/AMPSubscriber.php | 9 +- 6 files changed, 373 insertions(+), 374 deletions(-) diff --git a/src/Admin/AdminPage.php b/src/Admin/AdminPage.php index 1ebd2a6..aa484f0 100644 --- a/src/Admin/AdminPage.php +++ b/src/Admin/AdminPage.php @@ -7,7 +7,7 @@ namespace RocketLazyLoadPlugin\Admin; -defined('ABSPATH') || die('Cheatin\' uh?'); +defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' ); use RocketLazyLoadPlugin\Dependencies\LaunchpadFrameworkOptions\Interfaces\SettingsAwareInterface; use RocketLazyLoadPlugin\Dependencies\LaunchpadFrameworkOptions\Traits\SettingsAwareTrait; @@ -19,138 +19,130 @@ * @since 2.0 * @author Remy Perona */ -class AdminPage implements SettingsAwareInterface -{ +class AdminPage implements SettingsAwareInterface { use SettingsAwareTrait; - /** - * Plugin slug - * - * @since 2.0 - * @author Remy Perona - * - * @var string - */ - private $slug = 'rocket_lazyload'; - - /** - * Template path - * - * @since 2.0 - * @author Remy Perona - * - * @var string - */ - private $template_path; - - /** - * Constructor - * - * @param string $template_path Template path. - * - * @author Remy Perona - * - * @since 2.0 - */ - public function __construct( string $template_path) - { - $this->template_path = $template_path; - } - - /** - * Registers plugin settings with WordPress - * - * @since 2.0 - * @author Remy Perona - * - * @return void - */ - public function configure() - { - register_setting($this->getSlug(), $this->getSlug() . '_options'); - } - - /** - * Gets the settings page title - * - * @since 2.0 - * @author Remy Perona - * - * @return string - */ - public function getPageTitle() - { - return __('LazyLoad by WP Rocket', 'rocket-lazy-load'); - } - - /** - * Gets the settings submenu title - * - * @since 2.0 - * @author Remy Perona - * - * @return string - */ - public function getMenuTitle() - { - return __('LazyLoad', 'rocket-lazy-load'); - } - - /** - * Gets the plugin slug - * - * @since 2.0 - * @author Remy Perona - * - * @return string - */ - public function getSlug() - { - return $this->slug; - } - - /** - * Gets the plugin required capability - * - * @since 2.0 - * @author Remy Perona - * - * @return string - */ - public function getCapability() - { - return 'manage_options'; - } - - /** - * Renders the admin page template - * - * @since 2.0 - * @author Remy Perona - * - * @return void - */ - public function renderPage() - { - $this->renderTemplate('admin-page'); - } - - /** - * Renders the given template if it's readable. - * - * @since 2.0 - * @author Remy Perona - * - * @param string $template Template name. - */ - protected function renderTemplate($template) - { - $template_path = $this->template_path . $template . '.php'; - - if (! is_readable($template_path)) { - return; - } - - include $template_path; - } + /** + * Plugin slug + * + * @since 2.0 + * @author Remy Perona + * + * @var string + */ + private $slug = 'rocket_lazyload'; + + /** + * Template path + * + * @since 2.0 + * @author Remy Perona + * + * @var string + */ + private $template_path; + + /** + * Constructor + * + * @param string $template_path Template path. + * + * @author Remy Perona + * + * @since 2.0 + */ + public function __construct( string $template_path ) { + $this->template_path = $template_path; + } + + /** + * Registers plugin settings with WordPress + * + * @return void + * @author Remy Perona + * + * @since 2.0 + */ + public function configure() { + register_setting( $this->getSlug(), $this->getSlug() . '_options' ); + } + + /** + * Gets the settings page title + * + * @return string + * @author Remy Perona + * + * @since 2.0 + */ + public function getPageTitle() { + return __( 'LazyLoad by WP Rocket', 'rocket-lazy-load' ); + } + + /** + * Gets the settings submenu title + * + * @return string + * @author Remy Perona + * + * @since 2.0 + */ + public function getMenuTitle() { + return __( 'LazyLoad', 'rocket-lazy-load' ); + } + + /** + * Gets the plugin slug + * + * @return string + * @author Remy Perona + * + * @since 2.0 + */ + public function getSlug() { + return $this->slug; + } + + /** + * Gets the plugin required capability + * + * @return string + * @author Remy Perona + * + * @since 2.0 + */ + public function getCapability() { + return 'manage_options'; + } + + /** + * Renders the admin page template + * + * @return void + * @author Remy Perona + * + * @since 2.0 + */ + public function renderPage() { + $this->renderTemplate( 'admin-page' ); + } + + /** + * Renders the given template if it's readable. + * + * @param string $template Template name. + * + * @author Remy Perona + * + * @since 2.0 + */ + protected function renderTemplate( $template ) { + $template_path = $this->template_path . $template . '.php'; + + if ( ! is_readable( $template_path ) ) { + return; + } + + include $template_path; + } } diff --git a/src/Admin/ImagifyNotice.php b/src/Admin/ImagifyNotice.php index f563ab9..26c6136 100644 --- a/src/Admin/ImagifyNotice.php +++ b/src/Admin/ImagifyNotice.php @@ -13,60 +13,58 @@ * @since 2.0 * @author Remy Perona */ -class ImagifyNotice -{ - /** - * Template path - * - * @since 2.0 - * @author Remy Perona - * - * @var string - */ - private $template_path; +class ImagifyNotice { + /** + * Template path + * + * @since 2.0 + * @author Remy Perona + * + * @var string + */ + private $template_path; - /** - * Constructor - * - * @since 2.0 - * @author Remy Perona - * - * @param string $template_path Template path. - */ - public function __construct($template_path) - { - $this->template_path = $template_path; - } + /** + * Constructor + * + * @param string $template_path Template path. + * + * @author Remy Perona + * + * @since 2.0 + */ + public function __construct( $template_path ) { + $this->template_path = $template_path; + } - /** - * Renders the Imagify notice - * - * @since 2.0 - * @author Remy Perona - * - * @return void - */ - public function displayNotice() - { - $this->renderTemplate('imagify-notice'); - } + /** + * Renders the Imagify notice + * + * @return void + * @author Remy Perona + * + * @since 2.0 + */ + public function displayNotice() { + $this->renderTemplate( 'imagify-notice' ); + } - /** - * Renders the given template if it's readable. - * - * @since 2.0 - * @author Remy Perona - * - * @param string $template Template name. - */ - protected function renderTemplate($template) - { - $template_path = $this->template_path . $template . '.php'; + /** + * Renders the given template if it's readable. + * + * @param string $template Template name. + * + * @author Remy Perona + * + * @since 2.0 + */ + protected function renderTemplate( $template ) { + $template_path = $this->template_path . $template . '.php'; - if (! is_readable($template_path)) { - return; - } + if ( ! is_readable( $template_path ) ) { + return; + } - include $template_path; - } + include $template_path; + } } diff --git a/src/Subscriber/AdminPageSubscriber.php b/src/Subscriber/AdminPageSubscriber.php index a888686..6f7da29 100644 --- a/src/Subscriber/AdminPageSubscriber.php +++ b/src/Subscriber/AdminPageSubscriber.php @@ -36,11 +36,12 @@ class AdminPageSubscriber implements ClassicSubscriberInterface { /** * Constructor * + * @param AdminPage $page AdminPage instance. + * @param string $plugin_basename Plugin basename. + * * @since 2.0 * @author Remy Perona * - * @param AdminPage $page AdminPage instance. - * @param string $plugin_basename Plugin basename. */ public function __construct( AdminPage $page, $plugin_basename ) { $this->page = $page; @@ -54,20 +55,20 @@ public function __construct( AdminPage $page, $plugin_basename ) { */ public function get_subscribed_events(): array { return [ - 'admin_init' => 'configure', - 'admin_menu' => 'addAdminPage', - "plugin_action_links_".self::$plugin_basename => 'addPluginPageLink', - 'admin_enqueue_scripts' => 'enqueueAdminStyle', + 'admin_init' => 'configure', + 'admin_menu' => 'addAdminPage', + "plugin_action_links_" . self::$plugin_basename => 'addPluginPageLink', + 'admin_enqueue_scripts' => 'enqueueAdminStyle', ]; } /** * Registers the plugin settings in WordPress * - * @since 2.0 + * @return void * @author Remy Perona * - * @return void + * @since 2.0 */ public function configure() { $this->page->configure(); @@ -76,10 +77,10 @@ public function configure() { /** * Adds the admin page to the settings menu * - * @since 2.0 + * @return void * @author Remy Perona * - * @return void + * @since 2.0 */ public function addAdminPage() { add_options_page( @@ -94,11 +95,12 @@ public function addAdminPage() { /** * Adds a link to the plugin settings on the plugins page * + * @param array $actions Actions for the plugin. + * + * @return array * @since 2.0 * @author Remy Perona * - * @param array $actions Actions for the plugin. - * @return array */ public function addPluginPageLink( $actions ) { array_unshift( @@ -116,10 +118,11 @@ public function addPluginPageLink( $actions ) { /** * Enqueue the css for the option page * - * @since 2.0 + * @param string $hook_suffix Current page hook. + * * @author Remy Perona * - * @param string $hook_suffix Current page hook. + * @since 2.0 */ public function enqueueAdminStyle( $hook_suffix ) { if ( 'settings_page_rocket_lazyload' !== $hook_suffix ) { diff --git a/src/Subscriber/ImagifyNoticeSubscriber.php b/src/Subscriber/ImagifyNoticeSubscriber.php index 9e9b7c6..8a13f54 100644 --- a/src/Subscriber/ImagifyNoticeSubscriber.php +++ b/src/Subscriber/ImagifyNoticeSubscriber.php @@ -7,7 +7,7 @@ namespace RocketLazyLoadPlugin\Subscriber; -defined('ABSPATH') || die('Cheatin\' uh?'); +defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' ); use RocketLazyLoadPlugin\Dependencies\LaunchpadCore\EventManagement\ClassicSubscriberInterface; use RocketLazyLoadPlugin\Admin\ImagifyNotice; @@ -18,79 +18,76 @@ * @since 2.0 * @author Remy Perona */ -class ImagifyNoticeSubscriber implements ClassicSubscriberInterface -{ - /** - * ImagifyNotice instance - * - * @since 2.0 - * @author Remy Perona - * - * @var ImagifyNotice - */ - private $imagify_notice; - - /** - * Constructor - * - * @since 2.0 - * @author Remy Perona - * - * @param ImagifyNotice $imagify_notice ImagifyNotice instance. - */ - public function __construct(ImagifyNotice $imagify_notice) - { - $this->imagify_notice = $imagify_notice; - } - - /** - * @inheritDoc - */ - public function get_subscribed_events(): array { - return [ - 'admin_notices' => 'imagifyNotice', - 'admin_footer-settings_page_rocket_lazyload' => 'dismissNoticeJS', - 'wp_ajax_rocket_lazyload_ignore' => 'dismissBoxes', - 'admin_post_rocket_lazyload_ignore' => 'dismissBoxes', - ]; - } - - /** - * Displays the Imagify notice - * - * @since 2.0 - * @author Remy Perona - * - * @return void - */ - public function imagifyNotice() - { - $current_screen = get_current_screen(); - - if ('admin_notices' === current_filter() && ( isset($current_screen) && 'settings_page_rocket_lazyload' !== $current_screen->base )) { - return; - } - - $boxes = get_user_meta(get_current_user_id(), 'rocket_lazyload_boxes', true); - - if (defined('IMAGIFY_VERSION') || in_array('rocket_lazyload_imagify_notice', (array) $boxes, true) || 1 === get_option('rocket_lazyload_dismiss_imagify_notice') || ! current_user_can('manage_options')) { - return; - } - - $this->imagify_notice->displayNotice(); - } - - /** - * Inserts the javascript to dismiss the notice - * - * @since 2.0 - * @author Remy Perona - * - * @return void - */ - public function dismissNoticeJS() - { - echo "<script> +class ImagifyNoticeSubscriber implements ClassicSubscriberInterface { + /** + * ImagifyNotice instance + * + * @since 2.0 + * @author Remy Perona + * + * @var ImagifyNotice + */ + private $imagify_notice; + + /** + * Constructor + * + * @param ImagifyNotice $imagify_notice ImagifyNotice instance. + * + * @author Remy Perona + * + * @since 2.0 + */ + public function __construct( ImagifyNotice $imagify_notice ) { + $this->imagify_notice = $imagify_notice; + } + + /** + * @inheritDoc + */ + public function get_subscribed_events(): array { + return [ + 'admin_notices' => 'imagifyNotice', + 'admin_footer-settings_page_rocket_lazyload' => 'dismissNoticeJS', + 'wp_ajax_rocket_lazyload_ignore' => 'dismissBoxes', + 'admin_post_rocket_lazyload_ignore' => 'dismissBoxes', + ]; + } + + /** + * Displays the Imagify notice + * + * @return void + * @author Remy Perona + * + * @since 2.0 + */ + public function imagifyNotice() { + $current_screen = get_current_screen(); + + if ( 'admin_notices' === current_filter() && ( isset( $current_screen ) && 'settings_page_rocket_lazyload' !== $current_screen->base ) ) { + return; + } + + $boxes = get_user_meta( get_current_user_id(), 'rocket_lazyload_boxes', true ); + + if ( defined( 'IMAGIFY_VERSION' ) || in_array( 'rocket_lazyload_imagify_notice', (array) $boxes, true ) || 1 === get_option( 'rocket_lazyload_dismiss_imagify_notice' ) || ! current_user_can( 'manage_options' ) ) { + return; + } + + $this->imagify_notice->displayNotice(); + } + + /** + * Inserts the javascript to dismiss the notice + * + * @return void + * @author Remy Perona + * + * @since 2.0 + */ + public function dismissNoticeJS() { + echo "<script> jQuery( document ).ready( function( $ ){ $( '.rktll-cross' ).on( 'click', function( e ) { e.preventDefault(); @@ -99,53 +96,52 @@ public function dismissNoticeJS() }); } ); </script>"; - } - - /** - * Saves the dismiss for the user - * - * @since 2.0 - * @author Remy Perona - * - * @return void - */ - public function dismissBoxes() - { - if (! isset($_GET['box'], $_GET['action'], $_GET['_wpnonce'])) { - return; - } - - if (! wp_verify_nonce(sanitize_key($_GET['_wpnonce']), 'rocket_lazyload_ignore_rocket_lazyload_imagify_notice')) { - if (defined('DOING_AJAX')) { - wp_send_json(['error' => 1]); - } else { - wp_nonce_ays(''); - } - } - - $box = sanitize_key(wp_unslash($_GET['box'])); - - if ('rocket_lazyload_imagify_notice' === $box) { - update_option('rocket_lazyload_dismiss_imagify_notice', 0); - } - - $actual = (array) get_user_meta(get_current_user_id(), 'rocket_lazyload_boxes', true); - $actual = array_merge($actual, [ $box ]); - $actual = array_filter($actual); - $actual = array_unique($actual); - - update_user_meta(get_current_user_id(), 'rocket_lazyload_boxes', $actual); - delete_transient($box); - - if (empty($GLOBALS['pagenow']) || 'admin-post.php' !== $GLOBALS['pagenow']) { - return; - } - - if (defined('DOING_AJAX')) { - wp_send_json(['error' => 0]); - } else { - wp_safe_redirect(esc_url_raw(wp_get_referer())); - die(); - } - } + } + + /** + * Saves the dismiss for the user + * + * @return void + * @author Remy Perona + * + * @since 2.0 + */ + public function dismissBoxes() { + if ( ! isset( $_GET['box'], $_GET['action'], $_GET['_wpnonce'] ) ) { + return; + } + + if ( ! wp_verify_nonce( sanitize_key( $_GET['_wpnonce'] ), 'rocket_lazyload_ignore_rocket_lazyload_imagify_notice' ) ) { + if ( defined( 'DOING_AJAX' ) ) { + wp_send_json( [ 'error' => 1 ] ); + } else { + wp_nonce_ays( '' ); + } + } + + $box = sanitize_key( wp_unslash( $_GET['box'] ) ); + + if ( 'rocket_lazyload_imagify_notice' === $box ) { + update_option( 'rocket_lazyload_dismiss_imagify_notice', 0 ); + } + + $actual = (array) get_user_meta( get_current_user_id(), 'rocket_lazyload_boxes', true ); + $actual = array_merge( $actual, [ $box ] ); + $actual = array_filter( $actual ); + $actual = array_unique( $actual ); + + update_user_meta( get_current_user_id(), 'rocket_lazyload_boxes', $actual ); + delete_transient( $box ); + + if ( empty( $GLOBALS['pagenow'] ) || 'admin-post.php' !== $GLOBALS['pagenow'] ) { + return; + } + + if ( defined( 'DOING_AJAX' ) ) { + wp_send_json( [ 'error' => 0 ] ); + } else { + wp_safe_redirect( esc_url_raw( wp_get_referer() ) ); + die(); + } + } } diff --git a/src/Subscriber/LazyloadSubscriber.php b/src/Subscriber/LazyloadSubscriber.php index 6ac331d..51ec4b9 100644 --- a/src/Subscriber/LazyloadSubscriber.php +++ b/src/Subscriber/LazyloadSubscriber.php @@ -15,8 +15,7 @@ * @since 2.0 * @author Remy Perona */ -class LazyloadSubscriber implements ClassicSubscriberInterface, SettingsAwareInterface -{ +class LazyloadSubscriber implements ClassicSubscriberInterface, SettingsAwareInterface { use SettingsAwareTrait; @@ -53,17 +52,18 @@ class LazyloadSubscriber implements ClassicSubscriberInterface, SettingsAwareInt /** * Constructor * - * @since 2.0 + * @param Assets $assets Assets instance. + * @param Image $image Image instance. + * @param Iframe $iframe Iframe instance. + * * @author Remy Perona * - * @param Assets $assets Assets instance. - * @param Image $image Image instance. - * @param Iframe $iframe Iframe instance. + * @since 2.0 */ public function __construct( Assets $assets, Image $image, Iframe $iframe ) { - $this->assets = $assets; - $this->image = $image; - $this->iframe = $iframe; + $this->assets = $assets; + $this->image = $image; + $this->iframe = $iframe; } /** @@ -88,13 +88,13 @@ public function get_subscribed_events(): array { /** * Inserts the lazyload script in the footer * - * @since 2.0 + * @return void * @author Remy Perona * - * @return void + * @since 2.0 */ public function insertLazyloadScript() { - if ( ! $this->settings->get('images') && ! $this->settings->get('iframes') ) { + if ( ! $this->settings->get( 'images' ) && ! $this->settings->get( 'iframes' ) ) { return; } @@ -105,10 +105,11 @@ public function insertLazyloadScript() { /** * Filters the threshold at which lazyload is triggered * - * @since 1.2 + * @param int $threshold Threshold value. + * * @author Remy Perona * - * @param int $threshold Threshold value. + * @since 1.2 */ $threshold = apply_filters( 'rocket_lazyload_threshold', 300 ); @@ -125,8 +126,9 @@ public function insertLazyloadScript() { /** * Filters the use of native lazyload * - * @since 2.3.3 * @param bool $use_native True to enable native lazyload usage. + * + * @since 2.3.3 */ if ( apply_filters( 'rocket_use_native_lazyload', false ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals $inline_args['options'] = [ @@ -134,7 +136,7 @@ public function insertLazyloadScript() { ]; } - if ( $this->settings->get('images') || $this->settings->get('iframes') ) { + if ( $this->settings->get( 'images' ) || $this->settings->get( 'iframes' ) ) { // This filter is documented in src/Subscriber/LazyloadSubscriber.php. if ( apply_filters( 'rocket_use_native_lazyload', false ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals $inline_args['elements'] = isset( $inline_args['elements'] ) ? $inline_args['elements'] : []; @@ -142,13 +144,13 @@ public function insertLazyloadScript() { } } - if ( $this->settings->get('images') ) { + if ( $this->settings->get( 'images' ) ) { $inline_args['elements'] = isset( $inline_args['elements'] ) ? $inline_args['elements'] : []; $inline_args['elements']['image'] = 'img[data-lazy-src]'; $inline_args['elements']['background_image'] = '.rocket-lazyload'; } - if ( $this->settings->get('iframes') ) { + if ( $this->settings->get( 'iframes' ) ) { $inline_args['elements'] = isset( $inline_args['elements'] ) ? $inline_args['elements'] : []; $inline_args['elements']['iframe'] = 'iframe[data-lazy-src]'; } @@ -156,10 +158,11 @@ public function insertLazyloadScript() { /** * Filters the arguments array for the lazyload script options * - * @since 2.0 + * @param array $inline_args Arguments used for the lazyload script options. + * * @author Remy Perona * - * @param array $inline_args Arguments used for the lazyload script options. + * @since 2.0 */ $inline_args = apply_filters( 'rocket_lazyload_script_args', $inline_args ); @@ -170,13 +173,13 @@ public function insertLazyloadScript() { /** * Inserts the Youtube thumbnail script in the footer * - * @since 2.0 + * @return void * @author Remy Perona * - * @return void + * @since 2.0 */ public function insertYoutubeThumbnailScript() { - if ( ! $this->settings->get('youtube') ) { + if ( ! $this->settings->get( 'youtube' ) ) { return; } @@ -187,17 +190,18 @@ public function insertYoutubeThumbnailScript() { /** * Filters the resolution of the YouTube thumbnail * - * @since 1.4.8 + * @param string $thumbnail_resolution The resolution of the thumbnail. Accepted values: default, mqdefault, sddefault, hqdefault, maxresdefault + * * @author Arun Basil Lal * - * @param string $thumbnail_resolution The resolution of the thumbnail. Accepted values: default, mqdefault, sddefault, hqdefault, maxresdefault + * @since 1.4.8 */ $thumbnail_resolution = apply_filters( 'rocket_lazyload_youtube_thumbnail_resolution', 'hqdefault' ); $this->assets->insertYoutubeThumbnailScript( [ 'resolution' => $thumbnail_resolution, - 'lazy_image' => (bool) $this->settings->get('images'), + 'lazy_image' => (bool) $this->settings->get( 'images' ), ] ); } @@ -205,10 +209,10 @@ public function insertYoutubeThumbnailScript() { /** * Inserts the no JS CSS compatibility in the header * - * @since 2.0.3 + * @return void * @author Remy Perona * - * @return void + * @since 2.0.3 */ public function insertNoJSStyle() { if ( ! $this->shouldLazyload() ) { @@ -221,13 +225,13 @@ public function insertNoJSStyle() { /** * Inserts the Youtube thumbnail CSS in the header * - * @since 2.0 + * @return void * @author Remy Perona * - * @return void + * @since 2.0 */ public function insertYoutubeThumbnailStyle() { - if ( ! $this->settings->get('youtube') ) { + if ( ! $this->settings->get( 'youtube' ) ) { return; } @@ -246,10 +250,10 @@ public function insertYoutubeThumbnailStyle() { /** * Checks if lazyload should be applied * - * @since 2.0 + * @return bool * @author Remy Perona * - * @return bool + * @since 2.0 */ private function shouldLazyload() { if ( is_admin() || is_feed() || is_preview() || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) || ( defined( 'DONOTLAZYLOAD' ) && DONOTLAZYLOAD ) ) { @@ -263,10 +267,11 @@ private function shouldLazyload() { /** * Filters the lazyload application * - * @since 2.0 + * @param bool $do_rocket_lazyload True to apply lazyload, false otherwise. + * * @author Remy Perona * - * @param bool $do_rocket_lazyload True to apply lazyload, false otherwise. + * @since 2.0 */ if ( ! apply_filters( 'do_rocket_lazyload', true ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals return false; @@ -278,10 +283,10 @@ private function shouldLazyload() { /** * Checks if current page is a page builder editor. * - * @since 2.2.2 + * @return bool * @author Remy Perona * - * @return bool + * @since 2.2.2 */ private function isPageBuilder() { // Exclude Page Builders editors. @@ -303,10 +308,10 @@ private function isPageBuilder() { /** * Gets the content to lazyload * - * @since 2.0 + * @return void * @author Remy Perona * - * @return void + * @since 2.0 */ public function lazyload() { if ( ! $this->shouldLazyload() ) { @@ -319,25 +324,26 @@ public function lazyload() { /** * Applies lazyload on the provided content * + * @param string $html HTML content. + * + * @return string * @since 2.0 * @author Remy Perona * - * @param string $html HTML content. - * @return string */ public function lazyloadBuffer( $html ) { $buffer = $this->ignoreScripts( $html ); $buffer = $this->ignoreNoscripts( $buffer ); - if ( $this->settings->get('images')) { + if ( $this->settings->get( 'images' ) ) { $html = $this->image->lazyloadImages( $html, $buffer ); $html = $this->image->lazyloadPictures( $html, $buffer ); $html = $this->image->lazyloadBackgroundImages( $html, $buffer ); } - if ( $this->settings->get('iframes') ) { + if ( $this->settings->get( 'iframes' ) ) { $args = [ - 'youtube' => $this->settings->get('youtube'), + 'youtube' => $this->settings->get( 'youtube' ), ]; $html = $this->iframe->lazyloadIframes( $html, $buffer, $args ); @@ -349,11 +355,12 @@ public function lazyloadBuffer( $html ) { /** * Applies lazyload on responsive images attributes srcset and sizes * + * @param string $html Image HTML. + * + * @return string * @since 2.0 * @author Remy Perona * - * @param string $html Image HTML. - * @return string */ public function lazyloadResponsive( $html ) { return $this->image->lazyloadResponsiveAttributes( $html ); @@ -362,17 +369,17 @@ public function lazyloadResponsive( $html ) { /** * Applies lazyload on WordPress smilies * - * @since 2.0 + * @return void * @author Remy Perona * - * @return void + * @since 2.0 */ public function lazyloadSmilies() { if ( ! $this->shouldLazyload() ) { return; } - if ( ! $this->settings->get('images') ) { + if ( ! $this->settings->get( 'images' ) ) { return; } @@ -396,6 +403,7 @@ public function lazyloadSmilies() { * Remove inline scripts from the HTML to parse * * @param string $html HTML content. + * * @return string */ private function ignoreScripts( $html ) { @@ -406,6 +414,7 @@ private function ignoreScripts( $html ) { * Remove noscript tags from the HTML to parse * * @param string $html HTML content. + * * @return string */ private function ignoreNoscripts( $html ) { diff --git a/src/Subscriber/ThirdParty/AMPSubscriber.php b/src/Subscriber/ThirdParty/AMPSubscriber.php index d3d93ef..0cdf6bc 100644 --- a/src/Subscriber/ThirdParty/AMPSubscriber.php +++ b/src/Subscriber/ThirdParty/AMPSubscriber.php @@ -35,6 +35,7 @@ public function get_subscribed_events() { * Set the WordPress event manager for the subscriber. * * @param EventManager $event_manager EventManager instance. + * * @return void */ public function set_event_manager( EventManager $event_manager ) { @@ -44,10 +45,10 @@ public function set_event_manager( EventManager $event_manager ) { /** * Disable if on AMP page * - * @since 2.0.2 + * @return void * @author Remy Perona * - * @return void + * @since 2.0.2 */ public function disableIfAMP() { if ( $this->isAmpEndpoint() ) { @@ -59,10 +60,10 @@ public function disableIfAMP() { /** * Checks if current page uses AMP * - * @since 2.0 + * @return boolean * @author Remy Perona * - * @return boolean + * @since 2.0 */ private function isAmpEndpoint() { if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) { From 24645232522da24384d4cab7c73beb90c8927736 Mon Sep 17 00:00:00 2001 From: Nico Mollet <nico.mollet@gmail.com> Date: Wed, 3 Jul 2024 10:39:12 +0200 Subject: [PATCH 17/24] Remove unused EventManagement --- src/EventManagement/SubscriberInterface.php | 40 --------------------- 1 file changed, 40 deletions(-) delete mode 100644 src/EventManagement/SubscriberInterface.php diff --git a/src/EventManagement/SubscriberInterface.php b/src/EventManagement/SubscriberInterface.php deleted file mode 100644 index b1f7b03..0000000 --- a/src/EventManagement/SubscriberInterface.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -/** - * Interface for subscribers - * - * @package RocketLazyload - */ - -namespace RocketLazyLoadPlugin\EventManagement; -use RocketLazyLoadPlugin\Dependencies\LaunchpadCore\EventManagement\OptimizedSubscriberInterface; - -/** - * A Subscriber knows what specific WordPress events it wants to listen to. - * - * When an EventManager adds a Subscriber, it gets all the WordPress events that - * it wants to listen to. It then adds the subscriber as a listener for each of them. - * - * @author Carl Alexander <contact@carlalexander.ca> - */ -interface SubscriberInterface extends OptimizedSubscriberInterface -{ - /** - * Returns an array of events that this subscriber wants to listen to. - * - * The array key is the event name. The value can be: - * - * * The method name - * * An array with the method name and priority - * * An array with the method name, priority and number of accepted arguments - * - * For instance: - * - * * array('hook_name' => 'method_name') - * * array('hook_name' => array('method_name', $priority)) - * * array('hook_name' => array('method_name', $priority, $accepted_args)) - * * array('hook_name' => array(array('method_name_1', $priority_1, $accepted_args_1)), array('method_name_2', $priority_2, $accepted_args_2))) - * - * @return array - */ - public static function get_subscribed_events(); -} From 72511bd6df8f9a230203eb6868670003553a2553 Mon Sep 17 00:00:00 2001 From: Nico Mollet <nico.mollet@gmail.com> Date: Wed, 3 Jul 2024 11:23:45 +0200 Subject: [PATCH 18/24] Minimum PHP version 7.3 in composer --- composer.json | 2 +- composer.lock | 40 +++++++++++++++++++--------------------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/composer.json b/composer.json index 2f1e9b8..964839f 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,7 @@ } }, "require": { - "php": ">=7.4", + "php": ">=7.3", "composer/installers": "^1.0 || ^2.0", "wp-media/rocket-lazyload-common": "^3.0" }, diff --git a/composer.lock b/composer.lock index 3f91f0e..1df9066 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": "625de99d98d749e10e03afc9a9b428c1", + "content-hash": "f8f5522c9fbf865b72b500ccd40267d0", "packages": [ { "name": "composer/installers", @@ -750,26 +750,26 @@ }, { "name": "league/mime-type-detection", - "version": "1.15.0", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301" + "reference": "c7f2872fb273bf493811473dafc88d60ae829f48" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", - "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/c7f2872fb273bf493811473dafc88d60ae829f48", + "reference": "c7f2872fb273bf493811473dafc88d60ae829f48", "shasum": "" }, "require": { "ext-fileinfo": "*", - "php": "^7.4 || ^8.0" + "php": "^7.2 || ^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.2", "phpstan/phpstan": "^0.12.68", - "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0" + "phpunit/phpunit": "^8.5.8 || ^9.3" }, "type": "library", "autoload": { @@ -790,7 +790,7 @@ "description": "Mime-type detection for Flysystem", "support": { "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.15.0" + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.12.0" }, "funding": [ { @@ -802,7 +802,7 @@ "type": "tidelift" } ], - "time": "2024-01-28T23:22:08+00:00" + "time": "2023-08-03T07:14:11+00:00" }, { "name": "mikey179/vfsstream", @@ -1000,27 +1000,25 @@ }, { "name": "nikic/php-parser", - "version": "v5.0.2", + "version": "v4.19.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" + "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", - "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4e1b88d21c69391150ace211e9eaf05810858d0b", + "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b", "shasum": "" }, "require": { - "ext-ctype": "*", - "ext-json": "*", "ext-tokenizer": "*", - "php": ">=7.4" + "php": ">=7.1" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/php-parse" @@ -1028,7 +1026,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "4.9-dev" } }, "autoload": { @@ -1052,9 +1050,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.1" }, - "time": "2024-03-05T20:51:40+00:00" + "time": "2024-03-17T08:10:35+00:00" }, { "name": "phar-io/manifest", @@ -4219,7 +4217,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.4" + "php": ">=7.3" }, "platform-dev": [], "plugin-api-version": "2.2.0" From 1067b5dd4ad47603620d68b3f81eb1369774bcc3 Mon Sep 17 00:00:00 2001 From: COQUARD Cyrille <coquardcyr@gmail.com> Date: Thu, 4 Jul 2024 09:11:46 +0200 Subject: [PATCH 19/24] Updated dependency `wp-launchpad/framework-options` to 0.1.3 --- composer.json | 2 +- composer.lock | 123 +++++++++++++++++++++-------------------- configs/parameters.php | 2 +- 3 files changed, 65 insertions(+), 62 deletions(-) diff --git a/composer.json b/composer.json index 964839f..a825fdc 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "phpunit/phpunit": "^7.5 || ^8 || ^9", "wp-coding-standards/wpcs": "^2.0.0", "wp-launchpad/core": "^0.2.6", - "wp-launchpad/framework-options": "^0.1.2", + "wp-launchpad/framework-options": "^0.1.3", "wp-media/phpunit": "^3.0" }, "extra": { diff --git a/composer.lock b/composer.lock index 1df9066..859d718 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": "f8f5522c9fbf865b72b500ccd40267d0", + "content-hash": "3c18ef2fc1d2c23563098a57fe28ab2e", "packages": [ { "name": "composer/installers", @@ -456,30 +456,30 @@ }, { "name": "doctrine/instantiator", - "version": "1.5.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^9 || ^11", + "doctrine/coding-standard": "^11", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.30 || ^5.4" + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5.27", + "vimeo/psalm": "^5.4" }, "type": "library", "autoload": { @@ -506,7 +506,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + "source": "https://github.com/doctrine/instantiator/tree/2.0.0" }, "funding": [ { @@ -522,7 +522,7 @@ "type": "tidelift" } ], - "time": "2022-12-30T00:15:36+00:00" + "time": "2022-12-30T00:23:10+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -750,26 +750,26 @@ }, { "name": "league/mime-type-detection", - "version": "1.12.0", + "version": "1.15.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "c7f2872fb273bf493811473dafc88d60ae829f48" + "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/c7f2872fb273bf493811473dafc88d60ae829f48", - "reference": "c7f2872fb273bf493811473dafc88d60ae829f48", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", + "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", "shasum": "" }, "require": { "ext-fileinfo": "*", - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.2", "phpstan/phpstan": "^0.12.68", - "phpunit/phpunit": "^8.5.8 || ^9.3" + "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0" }, "type": "library", "autoload": { @@ -790,7 +790,7 @@ "description": "Mime-type detection for Flysystem", "support": { "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.12.0" + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.15.0" }, "funding": [ { @@ -802,7 +802,7 @@ "type": "tidelift" } ], - "time": "2023-08-03T07:14:11+00:00" + "time": "2024-01-28T23:22:08+00:00" }, { "name": "mikey179/vfsstream", @@ -1000,25 +1000,27 @@ }, { "name": "nikic/php-parser", - "version": "v4.19.1", + "version": "v5.1.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b" + "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4e1b88d21c69391150ace211e9eaf05810858d0b", - "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/683130c2ff8c2739f4822ff7ac5c873ec529abd1", + "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1", "shasum": "" }, "require": { + "ext-ctype": "*", + "ext-json": "*", "ext-tokenizer": "*", - "php": ">=7.1" + "php": ">=7.4" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^9.0" }, "bin": [ "bin/php-parse" @@ -1026,7 +1028,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.9-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -1050,9 +1052,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.1.0" }, - "time": "2024-03-17T08:10:35+00:00" + "time": "2024-07-01T20:03:41+00:00" }, { "name": "phar-io/manifest", @@ -2995,25 +2997,25 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.3", + "version": "v3.5.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "80d075412b557d41002320b96a096ca65aa2c98d" + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d", - "reference": "80d075412b557d41002320b96a096ca65aa2c98d", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -3042,7 +3044,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.3" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" }, "funding": [ { @@ -3058,7 +3060,7 @@ "type": "tidelift" } ], - "time": "2023-01-24T14:02:46+00:00" + "time": "2024-04-18T09:32:20+00:00" }, { "name": "symfony/finder", @@ -3678,34 +3680,34 @@ }, { "name": "symfony/string", - "version": "v5.4.41", + "version": "v6.4.9", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "065a9611e0b1fd2197a867e1fb7f2238191b7096" + "reference": "76792dbd99690a5ebef8050d9206c60c59e681d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/065a9611e0b1fd2197a867e1fb7f2238191b7096", - "reference": "065a9611e0b1fd2197a867e1fb7f2238191b7096", + "url": "https://api.github.com/repos/symfony/string/zipball/76792dbd99690a5ebef8050d9206c60c59e681d7", + "reference": "76792dbd99690a5ebef8050d9206c60c59e681d7", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "~1.15" + "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": ">=3.0" + "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0|^6.0" + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/intl": "^6.2|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -3744,7 +3746,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.41" + "source": "https://github.com/symfony/string/tree/v6.4.9" }, "funding": [ { @@ -3760,7 +3762,7 @@ "type": "tidelift" } ], - "time": "2024-06-28T09:20:55+00:00" + "time": "2024-06-28T09:25:38+00:00" }, { "name": "theseer/tokenizer", @@ -3966,16 +3968,16 @@ }, { "name": "wp-launchpad/framework-options", - "version": "v0.1.2", + "version": "v0.1.3", "source": { "type": "git", "url": "https://github.com/wp-launchpad/framework-options.git", - "reference": "0941149bc7ba628a1c4fdf380eeef69969ed5ced" + "reference": "2484621a54734c8f0e07fc78cde84fb74faae3fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-launchpad/framework-options/zipball/0941149bc7ba628a1c4fdf380eeef69969ed5ced", - "reference": "0941149bc7ba628a1c4fdf380eeef69969ed5ced", + "url": "https://api.github.com/repos/wp-launchpad/framework-options/zipball/2484621a54734c8f0e07fc78cde84fb74faae3fd", + "reference": "2484621a54734c8f0e07fc78cde84fb74faae3fd", "shasum": "" }, "require": { @@ -3984,6 +3986,7 @@ "wp-launchpad/options": "^0.1" }, "require-dev": { + "wp-launchpad/phpunit-wp-hooks": "^1.0", "wp-media/phpunit": "^3.0" }, "type": "library", @@ -3996,9 +3999,9 @@ "description": "Options library for the framework Launchpad", "support": { "issues": "https://github.com/wp-launchpad/framework-options/issues", - "source": "https://github.com/wp-launchpad/framework-options/tree/v0.1.2" + "source": "https://github.com/wp-launchpad/framework-options/tree/v0.1.3" }, - "time": "2024-05-09T13:30:49+00:00" + "time": "2024-07-03T09:48:16+00:00" }, { "name": "wp-launchpad/options", @@ -4220,5 +4223,5 @@ "php": ">=7.3" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } diff --git a/configs/parameters.php b/configs/parameters.php index 90e1abe..bed878a 100644 --- a/configs/parameters.php +++ b/configs/parameters.php @@ -8,5 +8,5 @@ 'is_mu_plugin' => false, 'translation_key' => 'rocket-lazy-load', 'prefix' => 'rocket_lazyload_', - 'rocket_lazyload__settings' => 'options' + 'rocket_lazyload_settings' => 'options' ]; \ No newline at end of file From 3946c40e0e8244b04b646054d2f0dcc6c96275dd Mon Sep 17 00:00:00 2001 From: COQUARD Cyrille <coquardcyr@gmail.com> Date: Thu, 4 Jul 2024 10:04:06 +0200 Subject: [PATCH 20/24] Added regular build in the pipeline --- .github/workflows/deploy-tag.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-tag.yml b/.github/workflows/deploy-tag.yml index 97c6ba9..36198d8 100644 --- a/.github/workflows/deploy-tag.yml +++ b/.github/workflows/deploy-tag.yml @@ -9,7 +9,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@master - - name: build + - name: regular build + run: composer install --ignore-platform-reqs + - name: build without dev run: composer install --no-dev --no-scripts --ignore-platform-reqs - name: remove composer/installers run: composer remove composer/installers --update-no-dev --no-scripts --ignore-platform-reqs From f3ded4d9e5833d510b625496d9e4197e14b60978 Mon Sep 17 00:00:00 2001 From: COQUARD Cyrille <coquardcyr@gmail.com> Date: Thu, 4 Jul 2024 13:49:18 +0200 Subject: [PATCH 21/24] Removed wp-media/rocket-lazyload-common from vendors and fixed a bug with ll --- composer.json | 6 +- composer.lock | 100 +++++++++++++------------- readme.txt | 1 + src/Subscriber/LazyloadSubscriber.php | 28 +++++--- 4 files changed, 71 insertions(+), 64 deletions(-) diff --git a/composer.json b/composer.json index a825fdc..1ba1956 100644 --- a/composer.json +++ b/composer.json @@ -39,8 +39,7 @@ }, "require": { "php": ">=7.3", - "composer/installers": "^1.0 || ^2.0", - "wp-media/rocket-lazyload-common": "^3.0" + "composer/installers": "^1.0 || ^2.0" }, "require-dev": { "psr/container": "1.0.0", @@ -52,7 +51,8 @@ "wp-coding-standards/wpcs": "^2.0.0", "wp-launchpad/core": "^0.2.6", "wp-launchpad/framework-options": "^0.1.3", - "wp-media/phpunit": "^3.0" + "wp-media/phpunit": "^3.0", + "wp-media/rocket-lazyload-common": "^3.0" }, "extra": { "mozart": { diff --git a/composer.lock b/composer.lock index 859d718..3a6f821 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": "3c18ef2fc1d2c23563098a57fe28ab2e", + "content-hash": "7d34084ad823de124118731064df1041", "packages": [ { "name": "composer/installers", @@ -151,55 +151,6 @@ } ], "time": "2024-06-24T20:46:46+00:00" - }, - { - "name": "wp-media/rocket-lazyload-common", - "version": "v3.0.11", - "source": { - "type": "git", - "url": "https://github.com/wp-media/rocket-lazyload-common.git", - "reference": "df4369bdb0b8777bca7a7375e3d956c5794d844c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/df4369bdb0b8777bca7a7375e3d956c5794d844c", - "reference": "df4369bdb0b8777bca7a7375e3d956c5794d844c", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "php": ">=7.0", - "phpcompatibility/phpcompatibility-wp": "^2.0", - "phpunit/phpunit": "^7.5 || ^8 || ^9", - "szepeviktor/phpstan-wordpress": "^0.7.0", - "wp-coding-standards/wpcs": "^2.0", - "wp-media/phpunit": "^3.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "RocketLazyload\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-3.0-or-later" - ], - "authors": [ - { - "name": "WP Media", - "email": "contact@wp-media.me" - } - ], - "description": "Common Code between WP Rocket and Lazyload by WP Rocket", - "support": { - "issues": "https://github.com/wp-media/rocket-lazyload-common/issues", - "source": "https://github.com/wp-media/rocket-lazyload-common" - }, - "time": "2023-04-20T06:44:58+00:00" } ], "packages-dev": [ @@ -4081,6 +4032,55 @@ }, "time": "2023-05-10T15:56:16+00:00" }, + { + "name": "wp-media/rocket-lazyload-common", + "version": "v3.0.11", + "source": { + "type": "git", + "url": "https://github.com/wp-media/rocket-lazyload-common.git", + "reference": "df4369bdb0b8777bca7a7375e3d956c5794d844c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/df4369bdb0b8777bca7a7375e3d956c5794d844c", + "reference": "df4369bdb0b8777bca7a7375e3d956c5794d844c", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "php": ">=7.0", + "phpcompatibility/phpcompatibility-wp": "^2.0", + "phpunit/phpunit": "^7.5 || ^8 || ^9", + "szepeviktor/phpstan-wordpress": "^0.7.0", + "wp-coding-standards/wpcs": "^2.0", + "wp-media/phpunit": "^3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "RocketLazyload\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "WP Media", + "email": "contact@wp-media.me" + } + ], + "description": "Common Code between WP Rocket and Lazyload by WP Rocket", + "support": { + "issues": "https://github.com/wp-media/rocket-lazyload-common/issues", + "source": "https://github.com/wp-media/rocket-lazyload-common" + }, + "time": "2023-04-20T06:44:58+00:00" + }, { "name": "yoast/phpunit-polyfills", "version": "1.1.1", diff --git a/readme.txt b/readme.txt index 51908af..7786d5f 100644 --- a/readme.txt +++ b/readme.txt @@ -116,6 +116,7 @@ You can report any security bugs found in the source code of the site-reviews pl = 2.3.8 = Enhancement: Launchpad compatibility (see https://github.com/wp-launchpad) Enhancement: Raised compatibility with PHP > 7.3 +Bug: Removed `wp-media/rocket-lazyload-common` from vendors = 2.3.7 = Bugfix: Removed `rocket_lazyload_polyfill` filter due to a vulnerability on polyfill diff --git a/src/Subscriber/LazyloadSubscriber.php b/src/Subscriber/LazyloadSubscriber.php index 51ec4b9..3549de7 100644 --- a/src/Subscriber/LazyloadSubscriber.php +++ b/src/Subscriber/LazyloadSubscriber.php @@ -123,22 +123,14 @@ public function insertLazyloadScript() { 'threshold' => $threshold, ]; - /** - * Filters the use of native lazyload - * - * @param bool $use_native True to enable native lazyload usage. - * - * @since 2.3.3 - */ - if ( apply_filters( 'rocket_use_native_lazyload', false ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals + if ( $this->is_native_images() ) { $inline_args['options'] = [ 'use_native' => 'true', ]; } if ( $this->settings->get( 'images' ) || $this->settings->get( 'iframes' ) ) { - // This filter is documented in src/Subscriber/LazyloadSubscriber.php. - if ( apply_filters( 'rocket_use_native_lazyload', false ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals + if ( $this->is_native_images() ) { $inline_args['elements'] = isset( $inline_args['elements'] ) ? $inline_args['elements'] : []; $inline_args['elements']['loading'] = '[loading=lazy]'; } @@ -336,7 +328,7 @@ public function lazyloadBuffer( $html ) { $buffer = $this->ignoreNoscripts( $buffer ); if ( $this->settings->get( 'images' ) ) { - $html = $this->image->lazyloadImages( $html, $buffer ); + $html = $this->image->lazyloadImages( $html, $buffer , $this->is_native_images() ); $html = $this->image->lazyloadPictures( $html, $buffer ); $html = $this->image->lazyloadBackgroundImages( $html, $buffer ); } @@ -420,4 +412,18 @@ private function ignoreScripts( $html ) { private function ignoreNoscripts( $html ) { return preg_replace( '#<noscript>(?:.+)</noscript>#Umsi', '', $html ); } + + /** + * Checks if native lazyload is enabled for images + ** + * @return bool + */ + private function is_native_images(): bool { + /** + * Filters the use of native lazyload for images + * + * @param bool $use_native True to use native lazyload for images, false otherwise. + */ + return (bool) apply_filters( 'rocket_use_native_lazyload', false ); + } } From 7b05d9ed4343dacd78a8dcfe8e0aad1b2c4eb968 Mon Sep 17 00:00:00 2001 From: COQUARD Cyrille <coquardcyr@gmail.com> Date: Thu, 4 Jul 2024 13:51:52 +0200 Subject: [PATCH 22/24] Removed wp-media/rocket-lazyload-common from vendors and fixed a bug with ll --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 7786d5f..062df7f 100644 --- a/readme.txt +++ b/readme.txt @@ -117,7 +117,7 @@ You can report any security bugs found in the source code of the site-reviews pl Enhancement: Launchpad compatibility (see https://github.com/wp-launchpad) Enhancement: Raised compatibility with PHP > 7.3 Bug: Removed `wp-media/rocket-lazyload-common` from vendors - +Enhancement: Raised `wp-media/rocket-lazyload-common` to 3.0 = 2.3.7 = Bugfix: Removed `rocket_lazyload_polyfill` filter due to a vulnerability on polyfill From c906b21134fbbea8c821951b4d91074931656ecf Mon Sep 17 00:00:00 2001 From: COQUARD Cyrille <coquardcyr@gmail.com> Date: Thu, 4 Jul 2024 13:52:03 +0200 Subject: [PATCH 23/24] Removed wp-media/rocket-lazyload-common from vendors and fixed a bug with ll --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index 062df7f..53a47b4 100644 --- a/readme.txt +++ b/readme.txt @@ -118,6 +118,7 @@ Enhancement: Launchpad compatibility (see https://github.com/wp-launchpad) Enhancement: Raised compatibility with PHP > 7.3 Bug: Removed `wp-media/rocket-lazyload-common` from vendors Enhancement: Raised `wp-media/rocket-lazyload-common` to 3.0 + = 2.3.7 = Bugfix: Removed `rocket_lazyload_polyfill` filter due to a vulnerability on polyfill From fc342adc80a36b74093ce5b25e2fa38d047ace46 Mon Sep 17 00:00:00 2001 From: Nico Mollet <nico.mollet@gmail.com> Date: Thu, 4 Jul 2024 14:02:12 +0200 Subject: [PATCH 24/24] Prevent overflow in admin because of legend width 100% --- assets/css/admin.css | 1 - composer.lock | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/assets/css/admin.css b/assets/css/admin.css index 3e231b3..b85ebbb 100644 --- a/assets/css/admin.css +++ b/assets/css/admin.css @@ -100,7 +100,6 @@ .rocket-lazyload-form legend { display: block; - width: 100%; padding: 19px 0 14px; border-bottom: 1px solid #EEEEEE; font-weight: 600; diff --git a/composer.lock b/composer.lock index 3a6f821..9b2a310 100644 --- a/composer.lock +++ b/composer.lock @@ -4223,5 +4223,5 @@ "php": ">=7.3" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" }