diff --git a/.env.example b/.env.example deleted file mode 100644 index 915a6af..0000000 --- a/.env.example +++ /dev/null @@ -1 +0,0 @@ -BASE_PATH=./ diff --git a/.gitattributes b/.gitattributes index 89a139e..fa44582 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,9 +1,9 @@ -test export-ignore +.idea export-ignore nbproject export-ignore +test export-ignore .codeclimate.yml export-ignore -.php_cs export-ignore -.travis.yml export-ignore .gitattributes export-ignore .gitignore export-ignore -composer.lock export-ignore +.travis.yml export-ignore phpunit.xml export-ignore +composer.lock export-ignore diff --git a/.gitignore b/.gitignore index afe0cde..c63e4f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,5 @@ -/vendor/ -/nbproject/private/ +/.idea/ +/nbproject/ /test/coverage/ /test/log/ -/build/ -/.idea/dictionaries/ -/.idea/workspace.xml -/.idea/tasks.xml -/.idea/deployment.xml -/.idea/vagrant.xml -/.idea/misc.xml -/.idea/inspectionProfiles/ -/.env +/vendor/ diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index 2b421f7..0000000 --- a/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/module-interface.iml b/.idea/module-interface.iml deleted file mode 100644 index 0b1b5fe..0000000 --- a/.idea/module-interface.iml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index bd5f287..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/php-test-framework.xml b/.idea/php-test-framework.xml deleted file mode 100644 index 21a7d7a..0000000 --- a/.idea/php-test-framework.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml deleted file mode 100644 index f902035..0000000 --- a/.idea/php.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /etc/php/7.0/cli/conf.d/10-mysqlnd.ini, /etc/php/7.0/cli/conf.d/10-opcache.ini, /etc/php/7.0/cli/conf.d/10-pdo.ini, /etc/php/7.0/cli/conf.d/15-xml.ini, /etc/php/7.0/cli/conf.d/20-apcu.ini, /etc/php/7.0/cli/conf.d/20-bcmath.ini, /etc/php/7.0/cli/conf.d/20-bz2.ini, /etc/php/7.0/cli/conf.d/20-calendar.ini, /etc/php/7.0/cli/conf.d/20-ctype.ini, /etc/php/7.0/cli/conf.d/20-curl.ini, /etc/php/7.0/cli/conf.d/20-dom.ini, /etc/php/7.0/cli/conf.d/20-exif.ini, /etc/php/7.0/cli/conf.d/20-fileinfo.ini, /etc/php/7.0/cli/conf.d/20-ftp.ini, /etc/php/7.0/cli/conf.d/20-gd.ini, /etc/php/7.0/cli/conf.d/20-geoip.ini, /etc/php/7.0/cli/conf.d/20-gettext.ini, /etc/php/7.0/cli/conf.d/20-iconv.ini, /etc/php/7.0/cli/conf.d/20-igbinary.ini, /etc/php/7.0/cli/conf.d/20-imagick.ini, /etc/php/7.0/cli/conf.d/20-imap.ini, /etc/php/7.0/cli/conf.d/20-intl.ini, /etc/php/7.0/cli/conf.d/20-json.ini, /etc/php/7.0/cli/conf.d/20-ldap.ini, /etc/php/7.0/cli/conf.d/20-mbstring.ini, /etc/php/7.0/cli/conf.d/20-mcrypt.ini, /etc/php/7.0/cli/conf.d/20-mongodb.ini, /etc/php/7.0/cli/conf.d/20-msgpack.ini, /etc/php/7.0/cli/conf.d/20-mysqli.ini, /etc/php/7.0/cli/conf.d/20-pdo_mysql.ini, /etc/php/7.0/cli/conf.d/20-pdo_pgsql.ini, /etc/php/7.0/cli/conf.d/20-pdo_sqlite.ini, /etc/php/7.0/cli/conf.d/20-pgsql.ini, /etc/php/7.0/cli/conf.d/20-phar.ini, /etc/php/7.0/cli/conf.d/20-posix.ini, /etc/php/7.0/cli/conf.d/20-readline.ini, /etc/php/7.0/cli/conf.d/20-redis.ini, /etc/php/7.0/cli/conf.d/20-shmop.ini, /etc/php/7.0/cli/conf.d/20-simplexml.ini, /etc/php/7.0/cli/conf.d/20-soap.ini, /etc/php/7.0/cli/conf.d/20-sockets.ini, /etc/php/7.0/cli/conf.d/20-sqlite3.ini, /etc/php/7.0/cli/conf.d/20-ssh2.ini, /etc/php/7.0/cli/conf.d/20-sysvmsg.ini, /etc/php/7.0/cli/conf.d/20-sysvsem.ini, /etc/php/7.0/cli/conf.d/20-sysvshm.ini, /etc/php/7.0/cli/conf.d/20-tokenizer.ini, /etc/php/7.0/cli/conf.d/20-wddx.ini, /etc/php/7.0/cli/conf.d/20-xdebug.ini, /etc/php/7.0/cli/conf.d/20-xmlreader.ini, /etc/php/7.0/cli/conf.d/20-xmlrpc.ini, /etc/php/7.0/cli/conf.d/20-xmlwriter.ini, /etc/php/7.0/cli/conf.d/20-xsl.ini, /etc/php/7.0/cli/conf.d/20-zip.ini, /etc/php/7.0/cli/conf.d/25-apcu_bc.ini, /etc/php/7.0/cli/conf.d/25-memcached.ini, /etc/php/7.0/cli/conf.d/999-custom.ini - /etc/php/7.0/cli/php.ini - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/remote-mappings.xml b/.idea/remote-mappings.xml deleted file mode 100644 index d4adda7..0000000 --- a/.idea/remote-mappings.xml +++ /dev/null @@ -1,16 +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/.php_cs b/.php_cs deleted file mode 100644 index 65bfcbc..0000000 --- a/.php_cs +++ /dev/null @@ -1,27 +0,0 @@ -getFixers(); - -$toRemove = array(); -foreach ($toRemove as $_fixer) { - if (($removeIndex = array_search($_fixer, $fixers)) === false) { - continue; - } - - unset($fixers[$removeIndex]); -} - -$toAdd = array(); -foreach ($toAdd as $_fixer) { - if (($removeIndex = array_search($_fixer, $fixers)) !== false) { - continue; - } - - $fixers[] = $_fixer; -} - -$config->fixers($fixers); -$config->getFinder()->in(__DIR__.DIRECTORY_SEPARATOR.'src'); -return $config; diff --git a/README.md b/README.md index a7b74c4..e715072 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,9 @@ This package contains interfaces that are useful in describing modules and their - [`ModuleInterface`][] - The interface for a module. A module is an object that represents an application fragment. Modules are prepared using `setup()`, which returns a `ServiceProviderInterface` instance that the application may consume, and invoked using `run()`. +- [`FactoryInterface`][] - The interface for a service factory. Implementations of this interface can be used instead +of anonymous functions when defining service providers. Implementations can provide generic service definition logic, +reducing code repetition, as well as allow for static analysis on modules by exposing the keys of dependent services. ### Requirements - PHP: <= 7.0 | < 7.4 @@ -23,3 +26,4 @@ the application may consume, and invoked using `run()`. [Dhii]: https://github.com/Dhii/dhii [`ModuleInterface`]: src/ModuleInterface.php +[`FactoryInterface`]: src/FactoryInterface.php diff --git a/composer.json b/composer.json index c06557b..39a76de 100644 --- a/composer.json +++ b/composer.json @@ -12,25 +12,25 @@ "prefer-stable": true, "minimum-stability": "dev", "require": { - "php": "^7.0" + "php": "^7.0", + "psr/container": "^1.0", + "container-interop/service-provider": "^0.4", + "dhii/containers": "dev-task/more-containers" }, "require-dev": { - "phpunit/phpunit": "^6.0", - "dhii/php-cs-fixer-config": "master", - "codeclimate/php-test-reporter": "<=0.3.2", - "psr/container": "^1.0", - "container-interop/service-provider": "^0.4" + "phpunit/phpunit": "^6.0 || ^7.0", + "codeclimate/php-test-reporter": "<=0.3.2" }, "autoload": { "psr-4": { - "Dhii\\Modular\\Module\\": "src" + "Mecha\\Modular\\": "src" } }, "autoload-dev": { "psr-4": { - "Dhii\\Modular\\Module\\UnitTest\\": "test/unit", - "Dhii\\Modular\\Module\\FuncTest\\": "test/functional", - "Dhii\\Modular\\Module\\Test\\": "test/stubs" + "Mecha\\Modular\\UnitTest\\": "test/unit", + "Mecha\\Modular\\FuncTest\\": "test/functional", + "Mecha\\Modular\\Test\\": "test/stubs" } }, "scripts": { diff --git a/composer.lock b/composer.lock index bedb838..539be51 100644 --- a/composer.lock +++ b/composer.lock @@ -4,46 +4,73 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3a0567368119dab304ce19a8ea44d3ac", - "packages": [], - "packages-dev": [ + "content-hash": "59b31cb9661584123f2fe07466d4b1c1", + "packages": [ { - "name": "codeclimate/php-test-reporter", - "version": "v0.3.2", + "name": "container-interop/service-provider", + "version": "v0.4.0", "source": { "type": "git", - "url": "https://github.com/codeclimate/php-test-reporter.git", - "reference": "3a2d3ebdc1df5acf372458c15041af240a6fc016" + "url": "https://github.com/container-interop/service-provider.git", + "reference": "4969b9e49460690b7430b3f1a87cab07be61418a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/codeclimate/php-test-reporter/zipball/3a2d3ebdc1df5acf372458c15041af240a6fc016", - "reference": "3a2d3ebdc1df5acf372458c15041af240a6fc016", + "url": "https://api.github.com/repos/container-interop/service-provider/zipball/4969b9e49460690b7430b3f1a87cab07be61418a", + "reference": "4969b9e49460690b7430b3f1a87cab07be61418a", "shasum": "" }, "require": { - "ext-curl": "*", - "php": ">=5.3", - "satooshi/php-coveralls": "1.0.*", - "symfony/console": ">=2.0" + "psr/container": "^1.0" }, - "require-dev": { - "ext-xdebug": "*", - "phpunit/phpunit": "3.7.*@stable" + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/" + } }, - "bin": [ - "composer/bin/test-reporter" + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" ], + "description": "Promoting container interoperability through standard service providers", + "homepage": "https://github.com/container-interop/service-provider", + "time": "2017-09-20T14:13:36+00:00" + }, + { + "name": "dhii/containers", + "version": "dev-task/more-containers", + "source": { + "type": "git", + "url": "https://github.com/Dhii/containers.git", + "reference": "e4f8c14d87b86ab555d1b66e270478f4ad720578" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Dhii/containers/zipball/e4f8c14d87b86ab555d1b66e270478f4ad720578", + "reference": "e4f8c14d87b86ab555d1b66e270478f4ad720578", + "shasum": "" + }, + "require": { + "container-interop/service-provider": "^0.4", + "dhii/data-container-interface": "^0.2", + "php": "^7.0 | ^8.0" + }, + "require-dev": { + "gmazzap/andrew": "^1.1", + "phpunit/phpunit": "^6.0 || ^7.0", + "psr/container": "^1.0", + "slevomat/coding-standard": "~4.0" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "0.3.x-dev" + "dev-develop": "0.1.x-dev" } }, "autoload": { - "psr-0": { - "CodeClimate\\Component": "src/", - "CodeClimate\\Bundle": "src/" + "psr-4": { + "Dhii\\Container\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -52,76 +79,104 @@ ], "authors": [ { - "name": "Code Climate", - "email": "hello@codeclimate.com", - "homepage": "https://codeclimate.com" + "name": "Dhii Team", + "email": "development@dhii.co" } ], - "description": "PHP client for reporting test coverage to Code Climate", - "homepage": "https://github.com/codeclimate/php-test-reporter", + "description": "A selection of PSR-11 containers for utility, simplicity, and ease.", "keywords": [ - "codeclimate", - "coverage" + "PSR-11", + "container" ], - "time": "2016-04-19T16:54:33+00:00" + "time": "2020-01-23T19:53:54+00:00" }, { - "name": "container-interop/service-provider", - "version": "v0.4.0", + "name": "dhii/data-container-interface", + "version": "v0.2", "source": { "type": "git", - "url": "https://github.com/container-interop/service-provider.git", - "reference": "4969b9e49460690b7430b3f1a87cab07be61418a" + "url": "https://github.com/Dhii/data-container-interface.git", + "reference": "3c3abe3c251e413915b139700a3bf6d52109ed8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/container-interop/service-provider/zipball/4969b9e49460690b7430b3f1a87cab07be61418a", - "reference": "4969b9e49460690b7430b3f1a87cab07be61418a", + "url": "https://api.github.com/repos/Dhii/data-container-interface/zipball/3c3abe3c251e413915b139700a3bf6d52109ed8d", + "reference": "3c3abe3c251e413915b139700a3bf6d52109ed8d", "shasum": "" }, "require": { + "dhii/exception-interface": "^0.1 | ^0.2", + "dhii/factory-interface": "^0.1-alpha1", + "php": "^5.3 | ^7.0", "psr/container": "^1.0" }, + "require-dev": { + "codeclimate/php-test-reporter": "<=0.3.2", + "dhii/php-cs-fixer-config": "dev-php-5.3", + "dhii/stringable-interface": "^0.1", + "phpunit/phpunit": "^4.8", + "ptrofimov/xpmock": "^1.1" + }, + "suggest": { + "dhii/stringable-interface": "To be able to pass Stringables as keys" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "0.2.x-dev" + } + }, "autoload": { "psr-4": { - "Interop\\Container\\": "src/" + "Dhii\\Data\\Container\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Promoting container interoperability through standard service providers", - "homepage": "https://github.com/container-interop/service-provider", - "time": "2017-09-20T14:13:36+00:00" + "authors": [ + { + "name": "Dhii Team", + "email": "development@dhii.co" + } + ], + "description": "Interfaces for working with data containers", + "time": "2019-05-10T13:48:39+00:00" }, { - "name": "dhii/php-cs-fixer-config", - "version": "dev-master", + "name": "dhii/exception-interface", + "version": "v0.2", "source": { "type": "git", - "url": "https://github.com/Dhii/php-cs-fixer-config.git", - "reference": "fc2f45d1f822bff7d871ba3c4c9750ad66f5ab0c" + "url": "https://github.com/Dhii/exception-interface.git", + "reference": "b69feebf7cb2879cd43977a03342e2393b73f7fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dhii/php-cs-fixer-config/zipball/fc2f45d1f822bff7d871ba3c4c9750ad66f5ab0c", - "reference": "fc2f45d1f822bff7d871ba3c4c9750ad66f5ab0c", + "url": "https://api.github.com/repos/Dhii/exception-interface/zipball/b69feebf7cb2879cd43977a03342e2393b73f7fb", + "reference": "b69feebf7cb2879cd43977a03342e2393b73f7fb", "shasum": "" }, "require": { - "friendsofphp/php-cs-fixer": ">=1.11 <1.12", - "php": "^5.4 | ^7.0" + "dhii/stringable-interface": "^0.1", + "php": "^5.3 | ^7.0" }, "require-dev": { - "codeclimate/php-test-reporter": "dev-master", - "phpunit/phpunit": "^4.8" + "codeclimate/php-test-reporter": "<=0.3.2", + "dhii/php-cs-fixer-config": "dev-php-5.3", + "phpunit/phpunit": "^4.8", + "ptrofimov/xpmock": "^1.1" }, "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "0.2.x-dev" + } + }, "autoload": { "psr-4": { - "Dhii\\Configuration\\PHPCSFixer\\": "src/" + "Dhii\\Exception\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -134,42 +189,44 @@ "email": "development@dhii.co" } ], - "description": "A default PHP CS Fixer config implementation", - "time": "2017-07-23T12:53:27+00:00" + "description": "Interfaces for most common exceptions", + "time": "2018-08-29T10:42:04+00:00" }, { - "name": "doctrine/instantiator", - "version": "1.0.5", + "name": "dhii/factory-interface", + "version": "v0.1", "source": { "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "url": "https://github.com/Dhii/factory-interface.git", + "reference": "b8d217aec8838e64ccaa770cb03dc164bf6f0515" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/Dhii/factory-interface/zipball/b8d217aec8838e64ccaa770cb03dc164bf6f0515", + "reference": "b8d217aec8838e64ccaa770cb03dc164bf6f0515", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "dhii/exception-interface": "^0.1|^0.2", + "php": "^5.3 | ^7.0" }, "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "codeclimate/php-test-reporter": "<=0.3.2", + "dhii/php-cs-fixer-config": "dev-php-5.3", + "dhii/stringable-interface": "^0.1", + "phpunit/phpunit": "^4.8", + "psr/container": "^1.0", + "ptrofimov/xpmock": "^1.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-develop": "0.1.x-dev" } }, "autoload": { "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + "Dhii\\Factory\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -178,58 +235,143 @@ ], "authors": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "name": "Dhii Team", + "email": "development@dhii.co" } ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" + "description": "Interfaces for working with factories.", + "time": "2018-08-29T11:15:09+00:00" + }, + { + "name": "dhii/stringable-interface", + "version": "v0.1", + "source": { + "type": "git", + "url": "https://github.com/Dhii/stringable-interface.git", + "reference": "b6653905eef2ebf377749feb80a6d18abbe913ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Dhii/stringable-interface/zipball/b6653905eef2ebf377749feb80a6d18abbe913ef", + "reference": "b6653905eef2ebf377749feb80a6d18abbe913ef", + "shasum": "" + }, + "require": { + "php": "^5.3 | ^7.0" + }, + "require-dev": { + "codeclimate/php-test-reporter": "<=0.3.2", + "dhii/php-cs-fixer-config": "dev-php-5.3", + "phpunit/phpunit": "^4.8", + "ptrofimov/xpmock": "^1.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Dhii\\Util\\String\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dhii Team", + "email": "development@dhii.co" + } ], - "time": "2015-06-14T21:17:01+00:00" + "description": "Interoperability interface for objects that can be cast to string", + "time": "2017-01-23T15:08:20+00:00" }, { - "name": "friendsofphp/php-cs-fixer", - "version": "v1.11.8", + "name": "psr/container", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "117137e9970054d022b7656209f094dab852b90c" + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/117137e9970054d022b7656209f094dab852b90c", - "reference": "117137e9970054d022b7656209f094dab852b90c", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=5.3.6", - "sebastian/diff": "~1.1", - "symfony/console": "~2.3|~3.0", - "symfony/event-dispatcher": "~2.1|~3.0", - "symfony/filesystem": "~2.1|~3.0", - "symfony/finder": "~2.1|~3.0", - "symfony/process": "~2.3|~3.0", - "symfony/stopwatch": "~2.5|~3.0" + "php": ">=5.3.0" }, - "conflict": { - "hhvm": "<3.9" + "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" + } + ], + "packages-dev": [ + { + "name": "codeclimate/php-test-reporter", + "version": "v0.3.2", + "source": { + "type": "git", + "url": "https://github.com/codeclimate/php-test-reporter.git", + "reference": "3a2d3ebdc1df5acf372458c15041af240a6fc016" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/codeclimate/php-test-reporter/zipball/3a2d3ebdc1df5acf372458c15041af240a6fc016", + "reference": "3a2d3ebdc1df5acf372458c15041af240a6fc016", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.3", + "satooshi/php-coveralls": "1.0.*", + "symfony/console": ">=2.0" }, "require-dev": { - "phpunit/phpunit": "^4.5|^5", - "satooshi/php-coveralls": "^0.7.1" + "ext-xdebug": "*", + "phpunit/phpunit": "3.7.*@stable" }, "bin": [ - "php-cs-fixer" + "composer/bin/test-reporter" ], - "type": "application", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.3.x-dev" + } + }, "autoload": { - "psr-4": { - "Symfony\\CS\\": "Symfony/CS/" + "psr-0": { + "CodeClimate\\Component": "src/", + "CodeClimate\\Bundle": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -238,16 +380,74 @@ ], "authors": [ { - "name": "Dariusz RumiƄski", - "email": "dariusz.ruminski@gmail.com" - }, + "name": "Code Climate", + "email": "hello@codeclimate.com", + "homepage": "https://codeclimate.com" + } + ], + "description": "PHP client for reporting test coverage to Code Climate", + "homepage": "https://github.com/codeclimate/php-test-reporter", + "keywords": [ + "codeclimate", + "coverage" + ], + "time": "2016-04-19T16:54:33+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "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": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" } ], - "description": "A tool to automatically fix PHP code style", - "time": "2016-08-16T23:31:05+00:00" + "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": "2019-10-21T16:45:58+00:00" }, { "name": "guzzle/guzzle", @@ -347,25 +547,28 @@ }, { "name": "myclabs/deep-copy", - "version": "1.7.0", + "version": "1.9.5", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef", + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" }, "require-dev": { "doctrine/collections": "^1.0", "doctrine/common": "^2.6", - "phpunit/phpunit": "^4.1" + "phpunit/phpunit": "^7.1" }, "type": "library", "autoload": { @@ -388,26 +591,26 @@ "object", "object graph" ], - "time": "2017-10-19T19:58:43+00:00" + "time": "2020-01-17T21:11:47+00:00" }, { "name": "phar-io/manifest", - "version": "1.0.1", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", "shasum": "" }, "require": { "ext-dom": "*", "ext-phar": "*", - "phar-io/version": "^1.0.1", + "phar-io/version": "^2.0", "php": "^5.6 || ^7.0" }, "type": "library", @@ -443,20 +646,20 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-03-05T18:14:27+00:00" + "time": "2018-07-08T19:23:20+00:00" }, { "name": "phar-io/version", - "version": "1.0.1", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", "shasum": "" }, "require": { @@ -490,39 +693,37 @@ } ], "description": "Library for handling version information and constraints", - "time": "2017-03-05T17:38:23+00:00" + "time": "2018-07-08T19:19:57+00:00" }, { "name": "phpdocumentor/reflection-common", - "version": "1.0.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", + "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", "shasum": "" }, "require": { - "php": ">=5.5" + "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "^4.6" + "phpunit/phpunit": "~6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] + "phpDocumentor\\Reflection\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -544,44 +745,42 @@ "reflection", "static analysis" ], - "time": "2017-09-11T18:02:19+00:00" + "time": "2018-08-07T13:53:10+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.2", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e" + "reference": "a48807183a4b819072f26e347bbd0b5199a9d15f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/b83ff7cfcfee7827e1e78b637a5904fe6a96698e", - "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/a48807183a4b819072f26e347bbd0b5199a9d15f", + "reference": "a48807183a4b819072f26e347bbd0b5199a9d15f", "shasum": "" }, "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0", - "phpdocumentor/type-resolver": "~0.4 || ^1.0.0", - "webmozart/assert": "^1.0" + "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.0.5", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.4" + "doctrine/instantiator": "^1", + "mockery/mockery": "^1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev" + "dev-master": "5.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -592,37 +791,42 @@ { "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": "2019-09-12T14:27:41+00:00" + "time": "2020-02-09T09:16:15+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.5.1", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "cf842904952e64e703800d094cdf34e715a8a3ae" + "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/cf842904952e64e703800d094cdf34e715a8a3ae", - "reference": "cf842904952e64e703800d094cdf34e715a8a3ae", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", + "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", "shasum": "" }, "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0" + "php": "^7.1", + "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.4" + "ext-tokenizer": "^7.1", + "mockery/mockery": "~1", + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { @@ -640,37 +844,38 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-12-30T13:23:38+00:00" + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "time": "2019-08-22T18:11:29+00:00" }, { "name": "phpspec/prophecy", - "version": "1.9.0", + "version": "v1.10.2", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203" + "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203", - "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b4400efc9d206e83138e2bb97ed7f5b14b831cd9", + "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9", "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.1|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.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", + "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.8.x-dev" + "dev-master": "1.10.x-dev" } }, "autoload": { @@ -703,44 +908,44 @@ "spy", "stub" ], - "time": "2019-10-03T11:07:50+00:00" + "time": "2020-01-20T15:57:02+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "5.3.2", + "version": "6.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac" + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^7.0", - "phpunit/php-file-iterator": "^1.4.2", + "php": "^7.1", + "phpunit/php-file-iterator": "^2.0", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^2.0.1", + "phpunit/php-token-stream": "^3.0", "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.0", + "sebastian/environment": "^3.1 || ^4.0", "sebastian/version": "^2.0.1", "theseer/tokenizer": "^1.1" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^7.0" }, "suggest": { - "ext-xdebug": "^2.5.5" + "ext-xdebug": "^2.6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.3.x-dev" + "dev-master": "6.1-dev" } }, "autoload": { @@ -766,29 +971,32 @@ "testing", "xunit" ], - "time": "2018-04-06T15:36:58+00:00" + "time": "2018-10-31T16:06:48+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "reference": "050bedf145a257b1ff02746c31894800e5122946" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", + "reference": "050bedf145a257b1ff02746c31894800e5122946", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -803,7 +1011,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -813,7 +1021,7 @@ "filesystem", "iterator" ], - "time": "2017-11-27T13:52:08+00:00" + "time": "2018-09-13T20:33:42+00:00" }, { "name": "phpunit/php-text-template", @@ -858,28 +1066,28 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.9", + "version": "2.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + "reference": "1038454804406b0b5f5f520358e78c1c2f71501e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1038454804406b0b5f5f520358e78c1c2f71501e", + "reference": "1038454804406b0b5f5f520358e78c1c2f71501e", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.1-dev" } }, "autoload": { @@ -894,7 +1102,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -903,33 +1111,33 @@ "keywords": [ "timer" ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2019-06-07T04:22:29+00:00" }, { "name": "phpunit/php-token-stream", - "version": "2.0.2", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "791198a2c6254db10131eecfe8c06670700904db" + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", - "reference": "791198a2c6254db10131eecfe8c06670700904db", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff", + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.2.4" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -952,57 +1160,57 @@ "keywords": [ "tokenizer" ], - "time": "2017-11-27T05:48:46+00:00" + "time": "2019-09-17T06:23:10+00:00" }, { "name": "phpunit/phpunit", - "version": "6.2.4", + "version": "7.5.20", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "ff3a76a58ac293657808aefd58c8aaf05945f4d9" + "reference": "9467db479d1b0487c99733bb1e7944d32deded2c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ff3a76a58ac293657808aefd58c8aaf05945f4d9", - "reference": "ff3a76a58ac293657808aefd58c8aaf05945f4d9", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9467db479d1b0487c99733bb1e7944d32deded2c", + "reference": "9467db479d1b0487c99733bb1e7944d32deded2c", "shasum": "" }, "require": { + "doctrine/instantiator": "^1.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "^1.3", - "phar-io/manifest": "^1.0.1", - "phar-io/version": "^1.0", - "php": "^7.0", + "myclabs/deep-copy": "^1.7", + "phar-io/manifest": "^1.0.2", + "phar-io/version": "^2.0", + "php": "^7.1", "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^5.2", - "phpunit/php-file-iterator": "^1.4", - "phpunit/php-text-template": "^1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^4.0", - "sebastian/comparator": "^2.0", - "sebastian/diff": "^1.4.3", - "sebastian/environment": "^3.0.2", + "phpunit/php-code-coverage": "^6.0.7", + "phpunit/php-file-iterator": "^2.0.1", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^2.1", + "sebastian/comparator": "^3.0", + "sebastian/diff": "^3.0", + "sebastian/environment": "^4.0", "sebastian/exporter": "^3.1", - "sebastian/global-state": "^1.1 || ^2.0", - "sebastian/object-enumerator": "^3.0.2", - "sebastian/resource-operations": "^1.0", - "sebastian/version": "^2.0" + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^2.0", + "sebastian/version": "^2.0.1" }, "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2", - "phpunit/dbunit": "<3.0" + "phpunit/phpunit-mock-objects": "*" }, "require-dev": { "ext-pdo": "*" }, "suggest": { + "ext-soap": "*", "ext-xdebug": "*", - "phpunit/php-invoker": "^1.1" + "phpunit/php-invoker": "^2.0" }, "bin": [ "phpunit" @@ -1010,7 +1218,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.2.x-dev" + "dev-master": "7.5-dev" } }, "autoload": { @@ -1036,116 +1244,7 @@ "testing", "xunit" ], - "time": "2017-08-03T13:59:28+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "2f789b59ab89669015ad984afa350c4ec577ade0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/2f789b59ab89669015ad984afa350c4ec577ade0", - "reference": "2f789b59ab89669015ad984afa350c4ec577ade0", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.5", - "php": "^7.0", - "phpunit/php-text-template": "^1.2.1", - "sebastian/exporter": "^3.0" - }, - "conflict": { - "phpunit/phpunit": "<6.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "abandoned": true, - "time": "2017-08-03T14:08:16+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" + "time": "2020-01-08T08:45:45+00:00" }, { "name": "psr/log", @@ -1303,30 +1402,30 @@ }, { "name": "sebastian/comparator", - "version": "2.0.0", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "20f84f468cb67efee293246e6a09619b891f55f0" + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/20f84f468cb67efee293246e6a09619b891f55f0", - "reference": "20f84f468cb67efee293246e6a09619b891f55f0", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/diff": "^1.2", - "sebastian/exporter": "^3.0" + "php": "^7.1", + "sebastian/diff": "^3.0", + "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1357,38 +1456,39 @@ } ], "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", + "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ "comparator", "compare", "equality" ], - "time": "2017-03-03T06:26:08+00:00" + "time": "2018-07-12T15:12:46+00:00" }, { "name": "sebastian/diff", - "version": "1.4.3", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^7.5 || ^8.0", + "symfony/process": "^2 || ^3.3 || ^4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1413,34 +1513,40 @@ "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "diff" + "diff", + "udiff", + "unidiff", + "unified diff" ], - "time": "2017-05-22T07:24:03+00:00" + "time": "2019-02-04T06:01:07+00:00" }, { "name": "sebastian/environment", - "version": "3.1.0", + "version": "4.2.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.1" + "phpunit/phpunit": "^7.5" + }, + "suggest": { + "ext-posix": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -1465,7 +1571,7 @@ "environment", "hhvm" ], - "time": "2017-07-01T08:51:00+00:00" + "time": "2019-11-20T08:46:58+00:00" }, { "name": "sebastian/exporter", @@ -1732,25 +1838,25 @@ }, { "name": "sebastian/resource-operations", - "version": "1.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", "shasum": "" }, "require": { - "php": ">=5.6.0" + "php": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1770,7 +1876,7 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" + "time": "2018-10-04T04:07:39+00:00" }, { "name": "sebastian/version", @@ -1817,32 +1923,32 @@ }, { "name": "symfony/config", - "version": "v3.4.33", + "version": "v4.4.4", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "c111091db748ed394fd8c3e473a90ad3b80e08ad" + "reference": "4d3979f54472637169080f802dc82197e21fdcce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/c111091db748ed394fd8c3e473a90ad3b80e08ad", - "reference": "c111091db748ed394fd8c3e473a90ad3b80e08ad", + "url": "https://api.github.com/repos/symfony/config/zipball/4d3979f54472637169080f802dc82197e21fdcce", + "reference": "4d3979f54472637169080f802dc82197e21fdcce", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/filesystem": "~2.8|~3.0|~4.0", + "php": "^7.1.3", + "symfony/filesystem": "^3.4|^4.0|^5.0", "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "symfony/dependency-injection": "<3.3", - "symfony/finder": "<3.3" + "symfony/finder": "<3.4" }, "require-dev": { - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/event-dispatcher": "~3.3|~4.0", - "symfony/finder": "~3.3|~4.0", - "symfony/yaml": "~3.0|~4.0" + "symfony/event-dispatcher": "^3.4|^4.0|^5.0", + "symfony/finder": "^3.4|^4.0|^5.0", + "symfony/messenger": "^4.1|^5.0", + "symfony/service-contracts": "^1.1|^2", + "symfony/yaml": "^3.4|^4.0|^5.0" }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" @@ -1850,7 +1956,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -1877,25 +1983,25 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2019-10-30T12:46:47+00:00" + "time": "2020-01-04T13:00:46+00:00" }, { "name": "symfony/console", - "version": "v3.4.33", + "version": "v4.2.12", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "c7edffb26b29cae972ca4afccb610a38ce8d0ccf" + "reference": "fc2e274aade6567a750551942094b2145ade9b6c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c7edffb26b29cae972ca4afccb610a38ce8d0ccf", - "reference": "c7edffb26b29cae972ca4afccb610a38ce8d0ccf", + "url": "https://api.github.com/repos/symfony/console/zipball/fc2e274aade6567a750551942094b2145ade9b6c", + "reference": "fc2e274aade6567a750551942094b2145ade9b6c", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0|~4.0", + "php": "^7.1.3", + "symfony/contracts": "^1.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { @@ -1907,11 +2013,11 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.3|~4.0", + "symfony/config": "~3.4|~4.0", "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.3|~4.0" + "symfony/process": "~3.4|~4.0" }, "suggest": { "psr/log": "For using the console logger", @@ -1922,7 +2028,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -1949,44 +2055,51 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-10-24T15:33:53+00:00" + "time": "2019-07-24T17:13:20+00:00" }, { - "name": "symfony/debug", - "version": "v3.4.33", + "name": "symfony/contracts", + "version": "v1.1.0", "source": { "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "f72e33fdb1170b326e72c3157f0cd456351dd086" + "url": "https://github.com/symfony/contracts.git", + "reference": "d3636025e8253c6144358ec0a62773cae588395b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/f72e33fdb1170b326e72c3157f0cd456351dd086", - "reference": "f72e33fdb1170b326e72c3157f0cd456351dd086", + "url": "https://api.github.com/repos/symfony/contracts/zipball/d3636025e8253c6144358ec0a62773cae588395b", + "reference": "d3636025e8253c6144358ec0a62773cae588395b", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + "php": "^7.1.3" }, "require-dev": { - "symfony/http-kernel": "~2.8|~3.0|~4.0" + "psr/cache": "^1.0", + "psr/container": "^1.0", + "symfony/polyfill-intl-idn": "^1.10" + }, + "suggest": { + "psr/cache": "When using the Cache contracts", + "psr/container": "When using the Service contracts", + "symfony/cache-contracts-implementation": "", + "symfony/event-dispatcher-implementation": "", + "symfony/http-client-contracts-implementation": "", + "symfony/service-contracts-implementation": "", + "symfony/translation-contracts-implementation": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "1.1-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Debug\\": "" + "Symfony\\Contracts\\": "" }, "exclude-from-classmap": [ - "/Tests/" + "**/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1995,21 +2108,29 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Debug Component", + "description": "A set of abstractions extracted out of the Symfony components", "homepage": "https://symfony.com", - "time": "2019-10-24T15:33:53+00:00" + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2019-04-27T14:29:50+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.50", + "version": "v2.8.52", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -2069,26 +2190,26 @@ }, { "name": "symfony/filesystem", - "version": "v3.4.33", + "version": "v5.0.4", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "00e3a6ddd723b8bcfe4f2a1b6f82b98eeeb51516" + "reference": "3afadc0f57cd74f86379d073e694b0f2cda2a88c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/00e3a6ddd723b8bcfe4f2a1b6f82b98eeeb51516", - "reference": "00e3a6ddd723b8bcfe4f2a1b6f82b98eeeb51516", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/3afadc0f57cd74f86379d073e694b0f2cda2a88c", + "reference": "3afadc0f57cd74f86379d073e694b0f2cda2a88c", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": "^7.2.5", "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -2115,69 +2236,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2019-08-20T13:31:17+00:00" - }, - { - "name": "symfony/finder", - "version": "v3.4.33", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "3e915e5ce305f8bc8017597f71f1f4095092ddf8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/3e915e5ce305f8bc8017597f71f1f4095092ddf8", - "reference": "3e915e5ce305f8bc8017597f71f1f4095092ddf8", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "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 Finder Component", - "homepage": "https://symfony.com", - "time": "2019-10-30T12:43:22+00:00" + "time": "2020-01-21T08:40:24+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", "shasum": "" }, "require": { @@ -2189,7 +2261,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -2222,20 +2294,20 @@ "polyfill", "portable" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17" + "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f", + "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f", "shasum": "" }, "require": { @@ -2247,7 +2319,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -2281,38 +2353,39 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T14:18:11+00:00" }, { - "name": "symfony/process", - "version": "v3.4.33", + "name": "symfony/service-contracts", + "version": "v2.0.1", "source": { "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "c19da50bc3e8fa7d60628fdb4ab5d67de534cf3e" + "url": "https://github.com/symfony/service-contracts.git", + "reference": "144c5e51266b281231e947b51223ba14acf1a749" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/c19da50bc3e8fa7d60628fdb4ab5d67de534cf3e", - "reference": "c19da50bc3e8fa7d60628fdb4ab5d67de534cf3e", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", + "reference": "144c5e51266b281231e947b51223ba14acf1a749", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.2.5", + "psr/container": "^1.0" + }, + "suggest": { + "symfony/service-implementation": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Symfony\\Contracts\\Service\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2320,39 +2393,48 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Process Component", + "description": "Generic abstractions related to writing services", "homepage": "https://symfony.com", - "time": "2019-10-24T15:33:53+00:00" + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2019-11-18T17:27:11+00:00" }, { "name": "symfony/stopwatch", - "version": "v3.4.33", + "version": "v4.4.4", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "c0c27e38f8accb452f830a4ec8e8ac94b6ec864a" + "reference": "abc08d7c48987829bac301347faa10f7e8bbf4fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/c0c27e38f8accb452f830a4ec8e8ac94b6ec864a", - "reference": "c0c27e38f8accb452f830a4ec8e8ac94b6ec864a", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/abc08d7c48987829bac301347faa10f7e8bbf4fb", + "reference": "abc08d7c48987829bac301347faa10f7e8bbf4fb", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3", + "symfony/service-contracts": "^1.0|^2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -2379,31 +2461,31 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2019-08-06T13:24:37+00:00" + "time": "2020-01-04T13:00:46+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.33", + "version": "v4.4.4", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "dab657db15207879217fc81df4f875947bf68804" + "reference": "cd014e425b3668220adb865f53bff64b3ad21767" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/dab657db15207879217fc81df4f875947bf68804", - "reference": "dab657db15207879217fc81df4f875947bf68804", + "url": "https://api.github.com/repos/symfony/yaml/zipball/cd014e425b3668220adb865f53bff64b3ad21767", + "reference": "cd014e425b3668220adb865f53bff64b3ad21767", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": "^7.1.3", "symfony/polyfill-ctype": "~1.8" }, "conflict": { "symfony/console": "<3.4" }, "require-dev": { - "symfony/console": "~3.4|~4.0" + "symfony/console": "^3.4|^4.0|^5.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" @@ -2411,7 +2493,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -2438,7 +2520,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-10-24T15:33:53+00:00" + "time": "2020-01-21T11:12:16+00:00" }, { "name": "theseer/tokenizer", @@ -2482,31 +2564,29 @@ }, { "name": "webmozart/assert", - "version": "1.5.0", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4" + "reference": "573381c0a64f155a0d9a23f4b0c797194805b925" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4", + "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925", + "reference": "573381c0a64f155a0d9a23f4b0c797194805b925", "shasum": "" }, "require": { "php": "^5.3.3 || ^7.0", "symfony/polyfill-ctype": "^1.8" }, + "conflict": { + "vimeo/psalm": "<3.6.0" + }, "require-dev": { "phpunit/phpunit": "^4.8.36 || ^7.5.13" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -2528,12 +2608,14 @@ "check", "validate" ], - "time": "2019-08-24T08:43:50+00:00" + "time": "2019-11-24T13:36:37+00:00" } ], "aliases": [], "minimum-stability": "dev", - "stability-flags": [], + "stability-flags": { + "dhii/containers": 20 + }, "prefer-stable": true, "prefer-lowest": false, "platform": { diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 175ffe7..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,8 +0,0 @@ -version: '3.1' -services: - php: - build: - context: docker - dockerfile: Dockerfile_php - volumes: - - ${BASE_PATH}:/srv/ diff --git a/docker/Dockerfile_php b/docker/Dockerfile_php deleted file mode 100644 index 4f9ea27..0000000 --- a/docker/Dockerfile_php +++ /dev/null @@ -1,6 +0,0 @@ -FROM dockette/php:7.0 - -RUN apt-get update \ - && apt-get -y install software-properties-common dirmngr apt-transport-https lsb-release ca-certificates \ - && add-apt-repository -y ppa:ondrej/php \ - && apt-get install -y php7.0-xdebug diff --git a/phpmd.xml b/phpmd.xml deleted file mode 100644 index 678cbf6..0000000 --- a/phpmd.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - A standard Dhii ruleset - - - - - - - - - - - - - - - - diff --git a/phpunit.xml b/phpunit.xml index 91e6369..eb1b7ae 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -28,7 +28,7 @@ - + diff --git a/src/Exception/ModuleExceptionInterface.php b/src/Exception/ModuleExceptionInterface.php deleted file mode 100644 index 632dfe1..0000000 --- a/src/Exception/ModuleExceptionInterface.php +++ /dev/null @@ -1,17 +0,0 @@ - new LogModule(), + * 'db' => new DbModule(), + * 'cms' => new CmsModule(), + * ]); + * + * $app->run($c); + * ``` + * + * @since [*next-version*] + */ +class ModularModule implements ModuleInterface, ModularInterface +{ + /** + * @since [*next-version*] + * + * @var ModuleInterface[] + */ + protected $modules; + + /** + * @since [*next-version*] + * + * @var FactoryInterface[] + */ + protected $factories; + + /** + * @since [*next-version*] + * + * @var ExtensionInterface[] + */ + protected $extensions; + + /** + * Constructor. + * + * @since [*next-version*] + * + * @param ModuleInterface[] $modules The modules. + */ + public function __construct(array $modules) + { + $this->modules = $modules; + + $this->compileServices(); + } + + /** + * @inheritDoc + */ + public function getFactories() : array + { + return $this->factories; + } + + /** + * @inheritDoc + */ + public function getExtensions() : array + { + return $this->extensions; + } + + /** + * @inheritDoc + */ + public function run(ContainerInterface $c) + { + foreach ($this->modules as $module) { + $module->run($c); + } + } + + /** + * Retrieves the list of modules. + * + * @since [*next-version*] + * + * @return ModuleInterface[] + */ + public function getModules() : array + { + return $this->modules; + } + + /** + * Retrieves the modular module's own factories. + * + * @since [*next-version*] + * + * @return FactoryInterface[] + */ + protected function getSelfFactories() : array + { + return []; + } + + /** + * Retrieves the modular module's own extensions. + * + * @since [*next-version*] + * + * @return ExtensionInterface[] + */ + protected function getSelfExtensions() : array + { + return []; + } + + /** + * Compiles all of the module services. + * + * @since [*next-version*] + */ + protected function compileServices() + { + $this->factories = $this->getSelfFactories(); + $this->extensions = $this->getSelfExtensions(); + + foreach ($this->modules as $module) { + $this->factories = array_merge($this->factories, $module->getFactories()); + $moduleExtensions = $module->getExtensions(); + + if (empty($this->extensions)) { + $this->extensions = $moduleExtensions; + continue; + } + + foreach ($moduleExtensions as $key => $extension) { + if (!array_key_exists($key, $this->extensions)) { + $this->extensions[$key] = $extension; + continue; + } + + $prevExtension = $this->extensions[$key]; + $this->extensions[$key] = function (ContainerInterface $c, $prev) use ($prevExtension, $extension) { + return $extension($c, $prevExtension($c, $prev)); + }; + } + } + } +} diff --git a/src/Modules/PrefixingModule.php b/src/Modules/PrefixingModule.php new file mode 100644 index 0000000..7fef7fb --- /dev/null +++ b/src/Modules/PrefixingModule.php @@ -0,0 +1,135 @@ + new Value(LogLevel::ERROR), + * + * 'logger' => new Factory(['level'], ...), + * ]; + * } + * + * public function getExtensions() : array { + * return []; + * } + * + * public function run(ContainerInterface $c) { + * $c->get('logger'); // works! + * + * $logger->log('Logger loaded'); + * } + * } + * + * // In another module or at an application level: + * $c->get('log/logger'); // returns the logger + * $c->get('logger'); // not found! + * ``` + * + * @since [*next-version*] + */ +class PrefixingModule implements ModuleInterface +{ + /** + * @since [*next-version*] + * + * @var string + */ + protected $prefix; + + /** + * @since [*next-version*] + * + * @var ModuleInterface + */ + protected $module; + + /** + * Constructor. + * + * @since [*next-version*] + * + * @param string $prefix The prefix to apply to the module's services. + * @param ModuleInterface $module The module instance to prefix. + */ + public function __construct(string $prefix, ModuleInterface $module) + { + $this->prefix = $prefix; + $this->module = $module; + } + + /** + * @inheritDoc + */ + public function getFactories() : array + { + return $this->prefixServices($this->module->getFactories()); + } + + /** + * @inheritDoc + */ + public function getExtensions() : array + { + return $this->prefixServices($this->module->getExtensions()); + } + + /** + * @inheritDoc + */ + public function run(ContainerInterface $c) + { + $this->module->run(new DeprefixingContainer($c, $this->prefix, false)); + } + + /** + * Prefixes a list of services. + * + * @since [*next-version*] + * + * @param ServiceInterface[] $services The services to prefix. + * + * @return array The list of prefixed services. + */ + protected function prefixServices(array $services) + { + $results = []; + + foreach ($services as $key => $service) { + $newKey = $this->prefix . $key; + + $dependencies = $service->getDependencies(); + $dependencies = array_map(function ($dep) use ($services) { + // Only prefix dependencies that exist as services inside the module + return array_key_exists($dep, $services) + ? $this->prefix . $dep + : $dep; + }, $dependencies); + + $results[$newKey] = $service->withDependencies($dependencies); + } + + return $results; + } +} diff --git a/src/ServiceInterface.php b/src/ServiceInterface.php new file mode 100644 index 0000000..c5c4622 --- /dev/null +++ b/src/ServiceInterface.php @@ -0,0 +1,31 @@ +dependencies = $dependencies; + } + + /** + * @inheritdoc + * + * @since [*next-version*] + */ + public function getDependencies() : array + { + return $this->dependencies; + } + + /** + * @inheritDoc + * + * @since [*next-version*] + */ + public function withDependencies(array $dependencies) : ServiceInterface + { + $clone = clone $this; + $clone->dependencies = $dependencies; + + return $clone; + } + + /** + * Resolves the dependency keys to their corresponding values from a container. + * + * @since [*next-version*] + * + * @param ContainerInterface $c The container from which to resolve service values. + * + * @return array An array of service values, in the same order as in {@link AbstractService::$dependencies}. + */ + protected function resolveDependencies(ContainerInterface $c) : array + { + return array_map([$c, 'get'], $this->dependencies); + } +} diff --git a/src/Services/Alias.php b/src/Services/Alias.php new file mode 100644 index 0000000..100631c --- /dev/null +++ b/src/Services/Alias.php @@ -0,0 +1,79 @@ + new Alias('service_b'), + * 'service_b' => function() { + * return "hello"; + * } + * 'service_c' => new Alias('service_d', function () { + * return "default"; + * }), + * ] + * + * $c->get('service_a'); // "hello" + * $c->get('service_c'); // "default" + * ``` + * + * @since [*next-version*] + */ +class Alias extends AbstractService implements FactoryInterface +{ + /** + * @since [*next-version*] + * + * @var string + */ + public $key; + + /** + * @since [*next-version*] + * + * @var callable|null + */ + protected $factoryFn; + + /** + * Constructor. + * + * @since [*next-version*] + * + * @param string $key The key of the service to alias. + * @param callable|null $factoryFn The factory function to invoke if the original service does not exist, or null + * to return a service value of null. + */ + public function __construct(string $key, callable $factoryFn = null) + { + parent::__construct([]); + + $this->key = $key; + $this->factoryFn = $factoryFn; + } + + /** + * @inheritdoc + * + * @since [*next-version*] + */ + public function __invoke(ContainerInterface $c) + { + if ($c->has($this->key)) { + return $c->get($this->key); + } + + if ($this->factoryFn === null) { + return null; + } + + return call_user_func_array($this->factoryFn, [$c]); + } +} diff --git a/src/Services/ArrayExtension.php b/src/Services/ArrayExtension.php new file mode 100644 index 0000000..1419d6d --- /dev/null +++ b/src/Services/ArrayExtension.php @@ -0,0 +1,44 @@ + new Value([]), + * 'home_link' => new Value('Home'), + * 'blog_link' => new Value('Blog'), + * 'about_link' => new Value('About Us'), + * ] + * // Extensions + * [ + * 'menu_links' => new ArrayExtension([ + * 'home_link', + * 'blog_link', + * 'about_link', + * ]), + * ] + * ``` + * + * @since [*next-version*] + */ +class ArrayExtension extends AbstractService implements ExtensionInterface +{ + /** + * @inheritDoc + */ + public function __invoke(ContainerInterface $c, $prev) + { + return array_merge($prev, $this->resolveDependencies($c)); + } +} diff --git a/src/Services/Extension.php b/src/Services/Extension.php new file mode 100644 index 0000000..a1d6d99 --- /dev/null +++ b/src/Services/Extension.php @@ -0,0 +1,45 @@ +factoryFn = $factoryFn; + } + + /** + * @inheritdoc + * + * @since [*next-version*] + */ + public function __invoke(ContainerInterface $c, $prev = null) + { + $args = array_merge([$prev], $this->resolveDependencies($c)); + + return call_user_func_array($this->factoryFn, $args); + } +} diff --git a/src/Services/Factory.php b/src/Services/Factory.php new file mode 100644 index 0000000..3a5a18e --- /dev/null +++ b/src/Services/Factory.php @@ -0,0 +1,64 @@ + new Factory([], function () { + * return 'hello'; + * }), + * 'service_b' => new Factory([], function () { + * return 'world'; + * }), + * 'service_c' => new Factory(['service_a', 'service_b'], function ($a, $b) { + * return "$a $b"; + * }), + * ] + * + * $c->get('service_c'); // "hello world" + * ``` + * + * @since [*next-version*] + */ +class Factory extends AbstractService implements FactoryInterface +{ + /** + * @since [*next-version*] + * + * @var callable + */ + protected $factoryFn; + + /** + * Constructor. + * + * @since [*next-version*] + * + * @param string[] $dependencies The keys of dependent services. + * @param callable $factoryFn The factory function that creates the service instance. Receives the dependent + * service instances as arguments, in the order they are given in $dependencies. + */ + public function __construct(array $dependencies, callable $factoryFn) + { + parent::__construct($dependencies); + + $this->factoryFn = $factoryFn; + } + + /** + * @inheritdoc + * + * @since [*next-version*] + */ + public function __invoke(ContainerInterface $c) + { + return call_user_func_array($this->factoryFn, $this->resolveDependencies($c)); + } +} diff --git a/src/Services/FormatStr.php b/src/Services/FormatStr.php new file mode 100644 index 0000000..b49cb53 --- /dev/null +++ b/src/Services/FormatStr.php @@ -0,0 +1,68 @@ + new FormatStr('John Smith'), + * 'service_b' => new FormatStr('User name is: {0}', ['service_a']), + * 'service_c' => new FormatStr('{day} {month}', [ + * 'day' => 'date/day', + * 'month' => 'date/month', + * ]), + * ] + * ``` + * + * @since [*next-version*] + */ +class FormatStr extends AbstractService implements FactoryInterface +{ + /** + * @since [*next-version*] + * + * @var string + */ + protected $string; + + /** + * Constructor. + * + * @since [*next-version*] + * + * @param string $format The string. Occurrences of indexes in the $dependencies array wrapped in braces + * will be interpolated the value of the corresponding dependent services. + * @param array $dependencies The keys of dependent services to use for interpolation. + */ + public function __construct(string $format, array $dependencies = []) + { + parent::__construct($dependencies); + + $this->string = $format; + } + + /** + * @inheritdoc + * + * @since [*next-version*] + */ + public function __invoke(ContainerInterface $c) + { + if (empty($this->dependencies)) { + return $this->string; + } + + $replace = []; + foreach ($this->dependencies as $idx => $dependency) { + $replace['{' . $idx . '}'] = strval($c->get($dependency)); + } + + return strtr($this->string, $replace); + } +} diff --git a/src/Services/Func.php b/src/Services/Func.php new file mode 100644 index 0000000..e1b762c --- /dev/null +++ b/src/Services/Func.php @@ -0,0 +1,74 @@ + function () { + * return "hello"; + * }, + * 'service_b' => function () { + * return "world"; + * }, + * 'service_c' => new Invocable(['service_a', 'service_b'], function ($x, $a, $b) { + * return "$x $a $b"; + * }) + * ] + * + * $fn = $c->get('service_c'); + * echo $fn('Yo!'); // "Yo! hello world" + * ``` + * + * @since [*next-version*] + */ +class Func extends AbstractService implements FactoryInterface +{ + /** + * @since [*next-version*] + * + * @var callable + */ + protected $function; + + /** + * Constructor. + * + * @since [*next-version*] + * + * @param string[] $dependencies The keys of dependent services. + * @param callable $function The function to return for this service. + */ + public function __construct(array $dependencies, callable $function) + { + parent::__construct($dependencies); + + $this->function = $function; + } + + /** + * @inheritdoc + * + * @since [*next-version*] + */ + public function __invoke(ContainerInterface $c) + { + $deps = $this->resolveDependencies($c); + + return function (...$args) use ($deps) { + return ($this->function)(...$args, ...$deps); + }; + } +} diff --git a/src/Services/GlobalVar.php b/src/Services/GlobalVar.php new file mode 100644 index 0000000..89d78f8 --- /dev/null +++ b/src/Services/GlobalVar.php @@ -0,0 +1,59 @@ + new GlobalVar('var') + * ] + * + * $c->get('service_a'); // 5 + * ``` + * + * @since [*next-version*] + */ +class GlobalVar extends AbstractService implements FactoryInterface +{ + /** + * @since [*next-version*] + * + * @var string + */ + protected $name; + + /** + * Constructor. + * + * @since [*next-version*] + * + * @param string $name The name of the global variable. + */ + public function __construct(string $name) + { + parent::__construct([]); + + $this->name = $name; + } + + /** + * @inheritdoc + * + * @since [*next-version*] + */ + public function __invoke(ContainerInterface $c) + { + global ${$this->name}; + + return ${$this->name}; + } +} diff --git a/src/Services/Value.php b/src/Services/Value.php new file mode 100644 index 0000000..fdcc09c --- /dev/null +++ b/src/Services/Value.php @@ -0,0 +1,58 @@ + new Value(2), + * 'value_b' => new Value('hello'), + * 'value_c' => new Value($someVar), + * ] + * + * $c->get('value_a'); // 2 + * $c->get('value_b'); // 'hello' + * $c->get('value_c'); // value of $someVar + * ``` + * + * @since [*next-version*] + */ +class Value extends AbstractService implements FactoryInterface +{ + /** + * @since [*next-version*] + * + * @var mixed + */ + protected $value; + + /** + * Constructor. + * + * @since [*next-version*] + * + * @param mixed $value The value. + */ + public function __construct($value) + { + parent::__construct([]); + + $this->value = $value; + } + + /** + * @inheritdoc + * + * @since [*next-version*] + */ + public function __invoke(ContainerInterface $c) + { + return $this->value; + } +} diff --git a/src/Util/ModuleServiceProvider.php b/src/Util/ModuleServiceProvider.php new file mode 100644 index 0000000..976cdc1 --- /dev/null +++ b/src/Util/ModuleServiceProvider.php @@ -0,0 +1,60 @@ +module = $module; + } + + /** + * @inheritDoc + */ + public function getFactories() + { + return $this->module->getFactories(); + } + + /** + * @inheritDoc + */ + public function getExtensions() + { + return $this->module->getExtensions(); + } +} diff --git a/test/stubs/CallbackInterface.php b/test/stubs/CallbackInterface.php new file mode 100644 index 0000000..16ed154 --- /dev/null +++ b/test/stubs/CallbackInterface.php @@ -0,0 +1,16 @@ +getMockBuilder($className); - } - - /** - * Retrieves a mock builder for the specified classname. - * - * @param string $className - * @return MockBuilder The builder. - */ - abstract public function getMockBuilder($className); -} \ No newline at end of file diff --git a/test/unit/Exception/ModuleExceptionInterfaceTest.php b/test/unit/Exception/ModuleExceptionInterfaceTest.php deleted file mode 100644 index bde7fbb..0000000 --- a/test/unit/Exception/ModuleExceptionInterfaceTest.php +++ /dev/null @@ -1,56 +0,0 @@ -getImplementingMockBuilder('Exception', [TestSubject::class]) - ->setMethods([]) - ->getMock(); - - return $mock; - } - - /** - * Tests whether a valid instance of the test subject can be created. - * - * @since [*next-version*] - */ - public function testCanBeCreated() - { - $subject = $this->createInstance(); - - $this->assertInstanceOf( - TestSubject::class, - $subject, - 'A valid instance of the test subject could not be created' - ); - - $this->assertInstanceOf( - 'Dhii\Modular\Module\ModuleAwareInterface', - $subject, - 'Subject does not implement required interface' - ); - } -} diff --git a/test/unit/ModuleAwareInterfaceTest.php b/test/unit/ExtensionInterfaceTest.php similarity index 52% rename from test/unit/ModuleAwareInterfaceTest.php rename to test/unit/ExtensionInterfaceTest.php index f3f9b3d..9679eff 100644 --- a/test/unit/ModuleAwareInterfaceTest.php +++ b/test/unit/ExtensionInterfaceTest.php @@ -1,9 +1,10 @@ getMockBuilder(TestSubject::class) - ->getMock(); - - return $mock; + return $this->getMockBuilder(TestSubject::class)->getMock(); } /** @@ -37,10 +35,6 @@ public function testCanBeCreated() { $subject = $this->createInstance(); - $this->assertInstanceOf( - TestSubject::class, - $subject, - 'A valid instance of the test subject could not be created' - ); + $this->assertInstanceOf(ServiceInterface::class, $subject); } } diff --git a/test/unit/ModuleInterfaceTest.php b/test/unit/FactoryInterfaceTest.php similarity index 58% rename from test/unit/ModuleInterfaceTest.php rename to test/unit/FactoryInterfaceTest.php index d2360f6..08455a9 100644 --- a/test/unit/ModuleInterfaceTest.php +++ b/test/unit/FactoryInterfaceTest.php @@ -1,17 +1,18 @@ getMockBuilder(TestSubject::class) - ->getMock(); - - return $mock; + return $this->getMockBuilder(TestSubject::class)->getMock(); } /** @@ -37,10 +35,6 @@ public function testCanBeCreated() { $subject = $this->createInstance(); - $this->assertInstanceOf( - TestSubject::class, - $subject, - 'A valid instance of the test subject could not be created' - ); + $this->assertInstanceOf(ServiceInterface::class, $subject); } } diff --git a/test/unit/Modules/ModularModuleTest.php b/test/unit/Modules/ModularModuleTest.php new file mode 100644 index 0000000..9d4d0de --- /dev/null +++ b/test/unit/Modules/ModularModuleTest.php @@ -0,0 +1,143 @@ + $fac1, + $key2 => $fac2, + ]; + + $factories2 = [ + $key2 => $fac4, + $key3 => $fac3, + ]; + } + { + /** @var ModuleInterface|MockObject $module1 */ + /** @var ModuleInterface|MockObject $module2 */ + $module1 = $this->getMockForAbstractClass(ModuleInterface::class); + $module2 = $this->getMockForAbstractClass(ModuleInterface::class); + + $module1->expects(static::once())->method('getFactories')->willReturn($factories1); + $module2->expects(static::once())->method('getFactories')->willReturn($factories2); + } + + $subject = new TestSubject([$module1, $module2]); + $actual = $subject->getFactories(); + + static::assertSame($fac1, $actual[$key1]); + static::assertSame($fac4, $actual[$key2]); + static::assertSame($fac3, $actual[$key3]); + } + + /** + * @since [*next-version*] + * + * @throws ReflectionException + */ + public function testGetExtensions() + { + { + $key1 = uniqid('key1'); + $key2 = uniqid('key2'); + $key3 = uniqid('key3'); + + $ext1 = uniqid('ext1'); + $ext2 = uniqid('ext2'); + $ext3 = uniqid('ext4'); + $ext4 = uniqid('ext5'); + + $extensions1 = [ + $key1 => $ext1, + $key2 => $ext2, + ]; + + $extensions2 = [ + $key2 => $ext4, + $key3 => $ext3, + ]; + } + { + /** @var ModuleInterface|MockObject $module1 */ + /** @var ModuleInterface|MockObject $module2 */ + $module1 = $this->getMockForAbstractClass(ModuleInterface::class); + $module2 = $this->getMockForAbstractClass(ModuleInterface::class); + + $module1->expects(static::once())->method('getExtensions')->willReturn($extensions1); + $module2->expects(static::once())->method('getExtensions')->willReturn($extensions2); + } + + $subject = new TestSubject([$module1, $module2]); + $actual = $subject->getExtensions(); + + static::assertSame($ext1, $actual[$key1]); + static::assertSame($ext3, $actual[$key3]); + + // The combined extension is neither of the exising ones, but still callable + static::assertNotSame($ext2, $actual[$key2]); + static::assertNotSame($ext4, $actual[$key2]); + static::assertIsCallable($actual[$key2]); + } + + /** + * @since [*next-version*] + * + * @throws ReflectionException + */ + public function testRun() + { + { + $c = $this->getMockForAbstractClass(ContainerInterface::class); + } + { + /** @var ModuleInterface|MockObject $module1 */ + /** @var ModuleInterface|MockObject $module2 */ + $module1 = $this->getMockForAbstractClass(ModuleInterface::class); + $module2 = $this->getMockForAbstractClass(ModuleInterface::class); + + $module1->expects(static::once())->method('run')->with($c); + $module2->expects(static::once())->method('run')->with($c); + } + + $subject = new TestSubject([$module1, $module2]); + $subject->run($c); + } +} diff --git a/test/unit/Modules/PrefixingModuleTest.php b/test/unit/Modules/PrefixingModuleTest.php new file mode 100644 index 0000000..d0ed25e --- /dev/null +++ b/test/unit/Modules/PrefixingModuleTest.php @@ -0,0 +1,197 @@ +getMockForAbstractClass(ModuleInterface::class); + $subject = new TestSubject("", $module); + + static::assertInstanceOf(ModuleInterface::class, $subject); + } + + /** + * @since [*next-version*] + * + * @throws ReflectionException + */ + public function testGetFactories() + { + $prefix = uniqid('prefix'); + + { + $key1 = uniqid('key1'); + $key2 = uniqid('key2'); + + /** @var FactoryInterface|MockObject $fac1 */ + /** @var FactoryInterface|MockObject $fac2 */ + $fac1 = $this->getMockForAbstractClass(FactoryInterface::class); + $fac2 = $this->getMockForAbstractClass(FactoryInterface::class); + + // Factories list + $factories = [ + $key1 => $fac1, + $key2 => $fac2, + ]; + } + { + // Factory dependencies + $deps1 = [$key2, 'external1']; + $deps2 = ['external2']; + + $fac1->expects(static::once())->method('getDependencies')->willReturn($deps1); + $fac2->expects(static::once())->method('getDependencies')->willReturn($deps2); + } + { + // Prefixed dependencies + $pDeps1 = [$prefix . $key2, 'external1']; + $pDeps2 = ['external2']; + + // New factory mock instances + /** @var FactoryInterface|MockObject $facVal1 */ + /** @var FactoryInterface|MockObject $facVal2 */ + $newFac1 = $this->getMockForAbstractClass(FactoryInterface::class); + $newFac2 = $this->getMockForAbstractClass(FactoryInterface::class); + + // Old factories create new ones + $fac1->expects(static::once())->method('withDependencies')->with($pDeps1)->willReturn($newFac1); + $fac2->expects(static::once())->method('withDependencies')->with($pDeps2)->willReturn($newFac2); + } + { + /** @var ModuleInterface|MockObject $module */ + $module = $this->getMockForAbstractClass(ModuleInterface::class); + + $module->expects(static::once())->method('getFactories')->willReturn($factories); + } + + $subject = new TestSubject($prefix, $module); + $expected = [ + $prefix . $key1 => $newFac1, + $prefix . $key2 => $newFac2, + ]; + + static::assertSame($expected, $subject->getFactories()); + } + + /** + * @since [*next-version*] + * + * @throws ReflectionException + */ + public function testGetExtensions() + { + $prefix = uniqid('prefix'); + + { + $key1 = uniqid('key1'); + $key2 = uniqid('key2'); + + /** @var ExtensionInterface|MockObject $ext1 */ + /** @var ExtensionInterface|MockObject $ext2 */ + $ext1 = $this->getMockForAbstractClass(ExtensionInterface::class); + $ext2 = $this->getMockForAbstractClass(ExtensionInterface::class); + + // Factories list + $factories = [ + $key1 => $ext1, + $key2 => $ext2, + ]; + } + { + // Extension dependencies + $deps1 = [$key2, 'external1']; + $deps2 = ['external2']; + + $ext1->expects(static::once())->method('getDependencies')->willReturn($deps1); + $ext2->expects(static::once())->method('getDependencies')->willReturn($deps2); + } + { + // Prefixed dependencies + $pDeps1 = [$prefix . $key2, 'external1']; + $pDeps2 = ['external2']; + + /** @var ExtensionInterface|MockObject $facVal1 */ + /** @var ExtensionInterface|MockObject $facVal2 */ + $newExt1 = $this->getMockForAbstractClass(ExtensionInterface::class); + $newExt2 = $this->getMockForAbstractClass(ExtensionInterface::class); + + // Old extensions create new ones + $ext1->expects(static::once())->method('withDependencies')->with($pDeps1)->willReturn($newExt1); + $ext2->expects(static::once())->method('withDependencies')->with($pDeps2)->willReturn($newExt2); + } + { + /** @var ModuleInterface|MockObject $module */ + $module = $this->getMockForAbstractClass(ModuleInterface::class); + + $module->expects(static::once())->method('getExtensions')->willReturn($factories); + } + + $subject = new TestSubject($prefix, $module); + $expected = [ + $prefix . $key1 => $newExt1, + $prefix . $key2 => $newExt2, + ]; + + static::assertSame($expected, $subject->getExtensions()); + } + + /** + * @since [*next-version*] + * + * @throws ReflectionException + */ + public function testRun() + { + $prefix = uniqid('prefix'); + + { + $key1 = uniqid('key1'); + $key2 = uniqid('key2'); + + $pKey1 = $prefix . $key1; + $pKey2 = $prefix . $key2; + } + { + /** @var ModuleInterface|MockObject $module */ + $module = $this->getMockForAbstractClass(ModuleInterface::class); + + $module->expects(static::once())->method('run')->willReturnCallback( + function (ContainerInterface $c) use ($key1, $key2) { + // Assert that the container still has the original keys + static::assertTrue($c->has($key1)); + static::assertTrue($c->has($key2)); + } + ); + } + { + /** @var ContainerInterface|MockObject $c */ + $c = $this->getMockForAbstractClass(ContainerInterface::class); + + $c->expects(static::exactly(2)) + ->method('has') + ->withConsecutive([$pKey1], [$pKey2]) + ->willReturn(true); + } + + $subject = new TestSubject($prefix, $module); + + $subject->run($c); + } +} diff --git a/test/unit/Services/AbstractServiceTest.php b/test/unit/Services/AbstractServiceTest.php new file mode 100644 index 0000000..2347720 --- /dev/null +++ b/test/unit/Services/AbstractServiceTest.php @@ -0,0 +1,56 @@ +getMockBuilder(TestSubject::class) + ->setConstructorArgs([$deps]) + ->getMockForAbstractClass(); + } + + /** + * @since [*next-version*] + */ + public function testConstruct() + { + $subject = $this->createSubject(); + + static::assertInstanceOf(ServiceInterface::class, $subject); + } + + /** + * @since [*next-version*] + */ + public function testGetDependencies() + { + $deps = [ + uniqid('dep1'), + uniqid('dep2'), + uniqid('dep3'), + ]; + + $subject = $this->createSubject($deps); + + static::assertSame($deps, $subject->getDependencies()); + } +} diff --git a/test/unit/Services/AliasTest.php b/test/unit/Services/AliasTest.php new file mode 100644 index 0000000..edade5e --- /dev/null +++ b/test/unit/Services/AliasTest.php @@ -0,0 +1,118 @@ +getDependencies()); + } + + /** + * @since [*next-version*] + */ + public function testInvoke() + { + { + $key = uniqid('key'); + $service = uniqid('service'); + } + { + /* @var $container MockObject|ContainerInterface */ + $container = $this->getMockForAbstractClass(ContainerInterface::class); + + $container->expects(static::exactly(1)) + ->method('has') + ->with($key) + ->willReturn(true); + + $container->expects(static::exactly(1)) + ->method('get') + ->with($key) + ->willReturn($service); + } + + $subject = new TestSubject($key); + + self::assertSame($service, $subject($container)); + } + + /** + * @since [*next-version*] + */ + public function testInvokeDefault() + { + { + $key = uniqid('key'); + $default = uniqid('default'); + } + { + /* @var $container MockObject|ContainerInterface */ + $container = $this->getMockForAbstractClass(ContainerInterface::class); + $container->expects(static::exactly(1)) + ->method('has') + ->with($key) + ->willReturn(false); + } + { + /* @var $callback MockObject|callable */ + $callback = $this->getMockForAbstractClass(CallbackInterface::class); + $callback->expects(static::once()) + ->method('__invoke') + ->with($container) + ->willReturn($default); + } + + $subject = new TestSubject($key, $callback); + + self::assertSame($default, $subject($container)); + } + + /** + * @since [*next-version*] + */ + public function testInvokeDefaultNull() + { + { + $key = uniqid('key'); + } + { + /* @var $container MockObject|ContainerInterface */ + $container = $this->getMockForAbstractClass(ContainerInterface::class); + $container->expects(static::exactly(1)) + ->method('has') + ->with($key) + ->willReturn(false); + } + + $subject = new TestSubject($key); + + self::assertNull($subject($container)); + } +} diff --git a/test/unit/Services/ArrayExtensionTest.php b/test/unit/Services/ArrayExtensionTest.php new file mode 100644 index 0000000..4d836bc --- /dev/null +++ b/test/unit/Services/ArrayExtensionTest.php @@ -0,0 +1,74 @@ +getDependencies()); + } + + /** + * @since [*next-version*] + * + * @throws ReflectionException + */ + public function testInvoke() + { + { + $dep1 = uniqid('dep1'); + $dep2 = uniqid('dep2'); + + $val1 = uniqid('str1'); + $val2 = uniqid('str2'); + } + { + $prev1 = uniqid('prev1'); + $prev2 = uniqid('prev2'); + + $prev = [$prev1, $prev2]; + $expected = [$prev1, $prev2, $val1, $val2]; + } + { + /* @var $container MockObject|ContainerInterface */ + $container = $this->getMockForAbstractClass(ContainerInterface::class); + $container->expects(static::exactly(2)) + ->method('get') + ->withConsecutive([$dep1], [$dep2]) + ->willReturnOnConsecutiveCalls($val1, $val2); + } + { + $subject = new TestSubject([$dep1, $dep2]); + } + + static::assertSame($expected, $subject($container, $prev)); + } +} diff --git a/test/unit/Services/ExtensionTest.php b/test/unit/Services/ExtensionTest.php new file mode 100644 index 0000000..f482ad3 --- /dev/null +++ b/test/unit/Services/ExtensionTest.php @@ -0,0 +1,116 @@ +getDependencies()); + } + + /** + * @since [*next-version*] + */ + public function testInvokeNoPrev() + { + { + $dep1 = uniqid('dep1'); + $dep2 = uniqid('dep2'); + + $service1 = uniqid('service1'); + $service2 = uniqid('service2'); + + $result = uniqid('result'); + } + { + /* @var $callback MockObject|callable */ + $callback = $this->getMockForAbstractClass(CallbackInterface::class); + $callback->expects(static::once()) + ->method('__invoke') + ->with(null, $service1, $service2) + ->willReturn($result); + } + { + /* @var $container MockObject|ContainerInterface */ + $container = $this->getMockForAbstractClass(ContainerInterface::class); + $container->expects(static::exactly(2)) + ->method('get') + ->withConsecutive([$dep1], [$dep2]) + ->willReturnOnConsecutiveCalls($service1, $service2); + } + + $subject = new TestSubject([$dep1, $dep2], $callback); + + self::assertSame($result, $subject($container)); + } + + /** + * @since [*next-version*] + */ + public function testInvokeWithPrev() + { + { + $prev = uniqid('prev'); + + $dep1 = uniqid('dep1'); + $dep2 = uniqid('dep2'); + + $service1 = uniqid('service1'); + $service2 = uniqid('service2'); + + $result = uniqid('result'); + } + { + /* @var $callback MockObject|callable */ + $callback = $this->getMockForAbstractClass(CallbackInterface::class); + $callback->expects(static::once()) + ->method('__invoke') + ->with($prev, $service1, $service2) + ->willReturn($result); + } + { + /* @var $container MockObject|ContainerInterface */ + $container = $this->getMockForAbstractClass(ContainerInterface::class); + $container->expects(static::exactly(2)) + ->method('get') + ->withConsecutive([$dep1], [$dep2]) + ->willReturnOnConsecutiveCalls($service1, $service2); + } + + $subject = new TestSubject([$dep1, $dep2], $callback); + + self::assertSame($result, $subject($container, $prev)); + } +} diff --git a/test/unit/Services/FactoryTest.php b/test/unit/Services/FactoryTest.php new file mode 100644 index 0000000..34c0e0c --- /dev/null +++ b/test/unit/Services/FactoryTest.php @@ -0,0 +1,78 @@ +getDependencies()); + } + + /** + * @since [*next-version*] + */ + public function testInvoke() + { + { + $dep1 = uniqid('dep1'); + $dep2 = uniqid('dep2'); + + $service1 = uniqid('service1'); + $service2 = uniqid('service2'); + + $result = uniqid('result'); + } + { + /* @var $callback MockObject|callable */ + $callback = $this->getMockForAbstractClass(CallbackInterface::class); + $callback->expects(static::once()) + ->method('__invoke') + ->with($service1, $service2) + ->willReturn($result); + } + { + /* @var $container MockObject|ContainerInterface */ + $container = $this->getMockForAbstractClass(ContainerInterface::class); + $container->expects(static::exactly(2)) + ->method('get') + ->withConsecutive([$dep1], [$dep2]) + ->willReturnOnConsecutiveCalls($service1, $service2); + } + + $subject = new TestSubject([$dep1, $dep2], $callback); + + self::assertSame($result, $subject($container)); + } +} diff --git a/test/unit/Services/FormatStrTest.php b/test/unit/Services/FormatStrTest.php new file mode 100644 index 0000000..2c8ee27 --- /dev/null +++ b/test/unit/Services/FormatStrTest.php @@ -0,0 +1,68 @@ +getDependencies()); + } + + /** + * @since [*next-version*] + */ + public function testInvoke() + { + { + $dep1 = uniqid('dep1'); + $dep2 = uniqid('dep2'); + + $str1 = uniqid('str1'); + $str2 = uniqid('str2'); + } + { + /* @var $container MockObject|ContainerInterface */ + $container = $this->getMockForAbstractClass(ContainerInterface::class); + $container->expects(static::exactly(2)) + ->method('get') + ->withConsecutive([$dep1], [$dep2]) + ->willReturnOnConsecutiveCalls($str1, $str2); + } + { + $subject = new TestSubject('Foo {0} Bar {1}', [$dep1, $dep2]); + $expected = sprintf('Foo %s Bar %s', $str1, $str2); + } + + static::assertSame($expected, $subject($container)); + } +} diff --git a/test/unit/Services/FuncTest.php b/test/unit/Services/FuncTest.php new file mode 100644 index 0000000..dfff24d --- /dev/null +++ b/test/unit/Services/FuncTest.php @@ -0,0 +1,87 @@ +getDependencies()); + } + + /** + * @since [*next-version*] + */ + public function testInvoke() + { + { + $dep1 = uniqid('dep1'); + $dep2 = uniqid('dep2'); + + $service1 = uniqid('service1'); + $service2 = uniqid('service2'); + + $arg1 = uniqid('arg1'); + $arg2 = uniqid('arg2'); + } + { + $return = uniqid('return'); + + /* @var $callback MockObject|callable */ + $callback = $this->getMockForAbstractClass(CallbackInterface::class); + $callback->expects(static::once()) + ->method('__invoke') + ->with($arg1, $arg2, $service1, $service2) + ->willReturn($return); + } + { + /* @var $container MockObject|ContainerInterface */ + $container = $this->getMockForAbstractClass(ContainerInterface::class); + $container->expects(static::exactly(2)) + ->method('get') + ->withConsecutive([$dep1], [$dep2]) + ->willReturnOnConsecutiveCalls($service1, $service2); + } + { + $subject = new TestSubject([$dep1, $dep2], $callback); + } + + $result = $subject($container); + + static::assertInternalType('callable', $result); + static::assertSame($return, $result($arg1, $arg2)); + } +} diff --git a/test/unit/Services/GlobalVarTest.php b/test/unit/Services/GlobalVarTest.php new file mode 100644 index 0000000..1097029 --- /dev/null +++ b/test/unit/Services/GlobalVarTest.php @@ -0,0 +1,51 @@ +getDependencies()); + } + + /** + * @since [*next-version*] + */ + public function testInvoke() + { + global $testGlobalVar; + $testGlobalVar = uniqid('test-value'); + + $subject = new TestSubject('testGlobalVar'); + + /* @var $container MockObject|ContainerInterface */ + $container = $this->getMockForAbstractClass(ContainerInterface::class); + + static::assertSame($testGlobalVar, $subject($container)); + } +} diff --git a/test/unit/Services/ValueTest.php b/test/unit/Services/ValueTest.php new file mode 100644 index 0000000..69f275d --- /dev/null +++ b/test/unit/Services/ValueTest.php @@ -0,0 +1,51 @@ +getMockForAbstractClass(ContainerInterface::class); + + static::assertSame($value, $subject($container)); + } + + /** + * @since [*next-version*] + */ + public function testGetDependencies() + { + $subject = new TestSubject(0); + + static::assertEmpty($subject->getDependencies()); + } +}