diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..127b465 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +end_of_line = lf + +[*.php] +indent_size = 4 + +[*.md] +indent_size = 4 +trim_trailing_whitespace = false diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000..391e134 --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,31 @@ +name: Tests +on: [push, pull_request] +jobs: + bedrock: + name: ScriptsStylesLoader (PHP ${{ matrix.php-versions }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php-versions: ['7.2', '7.3'] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup PHP, with composer and extensions + uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + with: + php-version: ${{ matrix.php-versions }} + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - uses: actions/cache@v1 + with: + path: ${{ steps.composer-cache.outputs.dir }} + # Use composer.json for key, if composer.lock is not committed. + # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + - name: Install Composer dependencies + run: composer install -n --prefer-dist + - name: PHP test + run: composer check diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index faae375..5a2f507 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,10 +1,8 @@ name: Release - on: push: tags: - - '*' - + - '*' jobs: release: runs-on: ubuntu-latest @@ -17,56 +15,71 @@ jobs: - name: Get the version id: get_version run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} + - name: Setup php + uses: shivammathur/setup-php@v2 + with: + php-version: '7.3' + - name: Setup node + uses: actions/setup-node@v1 + with: + node-version: '12.x' + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies + uses: actions/cache@v1 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + - name: Composer Install + run: composer install --no-dev + - name: Get yarn cache directory + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - name: Cache yarn dependencies + uses: actions/cache@v1 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Yarn Install + run: yarn install + - name: Yarn Build + run: yarn build - name: Create Zip File uses: thedoctor0/zip-release@master - if: startsWith(github.ref, 'refs/tags/') with: filename: '${{ steps.get_repo_name.outputs.REPOSITORY_NAME }}.zip' - exclusions: '.babelrc - .circleci/config.yml - .deployignore + exclusions: '*.git* + *.lock + *.log .distignore - .DS_Store .editorconfig .eslint* - .idea - .phpcs.xml - .phpcs.xml.dist - .travis.yml - .vscode - *.git* - *.lock - *.log - *.sql - *.tar.gz - *.zip - behat.yml - bin - bitbucket-pipelines.yml - circle.yml - composer* - dependencies.yml - Gruntfile.js + .phpunit.result.cache + composer.json + docker* gulp* - multisite.* - node_modules package* - phpcs* - phpunit* + phpcs.xml + phpstan.neon + phpunit.xml.dist README.md - src + require-checker.config.json stylelint* - tests - Thumbs.db tsconfig.json - vendor - webpack.config.js - wp-cli.local.yml' + /assets/src/* + /docker/* + /node_modules/* + /test/* + /wordpress/*' - name: Release uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') with: - files: ${{ steps.get_repo_name.outputs.REPOSITORY_NAME }}.zip - name: Version ${{ steps.get_version.outputs.VERSION }} + files: ${{ steps.get_repo_name.outputs.REPOSITORY_NAME }}.zip + name: Version ${{ steps.get_version.outputs.VERSION }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index c644253..f51ad42 100644 --- a/.gitignore +++ b/.gitignore @@ -1,55 +1,18 @@ ### Plugin ### -assets - -# GulpPress Local Config -gulppress.local.config.ts - -### Logs ### -*.log - -### Dotenv ### -.env -.env.* -!.env.example - -### Composer ### -/vendor - -### WP-CLI ### -wp-cli.local.yml - -### Database dumps ### -db-sync -*.sql +/assets/* +!/assets/src/ +/wordpress/ ### Composer ### -vendor +/vendor/ +/composer.lock ### Node ### -.node/ -node_modules/ -npm-debug.log -.npmrc - -### Log files ### -**/log -npm-debug.log* -yarn-error.log* - -### Mac OSX + Windows ### -.DS_Store -Thumbs.db - -### Vim ### -*.sw[op] -*.un~ +/node_modules/ +/yarn.lock -### Editor directory ### -.idea -.vscode -**/.idea -**/.vscode +### GulpPress Local Config ### +/gulppress.local.config.ts -### Archives ### -*.tar.gz -*.zip +## Tests ### +/infection-log.txt diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index e7e9d11..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Default ignored files -/workspace.xml diff --git a/.idea/composerJson.xml b/.idea/composerJson.xml deleted file mode 100644 index 1b07430..0000000 --- a/.idea/composerJson.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 28a804d..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 68675ba..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml deleted file mode 100644 index 220062d..0000000 --- a/.idea/php.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/scripts-styles-loader.iml b/.idea/scripts-styles-loader.iml deleted file mode 100644 index 781abda..0000000 --- a/.idea/scripts-styles-loader.iml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/README.md b/README.md index 58a4fc8..6f253b2 100644 --- a/README.md +++ b/README.md @@ -1 +1,84 @@ -# wplib-AssetLoader \ No newline at end of file +# WordPress Plugin - Woda Scripts Styles Loader + +> Load assets without the hassle + +## Installation + +You can install the plugin by uploading it in the WordPress Admin or via `composer`. + +```bash +composer require woda/wp-scripts-styles-loader +``` + +## Configure + +Pass the settings to the init function or hook into the supplied filter + +```php +use Woda\WordPress\ScriptsStylesLoader\HashFile; +use Woda\WordPress\ScriptsStylesLoader\Script; +use Woda\WordPress\ScriptsStylesLoader\Style; + +// Import a json containing cache busting hash values, versions, etc. +$scriptsHashFile = new HashFile(get_stylesheet_directory() . '/assets/js/.assets.json'); + +/** + * Create a Script Helper + * + * @param string $src Full URL of the script, or path of the script relative to the WordPress root directory. + * @param string[] $deps Optional. An array of registered script handles this script depends on. Default empty array. + * @param string $handle Optional. Name of the script. Should be unique. + * If empty, handle will be generated from prefix and file name. + * @param string|bool|null $ver Optional. String specifying script version number, if it has one, which is added to the URL + * as a query string for cache busting purposes. If version is set to false, a version + * number is automatically added equal to current installed WordPress version. + * If set to null, no version is added. + * @param string $inFooter Optional. Whether to enqueue the script before instead of in the . + * Default 'false'. + */ +(new Script(get_stylesheet_directory_uri() . '/assets/js/main.js', ['jquery'], null, null, true)) + // Cache busting via a hash file + ->addHashFile($scriptsHashFile) + // Enqueue in the frontend. + ->enqueue() + // Enqueue in the backend. + ->enqueueAdmin(); + +// Replace jQuery in the frontend with your own version +(new Script(get_stylesheet_directory_uri() . '/assets/js/vendor/jquery.js', ['jquery-core', 'jquery-migrate'], 'jquery')) + // Calculate an md5 hash value for cache busting purposes. + ->calculateHashValue() + // Deregister the handle we are about to reregister + ->deregister() + // Register our replacement + ->register(); + + +$stylesHashFile = new HashFile(get_stylesheet_directory() . '/assets/css/.assets.json'); +/** + * Create a Style Helper + * + * @param string $src Full URL of the stylesheet, or path of the stylesheet relative to the WordPress root directory. + * @param string[] $deps Optional. An array of registered stylesheet handles this stylesheet depends on. Default empty array. + * @param string $handle Optional. Name of the stylesheet. Should be unique. + * If empty, handle will be generated from prefix and file name. + * @param string|bool|null $ver Optional. String specifying stylesheet version number, if it has one, which is added to the URL + * as a query string for cache busting purposes. If version is set to false, a version + * number is automatically added equal to current installed WordPress version. + * If set to null, no version is added. + * @param string $media Optional. The media for which this stylesheet has been defined. + * Default 'all'. Accepts media types like 'all', 'print' and 'screen', or media queries like + * '(orientation: portrait)' and '(max-width: 640px)'. + */ +(new Style(get_stylesheet_directory_uri() . '/assets/css/main.css')) + ->addHashFile($stylesHashFile) + ->enqueue(); +(new Style(get_stylesheet_directory_uri() . '/assets/css/admin.css')) + ->addHashFile($stylesHashFile) + ->enqueueAdmin(); +(new Style(get_stylesheet_directory_uri() . '/assets/css/editor2.css')) + ->addHashFile($stylesHashFile) + // Add an editor style + // https://codex.wordpress.org/Editor_Style + ->enqueueEditor(); +``` diff --git a/composer.json b/composer.json index 4b855a5..84a74a9 100644 --- a/composer.json +++ b/composer.json @@ -1,10 +1,13 @@ { "name": "woda/wp-scripts-styles-loader", + "type": "wordpress-plugin", "description": "", "keywords": [ "wordpress", "plugin", - "assets" + "assets", + "scripts", + "styles" ], "license": "GPLv3", "homepage": "https://github.com/wwwoda/woda-scripts-styles-loader", @@ -23,18 +26,62 @@ "email": "wolfgang@woda.at" } ], - "type": "wordpress-plugin", "support": { "issues": "https://github.com/wwwoda/woda-scripts-styles-loader/issues", "source": "https://github.com/wwwoda/woda-scripts-styles-loader" }, - "require": { - "php": ">=7.2.0", - "ext-json": "*" - }, "autoload": { "psr-4": { - "Woda\\WordPress\\ScriptsStylesLoader\\": "includes/" + "Woda\\WordPress\\ScriptsStylesLoader\\": "includes" } + }, + "autoload-dev": { + "psr-4": { + "Woda\\Test\\WordPress\\ScriptsStylesLoader\\": "test" + } + }, + "repositories": [ + { + "type": "composer", + "url": "https://wpackagist.org" + } + ], + "require": { + "php": ">=7.2", + "ext-json": "^1.6" + }, + "require-dev": { + "10up/wp_mock": "^0.4.2", + "eventjet/coding-standard": "^3.1", + "maglnet/composer-require-checker": "^2.1", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12.25", + "phpstan/phpstan-mockery": "^0.12.5", + "roots/wordpress": "^5.4", + "szepeviktor/phpstan-wordpress": "^0.6.0" + }, + "config": { + "sort-packages": true + }, + "extra": { + "wordpress-install-dir": "vendor/wordpress/wordpress", + "installer-paths": { + "vendor/{$vendor}/{$name}/": [ + "type:wordpress-plugin" + ] + } + }, + "scripts": { + "check": [ + "@check-deps", + "@cs-check", + "@phpstan", + "@phpunit" + ], + "check-deps": "vendor/bin/composer-require-checker check --config-file=require-checker.config.json", + "cs-check": "vendor/bin/phpcs", + "cs-fix": "vendor/bin/phpcbf", + "phpstan": "vendor/bin/phpstan analyse", + "phpunit": "vendor/bin/phpunit" } } diff --git a/composer.lock b/composer.lock index 7cd2f21..04b1801 100644 --- a/composer.lock +++ b/composer.lock @@ -4,16 +4,3144 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1553800e94c3c02798f9756711f786f9", + "content-hash": "9e3ea1e49b2d46586619f7002807165a", "packages": [], - "packages-dev": [], + "packages-dev": [ + { + "name": "10up/wp_mock", + "version": "0.4.2", + "source": { + "type": "git", + "url": "https://github.com/10up/wp_mock.git", + "reference": "9019226eb50df275aa86bb15bfc98a619601ee49" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/10up/wp_mock/zipball/9019226eb50df275aa86bb15bfc98a619601ee49", + "reference": "9019226eb50df275aa86bb15bfc98a619601ee49", + "shasum": "" + }, + "require": { + "antecedent/patchwork": "^2.1", + "mockery/mockery": "^1.0", + "php": ">=7.1", + "phpunit/phpunit": ">=7.0" + }, + "require-dev": { + "behat/behat": "^3.0", + "php-coveralls/php-coveralls": "^2.1", + "sebastian/comparator": ">=1.2.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "WP_Mock\\": "./php/WP_Mock" + }, + "classmap": [ + "php/WP_Mock.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "A mocking library to take the pain out of unit testing for WordPress", + "time": "2019-03-16T03:44:39+00:00" + }, + { + "name": "antecedent/patchwork", + "version": "2.1.12", + "source": { + "type": "git", + "url": "https://github.com/antecedent/patchwork.git", + "reference": "b98e046dd4c0acc34a0846604f06f6111654d9ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/antecedent/patchwork/zipball/b98e046dd4c0acc34a0846604f06f6111654d9ea", + "reference": "b98e046dd4c0acc34a0846604f06f6111654d9ea", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": ">=4" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignas Rudaitis", + "email": "ignas.rudaitis@gmail.com" + } + ], + "description": "Method redefinition (monkey-patching) functionality for PHP.", + "homepage": "http://patchwork2.org/", + "keywords": [ + "aop", + "aspect", + "interception", + "monkeypatching", + "redefinition", + "runkit", + "testing" + ], + "time": "2019-12-22T17:52:09+00:00" + }, + { + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v0.5.0", + "source": { + "type": "git", + "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", + "reference": "e749410375ff6fb7a040a68878c656c2e610b132" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e749410375ff6fb7a040a68878c656c2e610b132", + "reference": "e749410375ff6fb7a040a68878c656c2e610b132", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0", + "php": "^5.3|^7", + "squizlabs/php_codesniffer": "^2|^3" + }, + "require-dev": { + "composer/composer": "*", + "phpcompatibility/php-compatibility": "^9.0", + "sensiolabs/security-checker": "^4.1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "autoload": { + "psr-4": { + "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Franck Nijhof", + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" + } + ], + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://www.dealerdirect.com", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" + ], + "time": "2018-10-26T13:21:45+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "f350df0268e904597e3bd9c4685c53e0e333feea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f350df0268e904597e3bd9c4685c53e0e333feea", + "reference": "f350df0268e904597e3bd9c4685c53e0e333feea", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-shim": "^0.11", + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2020-05-29T17:27:14+00:00" + }, + { + "name": "eventjet/coding-standard", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/eventjet/coding-standard.git", + "reference": "be8ccb48c27be05526670547841aea0331512a00" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/eventjet/coding-standard/zipball/be8ccb48c27be05526670547841aea0331512a00", + "reference": "be8ccb48c27be05526670547841aea0331512a00", + "shasum": "" + }, + "require": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", + "php": "^7.1", + "slevomat/coding-standard": "^6.0", + "squizlabs/php_codesniffer": "^3.5" + }, + "require-dev": { + "phpunit/phpunit": "^8.0" + }, + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "Eventjet\\CodingStandard\\": "Eventjet", + "Eventjet\\CodingStandard\\Strict\\": "EventjetStrict" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Rudolph Gottesheim", + "email": "r.gottesheim@loot.at" + }, + { + "name": "Thomas Rieschl", + "email": "thomas.rieschl@eventjet.at" + } + ], + "description": "Eventjet Coding Standard", + "time": "2020-01-15T10:04:56+00:00" + }, + { + "name": "hamcrest/hamcrest-php", + "version": "v2.0.0", + "source": { + "type": "git", + "url": "https://github.com/hamcrest/hamcrest-php.git", + "reference": "776503d3a8e85d4f9a1148614f95b7a608b046ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/776503d3a8e85d4f9a1148614f95b7a608b046ad", + "reference": "776503d3a8e85d4f9a1148614f95b7a608b046ad", + "shasum": "" + }, + "require": { + "php": "^5.3|^7.0" + }, + "replace": { + "cordoval/hamcrest-php": "*", + "davedevelopment/hamcrest-php": "*", + "kodova/hamcrest-php": "*" + }, + "require-dev": { + "phpunit/php-file-iterator": "1.3.3", + "phpunit/phpunit": "~4.0", + "satooshi/php-coveralls": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "hamcrest" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD" + ], + "description": "This is the PHP port of Hamcrest Matchers", + "keywords": [ + "test" + ], + "time": "2016-01-20T08:20:44+00:00" + }, + { + "name": "maglnet/composer-require-checker", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/maglnet/ComposerRequireChecker.git", + "reference": "0c66698d487fcb5c66cf07108e2180c818fb2e72" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maglnet/ComposerRequireChecker/zipball/0c66698d487fcb5c66cf07108e2180c818fb2e72", + "reference": "0c66698d487fcb5c66cf07108e2180c818fb2e72", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-phar": "*", + "nikic/php-parser": "^4.3", + "ocramius/package-versions": "^1.4.2", + "php": "^7.2", + "symfony/console": "^5.0", + "webmozart/glob": "^4.1" + }, + "require-dev": { + "ext-zend-opcache": "*", + "mikey179/vfsstream": "^1.6", + "phpstan/phpstan": "^0.12", + "phpunit/phpunit": "^8.4.3" + }, + "bin": [ + "bin/composer-require-checker" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "psr-4": { + "ComposerRequireChecker\\": "src/ComposerRequireChecker" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.io/" + }, + { + "name": "Matthias Glaub", + "email": "magl@magl.net", + "homepage": "http://magl.net" + } + ], + "description": "CLI tool to analyze composer dependencies and verify that no unknown symbols are used in the sources of a package", + "homepage": "https://github.com/maglnet/ComposerRequireChecker", + "keywords": [ + "analysis", + "cli", + "composer", + "dependency", + "imports", + "require", + "requirements" + ], + "time": "2019-12-28T13:49:20+00:00" + }, + { + "name": "mockery/mockery", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/mockery/mockery.git", + "reference": "f69bbde7d7a75d6b2862d9ca8fab1cd28014b4be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mockery/mockery/zipball/f69bbde7d7a75d6b2862d9ca8fab1cd28014b4be", + "reference": "f69bbde7d7a75d6b2862d9ca8fab1cd28014b4be", + "shasum": "" + }, + "require": { + "hamcrest/hamcrest-php": "~2.0", + "lib-pcre": ">=7.0", + "php": ">=5.6.0" + }, + "require-dev": { + "phpunit/phpunit": "~5.7.10|~6.5|~7.0|~8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-0": { + "Mockery": "library/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Pádraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "http://blog.astrumfutura.com" + }, + { + "name": "Dave Marshall", + "email": "dave.marshall@atstsolutions.co.uk", + "homepage": "http://davedevelopment.co.uk" + } + ], + "description": "Mockery is a simple yet flexible PHP mock object framework", + "homepage": "https://github.com/mockery/mockery", + "keywords": [ + "BDD", + "TDD", + "library", + "mock", + "mock objects", + "mockery", + "stub", + "test", + "test double", + "testing" + ], + "time": "2019-12-26T09:49:15+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.9.5", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef", + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2020-01-17T21:11:47+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.5.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "53c2753d756f5adb586dca79c2ec0e2654dd9463" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/53c2753d756f5adb586dca79c2ec0e2654dd9463", + "reference": "53c2753d756f5adb586dca79c2ec0e2654dd9463", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "0.0.5", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.3-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" + ], + "time": "2020-06-03T07:24:19+00:00" + }, + { + "name": "ocramius/package-versions", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/Ocramius/PackageVersions.git", + "reference": "44af6f3a2e2e04f2af46bcb302ad9600cba41c7d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/44af6f3a2e2e04f2af46bcb302ad9600cba41c7d", + "reference": "44af6f3a2e2e04f2af46bcb302ad9600cba41c7d", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": "^7.1.0" + }, + "require-dev": { + "composer/composer": "^1.6.3", + "doctrine/coding-standard": "^5.0.1", + "ext-zip": "*", + "infection/infection": "^0.7.1", + "phpunit/phpunit": "^7.5.17" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "time": "2019-11-15T16:17:10+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^2.0", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.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)", + "time": "2018-07-08T19:23:20+00:00" + }, + { + "name": "phar-io/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.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", + "time": "2018-07-08T19:19:57+00:00" + }, + { + "name": "php-stubs/wordpress-stubs", + "version": "v5.4.2", + "source": { + "type": "git", + "url": "https://github.com/php-stubs/wordpress-stubs.git", + "reference": "38b0963698ca5858658a5b09198062411f22932a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/38b0963698ca5858658a5b09198062411f22932a", + "reference": "38b0963698ca5858658a5b09198062411f22932a", + "shasum": "" + }, + "replace": { + "giacocorsiglia/wordpress-stubs": "*" + }, + "require-dev": { + "giacocorsiglia/stubs-generator": "^0.5.0", + "php": "~7.1" + }, + "suggest": { + "paragonie/sodium_compat": "Pure PHP implementation of libsodium", + "symfony/polyfill-php73": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WordPress function and class declaration stubs for static analysis.", + "homepage": "https://github.com/php-stubs/wordpress-stubs", + "keywords": [ + "PHPStan", + "static analysis", + "wordpress" + ], + "time": "2020-06-11T14:56:54+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/6568f4687e5b41b054365f9ae03fcb1ed5f2069b", + "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2020-04-27T09:25:28+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", + "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", + "shasum": "" + }, + "require": { + "ext-filter": "^7.1", + "php": "^7.2", + "phpdocumentor/reflection-common": "^2.0", + "phpdocumentor/type-resolver": "^1.0", + "webmozart/assert": "^1" + }, + "require-dev": { + "doctrine/instantiator": "^1", + "mockery/mockery": "^1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" + } + ], + "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-02-22T12:28:44+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "7462d5f123dfc080dfdf26897032a6513644fc95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/7462d5f123dfc080dfdf26897032a6513644fc95", + "reference": "7462d5f123dfc080dfdf26897032a6513644fc95", + "shasum": "" + }, + "require": { + "php": "^7.2", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "^7.2", + "mockery/mockery": "~1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "time": "2020-02-18T18:59:58+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "v1.10.3", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "451c3cd1418cf640de218914901e51b064abb093" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", + "reference": "451c3cd1418cf640de218914901e51b064abb093", + "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" + }, + "require-dev": { + "phpspec/phpspec": "^2.5 || ^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2020-03-05T15:02:03+00:00" + }, + { + "name": "phpstan/extension-installer", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/phpstan/extension-installer.git", + "reference": "2e041def501d661b806f50000c8a4dccbd4907b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/2e041def501d661b806f50000c8a4dccbd4907b4", + "reference": "2e041def501d661b806f50000c8a4dccbd4907b4", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1 || ^2.0", + "php": "^7.1", + "phpstan/phpstan": ">=0.11.6" + }, + "require-dev": { + "composer/composer": "^1.8", + "consistence/coding-standard": "^3.8", + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", + "ergebnis/composer-normalize": "^2.0.2", + "jakub-onderka/php-parallel-lint": "^1.0", + "phing/phing": "^2.16", + "phpstan/phpstan-strict-rules": "^0.11", + "slevomat/coding-standard": "^5.0.4" + }, + "type": "composer-plugin", + "extra": { + "class": "PHPStan\\ExtensionInstaller\\Plugin" + }, + "autoload": { + "psr-4": { + "PHPStan\\ExtensionInstaller\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Composer plugin for automatic installation of PHPStan extensions", + "time": "2020-03-31T16:00:42+00:00" + }, + { + "name": "phpstan/phpdoc-parser", + "version": "0.4.4", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "d8d9d4645379e677466d407034436bb155b11c65" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/d8d9d4645379e677466d407034436bb155b11c65", + "reference": "d8d9d4645379e677466d407034436bb155b11c65", + "shasum": "" + }, + "require": { + "php": "~7.1" + }, + "require-dev": { + "consistence/coding-standard": "^3.5", + "ergebnis/composer-normalize": "^2.0.2", + "jakub-onderka/php-parallel-lint": "^0.9.2", + "phing/phing": "^2.16.0", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12.19", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^6.3", + "slevomat/coding-standard": "^4.7.2", + "symfony/process": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.4-dev" + } + }, + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "time": "2020-04-13T16:28:46+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "0.12.29", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "9771daaf6b95c6313b908d0bcdee0afcd51f838a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9771daaf6b95c6313b908d0bcdee0afcd51f838a", + "reference": "9771daaf6b95c6313b908d0bcdee0afcd51f838a", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.12-dev" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "time": "2020-06-14T14:10:59+00:00" + }, + { + "name": "phpstan/phpstan-mockery", + "version": "0.12.5", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan-mockery.git", + "reference": "120ee84706acc93232b4ee08ec57fb5cdb877f4b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan-mockery/zipball/120ee84706acc93232b4ee08ec57fb5cdb877f4b", + "reference": "120ee84706acc93232b4ee08ec57fb5cdb877f4b", + "shasum": "" + }, + "require": { + "php": "~7.1", + "phpstan/phpstan": "^0.12" + }, + "require-dev": { + "consistence/coding-standard": "^3.5", + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", + "ergebnis/composer-normalize": "^2.0.2", + "jakub-onderka/php-parallel-lint": "^1.0", + "mockery/mockery": "^1.2.4", + "phing/phing": "^2.16.0", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^7.2", + "slevomat/coding-standard": "^4.7.2", + "squizlabs/php_codesniffer": "^3.3.2" + }, + "type": "phpstan-extension", + "extra": { + "branch-alias": { + "dev-master": "0.12-dev" + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan Mockery extension", + "time": "2020-04-23T13:49:42+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "7.0.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f1884187926fbb755a9aaf0b3836ad3165b478bf", + "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.2", + "phpunit/php-file-iterator": "^2.0.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^3.1.1", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^4.2.2", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1.3" + }, + "require-dev": { + "phpunit/phpunit": "^8.2.2" + }, + "suggest": { + "ext-xdebug": "^2.7.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.0-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": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2019-11-20T13:55:58+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "050bedf145a257b1ff02746c31894800e5122946" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", + "reference": "050bedf145a257b1ff02746c31894800e5122946", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" + }, + "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": "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" + ], + "time": "2018-09-13T20:33:42+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "2.1.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "1038454804406b0b5f5f520358e78c1c2f71501e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1038454804406b0b5f5f520358e78c1c2f71501e", + "reference": "1038454804406b0b5f5f520358e78c1c2f71501e", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-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": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2019-06-07T04:22:29+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff", + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2019-09-17T06:23:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "8.5.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "3f9c4079d1407cd84c51c02c6ad1df6ec2ed1348" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3f9c4079d1407cd84c51c02c6ad1df6ec2ed1348", + "reference": "3f9c4079d1407cd84c51c02c6ad1df6ec2ed1348", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.2.0", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.9.1", + "phar-io/manifest": "^1.0.3", + "phar-io/version": "^2.0.1", + "php": "^7.2", + "phpspec/prophecy": "^1.8.1", + "phpunit/php-code-coverage": "^7.0.7", + "phpunit/php-file-iterator": "^2.0.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^2.1.2", + "sebastian/comparator": "^3.0.2", + "sebastian/diff": "^3.0.2", + "sebastian/environment": "^4.2.2", + "sebastian/exporter": "^3.1.1", + "sebastian/global-state": "^3.0.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^2.0.1", + "sebastian/type": "^1.1.3", + "sebastian/version": "^2.0.1" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*", + "phpunit/php-invoker": "^2.0.0" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.5-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": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2020-06-15T10:45:47+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/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "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" + }, + { + "name": "roots/wordpress", + "version": "5.4.2", + "source": { + "type": "git", + "url": "https://github.com/WordPress/WordPress.git", + "reference": "5.4.2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/WordPress/WordPress/zipball/5.4.2", + "reference": "5.4.2" + }, + "require": { + "php": ">=5.3.2", + "roots/wordpress-core-installer": ">=1.0.0" + }, + "type": "wordpress-core", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "WordPress Community", + "homepage": "https://wordpress.org/about/" + } + ], + "description": "WordPress is web software you can use to create a beautiful website or blog.", + "homepage": "https://wordpress.org/", + "keywords": [ + "blog", + "cms", + "wordpress" + ], + "time": "2020-06-10T21:43:59+00:00" + }, + { + "name": "roots/wordpress-core-installer", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/roots/wordpress-core-installer.git", + "reference": "83744b1ba5bbdb5bb225f47e24da61a6cf6c5b80" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/roots/wordpress-core-installer/zipball/83744b1ba5bbdb5bb225f47e24da61a6cf6c5b80", + "reference": "83744b1ba5bbdb5bb225f47e24da61a6cf6c5b80", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0" + }, + "conflict": { + "composer/installers": "<1.0.6" + }, + "replace": { + "johnpbloch/wordpress-core-installer": "*" + }, + "require-dev": { + "composer/composer": "^1.0", + "phpunit/phpunit": ">=4.8.35" + }, + "type": "composer-plugin", + "extra": { + "class": "Roots\\Composer\\WordPressCorePlugin" + }, + "autoload": { + "psr-4": { + "Roots\\Composer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "John P. Bloch", + "email": "me@johnpbloch.com" + }, + { + "name": "Roots", + "email": "team@roots.io" + } + ], + "description": "A custom installer to handle deploying WordPress with composer", + "keywords": [ + "wordpress" + ], + "time": "2018-12-10T00:22:15+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "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": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "shasum": "" + }, + "require": { + "php": "^7.1", + "sebastian/diff": "^3.0", + "sebastian/exporter": "^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "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" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2018-07-12T15:12:46+00:00" + }, + { + "name": "sebastian/diff", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.5 || ^8.0", + "symfony/process": "^2 || ^3.3 || ^4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "time": "2019-02-04T06:01:07+00:00" + }, + { + "name": "sebastian/environment", + "version": "4.2.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.5" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2019-11-20T08:46:58+00:00" + }, + { + "name": "sebastian/exporter", + "version": "3.1.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-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": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "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", + "keywords": [ + "export", + "exporter" + ], + "time": "2019-09-14T09:02:43+00:00" + }, + { + "name": "sebastian/global-state", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", + "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", + "shasum": "" + }, + "require": { + "php": "^7.2", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^8.0" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2019-02-01T05:30:01+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-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/", + "time": "2017-03-29T09:07:27+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "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": "2017-03-03T06:23:57+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "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": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2018-10-04T04:07:39+00:00" + }, + { + "name": "sebastian/type", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/3aaaa15fa71d27650d62a948be022fe3b48541a3", + "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3", + "shasum": "" + }, + "require": { + "php": "^7.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-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", + "time": "2019-07-02T08:10:15+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "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": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "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" + }, + { + "name": "slevomat/coding-standard", + "version": "6.3.9", + "source": { + "type": "git", + "url": "https://github.com/slevomat/coding-standard.git", + "reference": "dd73c0f9c2207026aeda4b0fdff6e9b7ed2a83e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/dd73c0f9c2207026aeda4b0fdff6e9b7ed2a83e5", + "reference": "dd73c0f9c2207026aeda4b0fdff6e9b7ed2a83e5", + "shasum": "" + }, + "require": { + "php": "^7.1", + "phpstan/phpdoc-parser": "0.4.0 - 0.4.4", + "squizlabs/php_codesniffer": "^3.5.5" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "0.6.2", + "phing/phing": "2.16.3", + "php-parallel-lint/php-parallel-lint": "1.2.0", + "phpstan/phpstan": "0.12.19", + "phpstan/phpstan-deprecation-rules": "0.12.2", + "phpstan/phpstan-phpunit": "0.12.8", + "phpstan/phpstan-strict-rules": "0.12.2", + "phpunit/phpunit": "7.5.20|8.5.2|9.1.2" + }, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-master": "6.x-dev" + } + }, + "autoload": { + "psr-4": { + "SlevomatCodingStandard\\": "SlevomatCodingStandard" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", + "time": "2020-06-16T07:24:48+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.5.5", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/73e2e7f57d958e7228fce50dc0c61f58f017f9f6", + "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "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", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2020-04-17T01:09:41+00:00" + }, + { + "name": "symfony/console", + "version": "v5.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "34ac555a3627e324b660e318daa07572e1140123" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/34ac555a3627e324b660e318daa07572e1140123", + "reference": "34ac555a3627e324b660e318daa07572e1140123", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "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" + }, + "conflict": { + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.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" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2020-06-15T12:59:21+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.17.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e94c8b1bbe2bc77507a1056cdb06451c75b427f9", + "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.17-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "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" + ], + "time": "2020-05-12T16:14:59+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.17.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "e094b0770f7833fdf257e6ba4775be4e258230b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/e094b0770f7833fdf257e6ba4775be4e258230b2", + "reference": "e094b0770f7833fdf257e6ba4775be4e258230b2", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.17-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "time": "2020-05-12T16:47:27+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.17.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "1357b1d168eb7f68ad6a134838e46b0b159444a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/1357b1d168eb7f68ad6a134838e46b0b159444a9", + "reference": "1357b1d168eb7f68ad6a134838e46b0b159444a9", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.17-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "time": "2020-05-12T16:14:59+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.17.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "fa79b11539418b02fc5e1897267673ba2c19419c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fa79b11539418b02fc5e1897267673ba2c19419c", + "reference": "fa79b11539418b02fc5e1897267673ba2c19419c", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.17-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2020-05-12T16:47:27+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.17.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "a760d8964ff79ab9bf057613a5808284ec852ccc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a760d8964ff79ab9bf057613a5808284ec852ccc", + "reference": "a760d8964ff79ab9bf057613a5808284ec852ccc", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.17-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2020-05-12T16:47:27+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.17.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "5e30b2799bc1ad68f7feb62b60a73743589438dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/5e30b2799bc1ad68f7feb62b60a73743589438dd", + "reference": "5e30b2799bc1ad68f7feb62b60a73743589438dd", + "shasum": "" + }, + "require": { + "php": ">=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.17-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2020-05-12T16:47:27+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v2.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "66a8f0957a3ca54e4f724e49028ab19d75a8918b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/66a8f0957a3ca54e4f724e49028ab19d75a8918b", + "reference": "66a8f0957a3ca54e4f724e49028ab19d75a8918b", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.0" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2020-05-20T17:43:50+00:00" + }, + { + "name": "symfony/string", + "version": "v5.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "ac70459db781108db7c6d8981dd31ce0e29e3298" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/ac70459db781108db7c6d8981dd31ce0e29e3298", + "reference": "ac70459db781108db7c6d8981dd31ce0e29e3298", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "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" + }, + "require-dev": { + "symfony/error-handler": "^4.4|^5.0", + "symfony/http-client": "^4.4|^5.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "files": [ + "Resources/functions.php" + ], + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony String component", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "time": "2020-06-11T12:16:36+00:00" + }, + { + "name": "szepeviktor/phpstan-wordpress", + "version": "v0.6.1", + "source": { + "type": "git", + "url": "https://github.com/szepeviktor/phpstan-wordpress.git", + "reference": "796cc50374ed88ec997d946e030fa21736139e32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/796cc50374ed88ec997d946e030fa21736139e32", + "reference": "796cc50374ed88ec997d946e030fa21736139e32", + "shasum": "" + }, + "require": { + "php": "~7.1", + "php-stubs/wordpress-stubs": "^4.7 || ^5.0", + "phpstan/phpstan": "^0.12.26", + "symfony/polyfill-php73": "^1.12.0" + }, + "require-dev": { + "composer/composer": "^1.8.6", + "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpstan/phpstan-strict-rules": "^0.12", + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.4.3" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "PHPStan\\WordPress\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WordPress extensions for PHPStan", + "keywords": [ + "PHPStan", + "code analyse", + "code analysis", + "static analysis", + "wordpress" + ], + "time": "2020-06-08T15:49:50+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.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" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2019-06-13T22:48:21+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.9.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "9dc4f203e36f2b486149058bade43c851dd97451" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/9dc4f203e36f2b486149058bade43c851dd97451", + "reference": "9dc4f203e36f2b486149058bade43c851dd97451", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<3.9.1" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36 || ^7.5.13" + }, + "type": "library", + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2020-06-16T10:16:42+00:00" + }, + { + "name": "webmozart/glob", + "version": "4.1.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/glob.git", + "reference": "3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/glob/zipball/3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe", + "reference": "3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe", + "shasum": "" + }, + "require": { + "php": "^5.3.3|^7.0", + "webmozart/path-util": "^2.2" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1", + "symfony/filesystem": "^2.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Glob\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "A PHP implementation of Ant's glob.", + "time": "2015-12-29T11:14:33+00:00" + }, + { + "name": "webmozart/path-util", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/path-util.git", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "webmozart/assert": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\PathUtil\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", + "time": "2015-12-17T08:42:14+00:00" + } + ], "aliases": [], "minimum-stability": "stable", "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { - "ext-json": "*" + "php": ">=7.2", + "ext-json": "^1.6" }, "platform-dev": [] } diff --git a/config/plugin.config.php b/config/plugin.config.php new file mode 100644 index 0000000..39a1d82 --- /dev/null +++ b/config/plugin.config.php @@ -0,0 +1,10 @@ + '1.0.0', + 'plugin_name' => 'woda-scripts-styles-loader', + 'plugin_directory' => plugin_dir_path( __DIR__ ), + 'plugin_url' => plugin_dir_url( __DIR__ ), + 'handle_prefix' => 'woda-', + 'filter_prefix' => 'woda_scripts_styles_loader_', +]; diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..817aef9 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,59 @@ +version: '3.3' + +services: + db: + image: mysql:5.7 + volumes: + - db_data:/var/lib/mysql + restart: always + environment: + MYSQL_ROOT_PASSWORD: somewordpress + MYSQL_DATABASE: wordpress + MYSQL_USER: wordpress + MYSQL_PASSWORD: wordpress + + wordpress: + depends_on: + - db + build: + context: ./docker/wordpress + cache_from: + - wordpress:latest + volumes: + - wordpress_data:/var/www/html + - ./:/var/www/html/wp-content/plugins/woda-scripts-styles-loader + ports: + - "8000:80" + - "19000:19000" + restart: always + environment: + WORDPRESS_DB_HOST: db:3306 + WORDPRESS_DB_USER: wordpress + WORDPRESS_DB_PASSWORD: wordpress + WORDPRESS_DB_NAME: wordpress + + wpcli: + depends_on: + - wordpress + - db + image: wordpress:cli + # vstm: This is required to run wordpress-cli with the same + # user-id as wordpress. This way there are no permission problems + # when running the cli + user: xfs + # vstm: The sleep 10 is required so that the command is run after + # mysql is initialized. Depending on your machine this might take + # longer or it can go faster. + command: > + /bin/sh -c ' + sleep 10; + wp --info + ' + # vstm: add shared volume + volumes: + - wordpress_data:/var/www/html + - ./:/var/www/html/wp-content/plugins/woda-scripts-styles-loader + +volumes: + wordpress_data: {} + db_data: {} diff --git a/includes/AbstractAsset.php b/includes/AbstractAsset.php new file mode 100644 index 0000000..74b74e3 --- /dev/null +++ b/includes/AbstractAsset.php @@ -0,0 +1,126 @@ +file = new File($src); + $this->src = $src; + $this->deps = $deps ?? []; + $this->handle = $this->generateHandle($handle ?? ''); + $this->ver = $ver; + } + + public function addHashFile(HashFile $hashFile, ?string $key = null): AbstractAssetInterface + { + $this->hash = $hashFile->getHashValue($key ?? $this->file->getBaseName()); + return $this; + } + + public function calculateHashValue(): AbstractAssetInterface + { + $this->hash = md5($this->src); + return $this; + } + + public function enqueueAdmin(): AbstractAssetInterface + { + $this->enqueueAdmin = true; + return $this; + } + + public function enqueueFrontend(): AbstractAssetInterface + { + $this->enqueueFrontend = true; + return $this; + } + + public function enqueueLogin(): AbstractAssetInterface + { + $this->enqueueLogin = true; + return $this; + } + + public function loadAsync(): AbstractAssetInterface + { + $this->loadAsync = true; + return $this; + } + + public function getVersion(): string + { + if (!empty($this->hash)) { + return $this->hash; + } + if (is_string($this->ver)) { + return $this->ver; + } + if ($this->ver === false) { + return get_bloginfo('version'); + } + return ''; + } + + public function shouldEnqueueInAdmin(): bool + { + return $this->enqueueAdmin; + } + + public function shouldEnqueueInFrontend(): bool + { + return $this->enqueueFrontend; + } + + public function shouldEnqueueInLogin(): bool + { + return $this->enqueueLogin; + } + + private function generateHandle(?string $handle): string + { + if (!empty($handle)) { + return $handle; + } + $defaultPrefix = Config::loadConfigString('handle_prefix'); + $prefix = apply_filters(Config::loadConfigString('filter_prefix') . 'handle_prefix', $defaultPrefix); + return $prefix . $this->file->getFileName(); + } +} diff --git a/includes/AbstractAssetInterface.php b/includes/AbstractAssetInterface.php new file mode 100644 index 0000000..3f3d690 --- /dev/null +++ b/includes/AbstractAssetInterface.php @@ -0,0 +1,15 @@ +assetRegistry = new AssetRegistry(); + } + + /** + * @param AbstractAsset[]|AbstractAsset $asset + * + * @return AssetManager + */ + public function addAssets($assets): AssetManager + { + if (is_array($assets)) { + foreach ($assets as $asset) { + $this->assetRegistry->addAssetToRegistry($asset); + } + } else { + $this->assetRegistry->addAssetToRegistry($assets); + } + return $this; + } +} diff --git a/includes/AssetRegistry.php b/includes/AssetRegistry.php new file mode 100644 index 0000000..b7691a0 --- /dev/null +++ b/includes/AssetRegistry.php @@ -0,0 +1,132 @@ +registerHooks(); + } + + /** + * @param Script|Style $asset + */ + public function addAssetToRegistry($asset): void + { + if ($asset instanceof Script) { + $this->scripts[] = $asset; + return; + } + $this->styles[] = $asset; + } + + public function addEditorStyles(): void + { + foreach ($this->styles as $style) { + if ($style->shouldEnqueueInEditor() === true) { + $style->addEditorStyle(); + $this->addThemeSupportForEditorStyles(); + } + } + } + + private function addThemeSupportForEditorStyles(): void + { + if ($this->editorStylesThemeSupport !== true) { + add_theme_support('editor-styles'); + $this->editorStylesThemeSupport = true; + } + } + + public function processAssetsforAdmin(): void + { + foreach ($this->scripts as $script) { + if ($script->shouldEnqueueInAdmin() === true) { + $script->enqueue(); + } + } + foreach ($this->styles as $style) { + if ($style->shouldEnqueueInAdmin() === true) { + $style->enqueue(); + } + } + } + + public function processAssetsforFrontend(): void + { + foreach ($this->scripts as $script) { + if ($script->shouldEnqueueInFrontend() === true) { + $script->enqueue(); + } + } + foreach ($this->styles as $style) { + if ($style->shouldEnqueueInFrontend() === true) { + $style->enqueue(); + } + } + } + + public function processAssetsforLogin(): void + { + foreach ($this->scripts as $script) { + if ($script->shouldEnqueueInLogin() === true) { + $script->enqueue(); + } + } + foreach ($this->styles as $style) { + if ($style->shouldEnqueueInLogin() === true) { + $style->enqueue(); + } + } + } + + public function updateScriptTags(string $tag, string $handle): string + { + foreach ($this->scripts as $script) { + if ($script->handle !== $handle) { + continue; + } + if ($script->loadDeferred === true) { + return $script->applyDeferPatternToTag($tag); + } + if ($script->loadAsync === true) { + return $script->applyAsyncPatternToTag($tag); + } + return $tag; + } + return $tag; + } + + public function updateStyleTags(string $tag, string $handle): string + { + foreach ($this->styles as $style) { + if ($style->handle !== $handle) { + continue; + } + if ($style->loadAsync === true) { + return $style->applyAsyncPatternToTag($tag); + } + return $tag; + } + return $tag; + } + + private function registerHooks(): void + { + add_action('wp_enqueue_scripts', [$this, 'processAssetsforFrontend']); + add_action('admin_enqueue_scripts', [$this, 'processAssetsforAdmin']); + add_action('login_enqueue_scripts', [$this, 'processAssetsforLogin']); + add_action('after_setup_theme', [$this, 'addEditorStyles']); + apply_filters('script_loader_tag', [$this, 'updateScriptTags'], 10, 2); + apply_filters('style_loader_tag', [$this, 'updateStyleTags'], 10, 2); + } +} diff --git a/includes/Config.php b/includes/Config.php new file mode 100644 index 0000000..0b3b625 --- /dev/null +++ b/includes/Config.php @@ -0,0 +1,25 @@ + */ + public static $config = []; + + public static function loadConfigString(string $key): string + { + if (empty(self::$config)) { + self::$config = include __DIR__ . '/../config/plugin.config.php'; + } + $value = self::$config[$key] ?? null; + if (!is_string($value)) { + throw new RuntimeException(sprintf('Required config key "%s" not found.', $key)); + } + return $value; + } +} diff --git a/includes/Core/Dependency.php b/includes/Core/Dependency.php deleted file mode 100644 index 0054f8a..0000000 --- a/includes/Core/Dependency.php +++ /dev/null @@ -1,65 +0,0 @@ -src = $src; - $this->deps = $deps; - $this->handle = $handle; - $this->ver = $ver; - } - - /** - * @param string $handle - * @return string - */ - public function getHandle($handle = ''): string { - return $this->handle ?: Settings::getHandlePrefix() . '-' . File::getFilename($this->src); - } - - /** - * @param string $handle - * @return string - */ - public function getSource($handle = ''): string { - return $this->src; - } - - /** - * @param string $handle - * @return array - */ - public function getDependencies($handle = ''): array { - return $this->deps; - } -} diff --git a/includes/Core/HashHelper.php b/includes/Core/HashHelper.php deleted file mode 100644 index 6d244af..0000000 --- a/includes/Core/HashHelper.php +++ /dev/null @@ -1,59 +0,0 @@ -getHandle(), - $script->getSource(), - $script->getDependencies(), - $script->getVersion(), - $script->getInFooter() - ); - } - - /** - * @param array $styles - */ - private static function registerStyles(array $styles = []): void - { - foreach ($styles as $style) { - self::registerStyle($style); - } - } - - /** - * @param Style $style - */ - private static function registerStyle(Style $style): void - { - wp_enqueue_style( - $style->getHandle(), - $style->getSource(), - $style->getDependencies(), - $style->getVersion(), - $style->getMedia() - ); - } -} diff --git a/includes/File.php b/includes/File.php new file mode 100644 index 0000000..598892d --- /dev/null +++ b/includes/File.php @@ -0,0 +1,26 @@ +path = $path; + } + + public function getBaseName(): string + { + return pathinfo($this->path, PATHINFO_BASENAME); + } + + public function getFileName(): string + { + return pathinfo($this->path, PATHINFO_FILENAME); + } +} diff --git a/includes/HashFile.php b/includes/HashFile.php new file mode 100644 index 0000000..ce4c7ed --- /dev/null +++ b/includes/HashFile.php @@ -0,0 +1,22 @@ + */ + private $values; + + public function __construct(string $path) + { + $content = file_get_contents($path); + $this->values = $content ? json_decode($content, true) : []; + } + + public function getHashValue(string $name): string + { + return $this->values[$name] ?? ''; + } +} diff --git a/includes/Init.php b/includes/Init.php deleted file mode 100644 index 080d356..0000000 --- a/includes/Init.php +++ /dev/null @@ -1,19 +0,0 @@ -ver ?: HashHelper::getVendorScriptHashValue(File::getBasename($this->src)); - } -} diff --git a/includes/Script.php b/includes/Script.php index d42cd20..080d4dd 100644 --- a/includes/Script.php +++ b/includes/Script.php @@ -1,51 +1,72 @@ instead of in the + * . Default 'false'. */ public function __construct( string $src, - array $deps = [], - string $handle = '', - string $ver = '', - bool $inFooter = true + ?array $deps = null, + ?string $handle = null, + $ver = false, + bool $inFooter = false ) { parent::__construct($src, $deps, $handle, $ver); $this->inFooter = $inFooter; } - /** - * @return string - */ - public function getVersion(): string + public function applyAsyncPatternToTag(string $tag): string { - return $this->ver ?: HashHelper::getScriptHashValue(File::getBasename($this->src)); + return str_replace(' src', ' async=\'async\' src', $tag); } - /** - * @return string - */ - public function getInFooter(): string + public function applyDeferPatternToTag(string $tag): string + { + return str_replace(' src', ' defer=\'defer\' src', $tag); + } + + public function enqueue(): void + { + wp_enqueue_script( + $this->handle, + $this->src, + $this->deps, + $this->getVersion(), + $this->inFooter + ); + } + + public function loadDeferred(): ScriptInterface + { + $this->loadDeferred = true; + return $this; + } + + public function shouldEnqueueInEditor(): bool { - return $this->inFooter; + return false; } } diff --git a/includes/ScriptFactory.php b/includes/ScriptFactory.php new file mode 100644 index 0000000..571cadb --- /dev/null +++ b/includes/ScriptFactory.php @@ -0,0 +1,33 @@ + instead of in the + * . Default 'false'. + */ + public function create( + string $src, + ?array $deps = null, + ?string $handle = null, + $ver = false, + bool $inFooter = false + ): ScriptInterface + { + return new Script($src, $deps, $handle, $ver, $inFooter); + } +} diff --git a/includes/ScriptInterface.php b/includes/ScriptInterface.php new file mode 100644 index 0000000..fb0e854 --- /dev/null +++ b/includes/ScriptInterface.php @@ -0,0 +1,10 @@ + [], - 'scriptsHashesFilePath' => '', - 'styles' => [], - 'stylesHashesFilePath' => '', - 'handlePrefix' => 'woda', - 'jquery' => null, - 'vendorScriptsHashesFilePath' => '', - ]; - $settings = array_merge(self::$defaults, $settings); - self::$settings = apply_filters(self::FILTER, $settings); - self::checkHashesFiles(); - } - - /** - * @return array|mixed - */ - public static function getBackendStyles() - { - return self::$settings['backendStyles'] ?? []; - } - - /** - * @return string - */ - public static function getHandlePrefix(): string { - if (empty(self::$settings['handlePrefix'])) { - return self::$defaults['handlePrefix']; - } - return self::$settings['handlePrefix']; - } - - /** - * @return JQuery|null - */ - public static function getJQuery(): ?JQuery - { - return self::$settings['jquery'] ?? null; - } - - /** - * @return array - */ - public static function getScripts(): array - { - return self::$settings['scripts'] ?? []; - } - - /** - * @return string - */ - public static function getScriptsHashesFilePath(): string - { - return self::$settings['scriptsHashesFilePath'] ?? ''; - } - - /** - * @return array - */ - public static function getStyles(): array - { - return self::$settings['styles'] ?? []; - } - - /** - * @return string - */ - public static function getStylesHashesFilePath(): string - { - return self::$settings['stylesHashesFilePath'] ?? ''; - } - - /** - * @return array - */ - public static function getVendorScripts(): array - { - return self::$settings['vendorScripts'] ?? []; - } - - /** - * @return string - */ - public static function getVendorScriptsHashesFilePath(): string - { - return self::$settings['vendorScriptsHashesFilePath'] ?? ''; - } - - private static function checkHashesFiles(): void - { - $errorTemplate = 'Hashes file was not found at configured path: "%s"'; - if (empty(self::$settings['scriptsHashesFilePath']) - || !File::exists(self::$settings['scriptsHashesFilePath'], $errorTemplate)) { - self::$settings['scriptsHashesFilePath'] = ''; - } - if (empty(self::$settings['stylesHashesFilePath']) - || !File::exists(self::$settings['stylesHashesFilePath'], $errorTemplate)) { - self::$settings['stylesHashesFilePath'] = ''; - } - if (empty(self::$settings['vendorScriptsHashesFilePath']) - || !File::exists(self::$settings['vendorScriptsHashesFilePath'], $errorTemplate)) { - self::$settings['vendorScriptsHashesFilePath'] = ''; - } - } -} diff --git a/includes/Style.php b/includes/Style.php index 4afcc2c..bb31f57 100644 --- a/includes/Style.php +++ b/includes/Style.php @@ -1,51 +1,87 @@ media = $media; } - /** - * @return string - */ - public function getVersion(): string + public function addEditorStyle(): void { - return $this->ver ?: HashHelper::getStyleHashValue(File::getBasename($this->src)); + add_editor_style(str_replace(get_stylesheet_directory_uri() . '/', '', $this->src)); } - /** - * @return string - */ - public function getMedia(): string + public function applyAsyncPatternToTag(string $tag): string + { + $tag = str_replace( + ' rel=\'stylesheet\'', + ' rel="preload" as="style" onload="this.onload=null;this.rel=\'stylesheet\'"', + $tag + ); + $tag .= sprintf('', $this->extractHrefFromTag($tag)); + return $tag; + } + + public function enqueue(): void + { + wp_enqueue_style( + $this->handle, + $this->src, + $this->deps, + $this->getVersion(), + $this->media + ); + } + + public function enqueueEditor(): StyleInterface + { + $this->enqueueEditor = true; + return $this; + } + + public function shouldEnqueueInEditor(): bool + { + return $this->enqueueEditor; + } + + private function extractHrefFromTag(string $tag): string { - return $this->media; + preg_match('/(href=\'.*?\')/', $tag, $matches, PREG_OFFSET_CAPTURE); + if (isset($matches[0])) { + return $matches[0][0]; + } + return ''; } } diff --git a/includes/StyleFactory.php b/includes/StyleFactory.php new file mode 100644 index 0000000..0d6b898 --- /dev/null +++ b/includes/StyleFactory.php @@ -0,0 +1,34 @@ +ver ?: HashHelper::getVendorScriptHashValue(File::getBasename($this->src)); - } - - /** - * @param string $handle - * @return string - */ - public function getHandle($handle = ''): string { - return $this->handle ?: File::getFilename($this->src); - } -} diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..b31f516 --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,8 @@ + + + +includes +test + diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..fb07c35 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,10 @@ +# @see https://github.com/szepeviktor/phpstan-wordpress/blob/master/example/phpstan.neon.dist +includes: + # @see https://github.com/phpstan/phpstan-src/blob/master/conf/bleedingEdge.neon + - phar://phpstan.phar/conf/bleedingEdge.neon +parameters: + level: max + inferPrivatePropertyTypeFromConstructor: true + paths: + - includes/ + - test/ diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..abc4923 --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,17 @@ + + + + + ./test + + + + + ./includes/ + + + diff --git a/readme.txt b/readme.txt index 08dbd88..399a28c 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: @davidmondok Tags: fonts, performance Requires at least: 4.5 Tested up to: 5.3 -Stable tag: 0.4.0 +Stable tag: 1.0.0 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html @@ -37,4 +37,7 @@ License URI: https://www.gnu.org/licenses/gpl-3.0.html = 0.4.0 = * jQuery is not updated by default any more. Enable via `add_filter( 'woda-update-jquery', '__return_true' ); ` += 1.0.0 = +* Complete rewrite of plugin + `` diff --git a/require-checker.config.json b/require-checker.config.json new file mode 100644 index 0000000..c1cd4d5 --- /dev/null +++ b/require-checker.config.json @@ -0,0 +1,43 @@ +{ + "symbol-whitelist" : [ + "null", "true", "false", + "static", "self", "parent", + "array", "string", "int", "float", "bool", "iterable", "callable", "void", "object", + "WP_Query", + "WP_REST_Request", + "WP_REST_Response", + "_x", + "add_action", + "add_editor_style", + "add_filter", + "add_shortcode", + "add_theme_support", + "apply_filters", + "do_action", + "get_bloginfo", + "get_option", + "get_post_meta", + "get_the_ID", + "is_wp_error", + "register_rest_route", + "update_post_meta", + "wp_create_nonce", + "wp_deregister_script", + "wp_enqueue_script", + "wp_enqueue_style", + "wp_get_post_terms", + "wp_register_script", + "wp_reset_postdata", + "wp_verify_nonce" + ], + "php-core-extensions" : [ + "Core", + "date", + "pcre", + "Phar", + "Reflection", + "SPL", + "standard" + ], + "scan-files" : [] +} diff --git a/test/Unit/AbstractTestCase.php b/test/Unit/AbstractTestCase.php new file mode 100644 index 0000000..85a82d0 --- /dev/null +++ b/test/Unit/AbstractTestCase.php @@ -0,0 +1,20 @@ +addToAssertionCount( + Mockery::getContainer()->mockery_getExpectationCount() + ); + WP_Mock::tearDown(); + } +} diff --git a/test/Unit/AssetTest.php b/test/Unit/AssetTest.php new file mode 100644 index 0000000..7fe433a --- /dev/null +++ b/test/Unit/AssetTest.php @@ -0,0 +1,89 @@ + self::HANDLE_PREFIX]; + $this->asset = $this->getMockForAbstractClass(AbstractAsset::class, ['asset.js']); + $this->hashFile = new HashFile(__DIR__ . '/../hash-file.json'); + } + + public function testAddHashFile(): void + { + $this->asset->addHashFile($this->hashFile); + + self::assertSame('asset-hash', $this->asset->hash); + } + + public function testGetVersionReturnsWordPressVersionWhenPassedFalse(): void + { + WpMockHelper::expectCall('get_bloginfo', ['version'], '5.4.0'); + + self::assertSame('5.4.0', $this->asset->getVersion()); + } + + public function testGetVersionReturnsEmptyStringWhenPassedNull(): void + { + $asset = $this->getMockForAbstractClass(AbstractAsset::class, ['asset.js', [], self::HANDLE, null]); + + self::assertSame('', $asset->getVersion()); + + } + + public function testGetVersionReturnsArgumentWhenPassedString(): void + { + $asset = $this->getMockForAbstractClass(AbstractAsset::class, ['asset.js', [], self::HANDLE, 'ver']); + + self::assertSame('ver', $asset->getVersion()); + } + + public function testGetVersionReturnsHashValueWhenPassedHashFile(): void + { + $asset = $this->getMockForAbstractClass(AbstractAsset::class, ['asset.js', [], self::HANDLE]); + $asset->addHashFile($this->hashFile); + + self::assertSame('asset-hash', $asset->getVersion()); + } + + public function testAssetHasExpectedHandleWhenNoCustomHandlePassed(): void + { + self::assertSame(self::HANDLE_PREFIX . 'asset', $this->asset->handle); + } + + public function testAssetHasExpectedHandleWhenCustomHandlePassed(): void + { + $asset = $this->getMockForAbstractClass(AbstractAsset::class, ['asset.js', [], 'custom-handle']); + + self::assertSame('custom-handle', $asset->handle); + } + + public function testAssetHasExpectedHandlePrefixWhenPrefixChangedViaFilter(): void + { + \WP_Mock::onFilter('woda-scripts-styles-loader-prefix') + ->with(self::HANDLE_PREFIX) + ->reply(self::CUSTOM_HANDLE_PREFIX); + $asset = $this->getMockForAbstractClass(AbstractAsset::class, ['asset.js']); + + self::assertSame(self::CUSTOM_HANDLE_PREFIX . 'asset', $asset->handle); + } +} diff --git a/test/Unit/FileTest.php b/test/Unit/FileTest.php new file mode 100644 index 0000000..5c1d635 --- /dev/null +++ b/test/Unit/FileTest.php @@ -0,0 +1,20 @@ +getBaseName()); + } + + public function testGetFileName(): void + { + self::assertSame('main', (new File('https://www.woda.at/assets/dist/js/main.js'))->getFileName()); + } +} diff --git a/test/Unit/HashFileTest.php b/test/Unit/HashFileTest.php new file mode 100644 index 0000000..2d814a8 --- /dev/null +++ b/test/Unit/HashFileTest.php @@ -0,0 +1,20 @@ +getHashValue('script.js')); + } + + public function testGetHashValueReturnsEmptyStringWhenNoEntryFound(): void + { + self::assertSame('', (new HashFile(__DIR__ . '/../hash-file.json'))->getHashValue('foo.js')); + } +} diff --git a/test/Unit/Helper/WpMockHelper.php b/test/Unit/Helper/WpMockHelper.php new file mode 100644 index 0000000..e3231d9 --- /dev/null +++ b/test/Unit/Helper/WpMockHelper.php @@ -0,0 +1,24 @@ + $args + * @param mixed $return + */ + public static function expectCall( + string $function, + ?array $args = [], + $return = null, + int $times = 1 + ): ExpectationInterface { + return WP_Mock::userFunction($function, ['args' => $args ?? [], 'times' => $times, 'return' => $return]); + } +} diff --git a/test/Unit/ScriptTest.php b/test/Unit/ScriptTest.php new file mode 100644 index 0000000..3810961 --- /dev/null +++ b/test/Unit/ScriptTest.php @@ -0,0 +1,143 @@ +script = new Script( + self::SRC, + self::DEPS, + self::HANDLE, + self::VER, + self::IN_FOOTER + ); + } + + public function testDeregister(): void + { + \WP_Mock::expectActionAdded('wp_enqueue_scripts', [$this->script, 'deregisterScript'], 1); + + $this->script->deregister(1); + } + + public function testDeregisterAdmin(): void + { + \WP_Mock::expectActionAdded('admin_enqueue_scripts', [$this->script, 'deregisterScript'], 1); + + $this->script->deregisterAdmin(1); + } + + public function testEnqueue(): void + { + \WP_Mock::expectActionAdded('wp_enqueue_scripts', [$this->script, 'enqueueScript'], 1); + + $this->script->enqueue(1); + } + + public function testEnqueueAdmin(): void + { + \WP_Mock::expectActionAdded('admin_enqueue_scripts', [$this->script, 'enqueueScript'], 1); + + $this->script->enqueueAdmin(1); + } + + public function testLoadAsync(): void + { + \WP_Mock::expectActionAdded('script_loader_tag', [$this->script, 'addAsyncAttribute'], 1, 2); + + $this->script->loadAsync(1); + } + + public function testLoadDeferred(): void + { + \WP_Mock::expectActionAdded('script_loader_tag', [$this->script, 'addDeferAttribute'], 1, 2); + + $this->script->loadDeferred(1); + } + + public function testRegister(): void + { + \WP_Mock::expectActionAdded('wp_enqueue_scripts', [$this->script, 'registerScript'], 1); + + $this->script->register(1); + } + + public function testRegisterAdmin(): void + { + \WP_Mock::expectActionAdded('admin_enqueue_scripts', [$this->script, 'registerScript'], 1); + + $this->script->registerAdmin(1); + } + + public function testAddAsyncAttribute(): void + { + self::assertSame( + '', + $this->script->addAsyncAttribute( + '', + $this->script->handle + ) + ); + } + + public function testAddDeferAttribute(): void + { + self::assertSame( + '', + $this->script->addDeferAttribute( + '', + $this->script->handle + ) + ); + } + + public function testDeregisterScript(): void + { + WpMockHelper::expectCall('wp_deregister_script', [$this->script->handle]); + + $this->script->deregisterScript(); + } + + public function testEnqueueScript(): void + { + WpMockHelper::expectCall('wp_enqueue_script', [ + self::HANDLE, + self::SRC, + self::DEPS, + self::VER, + self::IN_FOOTER, + ]); + + $this->script->enqueueScript(); + } + + public function testRegisterScript(): void + { + WpMockHelper::expectCall('wp_register_script', [ + self::HANDLE, + self::SRC, + self::DEPS, + self::VER, + self::IN_FOOTER, + ]); + + $this->script->registerScript(); + } +} diff --git a/test/Unit/StyleTest.php b/test/Unit/StyleTest.php new file mode 100644 index 0000000..a06b75f --- /dev/null +++ b/test/Unit/StyleTest.php @@ -0,0 +1,94 @@ +style = new Style( + self::SRC, + self::DEPS, + self::HANDLE, + self::VER, + self::MEDIA + ); + } + + public function testEnqueue(): void + { + \WP_Mock::expectActionAdded('wp_enqueue_scripts', [$this->style, 'enqueueStyle'], 1); + + $this->style->enqueue(1); + } + + public function testEnqueueAdmin(): void + { + \WP_Mock::expectActionAdded('admin_enqueue_scripts', [$this->style, 'enqueueStyle'], 1); + + $this->style->enqueueAdmin(1); + } + + public function testEnqueueEditor(): void + { + \WP_Mock::expectActionAdded('after_setup_theme', [$this->style, 'addEditorStyle'], 1); + + $this->style->enqueueEditor(1); + } + + public function testLoadAsync(): void + { + \WP_Mock::expectActionAdded('style_loader_tag', [$this->style, 'applyAsyncPatternToTag'], 1, 2); + + $this->style->loadAsync(1); + } + + public function testAddEditorStyle(): void + { + WpMockHelper::expectCall('add_theme_support', ['editor-styles']); + WpMockHelper::expectCall('add_editor_style', [self::SRC]); + + $this->style->addEditorStyle(); + } + + public function testEnqueueStyle(): void + { + WpMockHelper::expectCall('wp_enqueue_style', [ + self::HANDLE, + self::SRC, + self::DEPS, + self::VER, + self::MEDIA, + ]); + + $this->style->enqueueStyle(); + } + + public function testApplyAsyncPatternToTag(): void + { + self::assertSame( + '' . + '', + $this->style->applyAsyncPatternToTag( + '', + $this->style->handle + ) + ); + } +} diff --git a/test/bootstrap.php b/test/bootstrap.php new file mode 100644 index 0000000..d91dcf9 --- /dev/null +++ b/test/bootstrap.php @@ -0,0 +1,6 @@ + - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - * @see http://www.php-fig.org/psr/psr-0/ - * @see http://www.php-fig.org/psr/psr-4/ - */ -class ClassLoader -{ - // PSR-4 - private $prefixLengthsPsr4 = array(); - private $prefixDirsPsr4 = array(); - private $fallbackDirsPsr4 = array(); - - // PSR-0 - private $prefixesPsr0 = array(); - private $fallbackDirsPsr0 = array(); - - private $useIncludePath = false; - private $classMap = array(); - private $classMapAuthoritative = false; - private $missingClasses = array(); - private $apcuPrefix; - - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', $this->prefixesPsr0); - } - - return array(); - } - - public function getPrefixesPsr4() - { - return $this->prefixDirsPsr4; - } - - public function getFallbackDirs() - { - return $this->fallbackDirsPsr0; - } - - public function getFallbackDirsPsr4() - { - return $this->fallbackDirsPsr4; - } - - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param array $classMap Class to filename map - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, either - * appending or prepending to the ones previously set for this prefix. - * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - */ - public function add($prefix, $paths, $prepend = false) - { - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - (array) $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - (array) $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, either - * appending or prepending to the ones previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException - */ - public function addPsr4($prefix, $paths, $prepend = false) - { - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - (array) $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - (array) $paths - ); - } - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { - // Register directories for a new namespace. - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, - * replacing any others previously set for this prefix. - * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 base directories - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; - } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, - * replacing any others previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - */ - public function setPsr4($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr4 = (array) $paths; - } else { - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Turns off searching the prefix and fallback directories for classes - * that have not been registered with the class map. - * - * @param bool $classMapAuthoritative - */ - public function setClassMapAuthoritative($classMapAuthoritative) - { - $this->classMapAuthoritative = $classMapAuthoritative; - } - - /** - * Should class lookup fail if not found in the current class map? - * - * @return bool - */ - public function isClassMapAuthoritative() - { - return $this->classMapAuthoritative; - } - - /** - * APCu prefix to use to cache found/not-found classes, if the extension is enabled. - * - * @param string|null $apcuPrefix - */ - public function setApcuPrefix($apcuPrefix) - { - $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; - } - - /** - * The APCu prefix in use, or null if APCu caching is not enabled. - * - * @return string|null - */ - public function getApcuPrefix() - { - return $this->apcuPrefix; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Unregisters this instance as an autoloader. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - includeFile($file); - - return true; - } - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - public function findFile($class) - { - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { - return false; - } - if (null !== $this->apcuPrefix) { - $file = apcu_fetch($this->apcuPrefix.$class, $hit); - if ($hit) { - return $file; - } - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if (false === $file && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if (null !== $this->apcuPrefix) { - apcu_add($this->apcuPrefix.$class, $file); - } - - if (false === $file) { - // Remember that this class does not exist. - $this->missingClasses[$class] = true; - } - - return $file; - } - - private function findFileWithExtension($class, $ext) - { - // PSR-4 lookup - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengthsPsr4[$first])) { - $subPath = $class; - while (false !== $lastPos = strrpos($subPath, '\\')) { - $subPath = substr($subPath, 0, $lastPos); - $search = $subPath . '\\'; - if (isset($this->prefixDirsPsr4[$search])) { - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); - foreach ($this->prefixDirsPsr4[$search] as $dir) { - if (file_exists($file = $dir . $pathEnd)) { - return $file; - } - } - } - } - } - - // PSR-4 fallback dirs - foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { - return $file; - } - } - - // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); - } else { - // PEAR-like class name - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; - } - - if (isset($this->prefixesPsr0[$first])) { - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - } - } - } - - // PSR-0 fallback dirs - foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - - // PSR-0 include paths. - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { - return $file; - } - - return false; - } -} - -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - */ -function includeFile($file) -{ - include $file; -} diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE deleted file mode 100644 index f27399a..0000000 --- a/vendor/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -Copyright (c) Nils Adermann, Jordi Boggiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php deleted file mode 100644 index 7a91153..0000000 --- a/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,9 +0,0 @@ - array($baseDir . '/includes'), -); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php deleted file mode 100644 index ee167ad..0000000 --- a/vendor/composer/autoload_real.php +++ /dev/null @@ -1,52 +0,0 @@ -= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require_once __DIR__ . '/autoload_static.php'; - - call_user_func(\Composer\Autoload\ComposerStaticInitdf3f8fe0eeed85367e28e07d385d66fd::getInitializer($loader)); - } else { - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } - - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } - - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - } - - $loader->register(true); - - return $loader; - } -} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php deleted file mode 100644 index 59e8841..0000000 --- a/vendor/composer/autoload_static.php +++ /dev/null @@ -1,31 +0,0 @@ - - array ( - 'Woda\\WordPress\\ScriptsStylesLoader\\' => 35, - ), - ); - - public static $prefixDirsPsr4 = array ( - 'Woda\\WordPress\\ScriptsStylesLoader\\' => - array ( - 0 => __DIR__ . '/../..' . '/includes', - ), - ); - - public static function getInitializer(ClassLoader $loader) - { - return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitdf3f8fe0eeed85367e28e07d385d66fd::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitdf3f8fe0eeed85367e28e07d385d66fd::$prefixDirsPsr4; - - }, null, ClassLoader::class); - } -} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json deleted file mode 100644 index fe51488..0000000 --- a/vendor/composer/installed.json +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/woda-scripts-styles-loader.php b/woda-scripts-styles-loader.php index 5442db6..8432eb0 100644 --- a/woda-scripts-styles-loader.php +++ b/woda-scripts-styles-loader.php @@ -3,7 +3,7 @@ * Plugin Name: Woda Scripts Styles Loader * Plugin URI: https://github.com/wwwoda/woda-scripts-styles-loader * Description: ... - * Version: 0.4.0 + * Version: 1.0.0 * Author: Woda * Author URI: https://www.woda.at * License: GPLv3 @@ -29,6 +29,6 @@ namespace Woda\WordPress\ScriptsStylesLoader; -include_once 'vendor/autoload.php'; - -Init::init(); +if (file_exists(__DIR__ . '/vendor/autoload.php')) { + include_once 'vendor/autoload.php'; +}