From d77a3e4211cf4bf62530bc3518e8c6e5585f8e95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danyi=20D=C3=A1vid?= Date: Mon, 12 Nov 2018 07:09:32 +0100 Subject: [PATCH] * updated expressive version --- composer.json | 68 +- composer.lock | 2842 +++++++++++------ config/autoload/authx2.global.php | 1 + config/autoload/cli.global.php | 4 +- config/autoload/dependencies.global.php | 23 +- config/autoload/development.local.php.dist | 3 +- config/autoload/doctrine.global.php | 6 - config/autoload/router.global.php | 12 - config/autoload/zend-expressive.global.php | 6 +- config/config.php | 17 +- config/container.php | 14 +- config/development.config.php.dist | 3 +- config/pipeline.php | 109 +- config/routes.php | 82 +- public/index.php | 19 +- src/ApiLibs/AbstractHandler/CrudHandler.php | 166 + src/ApiLibs/ConfigProvider.php | 43 + .../Middleware/CorsMiddlewareFactory.php | 23 + src/App/Action/AbstractCrudAction.php | 182 -- src/App/Action/Auth/AuthAction.php | 83 - src/App/Action/ErrorCategoryAction.php | 51 - src/App/Action/ErrorOriginAction.php | 51 - src/App/Action/FacilityLocationAction.php | 52 - src/App/Action/Fault/FaultAction.php | 122 - src/App/Action/Fault/FaultCommentAction.php | 59 - src/App/Action/Fault/FaultRejectAction.php | 59 - src/App/Action/Fault/FaultS2ConfirmAction.php | 58 - .../Action/Fault/FaultS3AcknowledgeAction.php | 58 - .../Action/Fault/FaultS4RepairedAction.php | 58 - .../Action/Fault/FaultS5AcceptedAction.php | 58 - src/App/Action/MaintenanceAction.php | 68 - src/App/Action/MaintenanceUpcomingAction.php | 37 - .../Pdf/GenerateMaintenanceSheetAction.php | 63 - src/App/Action/PingAction.php | 16 - src/App/Action/SolutionTimeIntervalAction.php | 51 - src/App/Action/User/PasswordAction.php | 57 - src/App/Action/User/UserAction.php | 93 - .../Command/ConvertMaintenanceHashCommand.php | 2 +- ...ilTestCommand.php => DebugMailCommand.php} | 8 +- ...actory.php => DebugMailCommandFactory.php} | 6 +- src/App/Command/InitializeFixtureCommand.php | 5 +- src/App/ConfigProvider.php | 32 +- .../{Action => Handler}/Auth/AuthFactory.php | 4 +- src/App/Handler/Auth/AuthHandler.php | 59 + .../ErrorCategoryFactory.php | 4 +- src/App/Handler/ErrorCategoryHandler.php | 30 + .../ErrorOriginFactory.php | 4 +- src/App/Handler/ErrorOriginHandler.php | 31 + .../FacilityLocationFactory.php | 4 +- src/App/Handler/FacilityLocationHandler.php | 31 + .../Fault/FaultAttachmentFactory.php | 4 +- .../Fault/FaultAttachmentHandler.php} | 54 +- .../Fault/FaultCommentFactory.php | 4 +- src/App/Handler/Fault/FaultCommentHandler.php | 38 + .../Fault/FaultFactory.php | 4 +- src/App/Handler/Fault/FaultHandler.php | 97 + .../Fault/FaultRejectFactory.php | 4 +- src/App/Handler/Fault/FaultRejectHandler.php | 38 + .../Handler/Fault/X_FaultS2ConfirmAction.php | 37 + .../Fault/X_FaultS3AcknowledgeAction.php | 37 + .../Handler/Fault/X_FaultS4RepairedAction.php | 37 + .../Handler/Fault/X_FaultS5AcceptedAction.php | 36 + .../MaintenanceFactory.php | 6 +- src/App/Handler/MaintenanceHandler.php | 59 + .../MaintenanceUpcomingFactory.php | 6 +- .../Handler/MaintenanceUpcomingHandler.php | 31 + .../Pdf/GenerateMaintenanceSheetFactory.php | 6 +- .../Pdf/GenerateMaintenanceSheetHandler.php | 40 + .../Pdf/GenerateWorksheetFactory.php | 4 +- .../Pdf/GenerateWorksheetHandler.php} | 39 +- src/App/Handler/PingHandler.php | 18 + .../SolutionTimeIntervalFactory.php | 4 +- .../Handler/SolutionTimeIntervalHandler.php | 31 + .../User/PasswordFactory.php | 4 +- src/App/Handler/User/PasswordHandler.php | 37 + .../{Action => Handler}/User/UserFactory.php | 4 +- src/App/Handler/User/UserHandler.php | 70 + src/App/Middleware/CorsMiddlewareFactory.php | 40 +- .../Middleware/JwtAuthenticationFactory.php | 15 +- src/App/Middleware/RouteAuthorization.php | 22 +- .../Middleware/RouteAuthorizationFactory.php | 3 +- src/App/Response/JsonCorsResponse.php | 32 - src/App/Service/FaultManagerService.php | 29 +- .../ConfigProvider.php | 66 + .../Form/Element/ElementFactory.php | 18 + .../InvalidRepositoryResultException.php | 9 + .../Form/Element/ObjectMultiCheckbox.php | 82 + .../Form/Element/ObjectRadio.php | 73 + .../Form/Element/ObjectSelect.php | 88 + .../Form/Element/Proxy.php | 653 ++++ .../Hydrator/DoctrineObject.php | 613 ++++ .../Hydrator/DoctrineObjectFactory.php | 15 + .../Hydrator/Filter/PropertyName.php | 66 + .../Strategy/AbstractCollectionStrategy.php | 190 ++ .../Strategy/AllowRemoveByReference.php | 58 + .../Hydrator/Strategy/AllowRemoveByValue.php | 76 + .../Strategy/DisallowRemoveByReference.php | 53 + .../Strategy/DisallowRemoveByValue.php | 72 + .../Validator/NoObjectExists.php | 43 + .../Validator/ObjectExists.php | 175 + .../Service/AbstractValidatorFactory.php | 121 + .../Exception/ServiceCreationException.php | 16 + .../Service/NoObjectExistsFactory.php | 34 + .../Validator/Service/ObjectExistsFactory.php | 34 + .../Validator/Service/UniqueObjectFactory.php | 28 + .../Validator/UniqueObject.php | 166 + test/AppTest/Action/HomePageActionTest.php | 2 +- test/AppTest/Action/HomePageFactoryTest.php | 4 +- test/AppTest/Action/PingActionTest.php | 4 +- 109 files changed, 5980 insertions(+), 2606 deletions(-) delete mode 100644 config/autoload/router.global.php create mode 100644 src/ApiLibs/AbstractHandler/CrudHandler.php create mode 100644 src/ApiLibs/ConfigProvider.php create mode 100644 src/ApiLibs/Middleware/CorsMiddlewareFactory.php delete mode 100644 src/App/Action/AbstractCrudAction.php delete mode 100644 src/App/Action/Auth/AuthAction.php delete mode 100644 src/App/Action/ErrorCategoryAction.php delete mode 100644 src/App/Action/ErrorOriginAction.php delete mode 100644 src/App/Action/FacilityLocationAction.php delete mode 100644 src/App/Action/Fault/FaultAction.php delete mode 100644 src/App/Action/Fault/FaultCommentAction.php delete mode 100644 src/App/Action/Fault/FaultRejectAction.php delete mode 100644 src/App/Action/Fault/FaultS2ConfirmAction.php delete mode 100644 src/App/Action/Fault/FaultS3AcknowledgeAction.php delete mode 100644 src/App/Action/Fault/FaultS4RepairedAction.php delete mode 100644 src/App/Action/Fault/FaultS5AcceptedAction.php delete mode 100644 src/App/Action/MaintenanceAction.php delete mode 100644 src/App/Action/MaintenanceUpcomingAction.php delete mode 100644 src/App/Action/Pdf/GenerateMaintenanceSheetAction.php delete mode 100644 src/App/Action/PingAction.php delete mode 100644 src/App/Action/SolutionTimeIntervalAction.php delete mode 100644 src/App/Action/User/PasswordAction.php delete mode 100644 src/App/Action/User/UserAction.php rename src/App/Command/{MailTestCommand.php => DebugMailCommand.php} (84%) rename src/App/Command/{MailTestCommandFactory.php => DebugMailCommandFactory.php} (68%) rename src/App/{Action => Handler}/Auth/AuthFactory.php (74%) create mode 100644 src/App/Handler/Auth/AuthHandler.php rename src/App/{Action => Handler}/ErrorCategoryFactory.php (79%) create mode 100644 src/App/Handler/ErrorCategoryHandler.php rename src/App/{Action => Handler}/ErrorOriginFactory.php (79%) create mode 100644 src/App/Handler/ErrorOriginHandler.php rename src/App/{Action => Handler}/FacilityLocationFactory.php (79%) create mode 100644 src/App/Handler/FacilityLocationHandler.php rename src/App/{Action => Handler}/Fault/FaultAttachmentFactory.php (77%) rename src/App/{Action/Fault/FaultAttachmentAction.php => Handler/Fault/FaultAttachmentHandler.php} (61%) rename src/App/{Action => Handler}/Fault/FaultCommentFactory.php (74%) create mode 100644 src/App/Handler/Fault/FaultCommentHandler.php rename src/App/{Action => Handler}/Fault/FaultFactory.php (75%) create mode 100644 src/App/Handler/Fault/FaultHandler.php rename src/App/{Action => Handler}/Fault/FaultRejectFactory.php (74%) create mode 100644 src/App/Handler/Fault/FaultRejectHandler.php create mode 100644 src/App/Handler/Fault/X_FaultS2ConfirmAction.php create mode 100644 src/App/Handler/Fault/X_FaultS3AcknowledgeAction.php create mode 100644 src/App/Handler/Fault/X_FaultS4RepairedAction.php create mode 100644 src/App/Handler/Fault/X_FaultS5AcceptedAction.php rename src/App/{Action => Handler}/MaintenanceFactory.php (78%) create mode 100644 src/App/Handler/MaintenanceHandler.php rename src/App/{Action => Handler}/MaintenanceUpcomingFactory.php (76%) create mode 100644 src/App/Handler/MaintenanceUpcomingHandler.php rename src/App/{Action => Handler}/Pdf/GenerateMaintenanceSheetFactory.php (80%) create mode 100644 src/App/Handler/Pdf/GenerateMaintenanceSheetHandler.php rename src/App/{Action => Handler}/Pdf/GenerateWorksheetFactory.php (81%) rename src/App/{Action/Pdf/GenerateWorksheetAction.php => Handler/Pdf/GenerateWorksheetHandler.php} (53%) create mode 100644 src/App/Handler/PingHandler.php rename src/App/{Action => Handler}/SolutionTimeIntervalFactory.php (79%) create mode 100644 src/App/Handler/SolutionTimeIntervalHandler.php rename src/App/{Action => Handler}/User/PasswordFactory.php (78%) create mode 100644 src/App/Handler/User/PasswordHandler.php rename src/App/{Action => Handler}/User/UserFactory.php (79%) create mode 100644 src/App/Handler/User/UserHandler.php delete mode 100644 src/App/Response/JsonCorsResponse.php create mode 100644 src/DoctrineExpressiveModule/ConfigProvider.php create mode 100644 src/DoctrineExpressiveModule/Form/Element/ElementFactory.php create mode 100644 src/DoctrineExpressiveModule/Form/Element/Exception/InvalidRepositoryResultException.php create mode 100644 src/DoctrineExpressiveModule/Form/Element/ObjectMultiCheckbox.php create mode 100644 src/DoctrineExpressiveModule/Form/Element/ObjectRadio.php create mode 100644 src/DoctrineExpressiveModule/Form/Element/ObjectSelect.php create mode 100644 src/DoctrineExpressiveModule/Form/Element/Proxy.php create mode 100755 src/DoctrineExpressiveModule/Hydrator/DoctrineObject.php create mode 100644 src/DoctrineExpressiveModule/Hydrator/DoctrineObjectFactory.php create mode 100644 src/DoctrineExpressiveModule/Hydrator/Filter/PropertyName.php create mode 100644 src/DoctrineExpressiveModule/Hydrator/Strategy/AbstractCollectionStrategy.php create mode 100644 src/DoctrineExpressiveModule/Hydrator/Strategy/AllowRemoveByReference.php create mode 100644 src/DoctrineExpressiveModule/Hydrator/Strategy/AllowRemoveByValue.php create mode 100644 src/DoctrineExpressiveModule/Hydrator/Strategy/DisallowRemoveByReference.php create mode 100644 src/DoctrineExpressiveModule/Hydrator/Strategy/DisallowRemoveByValue.php create mode 100644 src/DoctrineExpressiveModule/Validator/NoObjectExists.php create mode 100644 src/DoctrineExpressiveModule/Validator/ObjectExists.php create mode 100644 src/DoctrineExpressiveModule/Validator/Service/AbstractValidatorFactory.php create mode 100644 src/DoctrineExpressiveModule/Validator/Service/Exception/ServiceCreationException.php create mode 100644 src/DoctrineExpressiveModule/Validator/Service/NoObjectExistsFactory.php create mode 100644 src/DoctrineExpressiveModule/Validator/Service/ObjectExistsFactory.php create mode 100644 src/DoctrineExpressiveModule/Validator/Service/UniqueObjectFactory.php create mode 100644 src/DoctrineExpressiveModule/Validator/UniqueObject.php diff --git a/composer.json b/composer.json index ea5e333..680b15a 100644 --- a/composer.json +++ b/composer.json @@ -4,49 +4,71 @@ "type": "project", "homepage": "https://github.com/zendframework/zend-expressive-skeleton", "license": "BSD-3-Clause", + "minimum-stability": "dev", + "prefer-stable": true, "config": { "sort-packages": true }, - "minimum-stability": "dev", - "prefer-stable": true, + "extra": { + "zf": { + "component-whitelist": [ + "zendframework/zend-expressive", + "zendframework/zend-expressive-helpers", + "zendframework/zend-expressive-router", + "zendframework/zend-httphandlerrunner", + "zendframework/zend-expressive-fastroute" + ] + } + }, + "support": { + "issues": "https://github.com/zendframework/zend-expressive-skeleton/issues", + "source": "https://github.com/zendframework/zend-expressive-skeleton", + "rss": "https://github.com/zendframework/zend-expressive-skeleton/releases.atom", + "slack": "https://zendframework-slack.herokuapp.com", + "forum": "https://discourse.zendframework.com/c/questions/expressive" + }, "require": { "php": "^7.1", - "dasprid/container-interop-doctrine": "^1.0", - "doctrine/data-fixtures": "^1.2", + "dasprid/container-interop-doctrine": "^1.1", + "doctrine/data-fixtures": "~2.0", "gedmo/doctrine-extensions": "^2.4", - "imagine/imagine": "^0.7.1", - "lcobucci/jwt": "^3.2", - "monolog/monolog": "^1.23", + "imagine/imagine": "^1.1.0", + "lcobucci/jwt": "^3.3", + "monolog/monolog": "^1.24", "oro/doctrine-extensions": "^1.2", "phpoffice/phpexcel": "1.8.1", "psliwa/php-pdf": "^1.2", - "roave/security-advisories": "dev-master", - "symfony/yaml": "^3.3", - "tuupola/cors-middleware": "^0.5.2", - "tuupola/slim-jwt-auth": "^2.3", - "zendframework/zend-component-installer": "^1.0", + "symfony/yaml": "^4.1", + "tuupola/cors-middleware": "^0.9.1", + "tuupola/slim-jwt-auth": "^3.1.1", + "zendframework/zend-component-installer": "^2.1.1", "zendframework/zend-config": "^3.1", "zendframework/zend-config-aggregator": "^1.0", "zendframework/zend-crypt": "^3.2", - "zendframework/zend-expressive": "^2.0.2", - "zendframework/zend-expressive-fastroute": "^2.0", - "zendframework/zend-expressive-helpers": "^4.0", - "zendframework/zend-hydrator": "^2.2", - "zendframework/zend-json": "^3.0", - "zendframework/zend-mail": "^2.8", - "zendframework/zend-permissions-rbac": "^2.5", + "zendframework/zend-diactoros": "^1.7.1 || ^2.0", + "zendframework/zend-expressive": "^3.0.1", + "zendframework/zend-expressive-fastroute": "^3.0", + "zendframework/zend-expressive-helpers": "^5.0", + "zendframework/zend-hydrator": "^2.3", + "zendframework/zend-json": "^3.1", + "zendframework/zend-mail": "^2.10.0", + "zendframework/zend-permissions-rbac": "^3.0.0", "zendframework/zend-servicemanager": "^3.3", "zendframework/zend-stdlib": "^3.1" }, "require-dev": { - "phpunit/phpunit": "^6.0.8 || ^5.7.15", - "squizlabs/php_codesniffer": "^2.8.1", + "phpunit/phpunit": "^7.0.1", + "roave/security-advisories": "dev-master", + "squizlabs/php_codesniffer": "^2.9.1", + "zendframework/zend-expressive-tooling": "^1.0", "zfcampus/zf-development-mode": "^3.1", - "filp/whoops": "^2.1.7" + "filp/whoops": "^2.1.12" }, "autoload": { "psr-4": { - "App\\": "src/App/" + "App\\": "src/App/", + "ApiLibs\\": "src/ApiLibs/", + "DoctrineExpressiveModule\\": "src/DoctrineExpressiveModule/" } }, "autoload-dev": { diff --git a/composer.lock b/composer.lock index 8af2144..f281ead 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,10 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d56bfbdbd812dad68abdf21910e4ed01", + "content-hash": "99fd952d2eafc5dafae9479945333cc4", "packages": [ { "name": "behat/transliterator", @@ -190,16 +190,16 @@ }, { "name": "doctrine/cache", - "version": "v1.7.1", + "version": "v1.8.0", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "b3217d58609e9c8e661cd41357a54d926c4a2a1a" + "reference": "d768d58baee9a4862ca783840eca1b9add7a7f57" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/b3217d58609e9c8e661cd41357a54d926c4a2a1a", - "reference": "b3217d58609e9c8e661cd41357a54d926c4a2a1a", + "url": "https://api.github.com/repos/doctrine/cache/zipball/d768d58baee9a4862ca783840eca1b9add7a7f57", + "reference": "d768d58baee9a4862ca783840eca1b9add7a7f57", "shasum": "" }, "require": { @@ -210,8 +210,9 @@ }, "require-dev": { "alcaeus/mongo-php-adapter": "^1.1", + "doctrine/coding-standard": "^4.0", "mongodb/mongodb": "^1.1", - "phpunit/phpunit": "^5.7", + "phpunit/phpunit": "^7.0", "predis/predis": "~1.0" }, "suggest": { @@ -220,7 +221,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "1.8.x-dev" } }, "autoload": { @@ -255,12 +256,12 @@ } ], "description": "Caching library offering an object-oriented API for many cache backends", - "homepage": "http://www.doctrine-project.org", + "homepage": "https://www.doctrine-project.org", "keywords": [ "cache", "caching" ], - "time": "2017-08-25T07:02:50+00:00" + "time": "2018-08-21T18:01:43+00:00" }, { "name": "doctrine/collections", @@ -331,33 +332,39 @@ }, { "name": "doctrine/common", - "version": "v2.8.1", + "version": "v2.9.0", "source": { "type": "git", "url": "https://github.com/doctrine/common.git", - "reference": "f68c297ce6455e8fd794aa8ffaf9fa458f6ade66" + "reference": "a210246d286c77d2b89040f8691ba7b3a713d2c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/f68c297ce6455e8fd794aa8ffaf9fa458f6ade66", - "reference": "f68c297ce6455e8fd794aa8ffaf9fa458f6ade66", + "url": "https://api.github.com/repos/doctrine/common/zipball/a210246d286c77d2b89040f8691ba7b3a713d2c1", + "reference": "a210246d286c77d2b89040f8691ba7b3a713d2c1", "shasum": "" }, "require": { - "doctrine/annotations": "1.*", - "doctrine/cache": "1.*", - "doctrine/collections": "1.*", - "doctrine/inflector": "1.*", - "doctrine/lexer": "1.*", - "php": "~7.1" + "doctrine/annotations": "^1.0", + "doctrine/cache": "^1.0", + "doctrine/collections": "^1.0", + "doctrine/event-manager": "^1.0", + "doctrine/inflector": "^1.0", + "doctrine/lexer": "^1.0", + "doctrine/persistence": "^1.0", + "doctrine/reflection": "^1.0", + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^5.7" + "doctrine/coding-standard": "^1.0", + "phpunit/phpunit": "^6.3", + "squizlabs/php_codesniffer": "^3.0", + "symfony/phpunit-bridge": "^4.0.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8.x-dev" + "dev-master": "2.9.x-dev" } }, "autoload": { @@ -389,10 +396,14 @@ { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" } ], "description": "Common Library for Doctrine projects", - "homepage": "http://www.doctrine-project.org", + "homepage": "https://www.doctrine-project.org", "keywords": [ "annotations", "collections", @@ -400,33 +411,34 @@ "persistence", "spl" ], - "time": "2017-08-31T08:43:38+00:00" + "time": "2018-07-12T21:16:12+00:00" }, { "name": "doctrine/data-fixtures", - "version": "v1.3.0", + "version": "2.0.x-dev", "source": { "type": "git", "url": "https://github.com/doctrine/data-fixtures.git", - "reference": "7b76ccc8e648c4502aad7f61347326c8a072bd3b" + "reference": "8d4eafdebeb28cc4a94042dcf92b24c7e236c86f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/data-fixtures/zipball/7b76ccc8e648c4502aad7f61347326c8a072bd3b", - "reference": "7b76ccc8e648c4502aad7f61347326c8a072bd3b", + "url": "https://api.github.com/repos/doctrine/data-fixtures/zipball/8d4eafdebeb28cc4a94042dcf92b24c7e236c86f", + "reference": "8d4eafdebeb28cc4a94042dcf92b24c7e236c86f", "shasum": "" }, "require": { - "doctrine/common": "~2.2", - "php": "^7.1" + "doctrine/common": "~2.4", + "php": ">=5.3.2" }, "require-dev": { - "doctrine/dbal": "^2.5.4", - "doctrine/orm": "^2.5.4", - "phpunit/phpunit": "^6.3" + "doctrine/dbal": "~2.4", + "doctrine/orm": "~2.4", + "phpunit/phpunit": "~3.7" }, "suggest": { - "alcaeus/mongo-php-adapter": "For using MongoDB ODM with PHP 7", + "doctrine/dbal": "For loading DBAL fixtures", + "doctrine/mongodb": "For loading MongoDB fixtures", "doctrine/mongodb-odm": "For loading MongoDB ODM fixtures", "doctrine/orm": "For loading ORM fixtures", "doctrine/phpcr-odm": "For loading PHPCR ODM fixtures" @@ -434,12 +446,12 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { - "psr-4": { - "Doctrine\\Common\\DataFixtures\\": "lib/Doctrine/Common/DataFixtures" + "psr-0": { + "Doctrine\\Fixture": "lib/" } }, "notification-url": "https://packagist.org/downloads/", @@ -447,41 +459,52 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@hotmail.com" + }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" } ], - "description": "Data Fixtures for all Doctrine Object Managers", + "description": "Data Fixtures for all Doctrine tools", "homepage": "http://www.doctrine-project.org", "keywords": [ - "database" + "Fixture", + "database", + "persistence" ], - "time": "2017-11-27T18:48:06+00:00" + "time": "2017-07-20T16:54:41+00:00" }, { "name": "doctrine/dbal", - "version": "v2.6.3", + "version": "v2.8.0", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "e3eed9b1facbb0ced3a0995244843a189e7d1b13" + "reference": "5140a64c08b4b607b9bedaae0cedd26f04a0e621" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/e3eed9b1facbb0ced3a0995244843a189e7d1b13", - "reference": "e3eed9b1facbb0ced3a0995244843a189e7d1b13", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/5140a64c08b4b607b9bedaae0cedd26f04a0e621", + "reference": "5140a64c08b4b607b9bedaae0cedd26f04a0e621", "shasum": "" }, "require": { - "doctrine/common": "^2.7.1", + "doctrine/cache": "^1.0", + "doctrine/event-manager": "^1.0", "ext-pdo": "*", "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^5.4.6", + "doctrine/coding-standard": "^4.0", + "jetbrains/phpstorm-stubs": "^2018.1.2", + "phpstan/phpstan": "^0.10.1", + "phpunit/phpunit": "^7.1.2", "phpunit/phpunit-mock-objects": "!=3.2.4,!=3.2.5", - "symfony/console": "2.*||^3.0" + "symfony/console": "^2.0.5|^3.0|^4.0", + "symfony/phpunit-bridge": "^3.4.5|^4.0.5" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." @@ -492,7 +515,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6.x-dev" + "dev-master": "2.8.x-dev", + "dev-develop": "3.0.x-dev" } }, "autoload": { @@ -530,7 +554,81 @@ "persistence", "queryobject" ], - "time": "2017-11-19T13:38:54+00:00" + "time": "2018-07-13T03:16:35+00:00" + }, + { + "name": "doctrine/event-manager", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/event-manager.git", + "reference": "a520bc093a0170feeb6b14e9d83f3a14452e64b3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/a520bc093a0170feeb6b14e9d83f3a14452e64b3", + "reference": "a520bc093a0170feeb6b14e9d83f3a14452e64b3", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "conflict": { + "doctrine/common": "<2.9@dev" + }, + "require-dev": { + "doctrine/coding-standard": "^4.0", + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "lib/Doctrine/Common" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "Doctrine Event Manager component", + "homepage": "https://www.doctrine-project.org/projects/event-manager.html", + "keywords": [ + "event", + "eventdispatcher", + "eventmanager" + ], + "time": "2018-06-11T11:59:03+00:00" }, { "name": "doctrine/inflector", @@ -709,16 +807,16 @@ }, { "name": "doctrine/orm", - "version": "v2.6.0", + "version": "v2.6.2", "source": { "type": "git", "url": "https://github.com/doctrine/doctrine2.git", - "reference": "374e7ace49d864dad8cddbc55346447c8a6a2083" + "reference": "d2b4dd71d2a276edd65d0c170375b445f8a4a4a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/374e7ace49d864dad8cddbc55346447c8a6a2083", - "reference": "374e7ace49d864dad8cddbc55346447c8a6a2083", + "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/d2b4dd71d2a276edd65d0c170375b445f8a4a4a8", + "reference": "d2b4dd71d2a276edd65d0c170375b445f8a4a4a8", "shasum": "" }, "require": { @@ -787,7 +885,160 @@ "database", "orm" ], - "time": "2017-12-20T00:38:15+00:00" + "time": "2018-07-12T20:47:13+00:00" + }, + { + "name": "doctrine/persistence", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/persistence.git", + "reference": "af1ec238659a83e320f03e0e454e200f689b4b97" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/persistence/zipball/af1ec238659a83e320f03e0e454e200f689b4b97", + "reference": "af1ec238659a83e320f03e0e454e200f689b4b97", + "shasum": "" + }, + "require": { + "doctrine/annotations": "^1.0", + "doctrine/cache": "^1.0", + "doctrine/collections": "^1.0", + "doctrine/event-manager": "^1.0", + "doctrine/reflection": "^1.0", + "php": "^7.1" + }, + "conflict": { + "doctrine/common": "<2.9@dev" + }, + "require-dev": { + "doctrine/coding-standard": "^4.0", + "phpstan/phpstan": "^0.8", + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "lib/Doctrine/Common" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "Doctrine Persistence abstractions.", + "homepage": "https://doctrine-project.org/projects/persistence.html", + "keywords": [ + "persistence" + ], + "time": "2018-07-12T12:37:50+00:00" + }, + { + "name": "doctrine/reflection", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/reflection.git", + "reference": "02538d3f95e88eb397a5f86274deb2c6175c2ab6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/reflection/zipball/02538d3f95e88eb397a5f86274deb2c6175c2ab6", + "reference": "02538d3f95e88eb397a5f86274deb2c6175c2ab6", + "shasum": "" + }, + "require": { + "doctrine/annotations": "^1.0", + "ext-tokenizer": "*", + "php": "^7.1" + }, + "require-dev": { + "doctrine/coding-standard": "^4.0", + "doctrine/common": "^2.8", + "phpstan/phpstan": "^0.9.2", + "phpstan/phpstan-phpunit": "^0.9.4", + "phpunit/phpunit": "^7.0", + "squizlabs/php_codesniffer": "^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "lib/Doctrine/Common" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "Doctrine Reflection component", + "homepage": "https://www.doctrine-project.org/projects/reflection.html", + "keywords": [ + "reflection" + ], + "time": "2018-06-14T14:45:07+00:00" }, { "name": "fig/http-message-util", @@ -887,16 +1138,16 @@ }, { "name": "gedmo/doctrine-extensions", - "version": "v2.4.33", + "version": "v2.4.36", "source": { "type": "git", "url": "https://github.com/Atlantic18/DoctrineExtensions.git", - "reference": "d5fdc573b6a2ecfa29c070ecb3db8397ac55ed78" + "reference": "87c78ff9fd4b90460386f753d95622f6fbbfcb27" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Atlantic18/DoctrineExtensions/zipball/d5fdc573b6a2ecfa29c070ecb3db8397ac55ed78", - "reference": "d5fdc573b6a2ecfa29c070ecb3db8397ac55ed78", + "url": "https://api.github.com/repos/Atlantic18/DoctrineExtensions/zipball/87c78ff9fd4b90460386f753d95622f6fbbfcb27", + "reference": "87c78ff9fd4b90460386f753d95622f6fbbfcb27", "shasum": "" }, "require": { @@ -904,11 +1155,14 @@ "doctrine/common": "~2.4", "php": ">=5.3.2" }, + "conflict": { + "doctrine/annotations": "<1.2" + }, "require-dev": { "doctrine/common": ">=2.5.0", "doctrine/mongodb-odm": ">=1.0.2", "doctrine/orm": ">=2.5.0", - "phpunit/phpunit": "*", + "phpunit/phpunit": "^4.8.35|^5.7|^6.5", "symfony/yaml": "~2.6|~3.0|~4.0" }, "suggest": { @@ -922,8 +1176,8 @@ } }, "autoload": { - "psr-0": { - "Gedmo\\": "lib/" + "psr-4": { + "Gedmo\\": "lib/Gedmo" } }, "notification-url": "https://packagist.org/downloads/", @@ -961,81 +1215,28 @@ "tree", "uploadable" ], - "time": "2018-01-08T14:13:45+00:00" - }, - { - "name": "http-interop/http-middleware", - "version": "0.4.1", - "source": { - "type": "git", - "url": "https://github.com/http-interop/http-middleware.git", - "reference": "9a801fe60e70d5d608b61d56b2dcde29516c81b9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/http-interop/http-middleware/zipball/9a801fe60e70d5d608b61d56b2dcde29516c81b9", - "reference": "9a801fe60e70d5d608b61d56b2dcde29516c81b9", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "psr/http-message": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Interop\\Http\\ServerMiddleware\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP server-side middleware", - "keywords": [ - "factory", - "http", - "middleware", - "psr", - "psr-17", - "psr-7", - "request", - "response" - ], - "abandoned": "http-interop/http-server-middleware", - "time": "2017-01-14T15:23:42+00:00" + "time": "2018-07-26T12:16:35+00:00" }, { "name": "imagine/imagine", - "version": "v0.7.1", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/avalanche123/Imagine.git", - "reference": "a9a702a946073cbca166718f1b02a1e72d742daa" + "reference": "05c37ac994e620646b376633c14e6377c35e3399" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/avalanche123/Imagine/zipball/a9a702a946073cbca166718f1b02a1e72d742daa", - "reference": "a9a702a946073cbca166718f1b02a1e72d742daa", + "url": "https://api.github.com/repos/avalanche123/Imagine/zipball/05c37ac994e620646b376633c14e6377c35e3399", + "reference": "05c37ac994e620646b376633c14e6377c35e3399", "shasum": "" }, "require": { "php": ">=5.3.2" }, "require-dev": { - "sami/sami": "^3.3", - "symfony/phpunit-bridge": "^3.2" + "friendsofphp/php-cs-fixer": "2.2.*", + "symfony/phpunit-bridge": "^3.2 || ^4.0" }, "suggest": { "ext-gd": "to use the GD implementation", @@ -1049,8 +1250,8 @@ } }, "autoload": { - "psr-0": { - "Imagine": "lib/" + "psr-4": { + "Imagine\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1072,32 +1273,32 @@ "image manipulation", "image processing" ], - "time": "2017-05-16T10:31:22+00:00" + "time": "2018-10-25T06:45:38+00:00" }, { "name": "lcobucci/jwt", - "version": "3.2.2", + "version": "3.3.x-dev", "source": { "type": "git", "url": "https://github.com/lcobucci/jwt.git", - "reference": "0b5930be73582369e10c4d4bb7a12bac927a203c" + "reference": "6f773d0b094e6f9065239755ab84bd297f7c8d81" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lcobucci/jwt/zipball/0b5930be73582369e10c4d4bb7a12bac927a203c", - "reference": "0b5930be73582369e10c4d4bb7a12bac927a203c", + "url": "https://api.github.com/repos/lcobucci/jwt/zipball/6f773d0b094e6f9065239755ab84bd297f7c8d81", + "reference": "6f773d0b094e6f9065239755ab84bd297f7c8d81", "shasum": "" }, "require": { "ext-openssl": "*", - "php": ">=5.5" + "php": "^5.6 || ^7.0" }, "require-dev": { "mdanter/ecc": "~0.3.1", "mikey179/vfsstream": "~1.5", "phpmd/phpmd": "~2.2", "phpunit/php-invoker": "~1.1", - "phpunit/phpunit": "~4.5", + "phpunit/phpunit": "^5.7 || ^7.3", "squizlabs/php_codesniffer": "~2.3" }, "suggest": { @@ -1130,20 +1331,20 @@ "JWS", "jwt" ], - "time": "2017-09-01T08:23:26+00:00" + "time": "2018-11-11T12:23:46+00:00" }, { "name": "monolog/monolog", - "version": "1.23.0", + "version": "1.24.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4" + "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd8c787753b3a2ad11bc60c063cff1358a32a3b4", - "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", + "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", "shasum": "" }, "require": { @@ -1208,20 +1409,20 @@ "logging", "psr-3" ], - "time": "2017-06-19T01:22:40+00:00" + "time": "2018-11-05T09:00:11+00:00" }, { "name": "neomerx/cors-psr7", - "version": "v1.0.12", + "version": "v1.0.13", "source": { "type": "git", "url": "https://github.com/neomerx/cors-psr7.git", - "reference": "24944f39483d1a89f66ae9d58cca9f82b8815b35" + "reference": "2556e2013f16a55532c95928455257d5b6bbc6e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/neomerx/cors-psr7/zipball/24944f39483d1a89f66ae9d58cca9f82b8815b35", - "reference": "24944f39483d1a89f66ae9d58cca9f82b8815b35", + "url": "https://api.github.com/repos/neomerx/cors-psr7/zipball/2556e2013f16a55532c95928455257d5b6bbc6e2", + "reference": "2556e2013f16a55532c95928455257d5b6bbc6e2", "shasum": "" }, "require": { @@ -1230,7 +1431,7 @@ "psr/log": "^1.0" }, "require-dev": { - "mockery/mockery": "^0.9.9", + "mockery/mockery": "^1.0", "phpunit/phpunit": "^5.7", "scrutinizer/ocular": "^1.1", "squizlabs/php_codesniffer": "^3.0" @@ -1263,25 +1464,28 @@ "w3.org", "www.w3.org" ], - "time": "2017-09-03T22:31:57+00:00" + "time": "2018-05-23T16:10:11+00:00" }, { "name": "nikic/fast-route", - "version": "v1.2.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/nikic/FastRoute.git", - "reference": "b5f95749071c82a8e0f58586987627054400cdf6" + "reference": "181d480e08d9476e61381e04a71b34dc0432e812" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/FastRoute/zipball/b5f95749071c82a8e0f58586987627054400cdf6", - "reference": "b5f95749071c82a8e0f58586987627054400cdf6", + "url": "https://api.github.com/repos/nikic/FastRoute/zipball/181d480e08d9476e61381e04a71b34dc0432e812", + "reference": "181d480e08d9476e61381e04a71b34dc0432e812", "shasum": "" }, "require": { "php": ">=5.4.0" }, + "require-dev": { + "phpunit/phpunit": "^4.8.35|~5.7" + }, "type": "library", "autoload": { "psr-4": { @@ -1306,25 +1510,25 @@ "router", "routing" ], - "time": "2017-01-19T11:35:12+00:00" + "time": "2018-02-13T20:26:39+00:00" }, { "name": "oro/doctrine-extensions", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", - "url": "https://github.com/orocrm/doctrine-extensions.git", - "reference": "26f38a2065d36d308331ccecb0b5ef31d61541d2" + "url": "https://github.com/oroinc/doctrine-extensions.git", + "reference": "cfe8d4daa82f46e846480d24c51a6a5182e8cb95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orocrm/doctrine-extensions/zipball/26f38a2065d36d308331ccecb0b5ef31d61541d2", - "reference": "26f38a2065d36d308331ccecb0b5ef31d61541d2", + "url": "https://api.github.com/repos/oroinc/doctrine-extensions/zipball/cfe8d4daa82f46e846480d24c51a6a5182e8cb95", + "reference": "cfe8d4daa82f46e846480d24c51a6a5182e8cb95", "shasum": "" }, "require": { "doctrine/orm": ">=2.2.3", - "php": ">=5.3.0" + "php": ">=5.4.0" }, "require-dev": { "doctrine/data-fixtures": "^1.0", @@ -1361,20 +1565,20 @@ "postgresql", "type" ], - "time": "2017-07-17T10:33:16+00:00" + "time": "2018-08-15T09:13:39+00:00" }, { "name": "paragonie/random_compat", - "version": "v2.0.11", + "version": "v2.0.17", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8" + "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/5da4d3c796c275c55f057af5a643ae297d96b4d8", - "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/29af24f25bab834fcbb38ad2a69fa93b867e070d", + "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d", "shasum": "" }, "require": { @@ -1406,10 +1610,11 @@ "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", "keywords": [ "csprng", + "polyfill", "pseudorandom", "random" ], - "time": "2017-09-27T21:40:39+00:00" + "time": "2018-07-04T16:31:37+00:00" }, { "name": "phpoffice/phpexcel", @@ -1523,6 +1728,52 @@ ], "time": "2016-08-14T22:50:47+00:00" }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "time": "2016-08-06T20:24:11+00:00" + }, { "name": "psr/container", "version": "1.0.0", @@ -1572,6 +1823,58 @@ ], "time": "2017-02-14T16:28:37+00:00" }, + { + "name": "psr/http-factory", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "378bfe27931ecc54ff824a20d6f6bfc303bbd04c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/378bfe27931ecc54ff824a20d6f6bfc303bbd04c", + "reference": "378bfe27931ecc54ff824a20d6f6bfc303bbd04c", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "time": "2018-07-30T21:54:04+00:00" + }, { "name": "psr/http-message", "version": "1.0.1", @@ -1622,6 +1925,112 @@ ], "time": "2016-08-06T14:39:51+00:00" }, + { + "name": "psr/http-server-handler", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-server-handler.git", + "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/aff2f80e33b7f026ec96bb42f63242dc50ffcae7", + "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7", + "shasum": "" + }, + "require": { + "php": ">=7.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Server\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP server-side request handler", + "keywords": [ + "handler", + "http", + "http-interop", + "psr", + "psr-15", + "psr-7", + "request", + "response", + "server" + ], + "time": "2018-10-30T16:46:14+00:00" + }, + { + "name": "psr/http-server-middleware", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-server-middleware.git", + "reference": "ea17eb1fb2c8df6db919cc578451a8013c6a0ae5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/ea17eb1fb2c8df6db919cc578451a8013c6a0ae5", + "reference": "ea17eb1fb2c8df6db919cc578451a8013c6a0ae5", + "shasum": "" + }, + "require": { + "php": ">=7.0", + "psr/http-message": "^1.0", + "psr/http-server-handler": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Server\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP server-side middleware", + "keywords": [ + "http", + "http-interop", + "middleware", + "psr", + "psr-15", + "psr-7", + "request", + "response" + ], + "time": "2018-01-22T17:08:31+00:00" + }, { "name": "psr/log", "version": "1.0.2", @@ -1670,163 +2079,65 @@ "time": "2016-10-10T12:19:37+00:00" }, { - "name": "roave/security-advisories", - "version": "dev-master", + "name": "psr/simple-cache", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "3df94834c80037130b533703df4672785b6ea112" + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/3df94834c80037130b533703df4672785b6ea112", - "reference": "3df94834c80037130b533703df4672785b6ea112", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", "shasum": "" }, - "conflict": { - "adodb/adodb-php": "<5.20.6", - "amphp/artax": "<1.0.6|>=2,<2.0.6", - "aws/aws-sdk-php": ">=3,<3.2.1", - "bugsnag/bugsnag-laravel": ">=2,<2.0.2", - "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.0.15|>=3.1,<3.1.4", - "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", - "cartalyst/sentry": "<=2.1.6", - "codeigniter/framework": "<=3.0.6", - "composer/composer": "<=1.0.0-alpha11", - "contao-components/mediaelement": ">=2.14.2,<2.21.1", - "contao/core": ">=2,<3.5.32", - "contao/core-bundle": ">=4,<4.4.8", - "contao/listing-bundle": ">=4,<4.4.8", - "contao/newsletter-bundle": ">=4,<4.1", - "doctrine/annotations": ">=1,<1.2.7", - "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", - "doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1", - "doctrine/dbal": ">=2,<2.0.8|>=2.1,<2.1.2", - "doctrine/doctrine-bundle": "<1.5.2", - "doctrine/doctrine-module": "<=0.7.1", - "doctrine/mongodb-odm": ">=1,<1.0.2", - "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", - "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", - "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=8,<8.3.7", - "drupal/drupal": ">=8,<8.3.7", - "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.2|>=5.4,<5.4.10.1|>=2017.8,<2017.8.1.1", - "firebase/php-jwt": "<2", - "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", - "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", - "gree/jose": "<=2.2", - "gregwar/rst": "<1.0.3", - "guzzlehttp/guzzle": ">=6,<6.2.1|>=4.0.0-rc2,<4.2.4|>=5,<5.3.1", - "illuminate/auth": ">=4,<4.0.99|>=4.1,<4.1.26", - "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29", - "joomla/session": "<1.3.1", - "laravel/framework": ">=4,<4.0.99|>=4.1,<4.1.29", - "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", - "magento/magento1ce": ">=1.5.0.1,<1.9.3.2", - "magento/magento1ee": ">=1.9,<1.14.3.2", - "magento/magento2ce": ">=2,<2.2", - "monolog/monolog": ">=1.8,<1.12", - "namshi/jose": "<2.2", - "onelogin/php-saml": "<2.10.4", - "oro/crm": ">=1.7,<1.7.4", - "oro/platform": ">=1.7,<1.7.4", - "phpmailer/phpmailer": ">=5,<5.2.24", - "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3", - "phpxmlrpc/extras": "<0.6.1", - "pusher/pusher-php-server": "<2.2.1", - "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", - "shopware/shopware": "<5.3.7", - "silverstripe/cms": ">=3,<=3.0.11|>=3.1,<3.1.11", - "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", - "silverstripe/framework": ">=3,<3.3", - "silverstripe/userforms": "<3", - "simplesamlphp/saml2": "<1.10.4|>=2,<2.3.5|>=3,<3.1.1", - "simplesamlphp/simplesamlphp": "<1.15.2", - "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", - "socalnick/scn-social-auth": "<1.15.2", - "squizlabs/php_codesniffer": ">=1,<2.8.1", - "swiftmailer/swiftmailer": ">=4,<5.4.5", - "symfony/dependency-injection": ">=2,<2.0.17", - "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", - "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2", - "symfony/http-foundation": ">=2,<2.3.27|>=2.4,<2.5.11|>=2.6,<2.6.6", - "symfony/http-kernel": ">=2,<2.3.29|>=2.4,<2.5.12|>=2.6,<2.6.8", - "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", - "symfony/routing": ">=2,<2.0.19", - "symfony/security": ">=2,<2.0.25|>=2.1,<2.1.13|>=2.2,<2.2.9|>=2.3,<2.3.37|>=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8.23,<2.8.25|>=3.2.10,<3.2.12|>=3.3.3,<3.3.5", - "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<2.8.6|>=2.8.23,<2.8.25|>=3,<3.0.6|>=3.2.10,<3.2.12|>=3.3.3,<3.3.5", - "symfony/security-csrf": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", - "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", - "symfony/serializer": ">=2,<2.0.11", - "symfony/symfony": ">=2,<2.3.41|>=2.4,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", - "symfony/translation": ">=2,<2.0.17", - "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", - "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", - "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", - "thelia/backoffice-default-template": ">=2.1,<2.1.2", - "thelia/thelia": ">=2.1.0-beta1,<2.1.3|>=2.1,<2.1.2", - "twig/twig": "<1.20", - "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.22|>=8,<8.7.5", - "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", - "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", - "willdurand/js-translation-bundle": "<2.1.1", - "yiisoft/yii": ">=1.1.14,<1.1.15", - "yiisoft/yii2": "<2.0.5", - "yiisoft/yii2-bootstrap": "<2.0.4", - "yiisoft/yii2-dev": "<2.0.4", - "yiisoft/yii2-gii": "<2.0.4", - "yiisoft/yii2-jui": "<2.0.4", - "zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3", - "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2", - "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2", - "zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5", - "zendframework/zend-diactoros": ">=1,<1.0.4", - "zendframework/zend-form": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-http": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.3,<2.3.8|>=2.4,<2.4.1", - "zendframework/zend-json": ">=2.1,<2.1.6|>=2.2,<2.2.6", - "zendframework/zend-ldap": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.8|>=2.3,<2.3.3", - "zendframework/zend-mail": ">=2,<2.4.11|>=2.5,<2.7.2", - "zendframework/zend-navigation": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-session": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.9|>=2.3,<2.3.4", - "zendframework/zend-validator": ">=2.3,<2.3.6", - "zendframework/zend-view": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-xmlrpc": ">=2.1,<2.1.6|>=2.2,<2.2.6", - "zendframework/zendframework": ">=2,<2.4.11|>=2.5,<2.5.1", - "zendframework/zendframework1": "<1.12.20", - "zendframework/zendopenid": ">=2,<2.0.2", - "zendframework/zendxml": ">=1,<1.0.1", - "zetacomponents/mail": "<1.8.2", - "zf-commons/zfc-user": "<1.2.2", - "zfcampus/zf-apigility-doctrine": ">=1,<1.0.3", - "zfr/zfr-oauth2-server-module": "<0.1.2" + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } }, - "type": "metapackage", "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "role": "maintainer" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2018-02-04T22:09:50+00:00" + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "time": "2017-10-23T01:57:42+00:00" }, { "name": "symfony/console", - "version": "v4.0.4", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "36d5b41e7d4e1ccf0370f6babe966c08ef0a1488" + "reference": "432122af37d8cd52fba1b294b11976e0d20df595" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/36d5b41e7d4e1ccf0370f6babe966c08ef0a1488", - "reference": "36d5b41e7d4e1ccf0370f6babe966c08ef0a1488", + "url": "https://api.github.com/repos/symfony/console/zipball/432122af37d8cd52fba1b294b11976e0d20df595", + "reference": "432122af37d8cd52fba1b294b11976e0d20df595", "shasum": "" }, "require": { @@ -1846,7 +2157,7 @@ "symfony/process": "~3.4|~4.0" }, "suggest": { - "psr/log": "For using the console logger", + "psr/log-implementation": "For using the console logger", "symfony/event-dispatcher": "", "symfony/lock": "", "symfony/process": "" @@ -1854,7 +2165,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -1881,20 +2192,78 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-01-29T09:06:29+00:00" + "time": "2018-10-31T09:30:44+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.7.0", + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", "shasum": "" }, "require": { @@ -1906,7 +2275,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -1940,24 +2309,25 @@ "portable", "shim" ], - "time": "2018-01-30T19:27:44+00:00" + "time": "2018-09-21T13:07:52+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.4", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "eab73b6c21d27ae4cd037c417618dfd4befb0bfe" + "reference": "367e689b2fdc19965be435337b50bc8adf2746c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/eab73b6c21d27ae4cd037c417618dfd4befb0bfe", - "reference": "eab73b6c21d27ae4cd037c417618dfd4befb0bfe", + "url": "https://api.github.com/repos/symfony/yaml/zipball/367e689b2fdc19965be435337b50bc8adf2746c9", + "reference": "367e689b2fdc19965be435337b50bc8adf2746c9", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" }, "conflict": { "symfony/console": "<3.4" @@ -1971,7 +2341,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -1998,32 +2368,256 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-01-21T19:05:02+00:00" + "time": "2018-10-02T16:36:10+00:00" }, { - "name": "tuupola/cors-middleware", - "version": "0.5.2", + "name": "true/punycode", + "version": "v2.1.1", "source": { "type": "git", - "url": "https://github.com/tuupola/cors-middleware.git", - "reference": "db69d8e67b99570b16e8cd5f78c423ed1167cb21" + "url": "https://github.com/true/php-punycode.git", + "reference": "a4d0c11a36dd7f4e7cd7096076cab6d3378a071e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tuupola/cors-middleware/zipball/db69d8e67b99570b16e8cd5f78c423ed1167cb21", - "reference": "db69d8e67b99570b16e8cd5f78c423ed1167cb21", + "url": "https://api.github.com/repos/true/php-punycode/zipball/a4d0c11a36dd7f4e7cd7096076cab6d3378a071e", + "reference": "a4d0c11a36dd7f4e7cd7096076cab6d3378a071e", "shasum": "" }, "require": { - "neomerx/cors-psr7": "^1.0", - "php": "^5.5 || ^7.0" + "php": ">=5.3.0", + "symfony/polyfill-mbstring": "^1.3" }, "require-dev": { - "phpunit/phpunit": "^4.8", - "squizlabs/php_codesniffer": "^2.5", - "zendframework/zend-diactoros": "^1.3" + "phpunit/phpunit": "~4.7", + "squizlabs/php_codesniffer": "~2.0" }, "type": "library", + "autoload": { + "psr-4": { + "TrueBV\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Renan Gonçalves", + "email": "renan.saddam@gmail.com" + } + ], + "description": "A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)", + "homepage": "https://github.com/true/php-punycode", + "keywords": [ + "idna", + "punycode" + ], + "time": "2016-11-16T10:37:54+00:00" + }, + { + "name": "tuupola/callable-handler", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/tuupola/callable-handler.git", + "reference": "8b9d87f88056d4234af317d65612d7b6307a747a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tuupola/callable-handler/zipball/8b9d87f88056d4234af317d65612d7b6307a747a", + "reference": "8b9d87f88056d4234af317d65612d7b6307a747a", + "shasum": "" + }, + "require": { + "php": "^7.1", + "psr/http-server-middleware": "^1.0" + }, + "require-dev": { + "codedungeon/phpunit-result-printer": "^0.4.4", + "overtrue/phplint": "^1.0", + "phpunit/phpunit": "^6.5", + "squizlabs/php_codesniffer": "^3.2", + "tuupola/http-factory": "^0.4.0|^1.0", + "zendframework/zend-diactoros": "^1.6.0|^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Tuupola\\Middleware\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mika Tuupola", + "email": "tuupola@appelsiini.net", + "homepage": "https://appelsiini.net/", + "role": "Developer" + } + ], + "description": "Compatibility layer for PSR-7 double pass and PSR-15 middlewares.", + "homepage": "https://github.com/tuupola/callable-handler", + "keywords": [ + "middleware", + "psr-15", + "psr-7" + ], + "time": "2018-10-12T09:59:35+00:00" + }, + { + "name": "tuupola/cors-middleware", + "version": "0.9.1", + "source": { + "type": "git", + "url": "https://github.com/tuupola/cors-middleware.git", + "reference": "bd36c15e1abc63f300a004fa7da850ba845b92a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tuupola/cors-middleware/zipball/bd36c15e1abc63f300a004fa7da850ba845b92a5", + "reference": "bd36c15e1abc63f300a004fa7da850ba845b92a5", + "shasum": "" + }, + "require": { + "neomerx/cors-psr7": "^1.0.4", + "php": "^7.1", + "psr/http-server-middleware": "^1.0", + "tuupola/callable-handler": "^0.3.0|^0.4.0|^1.0", + "tuupola/http-factory": "^0.4.0|^1.0" + }, + "require-dev": { + "codedungeon/phpunit-result-printer": "^0.23.2", + "equip/dispatch": "^2.0", + "overtrue/phplint": "^1.0", + "phpunit/phpunit": "^7.4", + "squizlabs/php_codesniffer": "^3.2", + "zendframework/zend-diactoros": "^1.0|^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Tuupola\\Middleware\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mika Tuupola", + "email": "tuupola@appelsiini.net", + "homepage": "https://appelsiini.net/", + "role": "Developer" + } + ], + "description": "PSR-7 and PSR-15 CORS middleware", + "homepage": "https://github.com/tuupola/cors-middleware", + "keywords": [ + "cors", + "middleware", + "psr-15", + "psr-7" + ], + "time": "2018-10-15T12:34:33+00:00" + }, + { + "name": "tuupola/http-factory", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/tuupola/http-factory.git", + "reference": "dd38c41facebdec20b5b4a120cd6380e30720ce8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tuupola/http-factory/zipball/dd38c41facebdec20b5b4a120cd6380e30720ce8", + "reference": "dd38c41facebdec20b5b4a120cd6380e30720ce8", + "shasum": "" + }, + "require": { + "php": "^7.1", + "psr/http-factory": "^1.0" + }, + "conflict": { + "nyholm/psr7": "<1.0" + }, + "require-dev": { + "http-interop/http-factory-tests": "^0.5.0", + "overtrue/phplint": "^1.0", + "phpunit/phpunit": "^6.5", + "squizlabs/php_codesniffer": "^3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Tuupola\\Http\\Factory\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mika Tuupola", + "email": "tuupola@appelsiini.net", + "homepage": "https://appelsiini.net/", + "role": "Developer" + } + ], + "description": "Lightweight autodiscovering PSR-17 HTTP factories", + "homepage": "https://github.com/tuupola/http-factory", + "keywords": [ + "http", + "psr-17", + "psr-7" + ], + "time": "2018-10-12T09:32:20+00:00" + }, + { + "name": "tuupola/slim-jwt-auth", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/tuupola/slim-jwt-auth.git", + "reference": "e50fa3cc6135abdc1b03e88c0425258a4955d01b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tuupola/slim-jwt-auth/zipball/e50fa3cc6135abdc1b03e88c0425258a4955d01b", + "reference": "e50fa3cc6135abdc1b03e88c0425258a4955d01b", + "shasum": "" + }, + "require": { + "firebase/php-jwt": "^3.0|^4.0|^5.0", + "php": "^7.1", + "psr/http-message": "^1.0", + "psr/http-server-middleware": "^1.0", + "psr/log": "^1.0", + "tuupola/callable-handler": "^0.3.0|^0.4.0|^1.0", + "tuupola/http-factory": "^0.4.0|^1.0" + }, + "require-dev": { + "codedungeon/phpunit-result-printer": "^0.5.4", + "equip/dispatch": "^2.0", + "overtrue/phplint": "^0.2.4", + "phpstan/phpstan": "^0.9.1", + "phpunit/phpunit": "^6.5", + "squizlabs/php_codesniffer": "^2.3", + "zendframework/zend-diactoros": "^1.3|^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-3.x": "3.0.x-dev" + } + }, "autoload": { "psr-4": { "Tuupola\\Middleware\\": "src" @@ -2041,188 +2635,51 @@ "role": "Developer" } ], - "description": "PSR-7 CORS Middleware", - "homepage": "https://github.com/tuupola/cors-middleware", - "keywords": [ - "cors", - "middleware", - "slim" - ], - "time": "2016-08-12T13:12:58+00:00" - }, - { - "name": "tuupola/slim-jwt-auth", - "version": "2.3.3", - "source": { - "type": "git", - "url": "https://github.com/tuupola/slim-jwt-auth.git", - "reference": "1f9fb673e4f5bb9ca4104e328aabfc2e4af38c32" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/tuupola/slim-jwt-auth/zipball/1f9fb673e4f5bb9ca4104e328aabfc2e4af38c32", - "reference": "1f9fb673e4f5bb9ca4104e328aabfc2e4af38c32", - "shasum": "" - }, - "require": { - "firebase/php-jwt": "^3.0 || ^4.0 || ^5.0", - "php": "^5.5 || ^7.0", - "psr/http-message": "^1.0", - "psr/log": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "squizlabs/php_codesniffer": "^2.3", - "zendframework/zend-diactoros": "^1.3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Slim\\Middleware\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mika Tuupola", - "email": "tuupola@appelsiini.net", - "homepage": "http://www.appelsiini.net/", - "role": "Developer" - } - ], - "description": "PSR-7 JWT Authentication Middleware", + "description": "PSR-7 and PSR-15 JWT Authentication Middleware", "homepage": "https://github.com/tuupola/slim-jwt-auth", "keywords": [ "auth", "json", "jwt", "middleware", + "psr-15", "psr-7" ], - "time": "2017-07-12T09:57:35+00:00" - }, - { - "name": "webimpress/composer-extra-dependency", - "version": "0.2.2", - "source": { - "type": "git", - "url": "https://github.com/webimpress/composer-extra-dependency.git", - "reference": "31fa56391d30f03b1180c87610cbe22254780ad9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webimpress/composer-extra-dependency/zipball/31fa56391d30f03b1180c87610cbe22254780ad9", - "reference": "31fa56391d30f03b1180c87610cbe22254780ad9", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.1", - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "composer/composer": "^1.5.2", - "mikey179/vfsstream": "^1.6.5", - "phpunit/phpunit": "^5.7.22 || ^6.4.1", - "zendframework/zend-coding-standard": "~1.0.0" - }, - "type": "composer-plugin", - "extra": { - "class": "Webimpress\\ComposerExtraDependency\\Plugin" - }, - "autoload": { - "psr-4": { - "Webimpress\\ComposerExtraDependency\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "description": "Composer plugin to require extra dependencies", - "homepage": "https://github.com/webimpress/composer-extra-dependency", - "keywords": [ - "composer", - "dependency", - "webimpress" - ], - "time": "2017-10-17T17:15:14+00:00" - }, - { - "name": "webimpress/http-middleware-compatibility", - "version": "0.1.4", - "source": { - "type": "git", - "url": "https://github.com/webimpress/http-middleware-compatibility.git", - "reference": "8ed1c2c7523dce0035b98bc4f3a73ca9cd1d3717" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webimpress/http-middleware-compatibility/zipball/8ed1c2c7523dce0035b98bc4f3a73ca9cd1d3717", - "reference": "8ed1c2c7523dce0035b98bc4f3a73ca9cd1d3717", - "shasum": "" - }, - "require": { - "http-interop/http-middleware": "^0.1.1 || ^0.2 || ^0.3 || ^0.4.1 || ^0.5", - "php": "^5.6 || ^7.0", - "webimpress/composer-extra-dependency": "^0.2.2" - }, - "require-dev": { - "phpunit/phpunit": "^5.7.23 || ^6.4.3" - }, - "type": "library", - "extra": { - "dependency": [ - "http-interop/http-middleware" - ] - }, - "autoload": { - "files": [ - "autoload/http-middleware.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "description": "Compatibility library for Draft PSR-15 HTTP Middleware", - "homepage": "https://github.com/webimpress/http-middleware-compatibility", - "keywords": [ - "middleware", - "psr-15", - "webimpress" - ], - "abandoned": "psr/http-server-middleware", - "time": "2017-10-17T17:31:10+00:00" + "time": "2018-10-12T11:44:47+00:00" }, { "name": "zendframework/zend-cache", - "version": "2.7.2", + "version": "2.8.2", "source": { "type": "git", "url": "https://github.com/zendframework/zend-cache.git", - "reference": "c98331b96d3b9d9b24cf32d02660602edb34d039" + "reference": "4983dff629956490c78b88adcc8ece4711d7d8a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-cache/zipball/c98331b96d3b9d9b24cf32d02660602edb34d039", - "reference": "c98331b96d3b9d9b24cf32d02660602edb34d039", + "url": "https://api.github.com/repos/zendframework/zend-cache/zipball/4983dff629956490c78b88adcc8ece4711d7d8a3", + "reference": "4983dff629956490c78b88adcc8ece4711d7d8a3", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", - "zendframework/zend-eventmanager": "^2.6.2 || ^3.0", - "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", - "zendframework/zend-stdlib": "^2.7 || ^3.0" + "php": "^5.6 || ^7.0", + "psr/cache": "^1.0", + "psr/simple-cache": "^1.0", + "zendframework/zend-eventmanager": "^2.6.3 || ^3.2", + "zendframework/zend-servicemanager": "^2.7.8 || ^3.3", + "zendframework/zend-stdlib": "^2.7.7 || ^3.1" + }, + "provide": { + "psr/cache-implementation": "1.0", + "psr/simple-cache-implementation": "1.0" }, "require-dev": { - "phpbench/phpbench": "^0.10.0", - "phpunit/phpunit": "^4.8", + "cache/integration-tests": "^0.16", + "phpbench/phpbench": "^0.13", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", "zendframework/zend-coding-standard": "~1.0.0", "zendframework/zend-serializer": "^2.6", - "zendframework/zend-session": "^2.6.2" + "zendframework/zend-session": "^2.7.4" }, "suggest": { "ext-apc": "APC or compatible extension, to use the APC storage adapter", @@ -2231,9 +2688,11 @@ "ext-memcache": "Memcache >= 2.0.0 to use the Memcache storage adapter", "ext-memcached": "Memcached >= 1.0.0 to use the Memcached storage adapter", "ext-mongo": "Mongo, to use MongoDb storage adapter", + "ext-mongodb": "MongoDB, to use the ExtMongoDb storage adapter", "ext-redis": "Redis, to use Redis storage adapter", "ext-wincache": "WinCache, to use the WinCache storage adapter", "ext-xcache": "XCache, to use the XCache storage adapter", + "mongodb/mongodb": "Required for use with the ext-mongodb adapter", "mongofill/mongofill": "Alternative to ext-mongo - a pure PHP implementation designed as a drop in replacement", "zendframework/zend-serializer": "Zend\\Serializer component", "zendframework/zend-session": "Zend\\Session component" @@ -2241,8 +2700,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev", - "dev-develop": "2.8-dev" + "dev-master": "2.8.x-dev", + "dev-develop": "2.9.x-dev" }, "zf": { "component": "Zend\\Cache", @@ -2250,6 +2709,9 @@ } }, "autoload": { + "files": [ + "autoload/patternPluginManagerPolyfill.php" + ], "psr-4": { "Zend\\Cache\\": "src/" } @@ -2258,31 +2720,33 @@ "license": [ "BSD-3-Clause" ], - "description": "provides a generic way to cache any data", - "homepage": "https://github.com/zendframework/zend-cache", + "description": "Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output", "keywords": [ + "ZendFramework", "cache", - "zf2" + "psr-16", + "psr-6", + "zf" ], - "time": "2016-12-16T11:35:47+00:00" + "time": "2018-05-01T21:58:00+00:00" }, { "name": "zendframework/zend-component-installer", - "version": "1.1.1", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-component-installer.git", - "reference": "5e9beda3b81d29d4d080b110d67f8c8c44d93605" + "reference": "788b74439fff056b848c47aeb3d8b63cf2fb2161" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-component-installer/zipball/5e9beda3b81d29d4d080b110d67f8c8c44d93605", - "reference": "5e9beda3b81d29d4d080b110d67f8c8c44d93605", + "url": "https://api.github.com/repos/zendframework/zend-component-installer/zipball/788b74439fff056b848c47aeb3d8b63cf2fb2161", + "reference": "788b74439fff056b848c47aeb3d8b63cf2fb2161", "shasum": "" }, "require": { "composer-plugin-api": "^1.0", - "php": "^5.6 || ^7.0" + "php": "^7.1" }, "require-dev": { "composer/composer": "^1.5.2", @@ -2294,8 +2758,8 @@ "type": "composer-plugin", "extra": { "branch-alias": { - "dev-master": "1.1-dev", - "dev-develop": "1.2-dev" + "dev-master": "2.1.x-dev", + "dev-develop": "2.2.x-dev" }, "class": "Zend\\ComponentInstaller\\ComponentInstaller" }, @@ -2316,20 +2780,20 @@ "plugin", "zf" ], - "time": "2018-01-11T15:03:06+00:00" + "time": "2018-03-21T16:53:56+00:00" }, { "name": "zendframework/zend-config", - "version": "3.1.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-config.git", - "reference": "a12e4a592bf66d9629b84960e268f3752e53abe4" + "reference": "6796f5dcba52c84ef2501d7313618989b5ef3023" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-config/zipball/a12e4a592bf66d9629b84960e268f3752e53abe4", - "reference": "a12e4a592bf66d9629b84960e268f3752e53abe4", + "url": "https://api.github.com/repos/zendframework/zend-config/zipball/6796f5dcba52c84ef2501d7313618989b5ef3023", + "reference": "6796f5dcba52c84ef2501d7313618989b5ef3023", "shasum": "" }, "require": { @@ -2342,23 +2806,23 @@ "container-interop/container-interop": "<1.2.0" }, "require-dev": { - "malukenho/docheader": "^0.1.5", - "phpunit/phpunit": "^5.7 || ^6.0", + "malukenho/docheader": "^0.1.6", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", "zendframework/zend-coding-standard": "~1.0.0", - "zendframework/zend-filter": "^2.7.1", - "zendframework/zend-i18n": "^2.7.3", - "zendframework/zend-servicemanager": "^2.7.8 || ^3.2.1" + "zendframework/zend-filter": "^2.7.2", + "zendframework/zend-i18n": "^2.7.4", + "zendframework/zend-servicemanager": "^2.7.8 || ^3.3" }, "suggest": { - "zendframework/zend-filter": "^2.7.1; install if you want to use the Filter processor", - "zendframework/zend-i18n": "^2.7.3; install if you want to use the Translator processor", - "zendframework/zend-servicemanager": "^2.7.8 || ^3.2.1; if you need an extensible plugin manager for use with the Config Factory" + "zendframework/zend-filter": "^2.7.2; install if you want to use the Filter processor", + "zendframework/zend-i18n": "^2.7.4; install if you want to use the Translator processor", + "zendframework/zend-servicemanager": "^2.7.8 || ^3.3; if you need an extensible plugin manager for use with the Config Factory" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev", - "dev-develop": "3.2-dev" + "dev-master": "3.2.x-dev", + "dev-develop": "3.3.x-dev" } }, "autoload": { @@ -2371,25 +2835,25 @@ "BSD-3-Clause" ], "description": "provides a nested object property based user interface for accessing this configuration data within application code", - "homepage": "https://github.com/zendframework/zend-config", "keywords": [ + "ZendFramework", "config", - "zf2" + "zf" ], - "time": "2017-02-22T14:31:10+00:00" + "time": "2018-04-24T19:26:44+00:00" }, { "name": "zendframework/zend-config-aggregator", - "version": "1.0.1", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-config-aggregator.git", - "reference": "2762abefdb1df1517be7e77a6717540557dca1bb" + "reference": "2a08547b64119a73b6700bde3301d978258dfcb5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-config-aggregator/zipball/2762abefdb1df1517be7e77a6717540557dca1bb", - "reference": "2762abefdb1df1517be7e77a6717540557dca1bb", + "url": "https://api.github.com/repos/zendframework/zend-config-aggregator/zipball/2a08547b64119a73b6700bde3301d978258dfcb5", + "reference": "2a08547b64119a73b6700bde3301d978258dfcb5", "shasum": "" }, "require": { @@ -2405,13 +2869,15 @@ "zendframework/zend-servicemanager": "^2.7.7 || ^3.1.1" }, "suggest": { - "zendframework/zend-config": "Allows loading configuration from XML, INI, YAML, and JSON files" + "zendframework/zend-config": "Allows loading configuration from XML, INI, YAML, and JSON files", + "zendframework/zend-config-aggregator-modulemanager": "Allows loading configuration from zend-mvc Module classes", + "zendframework/zend-config-aggregator-parameters": "Allows usage of templated parameters within your configuration" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev", - "dev-develop": "1.1-dev" + "dev-master": "1.1.x-dev", + "dev-develop": "1.2.x-dev" } }, "autoload": { @@ -2421,41 +2887,40 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD 3-Clause" + "BSD-3-Clause" ], - "authors": [ - { - "name": "Mateusz Tymek", - "email": "mtymek@gmail.com" - } + "description": "Lightweight library for collecting and merging configuration from different sources", + "keywords": [ + "ZendFramework", + "config-aggregator", + "zf" ], - "description": "Lightweight library for merging and caching application config", - "time": "2017-11-06T14:55:00+00:00" + "time": "2018-04-04T20:37:31+00:00" }, { "name": "zendframework/zend-crypt", - "version": "3.2.1", + "version": "3.3.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-crypt.git", - "reference": "514cef5556bac069e36c2cbded40e529b86bb3f2" + "reference": "9c2916faa9b2132a0f91cdca8e95b025c352f065" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-crypt/zipball/514cef5556bac069e36c2cbded40e529b86bb3f2", - "reference": "514cef5556bac069e36c2cbded40e529b86bb3f2", + "url": "https://api.github.com/repos/zendframework/zend-crypt/zipball/9c2916faa9b2132a0f91cdca8e95b025c352f065", + "reference": "9c2916faa9b2132a0f91cdca8e95b025c352f065", "shasum": "" }, "require": { - "container-interop/container-interop": "~1.0", + "container-interop/container-interop": "^1.2", "ext-mbstring": "*", "php": "^5.6 || ^7.0", "zendframework/zend-math": "^3.0", - "zendframework/zend-stdlib": "^2.7 || ^3.0" + "zendframework/zend-stdlib": "^2.7.7 || ^3.1" }, "require-dev": { - "phpunit/phpunit": "^5.6.7", - "squizlabs/php_codesniffer": "^2.3.1" + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0" }, "suggest": { "ext-openssl": "Required for most features of Zend\\Crypt" @@ -2463,8 +2928,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev", - "dev-develop": "3.2-dev" + "dev-master": "3.3.x-dev", + "dev-develop": "3.4.x-dev" } }, "autoload": { @@ -2476,91 +2941,106 @@ "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-crypt", + "description": "Strong cryptography tools and password hashing", "keywords": [ + "ZendFramework", "crypt", - "zf2" + "zf" ], - "time": "2017-07-17T15:46:00+00:00" + "time": "2018-04-24T22:01:58+00:00" }, { "name": "zendframework/zend-diactoros", - "version": "1.7.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-diactoros.git", - "reference": "ed6ce7e2105c400ca10277643a8327957c0384b7" + "reference": "0bae78192e634774b5584f0210c1232da82cb1ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/ed6ce7e2105c400ca10277643a8327957c0384b7", - "reference": "ed6ce7e2105c400ca10277643a8327957c0384b7", + "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/0bae78192e634774b5584f0210c1232da82cb1ff", + "reference": "0bae78192e634774b5584f0210c1232da82cb1ff", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0", + "php": "^7.1", + "psr/http-factory": "^1.0", "psr/http-message": "^1.0" }, "provide": { + "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, "require-dev": { "ext-dom": "*", "ext-libxml": "*", - "phpunit/phpunit": "^5.7.16 || ^6.0.8", - "zendframework/zend-coding-standard": "~1.0" + "http-interop/http-factory-tests": "^0.5.0", + "php-http/psr7-integration-tests": "dev-master", + "phpunit/phpunit": "^7.0.2", + "zendframework/zend-coding-standard": "~1.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev", - "dev-develop": "1.8.x-dev" + "dev-master": "2.0.x-dev", + "dev-develop": "2.1.x-dev", + "dev-release-1.8": "1.8.x-dev" } }, "autoload": { + "files": [ + "src/functions/create_uploaded_file.php", + "src/functions/marshal_headers_from_sapi.php", + "src/functions/marshal_method_from_sapi.php", + "src/functions/marshal_protocol_version_from_sapi.php", + "src/functions/marshal_uri_from_sapi.php", + "src/functions/normalize_server.php", + "src/functions/normalize_uploaded_files.php", + "src/functions/parse_cookie_header.php" + ], "psr-4": { "Zend\\Diactoros\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-2-Clause" + "BSD-3-Clause" ], "description": "PSR HTTP Message implementations", - "homepage": "https://github.com/zendframework/zend-diactoros", "keywords": [ "http", "psr", "psr-7" ], - "time": "2018-01-04T18:21:48+00:00" + "time": "2018-09-27T19:49:04+00:00" }, { "name": "zendframework/zend-escaper", - "version": "2.5.2", + "version": "2.6.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-escaper.git", - "reference": "2dcd14b61a72d8b8e27d579c6344e12c26141d4e" + "reference": "31d8aafae982f9568287cb4dce987e6aff8fd074" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-escaper/zipball/2dcd14b61a72d8b8e27d579c6344e12c26141d4e", - "reference": "2dcd14b61a72d8b8e27d579c6344e12c26141d4e", + "url": "https://api.github.com/repos/zendframework/zend-escaper/zipball/31d8aafae982f9568287cb4dce987e6aff8fd074", + "reference": "31d8aafae982f9568287cb4dce987e6aff8fd074", "shasum": "" }, "require": { - "php": ">=5.5" + "php": "^5.6 || ^7.0" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" + "dev-master": "2.6.x-dev", + "dev-develop": "2.7.x-dev" } }, "autoload": { @@ -2572,25 +3052,26 @@ "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-escaper", + "description": "Securely and safely escape HTML, HTML attributes, JavaScript, CSS, and URLs", "keywords": [ + "ZendFramework", "escaper", - "zf2" + "zf" ], - "time": "2016-06-30T19:48:38+00:00" + "time": "2018-04-25T15:48:53+00:00" }, { "name": "zendframework/zend-eventmanager", - "version": "3.2.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-eventmanager.git", - "reference": "9d72db10ceb6e42fb92350c0cb54460da61bd79c" + "reference": "a5e2583a211f73604691586b8406ff7296a946dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/9d72db10ceb6e42fb92350c0cb54460da61bd79c", - "reference": "9d72db10ceb6e42fb92350c0cb54460da61bd79c", + "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/a5e2583a211f73604691586b8406ff7296a946dd", + "reference": "a5e2583a211f73604691586b8406ff7296a946dd", "shasum": "" }, "require": { @@ -2599,7 +3080,7 @@ "require-dev": { "athletic/athletic": "^0.1", "container-interop/container-interop": "^1.1.0", - "phpunit/phpunit": "^6.0.7 || ^5.7.14", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", "zendframework/zend-coding-standard": "~1.0.0", "zendframework/zend-stdlib": "^2.7.3 || ^3.0" }, @@ -2631,53 +3112,58 @@ "events", "zf2" ], - "time": "2017-07-11T19:17:22+00:00" + "time": "2018-04-25T15:33:34+00:00" }, { "name": "zendframework/zend-expressive", - "version": "2.1.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-expressive.git", - "reference": "05c82075d486fc7818f4c69e218fcad4d43e2cb4" + "reference": "c48f901f4d7c559a9ccd0e996186018477120744" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-expressive/zipball/05c82075d486fc7818f4c69e218fcad4d43e2cb4", - "reference": "05c82075d486fc7818f4c69e218fcad4d43e2cb4", + "url": "https://api.github.com/repos/zendframework/zend-expressive/zipball/c48f901f4d7c559a9ccd0e996186018477120744", + "reference": "c48f901f4d7c559a9ccd0e996186018477120744", "shasum": "" }, "require": { "fig/http-message-util": "^1.1.2", - "http-interop/http-middleware": "^0.4.1", - "php": "^5.6 || ^7.0", + "php": "^7.1", "psr/container": "^1.0", "psr/http-message": "^1.0.1", - "zendframework/zend-diactoros": "^1.3.10", - "zendframework/zend-expressive-router": "^2.1", - "zendframework/zend-expressive-template": "^1.0.4", - "zendframework/zend-stratigility": "^2.0.1" + "psr/http-server-middleware": "^1.0", + "zendframework/zend-expressive-router": "^3.0", + "zendframework/zend-expressive-template": "^2.0", + "zendframework/zend-httphandlerrunner": "^1.0.1", + "zendframework/zend-stratigility": "^3.0" }, "conflict": { - "container-interop/container-interop": "<1.2.0" + "container-interop/container-interop": "<1.2.0", + "zendframework/zend-diactoros": "<1.7.1" }, "require-dev": { - "filp/whoops": "^2.1.6 || ^1.1.10", - "malukenho/docheader": "^0.1.5", + "filp/whoops": "^1.1.10 || ^2.1.13", + "malukenho/docheader": "^0.1.6", "mockery/mockery": "^1.0", - "phpunit/phpunit": "^5.7.23 || ^6.4.3", + "phpstan/phpstan": "^0.9.2", + "phpstan/phpstan-strict-rules": "^0.9", + "phpunit/phpunit": "^7.0.1", "zendframework/zend-coding-standard": "~1.0.0", - "zendframework/zend-expressive-aurarouter": "^2.0", - "zendframework/zend-expressive-fastroute": "^2.0", - "zendframework/zend-expressive-zendrouter": "^2.0.1", - "zendframework/zend-servicemanager": "^3.3 || ^2.7.8" + "zendframework/zend-diactoros": "^1.7.1 || ^2.0", + "zendframework/zend-expressive-aurarouter": "^3.0", + "zendframework/zend-expressive-fastroute": "^3.0", + "zendframework/zend-expressive-zendrouter": "^3.0", + "zendframework/zend-servicemanager": "^2.7.8 || ^3.3" }, "suggest": { - "aura/di": "^3.2 to make use of Aura.Di dependency injection container", "filp/whoops": "^2.1 to use the Whoops error handler", - "xtreamwayz/pimple-container-interop": "^1.0 to use Pimple for dependency injection", + "psr/http-message-implementation": "Please install a psr/http-message-implementation to consume Expressive; e.g., zendframework/zend-diactoros", + "zendframework/zend-auradi-config": "^1.0 to use Aura.Di dependency injection container", "zendframework/zend-expressive-helpers": "^3.0 for its UrlHelper, ServerUrlHelper, and BodyParseMiddleware", - "zendframework/zend-expressive-tooling": "For migration and development tools; require it with the --dev flag", + "zendframework/zend-expressive-tooling": "^1.0 for migration and development tools; require it with the --dev flag", + "zendframework/zend-pimple-config": "^1.0 to use Pimple for dependency injection container", "zendframework/zend-servicemanager": "^3.3 to use zend-servicemanager for dependency injection" }, "bin": [ @@ -2686,12 +3172,17 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1.x-dev", - "dev-develop": "2.2.x-dev", - "dev-release-3.0.0": "3.0.x-dev" + "dev-master": "3.2.x-dev", + "dev-develop": "3.3.x-dev" + }, + "zf": { + "config-provider": "Zend\\Expressive\\ConfigProvider" } }, "autoload": { + "files": [ + "src/constants.php" + ], "psr-4": { "Zend\\Expressive\\": "src/" } @@ -2700,55 +3191,63 @@ "license": [ "BSD-3-Clause" ], - "description": "PSR-7 Middleware Microframework based on Stratigility", + "description": "PSR-15 Middleware Microframework", "keywords": [ "PSR-11", "ZendFramework", + "expressive", "http", "middleware", "psr", + "psr-15", "psr-7", "zend-expressive", "zf" ], - "time": "2017-12-11T21:41:17+00:00" + "time": "2018-11-08T15:30:09+00:00" }, { "name": "zendframework/zend-expressive-fastroute", - "version": "2.1.2", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/zendframework/zend-expressive-fastroute.git", - "reference": "8ba998e5f5de883d2753031338029cb4e545e963" + "reference": "da91f1ba3d03e3aad58d9f0290518f8e28e2e8f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-expressive-fastroute/zipball/8ba998e5f5de883d2753031338029cb4e545e963", - "reference": "8ba998e5f5de883d2753031338029cb4e545e963", + "url": "https://api.github.com/repos/zendframework/zend-expressive-fastroute/zipball/da91f1ba3d03e3aad58d9f0290518f8e28e2e8f0", + "reference": "da91f1ba3d03e3aad58d9f0290518f8e28e2e8f0", "shasum": "" }, "require": { "fig/http-message-util": "^1.1.2", "nikic/fast-route": "^1.2", - "php": "^5.6 || ^7.0", + "php": "^7.1", "psr/container": "^1.0", "psr/http-message": "^1.0.1", - "zendframework/zend-expressive-router": "^2.0.1", - "zendframework/zend-stdlib": "^3.1 || 2.*" + "zendframework/zend-expressive-router": "^3.0", + "zendframework/zend-stdlib": "^2.0 || ^3.1" }, "conflict": { "container-interop/container-interop": "<1.2.0" }, "require-dev": { - "malukenho/docheader": "^0.1.5", - "phpunit/phpunit": "^5.7.23 || ^6.4.3", - "zendframework/zend-coding-standard": "~1.0.0" + "malukenho/docheader": "^0.1.6", + "mikey179/vfsstream": "^1.6.5", + "phpunit/phpunit": "^7.0.2", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-diactoros": "^1.7.1", + "zendframework/zend-stratigility": "^3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev", - "dev-develop": "2.2-dev" + "dev-master": "3.0.x-dev", + "dev-develop": "3.1.x-dev" + }, + "zf": { + "config-provider": "Zend\\Expressive\\Router\\FastRouteRouter\\ConfigProvider" } }, "autoload": { @@ -2772,46 +3271,44 @@ "zend-expressive", "zf" ], - "time": "2017-12-06T21:35:57+00:00" + "time": "2018-08-02T14:10:40+00:00" }, { "name": "zendframework/zend-expressive-helpers", - "version": "4.2.0", + "version": "5.1.2", "source": { "type": "git", "url": "https://github.com/zendframework/zend-expressive-helpers.git", - "reference": "137d863d4741210d05297b4bb1c30264f100ba8f" + "reference": "c4db15318ae53965794f46618535fc61dd058ea7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-expressive-helpers/zipball/137d863d4741210d05297b4bb1c30264f100ba8f", - "reference": "137d863d4741210d05297b4bb1c30264f100ba8f", + "url": "https://api.github.com/repos/zendframework/zend-expressive-helpers/zipball/c4db15318ae53965794f46618535fc61dd058ea7", + "reference": "c4db15318ae53965794f46618535fc61dd058ea7", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0", + "php": "^7.1", "psr/container": "^1.0", "psr/http-message": "^1.0.1", - "webimpress/http-middleware-compatibility": "^0.1.1", - "zendframework/zend-expressive-router": "^2.2" + "psr/http-server-middleware": "^1.0", + "zendframework/zend-expressive-router": "^3.0" }, "require-dev": { - "malukenho/docheader": "^0.1.5", + "malukenho/docheader": "^0.1.6", "mockery/mockery": "^1.0", - "phpunit/phpunit": "^5.7.22 || ^6.4.1", + "phpunit/phpunit": "^7.0.2", "zendframework/zend-coding-standard": "~1.0.0", - "zendframework/zend-diactoros": "^1.3.10" - }, - "suggest": { - "aura/di": "^3.2 to make use of Aura.Di dependency injection container", - "mouf/pimple-interop": "^1.0 to use Pimple for dependency injection", - "zendframework/zend-servicemanager": "^3.3 to use zend-servicemanager for dependency injection" + "zendframework/zend-diactoros": "^1.7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev", - "dev-develop": "4.3-dev" + "dev-master": "5.1.x-dev", + "dev-develop": "5.2.x-dev" + }, + "zf": { + "config-provider": "Zend\\Expressive\\Helper\\ConfigProvider" } }, "autoload": { @@ -2825,50 +3322,56 @@ ], "description": "Helper/Utility classes for Expressive", "keywords": [ + "ZendFramework", "expressive", "http", "middleware", "psr", - "psr-7" + "psr-7", + "zend-expressive", + "zf" ], - "time": "2017-10-09T19:03:01+00:00" + "time": "2018-07-26T20:05:23+00:00" }, { "name": "zendframework/zend-expressive-router", - "version": "2.3.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-expressive-router.git", - "reference": "eb71000aa7970ad67f252076200bcc1593714f8d" + "reference": "072d6b0620f7e1e616cb60062425b4eedd1a0447" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-expressive-router/zipball/eb71000aa7970ad67f252076200bcc1593714f8d", - "reference": "eb71000aa7970ad67f252076200bcc1593714f8d", + "url": "https://api.github.com/repos/zendframework/zend-expressive-router/zipball/072d6b0620f7e1e616cb60062425b4eedd1a0447", + "reference": "072d6b0620f7e1e616cb60062425b4eedd1a0447", "shasum": "" }, "require": { "fig/http-message-util": "^1.1.2", - "php": "^5.6 || ^7.0", + "php": "^7.1", + "psr/container": "^1.0", "psr/http-message": "^1.0.1", - "webimpress/http-middleware-compatibility": "^0.1.1" + "psr/http-server-middleware": "^1.0" }, "require-dev": { - "malukenho/docheader": "^0.1.5", - "phpunit/phpunit": "^5.7.23 || ^6.4.3", + "malukenho/docheader": "^0.1.6", + "phpunit/phpunit": "^7.0.2", "zendframework/zend-coding-standard": "~1.0.0" }, "suggest": { - "zendframework/zend-expressive-aurarouter": "^1.0 to use the Aura.Router routing adapter", - "zendframework/zend-expressive-fastroute": "^1.2 to use the FastRoute routing adapter", - "zendframework/zend-expressive-zendrouter": "^1.2 to use the zend-router routing adapter" + "zendframework/zend-expressive-aurarouter": "^3.0 to use the Aura.Router routing adapter", + "zendframework/zend-expressive-fastroute": "^3.0 to use the FastRoute routing adapter", + "zendframework/zend-expressive-zendrouter": "^3.0 to use the zend-router routing adapter" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3.x-dev", - "dev-develop": "2.4.x-dev", - "dev-release-3.0.0": "3.0.x-dev" + "dev-master": "3.1.x-dev", + "dev-develop": "3.2.x-dev" + }, + "zf": { + "config-provider": "Zend\\Expressive\\Router\\ConfigProvider" } }, "autoload": { @@ -2891,39 +3394,40 @@ "zend-expressive", "zf" ], - "time": "2018-02-01T19:49:45+00:00" + "time": "2018-06-05T15:28:00+00:00" }, { "name": "zendframework/zend-expressive-template", - "version": "1.0.4", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-expressive-template.git", - "reference": "23922f96b32ab6e64fc551ec06b81fd047828765" + "reference": "b8b9ece61ed598a58223638933e2fd703ae4a5e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-expressive-template/zipball/23922f96b32ab6e64fc551ec06b81fd047828765", - "reference": "23922f96b32ab6e64fc551ec06b81fd047828765", + "url": "https://api.github.com/repos/zendframework/zend-expressive-template/zipball/b8b9ece61ed598a58223638933e2fd703ae4a5e9", + "reference": "b8b9ece61ed598a58223638933e2fd703ae4a5e9", "shasum": "" }, "require": { - "php": ">=5.5" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^4.7", + "malukenho/docheader": "^0.1.6", + "phpunit/phpunit": "^7.0.2", "zendframework/zend-coding-standard": "~1.0.0" }, "suggest": { - "zendframework/zend-expressive-platesrenderer": "^0.1 to use the Plates template renderer", - "zendframework/zend-expressive-twigrenderer": "^0.1 to use the Twig template renderer", - "zendframework/zend-expressive-zendviewrenderer": "^0.1 to use the zend-view PhpRenderer template renderer" + "zendframework/zend-expressive-platesrenderer": "^2.0 to use the Plates template renderer", + "zendframework/zend-expressive-twigrenderer": "^2.0 to use the Twig template renderer", + "zendframework/zend-expressive-zendviewrenderer": "^2.0 to use the zend-view PhpRenderer template renderer" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev", - "dev-develop": "1.1-dev" + "dev-master": "2.0.x-dev", + "dev-develop": "2.1.x-dev" } }, "autoload": { @@ -2937,23 +3441,80 @@ ], "description": "Template subcomponent for Expressive", "keywords": [ + "ZendFramework", "expressive", - "template" + "template", + "zend-expressive", + "zf" ], - "time": "2017-01-11T18:42:34+00:00" + "time": "2018-03-15T15:42:46+00:00" }, { - "name": "zendframework/zend-hydrator", - "version": "2.3.1", + "name": "zendframework/zend-httphandlerrunner", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/zendframework/zend-hydrator.git", - "reference": "de0d6465fbc4b7ca345fddc148834c321c4b361f" + "url": "https://github.com/zendframework/zend-httphandlerrunner.git", + "reference": "5e4c1e82a8bb1585020eafd32c49ece5a6ee98df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-hydrator/zipball/de0d6465fbc4b7ca345fddc148834c321c4b361f", - "reference": "de0d6465fbc4b7ca345fddc148834c321c4b361f", + "url": "https://api.github.com/repos/zendframework/zend-httphandlerrunner/zipball/5e4c1e82a8bb1585020eafd32c49ece5a6ee98df", + "reference": "5e4c1e82a8bb1585020eafd32c49ece5a6ee98df", + "shasum": "" + }, + "require": { + "php": "^7.1", + "psr/http-message": "^1.0", + "psr/http-message-implementation": "^1.0", + "psr/http-server-handler": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.3", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-diactoros": "^1.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + }, + "zf": { + "config-provider": "Zend\\HttpHandlerRunner\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Zend\\HttpHandlerRunner\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Execute PSR-15 RequestHandlerInterface instances and emit responses they generate.", + "keywords": [ + "ZendFramework", + "components", + "expressive", + "psr-15", + "psr-7", + "zf" + ], + "time": "2018-02-21T20:33:02+00:00" + }, + { + "name": "zendframework/zend-hydrator", + "version": "2.4.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-hydrator.git", + "reference": "bd48bc3bc046df007a94125f868dd1aa1b73a813" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-hydrator/zipball/bd48bc3bc046df007a94125f868dd1aa1b73a813", + "reference": "bd48bc3bc046df007a94125f868dd1aa1b73a813", "shasum": "" }, "require": { @@ -2961,9 +3522,9 @@ "zendframework/zend-stdlib": "^3.0" }, "require-dev": { - "phpunit/phpunit": "^5.7.21 || ^6.3", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", "zendframework/zend-coding-standard": "~1.0.0", - "zendframework/zend-eventmanager": "^3.0", + "zendframework/zend-eventmanager": "^2.6.2 || ^3.0", "zendframework/zend-filter": "^2.6", "zendframework/zend-inputfilter": "^2.6", "zendframework/zend-serializer": "^2.6.1", @@ -2978,10 +3539,10 @@ "type": "library", "extra": { "branch-alias": { - "dev-release-1.0": "1.0-dev", - "dev-release-1.1": "1.1-dev", - "dev-master": "2.3-dev", - "dev-develop": "2.4-dev" + "dev-release-1.0": "1.0.x-dev", + "dev-release-1.1": "1.1.x-dev", + "dev-master": "2.4.x-dev", + "dev-develop": "2.5.x-dev" }, "zf": { "component": "Zend\\Hydrator", @@ -2997,12 +3558,13 @@ "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-hydrator", + "description": "Serialize objects to arrays, and vice versa", "keywords": [ + "ZendFramework", "hydrator", - "zf2" + "zf" ], - "time": "2017-10-02T15:01:27+00:00" + "time": "2018-04-30T21:22:14+00:00" }, { "name": "zendframework/zend-json", @@ -3056,30 +3618,30 @@ }, { "name": "zendframework/zend-loader", - "version": "2.5.1", + "version": "2.6.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-loader.git", - "reference": "c5fd2f071bde071f4363def7dea8dec7393e135c" + "reference": "78f11749ea340f6ca316bca5958eef80b38f9b6c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-loader/zipball/c5fd2f071bde071f4363def7dea8dec7393e135c", - "reference": "c5fd2f071bde071f4363def7dea8dec7393e135c", + "url": "https://api.github.com/repos/zendframework/zend-loader/zipball/78f11749ea340f6ca316bca5958eef80b38f9b6c", + "reference": "78f11749ea340f6ca316bca5958eef80b38f9b6c", "shasum": "" }, "require": { - "php": ">=5.3.23" + "php": "^5.6 || ^7.0" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.4", + "zendframework/zend-coding-standard": "~1.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" + "dev-master": "2.6.x-dev", + "dev-develop": "2.7.x-dev" } }, "autoload": { @@ -3091,52 +3653,53 @@ "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-loader", + "description": "Autoloading and plugin loading strategies", "keywords": [ + "ZendFramework", "loader", - "zf2" + "zf" ], - "time": "2015-06-03T14:05:47+00:00" + "time": "2018-04-30T15:20:54+00:00" }, { "name": "zendframework/zend-mail", - "version": "2.8.0", + "version": "2.10.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-mail.git", - "reference": "248230940ab1453b2a532a8fde76c5a6470d7aad" + "reference": "d7beb63d5f7144a21ac100072c453e63860cdab8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-mail/zipball/248230940ab1453b2a532a8fde76c5a6470d7aad", - "reference": "248230940ab1453b2a532a8fde76c5a6470d7aad", + "url": "https://api.github.com/repos/zendframework/zend-mail/zipball/d7beb63d5f7144a21ac100072c453e63860cdab8", + "reference": "d7beb63d5f7144a21ac100072c453e63860cdab8", "shasum": "" }, "require": { "ext-iconv": "*", - "php": "^7.0 || ^5.6", + "php": "^5.6 || ^7.0", + "true/punycode": "^2.1", "zendframework/zend-loader": "^2.5", "zendframework/zend-mime": "^2.5", "zendframework/zend-stdlib": "^2.7 || ^3.0", - "zendframework/zend-validator": "^2.6" + "zendframework/zend-validator": "^2.10.2" }, "require-dev": { - "phpunit/phpunit": "^6.0.8 || ^5.7.15", + "phpunit/phpunit": "^5.7.25 || ^6.4.4 || ^7.1.4", "zendframework/zend-coding-standard": "~1.0.0", "zendframework/zend-config": "^2.6", - "zendframework/zend-crypt": "^2.6", - "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3" + "zendframework/zend-crypt": "^2.6 || ^3.0", + "zendframework/zend-servicemanager": "^2.7.10 || ^3.3.1" }, "suggest": { - "ext-intl": "Handle IDN in AddressList hostnames", "zendframework/zend-crypt": "Crammd5 support in SMTP Auth", - "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3 when using SMTP to deliver messages" + "zendframework/zend-servicemanager": "^2.7.10 || ^3.3.1 when using SMTP to deliver messages" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev", - "dev-develop": "2.9-dev" + "dev-master": "2.10.x-dev", + "dev-develop": "2.11.x-dev" }, "zf": { "component": "Zend\\Mail", @@ -3152,36 +3715,36 @@ "license": [ "BSD-3-Clause" ], - "description": "provides generalized functionality to compose and send both text and MIME-compliant multipart e-mail messages", - "homepage": "https://github.com/zendframework/zend-mail", + "description": "Provides generalized functionality to compose and send both text and MIME-compliant multipart e-mail messages", "keywords": [ + "ZendFramework", "mail", - "zf2" + "zf" ], - "time": "2017-06-08T20:03:58+00:00" + "time": "2018-06-07T13:37:07+00:00" }, { "name": "zendframework/zend-math", - "version": "3.0.0", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-math.git", - "reference": "fda3b4e6c3bb15c35adc6db38b2eacabaa243e65" + "reference": "0aa5ec1b3132dd7d749d4673d7bdc7ab6b2d202a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-math/zipball/fda3b4e6c3bb15c35adc6db38b2eacabaa243e65", - "reference": "fda3b4e6c3bb15c35adc6db38b2eacabaa243e65", + "url": "https://api.github.com/repos/zendframework/zend-math/zipball/0aa5ec1b3132dd7d749d4673d7bdc7ab6b2d202a", + "reference": "0aa5ec1b3132dd7d749d4673d7bdc7ab6b2d202a", "shasum": "" }, "require": { "ext-mbstring": "*", - "paragonie/random_compat": "^2.0.2", - "php": "^5.5 || ^7.0" + "paragonie/random_compat": "^2.0.11", + "php": "^5.6 || ^7.0" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0" }, "suggest": { "ext-bcmath": "If using the bcmath functionality", @@ -3190,8 +3753,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev", - "dev-develop": "3.1-dev" + "dev-master": "3.1.x-dev", + "dev-develop": "3.2.x-dev" } }, "autoload": { @@ -3203,34 +3766,35 @@ "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-math", + "description": "Create cryptographically secure pseudo-random numbers, and manage big integers", "keywords": [ + "ZendFramework", "math", - "zf2" + "zf" ], - "time": "2016-04-28T17:37:42+00:00" + "time": "2018-07-10T19:00:33+00:00" }, { "name": "zendframework/zend-memory", - "version": "2.5.2", + "version": "2.6.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-memory.git", - "reference": "bbf8b9509660b2a97f2d6ccfefabffac3cca6a5c" + "reference": "a01d5eb74012c2a170e1ea1e18486152d2eea5f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-memory/zipball/bbf8b9509660b2a97f2d6ccfefabffac3cca6a5c", - "reference": "bbf8b9509660b2a97f2d6ccfefabffac3cca6a5c", + "url": "https://api.github.com/repos/zendframework/zend-memory/zipball/a01d5eb74012c2a170e1ea1e18486152d2eea5f7", + "reference": "a01d5eb74012c2a170e1ea1e18486152d2eea5f7", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0" + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8", - "squizlabs/php_codesniffer": "^2.3.1", - "zendframework/zend-cache": "^2.7" + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.4", + "zendframework/zend-cache": "^2.7", + "zendframework/zend-coding-standard": "~1.0.0" }, "suggest": { "zendframework/zend-cache": "To support swapping memory objects into and out of non-memory cache storage" @@ -3238,8 +3802,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" + "dev-master": "2.6.x-dev", + "dev-develop": "2.7.x-dev" } }, "autoload": { @@ -3251,25 +3815,26 @@ "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-memory", + "description": "Manage data in an environment with limited memory", "keywords": [ + "ZendFramework", "memory", - "zf2" + "zf" ], - "time": "2016-05-11T14:49:42+00:00" + "time": "2018-04-30T15:45:17+00:00" }, { "name": "zendframework/zend-mime", - "version": "2.7.0", + "version": "2.7.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-mime.git", - "reference": "5db38e92f8a6c7c5e25c8afce6e2d0bd49340c5f" + "reference": "52ae5fa9f12845cae749271034a2d594f0e4c6f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-mime/zipball/5db38e92f8a6c7c5e25c8afce6e2d0bd49340c5f", - "reference": "5db38e92f8a6c7c5e25c8afce6e2d0bd49340c5f", + "url": "https://api.github.com/repos/zendframework/zend-mime/zipball/52ae5fa9f12845cae749271034a2d594f0e4c6f2", + "reference": "52ae5fa9f12845cae749271034a2d594f0e4c6f2", "shasum": "" }, "require": { @@ -3307,34 +3872,34 @@ "mime", "zf" ], - "time": "2017-11-28T15:02:22+00:00" + "time": "2018-05-14T19:02:50+00:00" }, { "name": "zendframework/zend-permissions-rbac", - "version": "2.6.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-permissions-rbac.git", - "reference": "c10ad55e50f402bf14eb2eb9bc424dd9a44dfc78" + "reference": "c63260476ba762b96392e3b36d799bff24056b32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-permissions-rbac/zipball/c10ad55e50f402bf14eb2eb9bc424dd9a44dfc78", - "reference": "c10ad55e50f402bf14eb2eb9bc424dd9a44dfc78", + "url": "https://api.github.com/repos/zendframework/zend-permissions-rbac/zipball/c63260476ba762b96392e3b36d799bff24056b32", + "reference": "c63260476ba762b96392e3b36d799bff24056b32", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^5.7.15|| ^6.2.1", + "phpunit/phpunit": "^7.0.1", "zendframework/zend-coding-standard": "~1.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6-dev", - "dev-develop": "2.7-dev" + "dev-master": "3.0.x-dev", + "dev-develop": "3.1.x-dev" } }, "autoload": { @@ -3346,13 +3911,15 @@ "license": [ "BSD-3-Clause" ], - "description": "provides a role-based access control management", + "description": "Provides a role-based access control management", "homepage": "https://github.com/zendframework/zend-permissions-rbac", "keywords": [ + "ZendFramework", + "authorization", "rbac", - "zf2" + "zend-permssions-rbac" ], - "time": "2018-02-01T09:55:50+00:00" + "time": "2018-08-20T10:42:55+00:00" }, { "name": "zendframework/zend-servicemanager", @@ -3424,31 +3991,31 @@ }, { "name": "zendframework/zend-stdlib", - "version": "3.1.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-stdlib.git", - "reference": "debedcfc373a293f9250cc9aa03cf121428c8e78" + "reference": "66536006722aff9e62d1b331025089b7ec71c065" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/debedcfc373a293f9250cc9aa03cf121428c8e78", - "reference": "debedcfc373a293f9250cc9aa03cf121428c8e78", + "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/66536006722aff9e62d1b331025089b7ec71c065", + "reference": "66536006722aff9e62d1b331025089b7ec71c065", "shasum": "" }, "require": { "php": "^5.6 || ^7.0" }, "require-dev": { - "athletic/athletic": "~0.1", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "^2.6.2" + "phpbench/phpbench": "^0.13", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev", - "dev-develop": "3.2-dev" + "dev-master": "3.2.x-dev", + "dev-develop": "3.3.x-dev" } }, "autoload": { @@ -3460,38 +4027,43 @@ "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-stdlib", + "description": "SPL extensions, array utilities, error handlers, and more", "keywords": [ + "ZendFramework", "stdlib", - "zf2" + "zf" ], - "time": "2016-09-13T14:38:50+00:00" + "time": "2018-08-28T21:34:05+00:00" }, { "name": "zendframework/zend-stratigility", - "version": "2.1.2", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/zendframework/zend-stratigility.git", - "reference": "7dfec8dee92dad0d01e68365015f2848c250fe9f" + "reference": "75b64558201807514734a9f46386816f2900d7f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-stratigility/zipball/7dfec8dee92dad0d01e68365015f2848c250fe9f", - "reference": "7dfec8dee92dad0d01e68365015f2848c250fe9f", + "url": "https://api.github.com/repos/zendframework/zend-stratigility/zipball/75b64558201807514734a9f46386816f2900d7f7", + "reference": "75b64558201807514734a9f46386816f2900d7f7", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0", + "fig/http-message-util": "^1.1", + "php": "^7.1", "psr/http-message": "^1.0", - "webimpress/http-middleware-compatibility": "^0.1.3", + "psr/http-server-middleware": "^1.0", "zendframework/zend-escaper": "^2.3" }, + "conflict": { + "zendframework/zend-diactoros": "<1.7.1" + }, "require-dev": { - "malukenho/docheader": "^0.1.5", - "phpunit/phpunit": "^6.0.8 || ^5.7.15", + "malukenho/docheader": "^0.1.6", + "phpunit/phpunit": "^7.0.1", "zendframework/zend-coding-standard": "~1.0.0", - "zendframework/zend-diactoros": "^1.0" + "zendframework/zend-diactoros": "^1.7.1" }, "suggest": { "psr/http-message-implementation": "Please install a psr/http-message-implementation to consume Stratigility; e.g., zendframework/zend-diactoros" @@ -3499,11 +4071,17 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1.0-dev", - "dev-develop": "2.2.0-dev" + "dev-master": "3.0.x-dev", + "dev-develop": "3.1.x-dev" } }, "autoload": { + "files": [ + "src/functions/double-pass-middleware.php", + "src/functions/host.php", + "src/functions/middleware.php", + "src/functions/path.php" + ], "psr-4": { "Zend\\Stratigility\\": "src/" } @@ -3512,14 +4090,16 @@ "license": [ "BSD-3-Clause" ], - "description": "Middleware for PHP", - "homepage": "https://github.com/zendframework/zend-stratigility", + "description": "PSR-7 middleware foundation for building and dispatching middleware pipelines", "keywords": [ + "ZendFramework", "http", "middleware", - "psr-7" + "psr-15", + "psr-7", + "zf" ], - "time": "2017-10-12T13:14:14+00:00" + "time": "2018-07-24T20:39:18+00:00" }, { "name": "zendframework/zend-validator", @@ -3639,16 +4219,16 @@ "packages-dev": [ { "name": "filp/whoops", - "version": "2.1.14", + "version": "2.3.1", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "c6081b8838686aa04f1e83ba7e91f78b7b2a23e6" + "reference": "bc0fd11bc455cc20ee4b5edabc63ebbf859324c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/c6081b8838686aa04f1e83ba7e91f78b7b2a23e6", - "reference": "c6081b8838686aa04f1e83ba7e91f78b7b2a23e6", + "url": "https://api.github.com/repos/filp/whoops/zipball/bc0fd11bc455cc20ee4b5edabc63ebbf859324c7", + "reference": "bc0fd11bc455cc20ee4b5edabc63ebbf859324c7", "shasum": "" }, "require": { @@ -3656,9 +4236,9 @@ "psr/log": "^1.0.1" }, "require-dev": { - "mockery/mockery": "0.9.*", + "mockery/mockery": "^0.9 || ^1.0", "phpunit/phpunit": "^4.8.35 || ^5.7", - "symfony/var-dumper": "^2.6 || ^3.0" + "symfony/var-dumper": "^2.6 || ^3.0 || ^4.0" }, "suggest": { "symfony/var-dumper": "Pretty print complex values better with var-dumper available", @@ -3667,7 +4247,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "2.2-dev" } }, "autoload": { @@ -3696,29 +4276,32 @@ "throwable", "whoops" ], - "time": "2017-11-23T18:22:44+00:00" + "time": "2018-10-23T09:00:00+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.7.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", "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": { @@ -3741,26 +4324,75 @@ "object", "object graph" ], - "time": "2017-10-19T19:58:43+00:00" + "time": "2018-06-11T23:09:50+00:00" }, { - "name": "phar-io/manifest", - "version": "1.0.1", + "name": "ocramius/package-versions", + "version": "1.3.0", "source": { "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + "url": "https://github.com/Ocramius/PackageVersions.git", + "reference": "4489d5002c49d55576fa0ba786f42dbb009be46f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/4489d5002c49d55576fa0ba786f42dbb009be46f", + "reference": "4489d5002c49d55576fa0ba786f42dbb009be46f", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": "^7.1.0" + }, + "require-dev": { + "composer/composer": "^1.6.3", + "ext-zip": "*", + "infection/infection": "^0.7.1", + "phpunit/phpunit": "^7.0.0" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "time": "2018-02-05T13:05:30+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", "shasum": "" }, "require": { "ext-dom": "*", "ext-phar": "*", - "phar-io/version": "^1.0.1", + "phar-io/version": "^2.0", "php": "^5.6 || ^7.0" }, "type": "library", @@ -3796,20 +4428,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": { @@ -3843,7 +4475,7 @@ } ], "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", @@ -3999,33 +4631,33 @@ }, { "name": "phpspec/prophecy", - "version": "1.7.3", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf" + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", - "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "1.8.x-dev" } }, "autoload": { @@ -4058,44 +4690,44 @@ "spy", "stub" ], - "time": "2017-11-24T13:59:53+00:00" + "time": "2018-08-05T17:53:17+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "5.3.0", + "version": "6.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1" + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/661f34d0bd3f1a7225ef491a70a020ad23a057a1", - "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1", + "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": { @@ -4121,29 +4753,32 @@ "testing", "xunit" ], - "time": "2017-12-06T09:29:45+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": { @@ -4158,7 +4793,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -4168,7 +4803,7 @@ "filesystem", "iterator" ], - "time": "2017-11-27T13:52:08+00:00" + "time": "2018-09-13T20:33:42+00:00" }, { "name": "phpunit/php-text-template", @@ -4213,28 +4848,28 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.9", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f" }, "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/8b8454ea6958c3dee38453d3bd571e023108c91f", + "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f", "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.0-dev" } }, "autoload": { @@ -4249,7 +4884,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -4258,33 +4893,33 @@ "keywords": [ "timer" ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2018-02-01T13:07:23+00:00" }, { "name": "phpunit/php-token-stream", - "version": "2.0.2", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "791198a2c6254db10131eecfe8c06670700904db" + "reference": "c99e3be9d3e85f60646f152f9002d46ed7770d18" }, "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/c99e3be9d3e85f60646f152f9002d46ed7770d18", + "reference": "c99e3be9d3e85f60646f152f9002d46ed7770d18", "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.0-dev" } }, "autoload": { @@ -4307,57 +4942,57 @@ "keywords": [ "tokenizer" ], - "time": "2017-11-27T05:48:46+00:00" + "time": "2018-10-30T05:52:18+00:00" }, { "name": "phpunit/phpunit", - "version": "6.5.6", + "version": "7.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "3330ef26ade05359d006041316ed0fa9e8e3cefe" + "reference": "c151651fb6ed264038d486ea262e243af72e5e64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3330ef26ade05359d006041316ed0fa9e8e3cefe", - "reference": "3330ef26ade05359d006041316ed0fa9e8e3cefe", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c151651fb6ed264038d486ea262e243af72e5e64", + "reference": "c151651fb6ed264038d486ea262e243af72e5e64", "shasum": "" }, "require": { + "doctrine/instantiator": "^1.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "^1.6.1", - "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.3", - "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-code-coverage": "^6.0.7", + "phpunit/php-file-iterator": "^2.0.1", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^1.0.9", - "phpunit/phpunit-mock-objects": "^5.0.5", - "sebastian/comparator": "^2.1", - "sebastian/diff": "^2.0", - "sebastian/environment": "^3.1", + "phpunit/php-timer": "^2.0", + "sebastian/comparator": "^3.0", + "sebastian/diff": "^3.0", + "sebastian/environment": "^3.1 || ^4.0", "sebastian/exporter": "^3.1", "sebastian/global-state": "^2.0", "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^1.0", + "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" @@ -4365,7 +5000,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.5.x-dev" + "dev-master": "7.4-dev" } }, "autoload": { @@ -4391,66 +5026,192 @@ "testing", "xunit" ], - "time": "2018-02-01T05:57:37+00:00" + "time": "2018-10-23T05:57:41+00:00" }, { - "name": "phpunit/phpunit-mock-objects", - "version": "5.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/33fd41a76e746b8fa96d00b49a23dadfa8334cdf", - "reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.5", - "php": "^7.0", - "phpunit/php-text-template": "^1.2.1", - "sebastian/exporter": "^3.1" - }, + "name": "roave/security-advisories", + "version": "dev-master", "conflict": { - "phpunit/phpunit": "<6.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.5" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] + "3f/pygmentize": "<1.2", + "adodb/adodb-php": "<5.20.12", + "alterphp/easyadmin-extension-bundle": ">=1.2,<1.2.11|>=1.3,<1.3.1", + "amphp/artax": "<1.0.6|>=2,<2.0.6", + "amphp/http": "<1.0.1", + "asymmetricrypt/asymmetricrypt": ">=0,<9.9.99", + "aws/aws-sdk-php": ">=3,<3.2.1", + "brightlocal/phpwhois": "<=4.2.5", + "bugsnag/bugsnag-laravel": ">=2,<2.0.2", + "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.0.15|>=3.1,<3.1.4|>=3.4,<3.4.14|>=3.5,<3.5.17|>=3.6,<3.6.4", + "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", + "cartalyst/sentry": "<=2.1.6", + "codeigniter/framework": "<=3.0.6", + "composer/composer": "<=1.0.0-alpha11", + "contao-components/mediaelement": ">=2.14.2,<2.21.1", + "contao/core": ">=2,<3.5.35", + "contao/core-bundle": ">=4,<4.4.18|>=4.5,<4.5.8", + "contao/listing-bundle": ">=4,<4.4.8", + "contao/newsletter-bundle": ">=4,<4.1", + "david-garcia/phpwhois": "<=4.3.1", + "doctrine/annotations": ">=1,<1.2.7", + "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", + "doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1", + "doctrine/dbal": ">=2,<2.0.8|>=2.1,<2.1.2", + "doctrine/doctrine-bundle": "<1.5.2", + "doctrine/doctrine-module": "<=0.7.1", + "doctrine/mongodb-odm": ">=1,<1.0.2", + "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", + "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", + "dompdf/dompdf": ">=0.6,<0.6.2", + "drupal/core": ">=7,<7.60|>=8,<8.5.8|>=8.6,<8.6.2", + "drupal/drupal": ">=7,<7.60|>=8,<8.5.8|>=8.6,<8.6.2", + "erusev/parsedown": "<1.7", + "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.5|>=5.4,<5.4.12.2|>=2017.8,<2017.8.1.1|>=2017.12,<2017.12.4.2|>=2018.6,<2018.6.1.3|>=2018.9,<2018.9.1.2", + "ezyang/htmlpurifier": "<4.1.1", + "firebase/php-jwt": "<2", + "fooman/tcpdf": "<6.2.22", + "fossar/tcpdf-parser": "<6.2.22", + "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", + "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", + "fuel/core": "<1.8.1", + "gree/jose": "<=2.2", + "gregwar/rst": "<1.0.3", + "guzzlehttp/guzzle": ">=6,<6.2.1|>=4.0.0-rc2,<4.2.4|>=5,<5.3.1", + "illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10", + "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30", + "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29", + "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", + "ivankristianto/phpwhois": "<=4.3", + "james-heinrich/getid3": "<1.9.9", + "joomla/session": "<1.3.1", + "jsmitty12/phpwhois": "<5.1", + "kazist/phpwhois": "<=4.2.6", + "kreait/firebase-php": ">=3.2,<3.8.1", + "la-haute-societe/tcpdf": "<6.2.22", + "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30", + "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", + "magento/magento1ce": "<1.9.3.9", + "magento/magento1ee": ">=1.9,<1.14.3.2", + "magento/product-community-edition": ">=2,<2.2.6", + "monolog/monolog": ">=1.8,<1.12", + "namshi/jose": "<2.2", + "onelogin/php-saml": "<2.10.4", + "openid/php-openid": "<2.3", + "oro/crm": ">=1.7,<1.7.4", + "oro/platform": ">=1.7,<1.7.4", + "padraic/humbug_get_contents": "<1.1.2", + "pagarme/pagarme-php": ">=0,<3", + "paragonie/random_compat": "<2", + "paypal/merchant-sdk-php": "<3.12", + "phpmailer/phpmailer": ">=5,<5.2.24", + "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3", + "phpwhois/phpwhois": "<=4.2.5", + "phpxmlrpc/extras": "<0.6.1", + "propel/propel": ">=2.0.0-alpha1,<=2.0.0-alpha7", + "propel/propel1": ">=1,<=1.7.1", + "pusher/pusher-php-server": "<2.2.1", + "robrichards/xmlseclibs": ">=1,<3.0.2", + "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", + "sensiolabs/connect": "<4.2.3", + "serluck/phpwhois": "<=4.2.6", + "shopware/shopware": "<5.3.7", + "silverstripe/cms": ">=3,<=3.0.11|>=3.1,<3.1.11", + "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", + "silverstripe/framework": ">=3,<3.3", + "silverstripe/userforms": "<3", + "simple-updates/phpwhois": "<=1", + "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4", + "simplesamlphp/simplesamlphp": "<1.15.2", + "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", + "slim/slim": "<2.6", + "smarty/smarty": "<3.1.33", + "socalnick/scn-social-auth": "<1.15.2", + "spoonity/tcpdf": "<6.2.22", + "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1", + "stormpath/sdk": ">=0,<9.9.99", + "swiftmailer/swiftmailer": ">=4,<5.4.5", + "sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", + "sylius/sylius": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", + "symfony/dependency-injection": ">=2,<2.0.17", + "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2", + "symfony/http-foundation": ">=2,<2.7.49|>=2.8,<2.8.44|>=3,<3.3.18|>=3.4,<3.4.14|>=4,<4.0.14|>=4.1,<4.1.3", + "symfony/http-kernel": ">=2,<2.3.29|>=2.4,<2.5.12|>=2.6,<2.6.8", + "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/polyfill": ">=1,<1.10", + "symfony/polyfill-php55": ">=1,<1.10", + "symfony/routing": ">=2,<2.0.19", + "symfony/security": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", + "symfony/security-bundle": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", + "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<2.8.37|>=3,<3.3.17|>=3.4,<3.4.7|>=4,<4.0.7", + "symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", + "symfony/security-guard": ">=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", + "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", + "symfony/serializer": ">=2,<2.0.11", + "symfony/symfony": ">=2,<2.7.49|>=2.8,<2.8.44|>=3,<3.3.18|>=3.4,<3.4.14|>=4,<4.0.14|>=4.1,<4.1.3", + "symfony/translation": ">=2,<2.0.17", + "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", + "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", + "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", + "tecnickcom/tcpdf": "<6.2.22", + "thelia/backoffice-default-template": ">=2.1,<2.1.2", + "thelia/thelia": ">=2.1.0-beta1,<2.1.3|>=2.1,<2.1.2", + "theonedemon/phpwhois": "<=4.2.5", + "titon/framework": ">=0,<9.9.99", + "truckersmp/phpwhois": "<=4.3.1", + "twig/twig": "<1.20", + "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.30|>=8,<8.7.17|>=9,<9.3.2", + "typo3/cms-core": ">=8,<8.7.17|>=9,<9.3.2", + "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", + "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", + "wallabag/tcpdf": "<6.2.22", + "willdurand/js-translation-bundle": "<2.1.1", + "yiisoft/yii": ">=1.1.14,<1.1.15", + "yiisoft/yii2": "<2.0.15", + "yiisoft/yii2-bootstrap": "<2.0.4", + "yiisoft/yii2-dev": "<2.0.15", + "yiisoft/yii2-elasticsearch": "<2.0.5", + "yiisoft/yii2-gii": "<2.0.4", + "yiisoft/yii2-jui": "<2.0.4", + "yiisoft/yii2-redis": "<2.0.8", + "zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3", + "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2", + "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2", + "zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5", + "zendframework/zend-diactoros": ">=1,<1.8.4", + "zendframework/zend-feed": ">=1,<2.10.3", + "zendframework/zend-form": ">=2,<2.2.7|>=2.3,<2.3.1", + "zendframework/zend-http": ">=1,<2.8.1", + "zendframework/zend-json": ">=2.1,<2.1.6|>=2.2,<2.2.6", + "zendframework/zend-ldap": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.8|>=2.3,<2.3.3", + "zendframework/zend-mail": ">=2,<2.4.11|>=2.5,<2.7.2", + "zendframework/zend-navigation": ">=2,<2.2.7|>=2.3,<2.3.1", + "zendframework/zend-session": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.9|>=2.3,<2.3.4", + "zendframework/zend-validator": ">=2.3,<2.3.6", + "zendframework/zend-view": ">=2,<2.2.7|>=2.3,<2.3.1", + "zendframework/zend-xmlrpc": ">=2.1,<2.1.6|>=2.2,<2.2.6", + "zendframework/zendframework": "<2.5.1", + "zendframework/zendframework1": "<1.12.20", + "zendframework/zendopenid": ">=2,<2.0.2", + "zendframework/zendxml": ">=1,<1.0.1", + "zetacomponents/mail": "<1.8.2", + "zf-commons/zfc-user": "<1.2.2", + "zfcampus/zf-apigility-doctrine": ">=1,<1.0.3", + "zfr/zfr-oauth2-server-module": "<0.1.2" }, + "type": "metapackage", "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "role": "maintainer" } ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2018-01-06T05:45:45+00:00" + "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", + "time": "2018-11-01T18:39:28+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -4499,30 +5260,30 @@ }, { "name": "sebastian/comparator", - "version": "2.1.3", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/diff": "^2.0 || ^3.0", + "php": "^7.1", + "sebastian/diff": "^3.0", "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "^6.4" + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -4559,32 +5320,33 @@ "compare", "equality" ], - "time": "2018-02-01T13:46:46+00:00" + "time": "2018-07-12T15:12:46+00:00" }, { "name": "sebastian/diff", - "version": "2.0.1", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" + "reference": "366541b989927187c4ca70490a35615d3fef2dce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/366541b989927187c4ca70490a35615d3fef2dce", + "reference": "366541b989927187c4ca70490a35615d3fef2dce", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.2" + "phpunit/phpunit": "^7.0", + "symfony/process": "^2 || ^3.3 || ^4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -4609,9 +5371,12 @@ "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "diff" + "diff", + "udiff", + "unidiff", + "unified diff" ], - "time": "2017-08-03T08:09:46+00:00" + "time": "2018-06-10T07:54:39+00:00" }, { "name": "sebastian/environment", @@ -4928,25 +5693,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": { @@ -4966,7 +5731,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", @@ -5013,16 +5778,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "2.9.1", + "version": "2.9.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" + "reference": "2acf168de78487db620ab4bc524135a13cfe6745" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", - "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745", "shasum": "" }, "require": { @@ -5087,7 +5852,7 @@ "phpcs", "standards" ], - "time": "2017-05-22T02:43:20+00:00" + "time": "2018-11-07T22:31:41+00:00" }, { "name": "theseer/tokenizer", @@ -5180,26 +5945,199 @@ "time": "2018-01-29T19:49:41+00:00" }, { - "name": "zfcampus/zf-development-mode", - "version": "3.1.0", + "name": "zendframework/zend-code", + "version": "3.3.1", "source": { "type": "git", - "url": "https://github.com/zfcampus/zf-development-mode.git", - "reference": "ffef6ab8cf84ee1d1a77a2b51ba2240d2707c05d" + "url": "https://github.com/zendframework/zend-code.git", + "reference": "c21db169075c6ec4b342149f446e7b7b724f95eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zfcampus/zf-development-mode/zipball/ffef6ab8cf84ee1d1a77a2b51ba2240d2707c05d", - "reference": "ffef6ab8cf84ee1d1a77a2b51ba2240d2707c05d", + "url": "https://api.github.com/repos/zendframework/zend-code/zipball/c21db169075c6ec4b342149f446e7b7b724f95eb", + "reference": "c21db169075c6ec4b342149f446e7b7b724f95eb", + "shasum": "" + }, + "require": { + "php": "^7.1", + "zendframework/zend-eventmanager": "^2.6 || ^3.0" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "ext-phar": "*", + "phpunit/phpunit": "^6.2.3", + "zendframework/zend-coding-standard": "^1.0.0", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "suggest": { + "doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features", + "zendframework/zend-stdlib": "Zend\\Stdlib component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3.x-dev", + "dev-develop": "3.4.x-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Code\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides facilities to generate arbitrary code using an object oriented interface", + "homepage": "https://github.com/zendframework/zend-code", + "keywords": [ + "code", + "zf2" + ], + "time": "2018-08-13T20:36:59+00:00" + }, + { + "name": "zendframework/zend-expressive-tooling", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-expressive-tooling.git", + "reference": "0e5b030961cd980323dd48965d13d5cb904b51de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-expressive-tooling/zipball/0e5b030961cd980323dd48965d13d5cb904b51de", + "reference": "0e5b030961cd980323dd48965d13d5cb904b51de", + "shasum": "" + }, + "require": { + "ocramius/package-versions": "^1.3", + "php": "^7.1", + "symfony/console": "^2.8 || ^3.0 || ^4.0", + "zendframework/zend-code": "^2.6.3 || ^3.3", + "zendframework/zend-component-installer": "^2.0", + "zendframework/zend-expressive": "^3.0", + "zendframework/zend-expressive-router": "^3.0", + "zendframework/zend-stdlib": "^3.1", + "zendframework/zend-stratigility": "^3.0", + "zfcampus/zf-composer-autoloading": "^2.0" + }, + "require-dev": { + "malukenho/docheader": "^0.1.6", + "mikey179/vfsstream": "^1.6.5", + "mockery/mockery": "^1.0", + "php-mock/php-mock-phpunit": "^2.1", + "phpunit/phpunit": "^7.0.3", + "zendframework/zend-coding-standard": "~1.0.0" + }, + "bin": [ + "bin/expressive" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev", + "dev-develop": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Expressive\\Tooling\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Migration and development tooling for Expressive", + "keywords": [ + "ZendFramework", + "http", + "middleware", + "psr", + "psr-7", + "zend-expressive", + "zf" + ], + "time": "2018-03-27T19:29:07+00:00" + }, + { + "name": "zfcampus/zf-composer-autoloading", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/zfcampus/zf-composer-autoloading.git", + "reference": "537145efec53c784ddc06f1af93102ddede52ceb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zfcampus/zf-composer-autoloading/zipball/537145efec53c784ddc06f1af93102ddede52ceb", + "reference": "537145efec53c784ddc06f1af93102ddede52ceb", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "zendframework/zend-stdlib": "^3.1" + }, + "require-dev": { + "mikey179/vfsstream": "^1.6.4", + "mockery/mockery": "^1.0", + "php-mock/php-mock-phpunit": "^1.1.2 || ^2.0", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.5", + "zendframework/zend-coding-standard": "~1.0.0" + }, + "bin": [ + "bin/zf-composer-autoloading" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1.x-dev", + "dev-develop": "2.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "ZF\\ComposerAutoloading\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Sets up Composer-based autoloading for your Zend Framework modules", + "homepage": "http://apigility.org/", + "keywords": [ + "ZendFramework", + "autoloading", + "console", + "framework", + "zf" + ], + "time": "2018-05-03T22:00:38+00:00" + }, + { + "name": "zfcampus/zf-development-mode", + "version": "3.2.0", + "source": { + "type": "git", + "url": "https://github.com/zfcampus/zf-development-mode.git", + "reference": "419004a320bab017d28f2bc5e7857dde7e19aecf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zfcampus/zf-development-mode/zipball/419004a320bab017d28f2bc5e7857dde7e19aecf", + "reference": "419004a320bab017d28f2bc5e7857dde7e19aecf", "shasum": "" }, "require": { "php": "^5.6 || ^7.0" }, "require-dev": { - "mikey179/vfsstream": "^1.6", - "phpunit/phpunit": "^5.4", - "squizlabs/php_codesniffer": "^2.3.1" + "mikey179/vfsstream": "^1.6.5", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.5", + "zendframework/zend-coding-standard": "~1.0.0" }, "bin": [ "bin/zf-development-mode" @@ -5207,8 +6145,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev", - "dev-develop": "3.2-dev" + "dev-master": "3.2.x-dev", + "dev-develop": "3.3.x-dev" } }, "autoload": { @@ -5221,12 +6159,12 @@ "BSD-3-Clause" ], "description": "Zend Framework development mode script", - "homepage": "http://github.com/zfcampus/zf-development-mode", "keywords": [ + "ZendFramework", "framework", - "zf2" + "zf" ], - "time": "2017-01-09T23:34:49+00:00" + "time": "2018-05-07T15:44:42+00:00" } ], "aliases": [], diff --git a/config/autoload/authx2.global.php b/config/autoload/authx2.global.php index 20f7863..53fbda1 100644 --- a/config/autoload/authx2.global.php +++ b/config/autoload/authx2.global.php @@ -7,6 +7,7 @@ return [ 'acl_config' => [ 'unguarded_routes' => [ + 'home', 'api.auth.login', 'api.ping', 'api.xlsx', diff --git a/config/autoload/cli.global.php b/config/autoload/cli.global.php index 9c5bba5..c2026ea 100644 --- a/config/autoload/cli.global.php +++ b/config/autoload/cli.global.php @@ -6,14 +6,14 @@ return [ 'factories' => [ App\Command\InitializeFixtureCommand::class => App\Command\InitializeFixtureCommandFactory::class, // App\Command\ConvertMaintenanceHashCommand::class => App\Command\ConvertMaintenanceHashCommandFactory::class, -// App\Command\MailTestCommand::class => App\Command\MailTestCommandFactory::class, +// App\Command\DebugMailCommand::class => App\Command\DebugMailCommandFactory::class, ], ], 'console' => [ 'commands' => [ App\Command\InitializeFixtureCommand::class, // App\Command\ConvertMaintenanceHashCommand::class, -// App\Command\MailTestCommand::class, +// App\Command\DebugMailCommand::class, ], ], ]; diff --git a/config/autoload/dependencies.global.php b/config/autoload/dependencies.global.php index 8f27cf2..c08e8f8 100644 --- a/config/autoload/dependencies.global.php +++ b/config/autoload/dependencies.global.php @@ -1,10 +1,6 @@ [ - 'Zend\Expressive\Delegate\DefaultDelegate' => Delegate\NotFoundDelegate::class, + // Fully\Qualified\ClassOrInterfaceName::class => Fully\Qualified\ClassName::class, ], // Use 'invokables' for constructor-less services, or services that do // not require arguments to the constructor. Map a service name to the // class name. 'invokables' => [ // Fully\Qualified\InterfaceName::class => Fully\Qualified\ClassName::class, - Helper\ServerUrlHelper::class => Helper\ServerUrlHelper::class, ], // Use 'factories' for services provided by callbacks/factory classes. 'factories' => [ - Application::class => Container\ApplicationFactory::class, - Delegate\NotFoundDelegate::class => Container\NotFoundDelegateFactory::class, - Helper\ServerUrlMiddleware::class => Helper\ServerUrlMiddlewareFactory::class, - Helper\UrlHelper::class => Helper\UrlHelperFactory::class, - Helper\UrlHelperMiddleware::class => Helper\UrlHelperMiddlewareFactory::class, - - Zend\Stratigility\Middleware\ErrorHandler::class => Container\ErrorHandlerFactory::class, - Middleware\ErrorResponseGenerator::class => Container\ErrorResponseGeneratorFactory::class, - Middleware\NotFoundHandler::class => Container\NotFoundHandlerFactory::class, - - Slim\Middleware\JwtAuthentication::class => App\Middleware\JwtAuthenticationFactory::class, - Tuupola\Middleware\Cors::class => App\Middleware\CorsMiddlewareFactory::class, + // Fully\Qualified\ClassName::class => Fully\Qualified\FactoryName::class, App\Middleware\RouteAuthorization::class => App\Middleware\RouteAuthorizationFactory::class, + Tuupola\Middleware\JwtAuthentication::class => App\Middleware\JwtAuthenticationFactory::class, ], ], ]; diff --git a/config/autoload/development.local.php.dist b/config/autoload/development.local.php.dist index 9c8aa17..99875e9 100644 --- a/config/autoload/development.local.php.dist +++ b/config/autoload/development.local.php.dist @@ -1,5 +1,4 @@ [ - 'factories' => [ - 'doctrine.entity_manager.orm_default' => ContainerInteropDoctrine\EntityManagerFactory::class, - 'doctrine.hydrator' => App\Hydrator\DoctrineObjectFactory::class, - ], - ], 'doctrine' => [ 'driver' => [ 'orm_default' => [ diff --git a/config/autoload/router.global.php b/config/autoload/router.global.php deleted file mode 100644 index 0505bee..0000000 --- a/config/autoload/router.global.php +++ /dev/null @@ -1,12 +0,0 @@ - [ - 'invokables' => [ - RouterInterface::class => FastRouteRouter::class, - ], - ], -]; diff --git a/config/autoload/zend-expressive.global.php b/config/autoload/zend-expressive.global.php index dd4acd1..7ae42e6 100644 --- a/config/autoload/zend-expressive.global.php +++ b/config/autoload/zend-expressive.global.php @@ -1,5 +1,7 @@ false, 'zend-expressive' => [ - // Enable programmatic pipeline: Any `middleware_pipeline` or `routes` - // configuration will be ignored when creating the `Application` instance. - 'programmatic_pipeline' => true, - // Provide templates for the error handling middleware to use when // generating responses. 'error_handler' => [ diff --git a/config/config.php b/config/config.php index d07c342..04c8410 100644 --- a/config/config.php +++ b/config/config.php @@ -1,5 +1,7 @@ getMergedConfig(); diff --git a/config/container.php b/config/container.php index e565faa..740fe23 100644 --- a/config/container.php +++ b/config/container.php @@ -1,16 +1,14 @@ configureServiceManager($container); - -// Inject config -$container->setService('config', $config); - -return $container; +return new ServiceManager($dependencies); diff --git a/config/development.config.php.dist b/config/development.config.php.dist index f9e594a..d17d6d6 100644 --- a/config/development.config.php.dist +++ b/config/development.config.php.dist @@ -1,5 +1,4 @@ pipe(ErrorHandler::class); + //$app->pipe(LosMiddleware\BasePath\BasePathMiddleware::class); + $app->pipe(ServerUrlMiddleware::class); -// The error handler should be the first (most outer) middleware to catch -// all Exceptions. -$app->pipe(Tuupola\Middleware\Cors::class); -$app->pipe(ErrorHandler::class); -$app->pipe(ServerUrlMiddleware::class); + // Pipe more middleware here that you want to execute on every request: + // - bootstrapping + // - pre-conditions + // - modifications to outgoing responses + // + // Piped Middleware may be either callables or service names. Middleware may + // also be passed as an array; each item in the array must resolve to + // middleware eventually (i.e., callable or service name). + // + // Middleware can be attached to specific paths, allowing you to mix and match + // applications under a common domain. The handlers in each middleware + // attached this way will see a URI with the matched path segment removed. + // + // i.e., path of "/api/member/profile" only passes "/member/profile" to $apiMiddleware + // - $app->pipe('/api', $apiMiddleware); + // - $app->pipe('/docs', $apiDocMiddleware); + // - $app->pipe('/files', $filesMiddleware); -// Pipe more middleware here that you want to execute on every request: -// - bootstrapping -// - pre-conditions -// - modifications to outgoing responses -// -// Piped Middleware may be either callables or service names. Middleware may -// also be passed as an array; each item in the array must resolve to -// middleware eventually (i.e., callable or service name). -// -// Middleware can be attached to specific paths, allowing you to mix and match -// applications under a common domain. The handlers in each middleware -// attached this way will see a URI with the MATCHED PATH SEGMENT REMOVED!!! -// -// - $app->pipe('/api', $apiMiddleware); -// - $app->pipe('/docs', $apiDocMiddleware); -// - $app->pipe('/files', $filesMiddleware); -// Register the routing middleware in the middleware pipeline -$app->pipeRoutingMiddleware(); -$app->pipe(ImplicitHeadMiddleware::class); -$app->pipe(ImplicitOptionsMiddleware::class); -$app->pipe(UrlHelperMiddleware::class); + // Register the routing middleware in the middleware pipeline. + // This middleware registers the Zend\Expressive\Router\RouteResult request attribute. + $app->pipe(RouteMiddleware::class); -// Add more middleware here that needs to introspect the routing results; this -// might include: -// -// - route-based authentication -// - route-based validation -// - etc. -$app->pipe(Slim\Middleware\JwtAuthentication::class); -$app->pipe(App\Middleware\RouteAuthorization::class); + // The following handle routing failures for common conditions: + // - HEAD request but no routes answer that method + // - OPTIONS request but no routes answer that method + // - method not allowed + // Order here matters; the MethodNotAllowedMiddleware should be placed + // after the Implicit*Middleware. + $app->pipe(ImplicitHeadMiddleware::class); + $app->pipe(CorsMiddleware::class); + $app->pipe(MethodNotAllowedMiddleware::class); -// Register the dispatch middleware in the middleware pipeline -$app->pipeDispatchMiddleware(); + // Seed the UrlHelper with the routing results: + $app->pipe(UrlHelperMiddleware::class); -// At this point, if no Response is return by any middleware, the -// NotFoundHandler kicks in; alternately, you can provide other fallback -// middleware to execute. -$app->pipe(NotFoundHandler::class); + // Add more middleware here that needs to introspect the routing results; this + // might include: + // + // - route-based authentication + // - route-based validation + // - etc. + + // Register the dispatch middleware in the middleware pipeline + $app->pipe(Tuupola\Middleware\JwtAuthentication::class); + $app->pipe(App\Middleware\RouteAuthorization::class); + $app->pipe(DispatchMiddleware::class); + + + // At this point, if no Response is returned by any middleware, the + // NotFoundHandler kicks in; alternately, you can provide other fallback + // middleware to execute. + $app->pipe(NotFoundHandler::class); +}; diff --git a/config/routes.php b/config/routes.php index 31fc92b..2d513cb 100644 --- a/config/routes.php +++ b/config/routes.php @@ -1,60 +1,72 @@ get('/', App\Action\HomePageAction::class, 'home'); - * $app->post('/album', App\Action\AlbumCreateAction::class, 'album.create'); - * $app->put('/album/:id', App\Action\AlbumUpdateAction::class, 'album.put'); - * $app->patch('/album/:id', App\Action\AlbumUpdateAction::class, 'album.patch'); - * $app->delete('/album/:id', App\Action\AlbumDeleteAction::class, 'album.delete'); + * $app->get('/', App\Handler\HomePageHandler::class, 'home'); + * $app->post('/album', App\Handler\AlbumCreateHandler::class, 'album.create'); + * $app->put('/album/:id', App\Handler\AlbumUpdateHandler::class, 'album.put'); + * $app->patch('/album/:id', App\Handler\AlbumUpdateHandler::class, 'album.patch'); + * $app->delete('/album/:id', App\Handler\AlbumDeleteHandler::class, 'album.delete'); * * Or with multiple request methods: * - * $app->route('/contact', App\Action\ContactAction::class, ['GET', 'POST', ...], 'contact'); + * $app->route('/contact', App\Handler\ContactHandler::class, ['GET', 'POST', ...], 'contact'); * * Or handling all request methods: * - * $app->route('/contact', App\Action\ContactAction::class)->setName('contact'); + * $app->route('/contact', App\Handler\ContactHandler::class)->setName('contact'); * * or: * * $app->route( * '/contact', - * App\Action\ContactAction::class, + * App\Handler\ContactHandler::class, * Zend\Expressive\Router\Route::HTTP_METHOD_ANY, * 'contact' * ); */ +return function ( + Application $app, + MiddlewareFactory $factory, + ContainerInterface $container +) : void { + $app->get('/', App\Handler\PingHandler::class, 'home'); + $app->get('/api/ping', App\Handler\PingHandler::class, 'api.ping'); -$app->get('/', App\Action\PingAction::class, 'home'); -$app->get('/api/ping', App\Action\PingAction::class, 'api.ping'); + $app->get('/api/maintenance/upcoming', App\Handler\MaintenanceUpcomingHandler::class, 'api.maintenance.upcoming'); + $app->route('/api/maintenance[/{id:\w+}]', App\Handler\MaintenanceHandler::class, ['GET', 'OPTIONS'], 'api.maintenance'); + $app->route('/api/maintenance/{id:\w+}', App\Handler\MaintenanceHandler::class, ['PUT'], 'api.maintenance.put'); -$app->get('/api/maintenance/upcoming', App\Action\MaintenanceUpcomingAction::class, 'api.maintenance.upcoming'); -$app->route('/api/maintenance[/{id:\w+}]', App\Action\MaintenanceAction::class, ['GET', 'OPTIONS'], 'api.maintenance'); -$app->route('/api/maintenance/{id:\w+}', App\Action\MaintenanceAction::class, ['PUT'], 'api.maintenance.put'); + // authentication and user management + $app->route('/api/auth/login', App\Handler\Auth\AuthHandler::class, ['POST', 'OPTIONS'], 'api.auth.login'); + $app->route('/api/auth/renew', App\Handler\Auth\AuthHandler::class, ['GET', 'OPTIONS'], 'api.auth.renew'); + $app->route('/api/user[/{id:\d+}]', App\Handler\User\UserHandler::class, ['GET', 'PUT', 'OPTIONS'], 'api.user.profile'); + $app->route('/api/user/password', App\Handler\User\PasswordHandler::class, ['POST', 'OPTIONS'], 'api.user.password'); -// authentication and user management -$app->route('/api/auth/login', App\Action\Auth\AuthAction::class, ['POST', 'OPTIONS'], 'api.auth.login'); -$app->route('/api/auth/renew', App\Action\Auth\AuthAction::class, ['GET', 'OPTIONS'], 'api.auth.renew'); -$app->route('/api/user[/{id:\d+}]', App\Action\User\UserAction::class, ['GET', 'PUT', 'OPTIONS'], 'api.user.profile'); -$app->route('/api/user/password', App\Action\User\PasswordAction::class, ['POST', 'OPTIONS'], 'api.user.password'); + // fault management + $app->route('/api/fault[/{id:\d+}]', App\Handler\Fault\FaultHandler::class, ['GET', 'OPTIONS'], 'api.fault.get'); // list/show + $app->post('/api/fault', App\Handler\Fault\FaultHandler::class, 'api.fault.post'); // create + $app->put('/api/fault/{id:\d+}', App\Handler\Fault\FaultHandler::class, 'api.fault.put'); // update + $app->delete('/api/fault/{id:\d+}', App\Handler\Fault\FaultHandler::class, 'api.fault.delete'); -// fault management -$app->route('/api/fault[/{id:\d+}]', App\Action\Fault\FaultAction::class, ['GET', 'OPTIONS'], 'api.fault.get'); // list/show -$app->post('/api/fault', App\Action\Fault\FaultAction::class, 'api.fault.post'); // create -$app->put('/api/fault/{id:\d+}', App\Action\Fault\FaultAction::class, 'api.fault.put'); // update -$app->delete('/api/fault/{id:\d+}', App\Action\Fault\FaultAction::class, 'api.fault.delete'); + $app->route('/api/fault-reject/{id:\d+}', App\Handler\Fault\FaultRejectHandler::class, ['POST', 'OPTIONS'], 'api.fault-reject.post'); + $app->route('/api/fault-comment/{id:\d+}', App\Handler\Fault\FaultCommentHandler::class, ['POST', 'OPTIONS'], 'api.fault-comment.post'); + $app->route('/api/fault-attachment/{id:\d+}/{type}', App\Handler\Fault\FaultAttachmentHandler::class, ['POST', 'OPTIONS'], 'api.fault-attachment.post'); + $app->route('/show-attachment/{id:\d+}', App\Handler\Fault\FaultAttachmentHandler::class, ['GET', 'OPTIONS'], 'show-attachment'); -$app->route('/api/fault-reject/{id:\d+}', App\Action\Fault\FaultRejectAction::class, ['POST', 'OPTIONS'], 'api.fault-reject.post'); -$app->route('/api/fault-comment/{id:\d+}', App\Action\Fault\FaultCommentAction::class, ['POST', 'OPTIONS'], 'api.fault-comment.post'); -$app->route('/api/fault-attachment/{id:\d+}/{type}', App\Action\Fault\FaultAttachmentAction::class, ['POST', 'OPTIONS'], 'api.fault-attachment.post'); -$app->route('/show-attachment/{id:\d+}', App\Action\Fault\FaultAttachmentAction::class, ['GET', 'OPTIONS'], 'show-attachment'); + $app->route('/hibajegy-pdf/{id:\d+}[/{filename}]', App\Handler\Pdf\GenerateWorksheetHandler::class, ['GET', 'OPTIONS'], 'hibajegy-pdf'); + $app->route('/karbantartasjegy-pdf/{id:\w+}[/{filename}]', App\Handler\Pdf\GenerateMaintenanceSheetHandler::class, ['GET', 'OPTIONS'], 'karbantartasjegy-pdf'); -$app->route('/hibajegy-pdf/{id:\d+}[/{filename}]', App\Action\Pdf\GenerateWorksheetAction::class, ['GET', 'OPTIONS'], 'hibajegy-pdf'); -$app->route('/karbantartasjegy-pdf/{id:\w+}[/{filename}]', App\Action\Pdf\GenerateMaintenanceSheetAction::class, ['GET', 'OPTIONS'], 'karbantartasjegy-pdf'); - -// core data -$app->route('/api/error-category', App\Action\ErrorCategoryAction::class, ['GET', 'OPTIONS'], 'api.error-category.get'); // list/show -$app->route('/api/error-origin', App\Action\ErrorOriginAction::class, ['GET', 'OPTIONS'], 'api.error-origin.get'); // list/show -$app->route('/api/facility-location', App\Action\FacilityLocationAction::class, ['GET', 'OPTIONS'], 'api.facility-location.get'); // list/show -$app->route('/api/solution-time-interval', App\Action\SolutionTimeIntervalAction::class, ['GET', 'OPTIONS'], 'api.solution-time-interval.get'); // list/show + // core data + $app->route('/api/error-category', App\Handler\ErrorCategoryHandler::class, ['GET', 'OPTIONS'], 'api.error-category.get'); // list/show + $app->route('/api/error-origin', App\Handler\ErrorOriginHandler::class, ['GET', 'OPTIONS'], 'api.error-origin.get'); // list/show + $app->route('/api/facility-location', App\Handler\FacilityLocationHandler::class, ['GET', 'OPTIONS'], 'api.facility-location.get'); // list/show + $app->route('/api/solution-time-interval', App\Handler\SolutionTimeIntervalHandler::class, ['GET', 'OPTIONS'], 'api.solution-time-interval.get'); // list/show +}; diff --git a/public/index.php b/public/index.php index 0fad61d..fd11502 100644 --- a/public/index.php +++ b/public/index.php @@ -1,9 +1,9 @@ get(\Zend\Expressive\Application::class); + $factory = $container->get(\Zend\Expressive\MiddlewareFactory::class); - // Import programmatic/declarative middleware pipeline and routing + // Execute programmatic/declarative middleware pipeline and routing // configuration statements - require 'config/pipeline.php'; - require 'config/routes.php'; + (require 'config/pipeline.php')($app, $factory, $container); + (require 'config/routes.php')($app, $factory, $container); $app->run(); -}); +})(); diff --git a/src/ApiLibs/AbstractHandler/CrudHandler.php b/src/ApiLibs/AbstractHandler/CrudHandler.php new file mode 100644 index 0000000..31b7ecc --- /dev/null +++ b/src/ApiLibs/AbstractHandler/CrudHandler.php @@ -0,0 +1,166 @@ +getMethod()); + $id = $request->getAttribute(static::IDENTIFIER_NAME); + + switch ($requestMethod) { + case 'GET': + return isset($id) + ? $this->get($request) + : $this->getList($request); + case 'POST': + return $this->create($request); + case 'PUT': + return $this->update($request); + case 'DELETE': + return isset($id) + ? $this->delete($request) + : $this->deleteList($request); + case 'HEAD': + return $this->head($request); + case 'OPTIONS': + return $this->options($request); + case 'PATCH': + return $this->patch($request); + default: + return $this->notAllowed(); + } + } + + public function get(ServerRequestInterface $request): ResponseInterface + { + return $this->notAllowed(); + } + + public function getList(ServerRequestInterface $request): ResponseInterface + { + return $this->notAllowed(); + } + + public function create(ServerRequestInterface $request): ResponseInterface + { + return $this->notAllowed(); + } + + public function update(ServerRequestInterface $request): ResponseInterface + { + return $this->notAllowed(); + } + + public function delete(ServerRequestInterface $request): ResponseInterface + { + return $this->notAllowed(); + } + + public function deleteList(ServerRequestInterface $request): ResponseInterface + { + return $this->notAllowed(); + } + + public function head(ServerRequestInterface $request): ResponseInterface + { + return $this->notAllowed(); + } + + public function options(ServerRequestInterface $request): ResponseInterface + { + return new EmptyResponse(200); + } + + public function patch(ServerRequestInterface $request): ResponseInterface + { + return $this->notAllowed(); + } + + final public function notAllowed(): ResponseInterface + { + return $this->createResponse(['content' => 'Method not allowed'], 405); + } + + final protected function createResponse($data, $status = 200): ResponseInterface + { + return new JsonResponse($data, $status); + } + + /** + * + * @param ServerRequestInterface $request + * @return array|object + */ + public function getRequestData(ServerRequestInterface $request) + { + $body = $request->getParsedBody(); + + if (!empty($body)) { + return $body; + } + + return $this->parseRequestData( + $request->getBody()->getContents(), + $request->getHeaderLine('content-type') + ); + } + + /** + * + * @param string $input + * @param string $contentType + * @return mixed + */ + private function parseRequestData($input, $contentType) + { + $contentTypeParts = preg_split('/\s*[;,]\s*/', $contentType); + $parser = $this->returnParserContentType($contentTypeParts[0]); + + return $parser($input); + } + + /** + * + * @param string $contentType + * @return callable + */ + private function returnParserContentType(string $contentType): callable + { + if ($contentType === 'application/x-www-form-urlencoded') { + return function ($input) { + parse_str($input, $data); + return $data; + }; + } elseif ($contentType === 'application/json') { + return function ($input) { + $jsonDecoder = new Json(); + try { + return $jsonDecoder->decode($input, Json::TYPE_ARRAY); + } catch (\Exception $e) { + return false; + } + }; + } elseif ($contentType === 'multipart/form-data') { + return function ($input) { + return $input; + }; + } + + return function ($input) { + return $input; + }; + } +} \ No newline at end of file diff --git a/src/ApiLibs/ConfigProvider.php b/src/ApiLibs/ConfigProvider.php new file mode 100644 index 0000000..91e03f2 --- /dev/null +++ b/src/ApiLibs/ConfigProvider.php @@ -0,0 +1,43 @@ + $this->getDependencies(), + ]; + } + + /** + * Returns the container dependencies + * + * @return array + */ + public function getDependencies() + { + return [ + 'invokables' => [], + 'factories' => [ + \Tuupola\Middleware\CorsMiddleware::class => Middleware\CorsMiddlewareFactory::class, + ], + ]; + } +} diff --git a/src/ApiLibs/Middleware/CorsMiddlewareFactory.php b/src/ApiLibs/Middleware/CorsMiddlewareFactory.php new file mode 100644 index 0000000..5c7a73a --- /dev/null +++ b/src/ApiLibs/Middleware/CorsMiddlewareFactory.php @@ -0,0 +1,23 @@ + [ + "Authorization", + "If-Match", + "If-Unmodified-Since", + "Content-type", + ], + ]); + } +} diff --git a/src/App/Action/AbstractCrudAction.php b/src/App/Action/AbstractCrudAction.php deleted file mode 100644 index db58baf..0000000 --- a/src/App/Action/AbstractCrudAction.php +++ /dev/null @@ -1,182 +0,0 @@ -getMethod()); - $id = $request->getAttribute(static::IDENTIFIER_NAME); - - switch ($requestMethod) { - case 'GET': - return isset($id) - ? $this->get($request, $delegate) - : $this->getList($request, $delegate); - case 'POST': - return $this->create($request, $delegate); - case 'PUT': - return $this->update($request, $delegate); - case 'DELETE': - return isset($id) - ? $this->delete($request, $delegate) - : $this->deleteList($request, $delegate); - case 'HEAD': - return $this->head($request, $delegate); - case 'OPTIONS': - return $this->options($request, $delegate); - case 'PATCH': - return $this->patch($request, $delegate); - default: - return $delegate->process($request); - } - } - - public function get(ServerRequestInterface $request, DelegateInterface $delegate) - { - return $this->createResponse(['content' => 'Method not allowed'], 405); - } - - public function getList(ServerRequestInterface $request, DelegateInterface $delegate) - { - return $this->createResponse(['content' => 'Method not allowed'], 405); - } - - public function create(ServerRequestInterface $request, DelegateInterface $delegate) - { - return $this->createResponse(['content' => 'Method not allowed'], 405); - } - - public function update(ServerRequestInterface $request, DelegateInterface $delegate) - { - return $this->createResponse(['content' => 'Method not allowed'], 405); - } - - public function delete(ServerRequestInterface $request, DelegateInterface $delegate) - { - return $this->createResponse(['content' => 'Method not allowed'], 405); - } - - public function deleteList(ServerRequestInterface $request, DelegateInterface $delegate) - { - return $this->createResponse(['content' => 'Method not allowed'], 405); - } - - public function head(ServerRequestInterface $request, DelegateInterface $delegate) - { - return $this->createResponse(['content' => 'Method not allowed'], 405); - } - - public function options(ServerRequestInterface $request, DelegateInterface $delegate) - { - return $this->createResponse(['content' => 'Method not allowed'], 405); - } - - public function patch(ServerRequestInterface $request, DelegateInterface $delegate) - { - return $this->createResponse(['content' => 'Method not allowed'], 405); - } - - final protected function createResponse($data, $status = 200) - { - return new JsonResponse($data, $status); - } - - /** - * - * @param ServerRequestInterface $request - * @return array|object - */ - public function getRequestData(ServerRequestInterface $request) - { - $body = $request->getParsedBody(); - - if (!empty($body)) { - return $body; - } - - return $this->parseRequestData( - $request->getBody()->getContents(), - $request->getHeaderLine('content-type') - ); - } - - protected function withCorsHeaders(ResponseInterface $response, iterable $methods = []) - { - if ($methods) { - $methodsHeader = implode(',', $methods); - $response = $response->withHeader('Accept', $methodsHeader) - ->withHeader('Access-Control-Allow-Methods', $methodsHeader); - } - return $response - ->withHeader('Access-Control-Allow-Origin', '*') - ->withHeader('Access-Control-Allow-Headers', implode(",", self::CORS_ALLOW_HEADERS)); - } - - /** - * - * @param string $input - * @param string $contentType - * @return mixed - */ - private function parseRequestData($input, $contentType) - { - $contentTypeParts = preg_split('/\s*[;,]\s*/', $contentType); - $parser = $this->returnParserContentType($contentTypeParts[0]); - - return $parser($input); - } - - /** - * - * @param string $contentType - * @return callable - */ - private function returnParserContentType(string $contentType) - { - if ($contentType === 'application/x-www-form-urlencoded') { - return function ($input) { - parse_str($input, $data); - return $data; - }; - } elseif ($contentType === 'application/json') { - return function ($input) { - $jsonDecoder = new Json(); - try { - return $jsonDecoder->decode($input, Json::TYPE_ARRAY); - } catch (\Exception $e) { - return false; - } - }; - } elseif ($contentType === 'multipart/form-data') { - return function ($input) { - return $input; - }; - } - - return function ($input) { - return $input; - }; - } -} diff --git a/src/App/Action/Auth/AuthAction.php b/src/App/Action/Auth/AuthAction.php deleted file mode 100644 index 3a32ce5..0000000 --- a/src/App/Action/Auth/AuthAction.php +++ /dev/null @@ -1,83 +0,0 @@ -authService = $authService; - } - - /** - * Create new auth token (login) - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response\JsonResponse - */ - public function create(ServerRequestInterface $request, DelegateInterface $delegate) - { - $authData = $this->getRequestData($request); - try { - return new JsonCorsResponse($this->authService->authenticate($authData['login'], $authData['password'])); - } catch (NoResultException $e) { - return new JsonCorsResponse([ - 'message' => $e->getMessage() - ], 403); - } catch (\Exception $e) { - return new JsonCorsResponse([ - 'message' => $e->getMessage() - ], 500); - } - } - - /** - * Renew auth token - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response\JsonResponse - */ - public function getList(ServerRequestInterface $request, DelegateInterface $delegate) - { - try { - $token = $request->getAttribute('token', false); - return new JsonCorsResponse($this->authService->renewToken($token)); - } catch (\Exception $e) { - return new JsonCorsResponse([ - 'message' => $e->getMessage() - ], 500); - } - } - - /** - * Configure CORS preflight - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return static - */ - public function options(ServerRequestInterface $request, DelegateInterface $delegate) - { - return $this->withCorsHeaders(new EmptyResponse(), self::CORS_ALLOW_METHODS); - } -} diff --git a/src/App/Action/ErrorCategoryAction.php b/src/App/Action/ErrorCategoryAction.php deleted file mode 100644 index 0560367..0000000 --- a/src/App/Action/ErrorCategoryAction.php +++ /dev/null @@ -1,51 +0,0 @@ -errorCategoryService = $errorCategoryService; - } - - /** - * Return all faults accessible to the user - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function getList(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - return new JsonCorsResponse($this->errorCategoryService->getList()); - } - - /** - * Configure CORS preflight - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function options(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - return $this->withCorsHeaders(new EmptyResponse(), self::CORS_ALLOW_METHODS); - } -} diff --git a/src/App/Action/ErrorOriginAction.php b/src/App/Action/ErrorOriginAction.php deleted file mode 100644 index 0704e6f..0000000 --- a/src/App/Action/ErrorOriginAction.php +++ /dev/null @@ -1,51 +0,0 @@ -errorOriginService = $errorOriginService; - } - - /** - * Return all faults accessible to the user - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function getList(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - return new JsonCorsResponse($this->errorOriginService->getList()); - } - - /** - * Configure CORS preflight - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function options(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - return $this->withCorsHeaders(new EmptyResponse(), self::CORS_ALLOW_METHODS); - } -} diff --git a/src/App/Action/FacilityLocationAction.php b/src/App/Action/FacilityLocationAction.php deleted file mode 100644 index 9eb748f..0000000 --- a/src/App/Action/FacilityLocationAction.php +++ /dev/null @@ -1,52 +0,0 @@ -facilityLocationService = $facilityLocationService; - } - - /** - * Return all faults accessible to the user - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function getList(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - return new JsonCorsResponse($this->facilityLocationService->getFacilityLocationListFlat()); - } - - /** - * Configure CORS preflight - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function options(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - return $this->withCorsHeaders(new EmptyResponse(), self::CORS_ALLOW_METHODS); - } -} diff --git a/src/App/Action/Fault/FaultAction.php b/src/App/Action/Fault/FaultAction.php deleted file mode 100644 index d7238cd..0000000 --- a/src/App/Action/Fault/FaultAction.php +++ /dev/null @@ -1,122 +0,0 @@ -faultManagerService = $faultManagerService; - } - - /** - * Return all faults accessible to the user - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function getList(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - return new JsonCorsResponse($this->faultManagerService->getFaultList()); - } - - /** - * Return a single fault - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function get(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - $id = $request->getAttribute('id', false); - return new JsonCorsResponse($this->faultManagerService->getFault($id)); - } - - /** - * Post a new fault report - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function create(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - try { - $data = $this->getRequestData($request); - $token = $request->getAttribute('token'); - return new JsonCorsResponse($this->faultManagerService->createFault($data, $token->uid), 201); - } catch (\Exception $e) { - return new JsonCorsResponse($e->getMessage(), 500); - } - } - - /** - * Update a fault report - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function update(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - try { - $id = $request->getAttribute('id'); - $token = $request->getAttribute('token'); - $data = $this->getRequestData($request); - return new JsonCorsResponse($this->faultManagerService->updateFault($id, $data, $token->uid)); - } catch (\Exception $e) { - return new JsonCorsResponse($e->getMessage(), 500); - } - } - - /** - * Delete a fault report (NYI) - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function delete(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - try { - $id = $request->getAttribute('id'); - return new JsonCorsResponse($this->faultManagerService->deleteFault($id)); - } catch (\Exception $e) { - return new JsonCorsResponse($e->getMessage(), $e->getCode()); - } - } - - /** - * Configure CORS preflight - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function options(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - return $this->withCorsHeaders(new EmptyResponse(), self::CORS_ALLOW_METHODS); - } -} diff --git a/src/App/Action/Fault/FaultCommentAction.php b/src/App/Action/Fault/FaultCommentAction.php deleted file mode 100644 index 216b6f0..0000000 --- a/src/App/Action/Fault/FaultCommentAction.php +++ /dev/null @@ -1,59 +0,0 @@ -faultManagerService = $faultManagerService; - } - - /** - * Post a new fault report - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function create(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - $faultId = $request->getAttribute('id'); - $jwt = $request->getAttribute('token'); - try { - $data = $this->getRequestData($request); - return new JsonCorsResponse($this->faultManagerService->addFaultComment($faultId, $data, $jwt->uid), 201); - } catch (\Exception $e) { - return new JsonCorsResponse($e->getMessage(), $e->getCode()); - } - } - - /** - * Configure CORS preflight - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function options(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - return $this->withCorsHeaders(new EmptyResponse(), self::CORS_ALLOW_METHODS); - } -} diff --git a/src/App/Action/Fault/FaultRejectAction.php b/src/App/Action/Fault/FaultRejectAction.php deleted file mode 100644 index fd5f496..0000000 --- a/src/App/Action/Fault/FaultRejectAction.php +++ /dev/null @@ -1,59 +0,0 @@ -faultManagerService = $faultManagerService; - } - - /** - * Post a new fault report - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function create(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - $faultId = $request->getAttribute('id'); - $jwt = $request->getAttribute('token'); - try { - $data = $this->getRequestData($request); - return new JsonCorsResponse($this->faultManagerService->rejectFault($faultId, $data, $jwt->uid), 201); - } catch (\Exception $e) { - return new JsonCorsResponse($e->getMessage(), 500); - } - } - - /** - * Configure CORS preflight - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function options(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - return $this->withCorsHeaders(new EmptyResponse(), self::CORS_ALLOW_METHODS); - } -} diff --git a/src/App/Action/Fault/FaultS2ConfirmAction.php b/src/App/Action/Fault/FaultS2ConfirmAction.php deleted file mode 100644 index 08b9c15..0000000 --- a/src/App/Action/Fault/FaultS2ConfirmAction.php +++ /dev/null @@ -1,58 +0,0 @@ -faultManagerService = $faultManagerService; - } - - /** - * Update a fault report - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function update(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - try { - $id = $request->getAttribute('id'); - $data = $this->getRequestData($request); - return new JsonCorsResponse($this->faultManagerService->confirmFault($id, $data)); - } catch (\Exception $e) { - return new JsonCorsResponse($e->getMessage(), $e->getCode()); - } - } - - /** - * Configure CORS preflight - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function options(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - return $this->withCorsHeaders(new EmptyResponse(), self::CORS_ALLOW_METHODS); - } -} diff --git a/src/App/Action/Fault/FaultS3AcknowledgeAction.php b/src/App/Action/Fault/FaultS3AcknowledgeAction.php deleted file mode 100644 index 6216881..0000000 --- a/src/App/Action/Fault/FaultS3AcknowledgeAction.php +++ /dev/null @@ -1,58 +0,0 @@ -faultManagerService = $faultManagerService; - } - - /** - * Update a fault report - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function update(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - try { - $id = $request->getAttribute('id'); - $data = $this->getRequestData($request); - return new JsonCorsResponse($this->faultManagerService->ackFault($id, $data)); - } catch (\Exception $e) { - return new JsonCorsResponse($e->getMessage(), $e->getCode()); - } - } - - /** - * Configure CORS preflight - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function options(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - return $this->withCorsHeaders(new EmptyResponse(), self::CORS_ALLOW_METHODS); - } -} diff --git a/src/App/Action/Fault/FaultS4RepairedAction.php b/src/App/Action/Fault/FaultS4RepairedAction.php deleted file mode 100644 index a6e3a30..0000000 --- a/src/App/Action/Fault/FaultS4RepairedAction.php +++ /dev/null @@ -1,58 +0,0 @@ -faultManagerService = $faultManagerService; - } - - /** - * Update a fault report - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function update(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - try { - $id = $request->getAttribute('id'); - $data = $this->getRequestData($request); - return new JsonCorsResponse($this->faultManagerService->repairFault($id, $data)); - } catch (\Exception $e) { - return new JsonCorsResponse($e->getMessage(), $e->getCode()); - } - } - - /** - * Configure CORS preflight - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function options(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - return $this->withCorsHeaders(new EmptyResponse(), self::CORS_ALLOW_METHODS); - } -} diff --git a/src/App/Action/Fault/FaultS5AcceptedAction.php b/src/App/Action/Fault/FaultS5AcceptedAction.php deleted file mode 100644 index bcc8e5a..0000000 --- a/src/App/Action/Fault/FaultS5AcceptedAction.php +++ /dev/null @@ -1,58 +0,0 @@ -faultManagerService = $faultManagerService; - } - - /** - * Update a fault report - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function update(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - try { - $id = $request->getAttribute('id'); - $data = $this->getRequestData($request); - return new JsonCorsResponse($this->faultManagerService->acceptFault($id, $data)); - } catch (\Exception $e) { - return new JsonCorsResponse($e->getMessage(), $e->getCode()); - } - } - - /** - * Configure CORS preflight - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function options(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - return $this->withCorsHeaders(new EmptyResponse(), self::CORS_ALLOW_METHODS); - } -} diff --git a/src/App/Action/MaintenanceAction.php b/src/App/Action/MaintenanceAction.php deleted file mode 100644 index 47aee97..0000000 --- a/src/App/Action/MaintenanceAction.php +++ /dev/null @@ -1,68 +0,0 @@ -maintenanceManagerService = $maintenanceManagerService; - } - - /** - * Renew auth token - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response\JsonResponse - */ - public function getList(ServerRequestInterface $request, DelegateInterface $delegate) - { - return new JsonCorsResponse($this->maintenanceManagerService->getMaintenanceList()->getValues()); - } - - /** - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return JsonCorsResponse|\Zend\Diactoros\Response\JsonResponse - * @throws \Doctrine\ORM\ORMException - * @throws \Doctrine\ORM\OptimisticLockException - * @throws \Doctrine\ORM\TransactionRequiredException - */ - public function get(ServerRequestInterface $request, DelegateInterface $delegate) - { - $hash = $request->getAttribute(self::IDENTIFIER_NAME); - return new JsonCorsResponse($this->maintenanceManagerService->get($hash)); - } - - /** - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return JsonCorsResponse|\Zend\Diactoros\Response\JsonResponse - * @throws \Doctrine\ORM\ORMException - * @throws \Doctrine\ORM\OptimisticLockException - * @throws \Doctrine\ORM\TransactionRequiredException - */ - public function update(ServerRequestInterface $request, DelegateInterface $delegate) - { - $hash = $request->getAttribute(self::IDENTIFIER_NAME); - $data = $this->getRequestData($request); - $jwt = $request->getAttribute('token'); - return new JsonCorsResponse($this->maintenanceManagerService->update($hash, $data, $jwt->uid)); - } -} diff --git a/src/App/Action/MaintenanceUpcomingAction.php b/src/App/Action/MaintenanceUpcomingAction.php deleted file mode 100644 index de062bb..0000000 --- a/src/App/Action/MaintenanceUpcomingAction.php +++ /dev/null @@ -1,37 +0,0 @@ -maintenanceManagerService = $maintenanceManagerService; - } - - /** - * Renew auth token - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response\JsonResponse - */ - public function getList(ServerRequestInterface $request, DelegateInterface $delegate) - { - return new JsonCorsResponse($this->maintenanceManagerService->getUpcomingMaintenanceList()->getValues()); - } -} diff --git a/src/App/Action/Pdf/GenerateMaintenanceSheetAction.php b/src/App/Action/Pdf/GenerateMaintenanceSheetAction.php deleted file mode 100644 index 0eb4882..0000000 --- a/src/App/Action/Pdf/GenerateMaintenanceSheetAction.php +++ /dev/null @@ -1,63 +0,0 @@ -pdfService = $pdfService; - $this->maintenanceManager = $maintenanceManagerService; - } - - /** - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response\JsonResponse|TextResponse|static - * @throws \PHPPdf\Core\PHPPdf\Exception\Exception - */ - public function get(ServerRequestInterface $request, DelegateInterface $delegate) - { - $id = $request->getAttribute('id', false); - try { - return (new TextResponse($this->pdfService->getMaintenanceSheet($id))) - ->withHeader('Content-type', 'application/pdf'); - } catch (\Exception $e) { - return new TextResponse($e->getMessage(), 500); - } - } - - /** - * Configure CORS preflight - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return static - */ - public function options(ServerRequestInterface $request, DelegateInterface $delegate) - { - return $this->withCorsHeaders(new EmptyResponse(), self::CORS_ALLOW_METHODS); - } -} diff --git a/src/App/Action/PingAction.php b/src/App/Action/PingAction.php deleted file mode 100644 index a1afba0..0000000 --- a/src/App/Action/PingAction.php +++ /dev/null @@ -1,16 +0,0 @@ - time()]); - } -} diff --git a/src/App/Action/SolutionTimeIntervalAction.php b/src/App/Action/SolutionTimeIntervalAction.php deleted file mode 100644 index 870c532..0000000 --- a/src/App/Action/SolutionTimeIntervalAction.php +++ /dev/null @@ -1,51 +0,0 @@ -solutionTimeIntervalService = $facilityLocationService; - } - - /** - * Return all faults accessible to the user - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function getList(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - return new JsonCorsResponse($this->solutionTimeIntervalService->getList()); - } - - /** - * Configure CORS preflight - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function options(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - return $this->withCorsHeaders(new EmptyResponse(), self::CORS_ALLOW_METHODS); - } -} diff --git a/src/App/Action/User/PasswordAction.php b/src/App/Action/User/PasswordAction.php deleted file mode 100644 index ea68cef..0000000 --- a/src/App/Action/User/PasswordAction.php +++ /dev/null @@ -1,57 +0,0 @@ -userService = $userService; - } - - /** - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return JsonCorsResponse - */ - public function create(ServerRequestInterface $request, DelegateInterface $delegate) - { - $token = $request->getAttribute('token'); - try { - $data = $this->getRequestData($request); - return new JsonCorsResponse($this->userService->changePassword($token->uid, $data['old'], $data['new'])); - } catch (\Exception $e) { - return new JsonCorsResponse([ - 'message' => $e->getMessage() - ], $e->getCode()); - } - } - - /** - * Configure CORS preflight - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return static - */ - public function options(ServerRequestInterface $request, DelegateInterface $delegate) - { - return $this->withCorsHeaders(new EmptyResponse(), self::CORS_ALLOW_METHODS); - } -} diff --git a/src/App/Action/User/UserAction.php b/src/App/Action/User/UserAction.php deleted file mode 100644 index 841dfac..0000000 --- a/src/App/Action/User/UserAction.php +++ /dev/null @@ -1,93 +0,0 @@ -userService = $userService; - } - - /** - * Renew auth token - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response\JsonResponse - */ - public function getList(ServerRequestInterface $request, DelegateInterface $delegate) - { - try { - return new JsonCorsResponse($this->userService->getList()); - } catch (\Exception $e) { - return new JsonCorsResponse([ - 'message' => $e->getMessage() - ], 500); - } - } - - /** - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return JsonCorsResponse - */ - public function get(ServerRequestInterface $request, DelegateInterface $delegate) - { - $id = $request->getAttribute('id'); - try { - return new JsonCorsResponse($this->userService->get($id)); - } catch (\Exception $e) { - return new JsonCorsResponse([ - 'message' => $e->getMessage() - ], 500); - } - } - - /** - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return JsonCorsResponse - */ - public function update(ServerRequestInterface $request, DelegateInterface $delegate) - { - $id = $request->getAttribute('id'); - try { - $data = $this->getRequestData($request); - return new JsonCorsResponse($this->userService->update($id, $data)); - } catch (\Exception $e) { - return new JsonCorsResponse([ - 'message' => $e->getMessage() - ], 500); - } - } - - /** - * Configure CORS preflight - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return static - */ - public function options(ServerRequestInterface $request, DelegateInterface $delegate) - { - return $this->withCorsHeaders(new EmptyResponse(), self::CORS_ALLOW_METHODS); - } -} diff --git a/src/App/Command/ConvertMaintenanceHashCommand.php b/src/App/Command/ConvertMaintenanceHashCommand.php index 599e55f..69ee3f4 100644 --- a/src/App/Command/ConvertMaintenanceHashCommand.php +++ b/src/App/Command/ConvertMaintenanceHashCommand.php @@ -3,7 +3,6 @@ namespace App\Command; use App\Entity\DeviceGroup; -use App\Entity\DeviceMaintenanceTask; use App\Entity\Maintenance; use App\Service\MaintenanceManagerService; use Doctrine\ORM\EntityManager; @@ -37,6 +36,7 @@ class ConvertMaintenanceHashCommand extends Command * @param OutputInterface $output * @return int|null|void * @throws \Doctrine\ORM\OptimisticLockException + * @throws \Doctrine\ORM\ORMException */ protected function execute(InputInterface $input, OutputInterface $output) { diff --git a/src/App/Command/MailTestCommand.php b/src/App/Command/DebugMailCommand.php similarity index 84% rename from src/App/Command/MailTestCommand.php rename to src/App/Command/DebugMailCommand.php index c60e262..3f51e29 100644 --- a/src/App/Command/MailTestCommand.php +++ b/src/App/Command/DebugMailCommand.php @@ -2,16 +2,14 @@ namespace App\Command; -use App\Service\Mailer\MailerService; +use App\Service\MailerService; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -class MailTestCommand extends Command +class DebugMailCommand extends Command { - /** - * @var MailerService - */ + /** @var MailerService */ private $mailerService; public function __construct(MailerService $mailerService) diff --git a/src/App/Command/MailTestCommandFactory.php b/src/App/Command/DebugMailCommandFactory.php similarity index 68% rename from src/App/Command/MailTestCommandFactory.php rename to src/App/Command/DebugMailCommandFactory.php index 2cc8129..2278945 100644 --- a/src/App/Command/MailTestCommandFactory.php +++ b/src/App/Command/DebugMailCommandFactory.php @@ -2,15 +2,15 @@ namespace App\Command; -use App\Service\Mailer\MailerService; +use App\Service\MailerService; use Interop\Container\ContainerInterface; -class MailTestCommandFactory +class DebugMailCommandFactory { public function __invoke(ContainerInterface $container) { /** @var MailerService $mailerService */ $mailerService = $container->get(MailerService::class); - return new MailTestCommand($mailerService); + return new DebugMailCommand($mailerService); } } diff --git a/src/App/Command/InitializeFixtureCommand.php b/src/App/Command/InitializeFixtureCommand.php index b187a55..9316088 100644 --- a/src/App/Command/InitializeFixtureCommand.php +++ b/src/App/Command/InitializeFixtureCommand.php @@ -4,15 +4,12 @@ namespace App\Command; use App\Service\FixtureLoaderService; use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class InitializeFixtureCommand extends Command { - /** - * @var FixtureLoaderService - */ + /** @var FixtureLoaderService */ private $fixtureLoaderService; public function __construct(FixtureLoaderService $fixtureLoaderService) diff --git a/src/App/ConfigProvider.php b/src/App/ConfigProvider.php index bf4a875..0f6e835 100644 --- a/src/App/ConfigProvider.php +++ b/src/App/ConfigProvider.php @@ -36,26 +36,26 @@ class ConfigProvider { return [ 'invokables' => [ - Action\PingAction::class => Action\PingAction::class, + Handler\PingHandler::class => Handler\PingHandler::class, ], 'factories' => [ - Action\MaintenanceAction::class => Action\MaintenanceFactory::class, - Action\MaintenanceUpcomingAction::class => Action\MaintenanceUpcomingFactory::class, + Handler\MaintenanceHandler::class => Handler\MaintenanceFactory::class, + Handler\MaintenanceUpcomingHandler::class => Handler\MaintenanceUpcomingFactory::class, - Action\Auth\AuthAction::class => Action\Auth\AuthFactory::class, - Action\User\UserAction::class => Action\User\UserFactory::class, - Action\User\PasswordAction::class => Action\User\PasswordFactory::class, - Action\Fault\FaultAction::class => Action\Fault\FaultFactory::class, - Action\Fault\FaultAttachmentAction::class => Action\Fault\FaultAttachmentFactory::class, - Action\Fault\FaultCommentAction::class => Action\Fault\FaultCommentFactory::class, - Action\Fault\FaultRejectAction::class => Action\Fault\FaultRejectFactory::class, - Action\ErrorOriginAction::class => Action\ErrorOriginFactory::class, - Action\ErrorCategoryAction::class => Action\ErrorCategoryFactory::class, - Action\FacilityLocationAction::class => Action\FacilityLocationFactory::class, - Action\SolutionTimeIntervalAction::class => Action\SolutionTimeIntervalFactory::class, - Action\Pdf\GenerateWorksheetAction::class => Action\Pdf\GenerateWorksheetFactory::class, - Action\Pdf\GenerateMaintenanceSheetAction::class => Action\Pdf\GenerateMaintenanceSheetFactory::class, + Handler\Auth\AuthHandler::class => Handler\Auth\AuthFactory::class, + Handler\User\UserHandler::class => Handler\User\UserFactory::class, + Handler\User\PasswordHandler::class => Handler\User\PasswordFactory::class, + Handler\Fault\FaultHandler::class => Handler\Fault\FaultFactory::class, + Handler\Fault\FaultAttachmentHandler::class => Handler\Fault\FaultAttachmentFactory::class, + Handler\Fault\FaultCommentHandler::class => Handler\Fault\FaultCommentFactory::class, + Handler\Fault\FaultRejectHandler::class => Handler\Fault\FaultRejectFactory::class, + Handler\ErrorOriginHandler::class => Handler\ErrorOriginFactory::class, + Handler\ErrorCategoryHandler::class => Handler\ErrorCategoryFactory::class, + Handler\FacilityLocationHandler::class => Handler\FacilityLocationFactory::class, + Handler\SolutionTimeIntervalHandler::class => Handler\SolutionTimeIntervalFactory::class, + Handler\Pdf\GenerateWorksheetHandler::class => Handler\Pdf\GenerateWorksheetFactory::class, + Handler\Pdf\GenerateMaintenanceSheetHandler::class => Handler\Pdf\GenerateMaintenanceSheetFactory::class, Service\AuthService::class => Service\AuthServiceFactory::class, Service\UserService::class => Service\UserServiceFactory::class, diff --git a/src/App/Action/Auth/AuthFactory.php b/src/App/Handler/Auth/AuthFactory.php similarity index 74% rename from src/App/Action/Auth/AuthFactory.php rename to src/App/Handler/Auth/AuthFactory.php index 67ead40..85eb428 100644 --- a/src/App/Action/Auth/AuthFactory.php +++ b/src/App/Handler/Auth/AuthFactory.php @@ -1,6 +1,6 @@ get(AuthService::class); - return new AuthAction($faultManagerService); + return new AuthHandler($faultManagerService); } } diff --git a/src/App/Handler/Auth/AuthHandler.php b/src/App/Handler/Auth/AuthHandler.php new file mode 100644 index 0000000..f78714a --- /dev/null +++ b/src/App/Handler/Auth/AuthHandler.php @@ -0,0 +1,59 @@ +authService = $authService; + } + + /** + * Create new auth token (login) + * @param ServerRequestInterface $request + * @return ResponseInterface + */ + public function create(ServerRequestInterface $request): ResponseInterface + { + $authData = $this->getRequestData($request); + try { + return new JsonResponse($this->authService->authenticate($authData['login'], $authData['password'])); + } catch (NoResultException $e) { + return new JsonResponse([ + 'message' => $e->getMessage() + ], 403); + } catch (\Exception $e) { + return new JsonResponse([ + 'message' => $e->getMessage() + ], 500); + } + } + + /** + * Renew auth token + * @param ServerRequestInterface $request + * @return ResponseInterface + */ + public function getList(ServerRequestInterface $request): ResponseInterface + { + try { + $token = $request->getAttribute('token', false); + return new JsonResponse($this->authService->renewToken($token)); + } catch (\Exception $e) { + return new JsonResponse([ + 'message' => $e->getMessage() + ], 500); + } + } +} diff --git a/src/App/Action/ErrorCategoryFactory.php b/src/App/Handler/ErrorCategoryFactory.php similarity index 79% rename from src/App/Action/ErrorCategoryFactory.php rename to src/App/Handler/ErrorCategoryFactory.php index 055211f..1eb747f 100644 --- a/src/App/Action/ErrorCategoryFactory.php +++ b/src/App/Handler/ErrorCategoryFactory.php @@ -1,6 +1,6 @@ get(ErrorCategoryService::class); - return new ErrorCategoryAction($errorCategoryService); + return new ErrorCategoryHandler($errorCategoryService); } } diff --git a/src/App/Handler/ErrorCategoryHandler.php b/src/App/Handler/ErrorCategoryHandler.php new file mode 100644 index 0000000..54f812a --- /dev/null +++ b/src/App/Handler/ErrorCategoryHandler.php @@ -0,0 +1,30 @@ +errorCategoryService = $errorCategoryService; + } + + /** + * Return all faults accessible to the user + * @param ServerRequestInterface $request + * @return ResponseInterface + */ + public function getList(ServerRequestInterface $request): ResponseInterface + { + return new JsonResponse($this->errorCategoryService->getList()); + } +} diff --git a/src/App/Action/ErrorOriginFactory.php b/src/App/Handler/ErrorOriginFactory.php similarity index 79% rename from src/App/Action/ErrorOriginFactory.php rename to src/App/Handler/ErrorOriginFactory.php index 883fa3d..5df51ee 100644 --- a/src/App/Action/ErrorOriginFactory.php +++ b/src/App/Handler/ErrorOriginFactory.php @@ -1,6 +1,6 @@ get(ErrorOriginService::class); - return new ErrorOriginAction($errorOriginService); + return new ErrorOriginHandler($errorOriginService); } } diff --git a/src/App/Handler/ErrorOriginHandler.php b/src/App/Handler/ErrorOriginHandler.php new file mode 100644 index 0000000..898889c --- /dev/null +++ b/src/App/Handler/ErrorOriginHandler.php @@ -0,0 +1,31 @@ +errorOriginService = $errorOriginService; + } + + /** + * Return all faults accessible to the user + * + * @param ServerRequestInterface $request + * @return ResponseInterface + */ + public function getList(ServerRequestInterface $request): ResponseInterface + { + return new JsonResponse($this->errorOriginService->getList()); + } +} diff --git a/src/App/Action/FacilityLocationFactory.php b/src/App/Handler/FacilityLocationFactory.php similarity index 79% rename from src/App/Action/FacilityLocationFactory.php rename to src/App/Handler/FacilityLocationFactory.php index e6de325..6b2658e 100644 --- a/src/App/Action/FacilityLocationFactory.php +++ b/src/App/Handler/FacilityLocationFactory.php @@ -1,6 +1,6 @@ get(FacilityLocationService::class); - return new FacilityLocationAction($facilityLocationService); + return new FacilityLocationHandler($facilityLocationService); } } diff --git a/src/App/Handler/FacilityLocationHandler.php b/src/App/Handler/FacilityLocationHandler.php new file mode 100644 index 0000000..a7dbe9b --- /dev/null +++ b/src/App/Handler/FacilityLocationHandler.php @@ -0,0 +1,31 @@ +facilityLocationService = $facilityLocationService; + } + + /** + * Return all faults accessible to the user + * + * @param ServerRequestInterface $request + * @return JsonResponse + */ + public function getList(ServerRequestInterface $request): ResponseInterface + { + return new JsonResponse($this->facilityLocationService->getFacilityLocationListFlat()); + } +} diff --git a/src/App/Action/Fault/FaultAttachmentFactory.php b/src/App/Handler/Fault/FaultAttachmentFactory.php similarity index 77% rename from src/App/Action/Fault/FaultAttachmentFactory.php rename to src/App/Handler/Fault/FaultAttachmentFactory.php index 70dd392..35801b2 100644 --- a/src/App/Action/Fault/FaultAttachmentFactory.php +++ b/src/App/Handler/Fault/FaultAttachmentFactory.php @@ -1,6 +1,6 @@ get(FaultManagerService::class); $attachmentService = $container->get(FaultAttachmentService::class); - return new FaultAttachmentAction($faultManagerService, $attachmentService); + return new FaultAttachmentHandler($faultManagerService, $attachmentService); } } diff --git a/src/App/Action/Fault/FaultAttachmentAction.php b/src/App/Handler/Fault/FaultAttachmentHandler.php similarity index 61% rename from src/App/Action/Fault/FaultAttachmentAction.php rename to src/App/Handler/Fault/FaultAttachmentHandler.php index 7ae1112..823b0a4 100644 --- a/src/App/Action/Fault/FaultAttachmentAction.php +++ b/src/App/Handler/Fault/FaultAttachmentHandler.php @@ -1,52 +1,39 @@ faultManagerService = $faultManagerService; $this->attachmentService = $attachmentService; } /** * Post a new fault report - * * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response + * @return ResponseInterface */ - public function create(ServerRequestInterface $request, DelegateInterface $delegate): Response + public function create(ServerRequestInterface $request): ResponseInterface { $faultId = $request->getAttribute('id'); $type = $request->getAttribute('type', 'file'); @@ -54,21 +41,22 @@ class FaultAttachmentAction extends AbstractCrudAction try { /** @var UploadedFileInterface[] $files */ $files = $request->getUploadedFiles()['file']; - return new JsonCorsResponse( + return new JsonResponse( $this->attachmentService->createAttachments($faultId, $files, $token->uid, $type), 201 ); } catch (\Exception $e) { - return new JsonCorsResponse($e->getMessage(), 500); + return new JsonResponse($e->getMessage(), 500); } } /** * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return Response + * @return ResponseInterface + * @throws \Doctrine\ORM\NoResultException + * @throws \Doctrine\ORM\NonUniqueResultException */ - public function get(ServerRequestInterface $request, DelegateInterface $delegate): Response + public function get(ServerRequestInterface $request): ResponseInterface { $id = $request->getAttribute('id'); $attachment = $this->attachmentService->get($id); @@ -89,16 +77,4 @@ class FaultAttachmentAction extends AbstractCrudAction // ->withHeader('Content-disposition', 'attachment;filename='.$attachment->getFileName()) ; } - - /** - * Configure CORS preflight - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return \Zend\Diactoros\Response - */ - public function options(ServerRequestInterface $request, DelegateInterface $delegate): Response - { - return $this->withCorsHeaders(new EmptyResponse(), self::CORS_ALLOW_METHODS); - } } diff --git a/src/App/Action/Fault/FaultCommentFactory.php b/src/App/Handler/Fault/FaultCommentFactory.php similarity index 74% rename from src/App/Action/Fault/FaultCommentFactory.php rename to src/App/Handler/Fault/FaultCommentFactory.php index 2323035..8ba9d74 100644 --- a/src/App/Action/Fault/FaultCommentFactory.php +++ b/src/App/Handler/Fault/FaultCommentFactory.php @@ -1,6 +1,6 @@ get(FaultManagerService::class); - return new FaultCommentAction($faultManagerService); + return new FaultCommentHandler($faultManagerService); } } diff --git a/src/App/Handler/Fault/FaultCommentHandler.php b/src/App/Handler/Fault/FaultCommentHandler.php new file mode 100644 index 0000000..6eafde3 --- /dev/null +++ b/src/App/Handler/Fault/FaultCommentHandler.php @@ -0,0 +1,38 @@ +faultManagerService = $faultManagerService; + } + + /** + * Post a new fault report + * + * @param ServerRequestInterface $request + * @return ResponseInterface + */ + public function create(ServerRequestInterface $request): ResponseInterface + { + $faultId = $request->getAttribute('id'); + $jwt = $request->getAttribute('token'); + try { + $data = $this->getRequestData($request); + return new JsonResponse($this->faultManagerService->addFaultComment($faultId, $data, $jwt->uid), 201); + } catch (\Exception $e) { + return new JsonResponse($e->getMessage(), $e->getCode()); + } + } +} diff --git a/src/App/Action/Fault/FaultFactory.php b/src/App/Handler/Fault/FaultFactory.php similarity index 75% rename from src/App/Action/Fault/FaultFactory.php rename to src/App/Handler/Fault/FaultFactory.php index 9226fda..c6f258a 100644 --- a/src/App/Action/Fault/FaultFactory.php +++ b/src/App/Handler/Fault/FaultFactory.php @@ -1,6 +1,6 @@ get(FaultManagerService::class); - return new FaultAction($faultManagerService); + return new FaultHandler($faultManagerService); } } diff --git a/src/App/Handler/Fault/FaultHandler.php b/src/App/Handler/Fault/FaultHandler.php new file mode 100644 index 0000000..c60b291 --- /dev/null +++ b/src/App/Handler/Fault/FaultHandler.php @@ -0,0 +1,97 @@ +faultManagerService = $faultManagerService; + } + + /** + * Return all faults accessible to the user + * + * @param ServerRequestInterface $request + * @return ResponseInterface + */ + public function getList(ServerRequestInterface $request): ResponseInterface + { + return new JsonResponse($this->faultManagerService->getFaultList()); + } + + /** + * Return a single fault + * + * @param ServerRequestInterface $request + * @return ResponseInterface + * @throws \Doctrine\ORM\ORMException + * @throws \Doctrine\ORM\OptimisticLockException + * @throws \Doctrine\ORM\TransactionRequiredException + */ + public function get(ServerRequestInterface $request): ResponseInterface + { + $id = $request->getAttribute('id', false); + return new JsonResponse($this->faultManagerService->getFault($id)); + } + + /** + * Post a new fault report + * + * @param ServerRequestInterface $request + * @return ResponseInterface + */ + public function create(ServerRequestInterface $request): ResponseInterface + { + try { + $data = $this->getRequestData($request); + $token = $request->getAttribute('token'); + return new JsonResponse($this->faultManagerService->createFault($data, $token->uid), 201); + } catch (\Exception $e) { + return new JsonResponse($e->getMessage(), 500); + } + } + + /** + * Update a fault report + * + * @param ServerRequestInterface $request + * @return ResponseInterface + */ + public function update(ServerRequestInterface $request): ResponseInterface + { + try { + $id = $request->getAttribute('id'); + $token = $request->getAttribute('token'); + $data = $this->getRequestData($request); + return new JsonResponse($this->faultManagerService->updateFault($id, $data, $token->uid)); + } catch (\Exception $e) { + return new JsonResponse($e->getMessage(), 500); + } + } + + /** + * Delete a fault report (NYI) + * + * @param ServerRequestInterface $request + * @return ResponseInterface + */ + public function delete(ServerRequestInterface $request): ResponseInterface + { + try { + $id = $request->getAttribute('id'); + return new JsonResponse($this->faultManagerService->deleteFault($id)); + } catch (\Exception $e) { + return new JsonResponse($e->getMessage(), $e->getCode()); + } + } +} diff --git a/src/App/Action/Fault/FaultRejectFactory.php b/src/App/Handler/Fault/FaultRejectFactory.php similarity index 74% rename from src/App/Action/Fault/FaultRejectFactory.php rename to src/App/Handler/Fault/FaultRejectFactory.php index 91d1e2a..567ba5f 100644 --- a/src/App/Action/Fault/FaultRejectFactory.php +++ b/src/App/Handler/Fault/FaultRejectFactory.php @@ -1,6 +1,6 @@ get(FaultManagerService::class); - return new FaultRejectAction($faultManagerService); + return new FaultRejectHandler($faultManagerService); } } diff --git a/src/App/Handler/Fault/FaultRejectHandler.php b/src/App/Handler/Fault/FaultRejectHandler.php new file mode 100644 index 0000000..3e6ed63 --- /dev/null +++ b/src/App/Handler/Fault/FaultRejectHandler.php @@ -0,0 +1,38 @@ +faultManagerService = $faultManagerService; + } + + /** + * Post a new fault report + * + * @param ServerRequestInterface $request + * @return ResponseInterface + */ + public function create(ServerRequestInterface $request): ResponseInterface + { + $faultId = $request->getAttribute('id'); + $jwt = $request->getAttribute('token'); + try { + $data = $this->getRequestData($request); + return new JsonResponse($this->faultManagerService->rejectFault($faultId, $data, $jwt->uid), 201); + } catch (\Exception $e) { + return new JsonResponse($e->getMessage(), 500); + } + } +} diff --git a/src/App/Handler/Fault/X_FaultS2ConfirmAction.php b/src/App/Handler/Fault/X_FaultS2ConfirmAction.php new file mode 100644 index 0000000..0766c60 --- /dev/null +++ b/src/App/Handler/Fault/X_FaultS2ConfirmAction.php @@ -0,0 +1,37 @@ +faultManagerService = $faultManagerService; + } + + /** + * Update a fault report + * + * @param ServerRequestInterface $request + * @return ResponseInterface + */ + public function update(ServerRequestInterface $request): ResponseInterface + { + try { + $id = $request->getAttribute('id'); + $data = $this->getRequestData($request); + return new JsonResponse($this->faultManagerService->confirmFault($id, $data)); + } catch (\Exception $e) { + return new JsonResponse($e->getMessage(), $e->getCode()); + } + } +} diff --git a/src/App/Handler/Fault/X_FaultS3AcknowledgeAction.php b/src/App/Handler/Fault/X_FaultS3AcknowledgeAction.php new file mode 100644 index 0000000..4c3294d --- /dev/null +++ b/src/App/Handler/Fault/X_FaultS3AcknowledgeAction.php @@ -0,0 +1,37 @@ +faultManagerService = $faultManagerService; + } + + /** + * Update a fault report + * + * @param ServerRequestInterface $request + * @return ResponseInterface + */ + public function update(ServerRequestInterface $request): ResponseInterface + { + try { + $id = $request->getAttribute('id'); + $data = $this->getRequestData($request); + return new JsonResponse($this->faultManagerService->ackFault($id, $data)); + } catch (\Exception $e) { + return new JsonResponse($e->getMessage(), $e->getCode()); + } + } +} diff --git a/src/App/Handler/Fault/X_FaultS4RepairedAction.php b/src/App/Handler/Fault/X_FaultS4RepairedAction.php new file mode 100644 index 0000000..ab27a27 --- /dev/null +++ b/src/App/Handler/Fault/X_FaultS4RepairedAction.php @@ -0,0 +1,37 @@ +faultManagerService = $faultManagerService; + } + + /** + * Update a fault report + * + * @param ServerRequestInterface $request + * @return ResponseInterface + */ + public function update(ServerRequestInterface $request): ResponseInterface + { + try { + $id = $request->getAttribute('id'); + $data = $this->getRequestData($request); + return new JsonResponse($this->faultManagerService->repairFault($id, $data)); + } catch (\Exception $e) { + return new JsonResponse($e->getMessage(), $e->getCode()); + } + } +} diff --git a/src/App/Handler/Fault/X_FaultS5AcceptedAction.php b/src/App/Handler/Fault/X_FaultS5AcceptedAction.php new file mode 100644 index 0000000..ac86254 --- /dev/null +++ b/src/App/Handler/Fault/X_FaultS5AcceptedAction.php @@ -0,0 +1,36 @@ +faultManagerService = $faultManagerService; + } + + /** + * Update a fault report + * @param ServerRequestInterface $request + * @return ResponseInterface + */ + public function update(ServerRequestInterface $request): ResponseInterface + { + try { + $id = $request->getAttribute('id'); + $data = $this->getRequestData($request); + return new JsonResponse($this->faultManagerService->acceptFault($id, $data)); + } catch (\Exception $e) { + return new JsonResponse($e->getMessage(), $e->getCode()); + } + } +} diff --git a/src/App/Action/MaintenanceFactory.php b/src/App/Handler/MaintenanceFactory.php similarity index 78% rename from src/App/Action/MaintenanceFactory.php rename to src/App/Handler/MaintenanceFactory.php index 604af51..dcde726 100644 --- a/src/App/Action/MaintenanceFactory.php +++ b/src/App/Handler/MaintenanceFactory.php @@ -1,6 +1,6 @@ get(MaintenanceManagerService::class); - return new MaintenanceAction($maintenanceManagerService); + return new MaintenanceHandler($maintenanceManagerService); } } diff --git a/src/App/Handler/MaintenanceHandler.php b/src/App/Handler/MaintenanceHandler.php new file mode 100644 index 0000000..620ba8c --- /dev/null +++ b/src/App/Handler/MaintenanceHandler.php @@ -0,0 +1,59 @@ +maintenanceManagerService = $maintenanceManagerService; + } + + /** + * Renew auth token + * + * @param ServerRequestInterface $request + * @return ResponseInterface + */ + public function getList(ServerRequestInterface $request): ResponseInterface + { + return new JsonResponse($this->maintenanceManagerService->getMaintenanceList()->getValues()); + } + + /** + * @param ServerRequestInterface $request + * @return ResponseInterface + * @throws \Doctrine\ORM\ORMException + * @throws \Doctrine\ORM\OptimisticLockException + * @throws \Doctrine\ORM\TransactionRequiredException + */ + public function get(ServerRequestInterface $request): ResponseInterface + { + $hash = $request->getAttribute(self::IDENTIFIER_NAME); + return new JsonResponse($this->maintenanceManagerService->get($hash)); + } + + /** + * @param ServerRequestInterface $request + * @return ResponseInterface + * @throws \Doctrine\ORM\ORMException + * @throws \Doctrine\ORM\OptimisticLockException + * @throws \Doctrine\ORM\TransactionRequiredException + */ + public function update(ServerRequestInterface $request): ResponseInterface + { + $hash = $request->getAttribute(self::IDENTIFIER_NAME); + $data = $this->getRequestData($request); + $jwt = $request->getAttribute('token'); + return new JsonResponse($this->maintenanceManagerService->update($hash, $data, $jwt->uid)); + } +} diff --git a/src/App/Action/MaintenanceUpcomingFactory.php b/src/App/Handler/MaintenanceUpcomingFactory.php similarity index 76% rename from src/App/Action/MaintenanceUpcomingFactory.php rename to src/App/Handler/MaintenanceUpcomingFactory.php index 2afbe26..23f4c83 100644 --- a/src/App/Action/MaintenanceUpcomingFactory.php +++ b/src/App/Handler/MaintenanceUpcomingFactory.php @@ -1,6 +1,6 @@ get(MaintenanceManagerService::class); - return new MaintenanceUpcomingAction($maintenanceManagerService); + return new MaintenanceUpcomingHandler($maintenanceManagerService); } } diff --git a/src/App/Handler/MaintenanceUpcomingHandler.php b/src/App/Handler/MaintenanceUpcomingHandler.php new file mode 100644 index 0000000..bed4c82 --- /dev/null +++ b/src/App/Handler/MaintenanceUpcomingHandler.php @@ -0,0 +1,31 @@ +maintenanceManagerService = $maintenanceManagerService; + } + + /** + * Renew auth token + * + * @param ServerRequestInterface $request + * @return ResponseInterface + */ + public function getList(ServerRequestInterface $request): ResponseInterface + { + return new JsonResponse($this->maintenanceManagerService->getUpcomingMaintenanceList()->getValues()); + } +} diff --git a/src/App/Action/Pdf/GenerateMaintenanceSheetFactory.php b/src/App/Handler/Pdf/GenerateMaintenanceSheetFactory.php similarity index 80% rename from src/App/Action/Pdf/GenerateMaintenanceSheetFactory.php rename to src/App/Handler/Pdf/GenerateMaintenanceSheetFactory.php index b76e1f5..07d2e4a 100644 --- a/src/App/Action/Pdf/GenerateMaintenanceSheetFactory.php +++ b/src/App/Handler/Pdf/GenerateMaintenanceSheetFactory.php @@ -1,6 +1,6 @@ get(PdfService::class); /** @var MaintenanceManagerService $maintenanceManagerService */ $maintenanceManagerService = $container->get(MaintenanceManagerService::class); - return new GenerateMaintenanceSheetAction($pdfService, $maintenanceManagerService); + return new GenerateMaintenanceSheetHandler($pdfService, $maintenanceManagerService); } } diff --git a/src/App/Handler/Pdf/GenerateMaintenanceSheetHandler.php b/src/App/Handler/Pdf/GenerateMaintenanceSheetHandler.php new file mode 100644 index 0000000..ef0296b --- /dev/null +++ b/src/App/Handler/Pdf/GenerateMaintenanceSheetHandler.php @@ -0,0 +1,40 @@ +pdfService = $pdfService; + $this->maintenanceManager = $maintenanceManagerService; + } + + /** + * @param ServerRequestInterface $request + * @return ResponseInterface + */ + public function get(ServerRequestInterface $request): ResponseInterface + { + $id = $request->getAttribute('id', false); + try { + return (new TextResponse($this->pdfService->getMaintenanceSheet($id))) + ->withHeader('Content-type', 'application/pdf'); + } catch (\Exception $e) { + return new TextResponse($e->getMessage(), 500); + } + } +} diff --git a/src/App/Action/Pdf/GenerateWorksheetFactory.php b/src/App/Handler/Pdf/GenerateWorksheetFactory.php similarity index 81% rename from src/App/Action/Pdf/GenerateWorksheetFactory.php rename to src/App/Handler/Pdf/GenerateWorksheetFactory.php index 48441f7..ab45248 100644 --- a/src/App/Action/Pdf/GenerateWorksheetFactory.php +++ b/src/App/Handler/Pdf/GenerateWorksheetFactory.php @@ -1,6 +1,6 @@ get(PdfService::class); /** @var FaultManagerService $faultManager */ $faultManager = $container->get(FaultManagerService::class); - return new GenerateWorksheetAction($pdfService, $faultManager); + return new GenerateWorksheetHandler($pdfService, $faultManager); } } diff --git a/src/App/Action/Pdf/GenerateWorksheetAction.php b/src/App/Handler/Pdf/GenerateWorksheetHandler.php similarity index 53% rename from src/App/Action/Pdf/GenerateWorksheetAction.php rename to src/App/Handler/Pdf/GenerateWorksheetHandler.php index 181221e..c0ffe50 100644 --- a/src/App/Action/Pdf/GenerateWorksheetAction.php +++ b/src/App/Handler/Pdf/GenerateWorksheetHandler.php @@ -1,29 +1,20 @@ getAttribute('id', false); try { @@ -52,16 +41,4 @@ class GenerateWorksheetAction extends AbstractCrudAction return new TextResponse($e->getMessage(), 500); } } - - /** - * Configure CORS preflight - * - * @param ServerRequestInterface $request - * @param DelegateInterface $delegate - * @return static - */ - public function options(ServerRequestInterface $request, DelegateInterface $delegate) - { - return $this->withCorsHeaders(new EmptyResponse(), self::CORS_ALLOW_METHODS); - } } diff --git a/src/App/Handler/PingHandler.php b/src/App/Handler/PingHandler.php new file mode 100644 index 0000000..cd1c43d --- /dev/null +++ b/src/App/Handler/PingHandler.php @@ -0,0 +1,18 @@ + time()]); + } +} diff --git a/src/App/Action/SolutionTimeIntervalFactory.php b/src/App/Handler/SolutionTimeIntervalFactory.php similarity index 79% rename from src/App/Action/SolutionTimeIntervalFactory.php rename to src/App/Handler/SolutionTimeIntervalFactory.php index 6c1f475..a56f3df 100644 --- a/src/App/Action/SolutionTimeIntervalFactory.php +++ b/src/App/Handler/SolutionTimeIntervalFactory.php @@ -1,6 +1,6 @@ get(SolutionTimeIntervalService::class); - return new SolutionTimeIntervalAction($facilityLocationService); + return new SolutionTimeIntervalHandler($facilityLocationService); } } diff --git a/src/App/Handler/SolutionTimeIntervalHandler.php b/src/App/Handler/SolutionTimeIntervalHandler.php new file mode 100644 index 0000000..881f42f --- /dev/null +++ b/src/App/Handler/SolutionTimeIntervalHandler.php @@ -0,0 +1,31 @@ +solutionTimeIntervalService = $facilityLocationService; + } + + /** + * Return all faults accessible to the user + * + * @param ServerRequestInterface $request + * @return ResponseInterface + */ + public function getList(ServerRequestInterface $request): ResponseInterface + { + return new JsonResponse($this->solutionTimeIntervalService->getList()); + } +} diff --git a/src/App/Action/User/PasswordFactory.php b/src/App/Handler/User/PasswordFactory.php similarity index 78% rename from src/App/Action/User/PasswordFactory.php rename to src/App/Handler/User/PasswordFactory.php index c518dc1..a1f0527 100644 --- a/src/App/Action/User/PasswordFactory.php +++ b/src/App/Handler/User/PasswordFactory.php @@ -1,6 +1,6 @@ get(UserService::class); - return new PasswordAction($userService); + return new PasswordHandler($userService); } } diff --git a/src/App/Handler/User/PasswordHandler.php b/src/App/Handler/User/PasswordHandler.php new file mode 100644 index 0000000..827415a --- /dev/null +++ b/src/App/Handler/User/PasswordHandler.php @@ -0,0 +1,37 @@ +userService = $userService; + } + + /** + * @param ServerRequestInterface $request + * @return ResponseInterface + */ + public function create(ServerRequestInterface $request): ResponseInterface + { + $token = $request->getAttribute('token'); + try { + $data = $this->getRequestData($request); + return new JsonResponse($this->userService->changePassword($token->uid, $data['old'], $data['new'])); + } catch (\Exception $e) { + return new JsonResponse([ + 'message' => $e->getMessage() + ], $e->getCode()); + } + } +} diff --git a/src/App/Action/User/UserFactory.php b/src/App/Handler/User/UserFactory.php similarity index 79% rename from src/App/Action/User/UserFactory.php rename to src/App/Handler/User/UserFactory.php index 5788562..83f2b64 100644 --- a/src/App/Action/User/UserFactory.php +++ b/src/App/Handler/User/UserFactory.php @@ -1,6 +1,6 @@ get(UserService::class); - return new UserAction($userService); + return new UserHandler($userService); } } diff --git a/src/App/Handler/User/UserHandler.php b/src/App/Handler/User/UserHandler.php new file mode 100644 index 0000000..0eabfc6 --- /dev/null +++ b/src/App/Handler/User/UserHandler.php @@ -0,0 +1,70 @@ +userService = $userService; + } + + /** + * Renew auth token + * + * @param ServerRequestInterface $request + * @return ResponseInterface + */ + public function getList(ServerRequestInterface $request): ResponseInterface + { + try { + return new JsonResponse($this->userService->getList()); + } catch (\Exception $e) { + return new JsonResponse([ + 'message' => $e->getMessage() + ], 500); + } + } + + /** + * @param ServerRequestInterface $request + * @return ResponseInterface + */ + public function get(ServerRequestInterface $request): ResponseInterface + { + $id = $request->getAttribute('id'); + try { + return new JsonResponse($this->userService->get($id)); + } catch (\Exception $e) { + return new JsonResponse([ + 'message' => $e->getMessage() + ], 500); + } + } + + /** + * @param ServerRequestInterface $request + * @return ResponseInterface + */ + public function update(ServerRequestInterface $request): ResponseInterface + { + $id = $request->getAttribute('id'); + try { + $data = $this->getRequestData($request); + return new JsonResponse($this->userService->update($id, $data)); + } catch (\Exception $e) { + return new JsonResponse([ + 'message' => $e->getMessage() + ], 500); + } + } +} diff --git a/src/App/Middleware/CorsMiddlewareFactory.php b/src/App/Middleware/CorsMiddlewareFactory.php index a74d930..b6fbc0b 100644 --- a/src/App/Middleware/CorsMiddlewareFactory.php +++ b/src/App/Middleware/CorsMiddlewareFactory.php @@ -3,40 +3,30 @@ namespace App\Middleware; use Interop\Container\ContainerInterface; -use Tuupola\Middleware\Cors; +use Tuupola\Middleware\CorsMiddleware; class CorsMiddlewareFactory { const CORS_ALLOW_HEADERS = [ - 'DNT', - 'X-CustomHeader', - 'Keep-Alive', - 'User-Agent', - 'X-Requested-With', - 'If-Modified-Since', - 'Cache-Control', - 'Content-Type', - 'Authorization', + 'DNT', + 'X-CustomHeader', + 'Keep-Alive', + 'User-Agent', + 'X-Requested-With', + 'If-Match', + 'If-Modified-Since', + 'If-Unmodified-Since', + 'Cache-Control', + 'Content-Type', + 'Authorization', ]; - public function __invoke(ContainerInterface $container): Cors + public function __invoke(ContainerInterface $container): CorsMiddleware { - return new Cors([ + return new CorsMiddleware([ "origin" => ["*"], "methods" => ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"], - "headers.allow" => [ - 'DNT', - 'X-CustomHeader', - 'Keep-Alive', - 'User-Agent', - 'X-Requested-With', - 'If-Match', - 'If-Modified-Since', - 'If-Unmodified-Since', - 'Cache-Control', - 'Content-Type', - 'Authorization', - ], + "headers.allow" => self::CORS_ALLOW_HEADERS, "headers.expose" => ["Etag"], "credentials" => true, // "cache" => 86400 diff --git a/src/App/Middleware/JwtAuthenticationFactory.php b/src/App/Middleware/JwtAuthenticationFactory.php index 67a9a0d..cce7a47 100644 --- a/src/App/Middleware/JwtAuthenticationFactory.php +++ b/src/App/Middleware/JwtAuthenticationFactory.php @@ -2,12 +2,11 @@ namespace App\Middleware; -use App\Response\JsonCorsResponse; use Interop\Container\ContainerInterface; -use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; -use Slim\Middleware\JwtAuthentication; +use Tuupola\Middleware\JwtAuthentication; use Zend\Config\Config; +use Zend\Diactoros\Response\JsonResponse; use Zend\Expressive\Application; use Zend\Expressive\Router\Route; @@ -15,9 +14,7 @@ class JwtAuthenticationFactory { const DEFAULT_HMAC = 'thisShouldBeChangedForReal'; - /** - * @var Config - */ + /** @var Config */ private $config; public function __invoke(ContainerInterface $container): JwtAuthentication @@ -27,16 +24,16 @@ class JwtAuthenticationFactory return new JwtAuthentication([ "secret" => $this->config->get('hmac_key', self::DEFAULT_HMAC), "path" => "/api", - "passthrough" => $this->getPassThroughRoutes($container), + "ignore" => $this->getPassThroughRoutes($container), "secure" => true, "relaxed" => [ "localhost", "wnapi.yvan.hu", ], - "error" => function (RequestInterface $request, ResponseInterface $response, $arguments) { + "error" => function (ResponseInterface $response, $arguments) { $data["status"] = "error"; $data["message"] = $arguments["message"]; - return new JsonCorsResponse($data, 401); + return new JsonResponse($data, 401); } ]); } diff --git a/src/App/Middleware/RouteAuthorization.php b/src/App/Middleware/RouteAuthorization.php index 9013903..a0c0699 100644 --- a/src/App/Middleware/RouteAuthorization.php +++ b/src/App/Middleware/RouteAuthorization.php @@ -2,14 +2,16 @@ namespace App\Middleware; -use App\Response\JsonCorsResponse; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; +use Psr\Http\Server\MiddlewareInterface; +use Psr\Http\Server\RequestHandlerInterface; use Zend\Config\Config; +use Zend\Diactoros\Response\JsonResponse; use Zend\Expressive\Router\RouteResult; use Zend\Permissions\Rbac\Rbac; -class RouteAuthorization +class RouteAuthorization implements MiddlewareInterface { private $config; @@ -25,10 +27,17 @@ class RouteAuthorization $this->aclService = $aclService; } - public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next = null) + /** + * Process an incoming server request and return a response, optionally delegating + * response creation to a handler. + * @param ServerRequestInterface $request + * @param RequestHandlerInterface $handler + * @return ResponseInterface + */ + public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { if ($request->getMethod() == 'OPTIONS') { - return $next($request, $response); + return $handler->handle($request); } /** @var RouteResult $routeResult */ @@ -36,10 +45,10 @@ class RouteAuthorization $token = $request->getAttribute('token'); if ($this->hasRouteAccess($routeResult->getMatchedRouteName(), $token->roles ?? [])) { - return $next($request, $response); + return $handler->handle($request); } - return new JsonCorsResponse([ + return new JsonResponse([ 'status' => 'err', 'message' => "Access denied to " . $routeResult->getMatchedRouteName(), ], 401); @@ -72,4 +81,5 @@ class RouteAuthorization { return $this->aclService->isGranted($role, $routeName); } + } diff --git a/src/App/Middleware/RouteAuthorizationFactory.php b/src/App/Middleware/RouteAuthorizationFactory.php index 32cfefa..4aa12b2 100644 --- a/src/App/Middleware/RouteAuthorizationFactory.php +++ b/src/App/Middleware/RouteAuthorizationFactory.php @@ -3,12 +3,13 @@ namespace App\Middleware; use Interop\Container\ContainerInterface; +use Psr\Http\Server\MiddlewareInterface; use Zend\Config\Config; use Zend\Permissions\Rbac\Rbac; class RouteAuthorizationFactory { - public function __invoke(ContainerInterface $container): RouteAuthorization + public function __invoke(ContainerInterface $container): MiddlewareInterface { /** @var Config $config */ $config = new Config($container->get('config')['acl_config']); diff --git a/src/App/Response/JsonCorsResponse.php b/src/App/Response/JsonCorsResponse.php deleted file mode 100644 index 7b71dd9..0000000 --- a/src/App/Response/JsonCorsResponse.php +++ /dev/null @@ -1,32 +0,0 @@ -em = $em; $this->hydrator = $hydrator; $this->authService = $authService; @@ -64,6 +63,9 @@ class FaultManagerService /** * @param int $id * @return Fault|null + * @throws \Doctrine\ORM\ORMException + * @throws \Doctrine\ORM\OptimisticLockException + * @throws \Doctrine\ORM\TransactionRequiredException */ public function getFault(int $id): ?Fault { @@ -72,6 +74,14 @@ class FaultManagerService return $fault; } + /** + * @param $data + * @param $uid + * @return Fault + * @throws \Doctrine\ORM\ORMException + * @throws \Doctrine\ORM\OptimisticLockException + * @throws \Doctrine\ORM\TransactionRequiredException + */ public function createFault($data, $uid): Fault { /** @var User $user */ @@ -100,6 +110,9 @@ class FaultManagerService * @param array $data * @param int $uid * @return Fault + * @throws \Doctrine\ORM\ORMException + * @throws \Doctrine\ORM\OptimisticLockException + * @throws \Doctrine\ORM\TransactionRequiredException */ public function updateFault(int $id, array $data, int $uid): Fault { @@ -174,6 +187,15 @@ class FaultManagerService return false; } + /** + * @param int $id + * @param $data + * @param int $uid + * @return Fault + * @throws \Doctrine\ORM\ORMException + * @throws \Doctrine\ORM\OptimisticLockException + * @throws \Doctrine\ORM\TransactionRequiredException + */ public function addFaultComment(int $id, $data, int $uid): Fault { /** @var Fault $fault */ @@ -195,6 +217,9 @@ class FaultManagerService * @param $data * @param int $uid * @return Fault + * @throws \Doctrine\ORM\ORMException + * @throws \Doctrine\ORM\OptimisticLockException + * @throws \Doctrine\ORM\TransactionRequiredException */ public function rejectFault(int $id, $data, int $uid): Fault { @@ -224,6 +249,8 @@ class FaultManagerService * @param User $user * @param $newState * @param string $comment + * @throws \Doctrine\ORM\ORMException + * @throws \Doctrine\ORM\OptimisticLockException */ private function snapshotHandler(Fault $fault, User $user, $newState, $comment = '') { diff --git a/src/DoctrineExpressiveModule/ConfigProvider.php b/src/DoctrineExpressiveModule/ConfigProvider.php new file mode 100644 index 0000000..fd74d3b --- /dev/null +++ b/src/DoctrineExpressiveModule/ConfigProvider.php @@ -0,0 +1,66 @@ + $this->getDependencies(), + 'form_elements' => $this->getFormElements(), + ]; + } + + /** + * Returns the container dependencies + */ + public function getDependencies() : array + { + return [ + 'aliases' => [ + 'doctrine.hydrator' => Hydrator\DoctrineObject::class, + 'EventManager' => EventManager::class, + \Doctrine\ORM\EntityManager::class => 'doctrine.entity_manager.orm_default', + ], + 'invokables' => [ + EventManager::class => EventManager::class, + ], + 'factories' => [ + Hydrator\DoctrineObject::class => Hydrator\DoctrineObjectFactory::class, + 'doctrine.entity_manager.orm_default' => \ContainerInteropDoctrine\EntityManagerFactory::class, + ], + ]; + } + + /** + * Returns the form dependencies + */ + public function getFormElements() : array + { + return [ + 'aliases' => [ + 'doctrine.object_select' => Form\Element\ObjectSelect::class, + ], + 'factories' => [ + Form\Element\ObjectSelect::class => Form\Element\ElementFactory::class, + ], + ]; + } +} diff --git a/src/DoctrineExpressiveModule/Form/Element/ElementFactory.php b/src/DoctrineExpressiveModule/Form/Element/ElementFactory.php new file mode 100644 index 0000000..0ab0901 --- /dev/null +++ b/src/DoctrineExpressiveModule/Form/Element/ElementFactory.php @@ -0,0 +1,18 @@ +get('doctrine.entity_manager.orm_default'); + /** @var ObjectSelect|ObjectRadio|ObjectMultiCheckbox $element */ + $element = new $elementClass(); + $element->setOption('object_manager', $em); + return $element; + } +} diff --git a/src/DoctrineExpressiveModule/Form/Element/Exception/InvalidRepositoryResultException.php b/src/DoctrineExpressiveModule/Form/Element/Exception/InvalidRepositoryResultException.php new file mode 100644 index 0000000..968e053 --- /dev/null +++ b/src/DoctrineExpressiveModule/Form/Element/Exception/InvalidRepositoryResultException.php @@ -0,0 +1,9 @@ +proxy) { + $this->proxy = new Proxy(); + } + return $this->proxy; + } + + /** + * @param array|\Traversable $options + * @return self + */ + public function setOptions($options) + { + $this->getProxy()->setOptions($options); + return parent::setOptions($options); + } + + /** + * @param string $key + * @param mixed $value + * @return self + */ + public function setOption($key, $value) + { + $this->getProxy()->setOptions([$key => $value]); + return parent::setOption($key, $value); + } + + /** + * {@inheritDoc} + */ + public function setValue($value) + { + if ($value instanceof \Traversable) { + $value = ArrayUtils::iteratorToArray($value); + } elseif ($value == null) { + return parent::setValue([]); + } elseif (! is_array($value)) { + $value = (array)$value; + } + + return parent::setValue(array_map([$this->getProxy(), 'getValue'], $value)); + } + + /** + * {@inheritDoc} + */ + public function getValueOptions() + { + if (! empty($this->valueOptions)) { + return $this->valueOptions; + } + + $proxyValueOptions = $this->getProxy()->getValueOptions(); + + if (! empty($proxyValueOptions)) { + $this->setValueOptions($proxyValueOptions); + } + + return $this->valueOptions; + } +} diff --git a/src/DoctrineExpressiveModule/Form/Element/ObjectRadio.php b/src/DoctrineExpressiveModule/Form/Element/ObjectRadio.php new file mode 100644 index 0000000..05c4315 --- /dev/null +++ b/src/DoctrineExpressiveModule/Form/Element/ObjectRadio.php @@ -0,0 +1,73 @@ +proxy) { + $this->proxy = new Proxy(); + } + return $this->proxy; + } + + /** + * @param array|\Traversable $options + * @return self + */ + public function setOptions($options) + { + $this->getProxy()->setOptions($options); + return parent::setOptions($options); + } + + /** + * @param string $key + * @param mixed $value + * @return self + */ + public function setOption($key, $value) + { + $this->getProxy()->setOptions([$key => $value]); + return parent::setOption($key, $value); + } + + /** + * {@inheritDoc} + */ + public function setValue($value) + { + return parent::setValue($this->getProxy()->getValue($value)); + } + + /** + * {@inheritDoc} + */ + public function getValueOptions() + { + if (! empty($this->valueOptions)) { + return $this->valueOptions; + } + + $proxyValueOptions = $this->getProxy()->getValueOptions(); + + if (! empty($proxyValueOptions)) { + $this->setValueOptions($proxyValueOptions); + } + + return $this->valueOptions; + } +} diff --git a/src/DoctrineExpressiveModule/Form/Element/ObjectSelect.php b/src/DoctrineExpressiveModule/Form/Element/ObjectSelect.php new file mode 100644 index 0000000..2adeacd --- /dev/null +++ b/src/DoctrineExpressiveModule/Form/Element/ObjectSelect.php @@ -0,0 +1,88 @@ +proxy) { + $this->proxy = new Proxy(); + } + return $this->proxy; + } + + /** + * @param array|\Traversable $options + * @return self + */ + public function setOptions($options) + { + $this->getProxy()->setOptions($options); + return parent::setOptions($options); + } + + /** + * @param string $key + * @param mixed $value + * @return self + */ + public function setOption($key, $value) + { + $this->getProxy()->setOptions([$key => $value]); + return parent::setOption($key, $value); + } + + /** + * {@inheritDoc} + */ + public function setValue($value) + { + $multiple = $this->getAttribute('multiple'); + + if (true === $multiple || 'multiple' === $multiple) { + if ($value instanceof \Traversable) { + $value = ArrayUtils::iteratorToArray($value); + } elseif ($value == null) { + return parent::setValue([]); + } elseif (! is_array($value)) { + $value = (array) $value; + } + + return parent::setValue(array_map([$this->getProxy(), 'getValue'], $value)); + } + + return parent::setValue($this->getProxy()->getValue($value)); + } + + /** + * {@inheritDoc} + */ + public function getValueOptions() + { + if (! empty($this->valueOptions)) { + return $this->valueOptions; + } + + $proxyValueOptions = $this->getProxy()->getValueOptions(); + + if (! empty($proxyValueOptions)) { + $this->setValueOptions($proxyValueOptions); + } + + return $this->valueOptions; + } +} diff --git a/src/DoctrineExpressiveModule/Form/Element/Proxy.php b/src/DoctrineExpressiveModule/Form/Element/Proxy.php new file mode 100644 index 0000000..fa73e2a --- /dev/null +++ b/src/DoctrineExpressiveModule/Form/Element/Proxy.php @@ -0,0 +1,653 @@ +setObjectManager($options['object_manager']); + } + + if (isset($options['target_class'])) { + $this->setTargetClass($options['target_class']); + } + + if (isset($options['property'])) { + $this->setProperty($options['property']); + } + + if (isset($options['label_generator'])) { + $this->setLabelGenerator($options['label_generator']); + } + + if (isset($options['find_method'])) { + $this->setFindMethod($options['find_method']); + } + + if (isset($options['is_method'])) { + $this->setIsMethod($options['is_method']); + } + + if (isset($options['display_empty_item'])) { + $this->setDisplayEmptyItem($options['display_empty_item']); + } + + if (isset($options['empty_item_label'])) { + $this->setEmptyItemLabel($options['empty_item_label']); + } + + if (isset($options['option_attributes'])) { + $this->setOptionAttributes($options['option_attributes']); + } + + if (isset($options['optgroup_identifier'])) { + $this->setOptgroupIdentifier($options['optgroup_identifier']); + } + + if (isset($options['optgroup_default'])) { + $this->setOptgroupDefault($options['optgroup_default']); + } + } + + public function getValueOptions() + { + if (empty($this->valueOptions)) { + $this->loadValueOptions(); + } + + return $this->valueOptions; + } + + /** + * @return array|Traversable + */ + public function getObjects() + { + $this->loadObjects(); + + return $this->objects; + } + + /** + * Set the label for the empty option + * + * @param string $emptyItemLabel + * + * @return Proxy + */ + public function setEmptyItemLabel($emptyItemLabel) + { + $this->emptyItemLabel = $emptyItemLabel; + + return $this; + } + + /** + * @return string + */ + public function getEmptyItemLabel() + { + return $this->emptyItemLabel; + } + + /** + * @return array + */ + public function getOptionAttributes() + { + return $this->option_attributes; + } + + /** + * @param array $option_attributes + */ + public function setOptionAttributes(array $option_attributes) + { + $this->option_attributes = $option_attributes; + } + + /** + * Set a flag, whether to include the empty option at the beginning or not + * + * @param boolean $displayEmptyItem + * + * @return Proxy + */ + public function setDisplayEmptyItem($displayEmptyItem) + { + $this->displayEmptyItem = $displayEmptyItem; + + return $this; + } + + /** + * @return boolean + */ + public function getDisplayEmptyItem() + { + return $this->displayEmptyItem; + } + + /** + * Set the object manager + * + * @param ObjectManager $objectManager + * + * @return Proxy + */ + public function setObjectManager(ObjectManager $objectManager) + { + $this->objectManager = $objectManager; + + return $this; + } + + /** + * Get the object manager + * + * @return ObjectManager + */ + public function getObjectManager() + { + return $this->objectManager; + } + + /** + * Set the FQCN of the target object + * + * @param string $targetClass + * + * @return Proxy + */ + public function setTargetClass($targetClass) + { + $this->targetClass = $targetClass; + + return $this; + } + + /** + * Get the target class + * + * @return string + */ + public function getTargetClass() + { + return $this->targetClass; + } + + /** + * Set the property to use as the label in the options + * + * @param string $property + * + * @return Proxy + */ + public function setProperty($property) + { + $this->property = $property; + + return $this; + } + + /** + * @return mixed + */ + public function getProperty() + { + return $this->property; + } + + /** + * Set the label generator callable that is responsible for generating labels for the items in the collection + * + * @param callable $callable A callable used to create a label based off of an Entity + * + * @throws InvalidArgumentException + * + * @return void + */ + public function setLabelGenerator($callable) + { + if (! is_callable($callable)) { + throw new InvalidArgumentException( + 'Property "label_generator" needs to be a callable function or a \Closure' + ); + } + + $this->labelGenerator = $callable; + } + + /** + * @return callable|null + */ + public function getLabelGenerator() + { + return $this->labelGenerator; + } + + /** + * @return string|null + */ + public function getOptgroupIdentifier() + { + return $this->optgroupIdentifier; + } + + /** + * @param string $optgroupIdentifier + */ + public function setOptgroupIdentifier($optgroupIdentifier) + { + $this->optgroupIdentifier = (string) $optgroupIdentifier; + } + + /** + * @return string|null + */ + public function getOptgroupDefault() + { + return $this->optgroupDefault; + } + + /** + * @param string $optgroupDefault + */ + public function setOptgroupDefault($optgroupDefault) + { + $this->optgroupDefault = (string) $optgroupDefault; + } + + /** + * Set if the property is a method to use as the label in the options + * + * @param boolean $method + * + * @return Proxy + */ + public function setIsMethod($method) + { + $this->isMethod = (bool) $method; + + return $this; + } + + /** + * @return mixed + */ + public function getIsMethod() + { + return $this->isMethod; + } + + /** Set the findMethod property to specify the method to use on repository + * + * @param array $findMethod + * + * @return Proxy + */ + public function setFindMethod($findMethod) + { + $this->findMethod = $findMethod; + + return $this; + } + + /** + * Get findMethod definition + * + * @return array + */ + public function getFindMethod() + { + return $this->findMethod; + } + + /** + * @param $targetEntity + * + * @return string|null + */ + protected function generateLabel($targetEntity) + { + if (null === ($labelGenerator = $this->getLabelGenerator())) { + return null; + } + + return call_user_func($labelGenerator, $targetEntity); + } + + /** + * @param $value + * + * @return array|mixed|object + * @throws RuntimeException + */ + public function getValue($value) + { + if (! ($om = $this->getObjectManager())) { + throw new RuntimeException('No object manager was set'); + } + + if (! ($targetClass = $this->getTargetClass())) { + throw new RuntimeException('No target class was set'); + } + + $metadata = $om->getClassMetadata($targetClass); + + if (is_object($value)) { + if ($value instanceof Collection) { + $data = []; + + foreach ($value as $object) { + $values = $metadata->getIdentifierValues($object); + $data[] = array_shift($values); + } + + $value = $data; + } else { + $metadata = $om->getClassMetadata(get_class($value)); + $identifier = $metadata->getIdentifierFieldNames(); + + // TODO: handle composite (multiple) identifiers + if (null !== $identifier && count($identifier) > 1) { + //$value = $key; + } else { + $value = current($metadata->getIdentifierValues($value)); + } + } + } + + return $value; + } + + /** + * Load objects + * + * @throws RuntimeException + * @throws Exception\InvalidRepositoryResultException + * @return void + */ + protected function loadObjects() + { + if (! empty($this->objects)) { + return; + } + + $findMethod = (array) $this->getFindMethod(); + + if (! $findMethod) { + $findMethodName = 'findAll'; + $repository = $this->objectManager->getRepository($this->targetClass); + $objects = $repository->findAll(); + } else { + if (! isset($findMethod['name'])) { + throw new RuntimeException('No method name was set'); + } + $findMethodName = $findMethod['name']; + $findMethodParams = isset($findMethod['params']) ? array_change_key_case($findMethod['params']) : []; + $repository = $this->objectManager->getRepository($this->targetClass); + + if (! method_exists($repository, $findMethodName)) { + throw new RuntimeException( + sprintf( + 'Method "%s" could not be found in repository "%s"', + $findMethodName, + get_class($repository) + ) + ); + } + + $r = new ReflectionMethod($repository, $findMethodName); + $args = []; + + foreach ($r->getParameters() as $param) { + if (array_key_exists(strtolower($param->getName()), $findMethodParams)) { + $args[] = $findMethodParams[strtolower($param->getName())]; + } elseif ($param->isDefaultValueAvailable()) { + $args[] = $param->getDefaultValue(); + } elseif (! $param->isOptional()) { + throw new RuntimeException( + sprintf( + 'Required parameter "%s" with no default value for method "%s" in repository "%s"' + . ' was not provided', + $param->getName(), + $findMethodName, + get_class($repository) + ) + ); + } + } + $objects = $r->invokeArgs($repository, $args); + } + + $this->guardForArrayOrTraversable( + $objects, + sprintf('%s::%s() return value', get_class($repository), $findMethodName), + 'DoctrineModule\Form\Element\Exception\InvalidRepositoryResultException' + ); + + $this->objects = $objects; + } + + /** + * Load value options + * + * @throws RuntimeException + * @return void + */ + protected function loadValueOptions() + { + if (! ($om = $this->objectManager)) { + throw new RuntimeException('No object manager was set'); + } + + if (! ($targetClass = $this->targetClass)) { + throw new RuntimeException('No target class was set'); + } + + $metadata = $om->getClassMetadata($targetClass); + $identifier = $metadata->getIdentifierFieldNames(); + $objects = $this->getObjects(); + $options = []; + $optionAttributes = []; + + if ($this->displayEmptyItem) { + $options[''] = $this->getEmptyItemLabel(); + } + + foreach ($objects as $key => $object) { + if (null !== ($generatedLabel = $this->generateLabel($object))) { + $label = $generatedLabel; + } elseif ($property = $this->property) { + if ($this->isMethod == false && ! $metadata->hasField($property)) { + throw new RuntimeException( + sprintf( + 'Property "%s" could not be found in object "%s"', + $property, + $targetClass + ) + ); + } + + $getter = 'get' . Inflector::classify($property); + + if (! is_callable([$object, $getter])) { + throw new RuntimeException( + sprintf('Method "%s::%s" is not callable', $this->targetClass, $getter) + ); + } + + $label = $object->{$getter}(); + } else { + if (! is_callable([$object, '__toString'])) { + throw new RuntimeException( + sprintf( + '%s must have a "__toString()" method defined if you have not set a property' + . ' or method to use.', + $targetClass + ) + ); + } + + $label = (string) $object; + } + + if (null !== $identifier && count($identifier) > 1) { + $value = $key; + } else { + $value = current($metadata->getIdentifierValues($object)); + } + + foreach ($this->getOptionAttributes() as $optionKey => $optionValue) { + if (is_string($optionValue)) { + $optionAttributes[$optionKey] = $optionValue; + + continue; + } + + if (is_callable($optionValue)) { + $callableValue = call_user_func($optionValue, $object); + $optionAttributes[$optionKey] = (string) $callableValue; + + continue; + } + + throw new RuntimeException( + sprintf( + 'Parameter "option_attributes" expects an array of key => value where value is of type' + . '"string" or "callable". Value of type "%s" found.', + gettype($optionValue) + ) + ); + } + + // If no optgroup_identifier has been configured, apply default handling and continue + if (is_null($this->getOptgroupIdentifier())) { + $options[] = ['label' => $label, 'value' => $value, 'attributes' => $optionAttributes]; + + continue; + } + + // optgroup_identifier found, handle grouping + $optgroupGetter = 'get' . Inflector::classify($this->getOptgroupIdentifier()); + + if (! is_callable([$object, $optgroupGetter])) { + throw new RuntimeException( + sprintf('Method "%s::%s" is not callable', $this->targetClass, $optgroupGetter) + ); + } + + $optgroup = $object->{$optgroupGetter}(); + + // optgroup_identifier contains a valid group-name. Handle default grouping. + if (false === is_null($optgroup) && trim($optgroup) !== '') { + $options[$optgroup]['label'] = $optgroup; + $options[$optgroup]['options'][] = [ + 'label' => $label, + 'value' => $value, + 'attributes' => $optionAttributes, + ]; + + continue; + } + + $optgroupDefault = $this->getOptgroupDefault(); + + // No optgroup_default has been provided. Line up without a group + if (is_null($optgroupDefault)) { + $options[] = ['label' => $label, 'value' => $value, 'attributes' => $optionAttributes]; + + continue; + } + + // Line up entry with optgroup_default + $options[$optgroupDefault]['label'] = $optgroupDefault; + $options[$optgroupDefault]['options'][] = [ + 'label' => $label, + 'value' => $value, + 'attributes' => $optionAttributes, + ]; + } + + $this->valueOptions = $options; + } +} diff --git a/src/DoctrineExpressiveModule/Hydrator/DoctrineObject.php b/src/DoctrineExpressiveModule/Hydrator/DoctrineObject.php new file mode 100755 index 0000000..9b9a7b9 --- /dev/null +++ b/src/DoctrineExpressiveModule/Hydrator/DoctrineObject.php @@ -0,0 +1,613 @@ +. + */ + +namespace DoctrineExpressiveModule\Hydrator; + +use DateTime; +use DateTimeImmutable; +use Doctrine\Common\Persistence\Mapping\ClassMetadata; +use Doctrine\Common\Persistence\ObjectManager; +use Doctrine\Common\Util\Inflector; +use InvalidArgumentException; +use RuntimeException; +use Traversable; +use Zend\Stdlib\ArrayUtils; +use Zend\Hydrator\AbstractHydrator; +use Zend\Hydrator\Filter\FilterProviderInterface; + +/** + * This hydrator has been completely refactored for DoctrineModule 0.7.0. It provides an easy and powerful way + * of extracting/hydrator objects in Doctrine, by handling most associations types. + * + * Starting from DoctrineModule 0.8.0, the hydrator can be used multiple times with different objects + * + * @license MIT + * @link http://www.doctrine-project.org/ + * @since 0.7.0 + * @author Michael Gallego + */ +class DoctrineObject extends AbstractHydrator +{ + /** + * @var ObjectManager + */ + protected $objectManager; + + /** + * @var ClassMetadata + */ + protected $metadata; + + /** + * @var bool + */ + protected $byValue = true; + + + /** + * Constructor + * + * @param ObjectManager $objectManager The ObjectManager to use + * @param bool $byValue If set to true, hydrator will always use entity's public API + */ + public function __construct(ObjectManager $objectManager, $byValue = true) + { + parent::__construct(); + + $this->objectManager = $objectManager; + $this->byValue = (bool) $byValue; + } + + /** + * Extract values from an object + * + * @param object $object + * @return array + */ + public function extract($object) + { + $this->prepare($object); + + if ($this->byValue) { + return $this->extractByValue($object); + } + + return $this->extractByReference($object); + } + + /** + * Hydrate $object with the provided $data. + * + * @param array $data + * @param object $object + * @return object + */ + public function hydrate(array $data, $object) + { + $this->prepare($object); + + if ($this->byValue) { + return $this->hydrateByValue($data, $object); + } + + return $this->hydrateByReference($data, $object); + } + + /** + * Prepare the hydrator by adding strategies to every collection valued associations + * + * @param object $object + * @return void + */ + protected function prepare($object) + { + $this->metadata = $this->objectManager->getClassMetadata(get_class($object)); + $this->prepareStrategies(); + } + + /** + * Prepare strategies before the hydrator is used + * + * @throws \InvalidArgumentException + * @return void + */ + protected function prepareStrategies() + { + $associations = $this->metadata->getAssociationNames(); + + foreach ($associations as $association) { + if ($this->metadata->isCollectionValuedAssociation($association)) { + // Add a strategy if the association has none set by user + if (!$this->hasStrategy($association)) { + if ($this->byValue) { + $this->addStrategy($association, new Strategy\AllowRemoveByValue()); + } else { + $this->addStrategy($association, new Strategy\AllowRemoveByReference()); + } + } + + $strategy = $this->getStrategy($association); + + if (!$strategy instanceof Strategy\AbstractCollectionStrategy) { + throw new InvalidArgumentException( + sprintf( + 'Strategies used for collections valued associations must inherit from ' + . 'Strategy\AbstractCollectionStrategy, %s given', + get_class($strategy) + ) + ); + } + + $strategy->setCollectionName($association) + ->setClassMetadata($this->metadata); + } + } + } + + /** + * Extract values from an object using a by-value logic (this means that it uses the entity + * API, in this case, getters) + * + * @param object $object + * @throws RuntimeException + * @return array + */ + protected function extractByValue($object) + { + $fieldNames = array_merge($this->metadata->getFieldNames(), $this->metadata->getAssociationNames()); + $methods = get_class_methods($object); + $filter = $object instanceof FilterProviderInterface + ? $object->getFilter() + : $this->filterComposite; + + $data = []; + foreach ($fieldNames as $fieldName) { + if ($filter && !$filter->filter($fieldName)) { + continue; + } + + $getter = 'get' . Inflector::classify($fieldName); + $isser = 'is' . Inflector::classify($fieldName); + + $dataFieldName = $this->computeExtractFieldName($fieldName); + if (in_array($getter, $methods)) { + $data[$dataFieldName] = $this->extractValue($fieldName, $object->$getter(), $object); + } elseif (in_array($isser, $methods)) { + $data[$dataFieldName] = $this->extractValue($fieldName, $object->$isser(), $object); + } elseif (substr($fieldName, 0, 2) === 'is' + && ctype_upper(substr($fieldName, 2, 1)) + && in_array($fieldName, $methods)) { + $data[$dataFieldName] = $this->extractValue($fieldName, $object->$fieldName(), $object); + } + + // Unknown fields are ignored + } + + return $data; + } + + /** + * Extract values from an object using a by-reference logic (this means that values are + * directly fetched without using the public API of the entity, in this case, getters) + * + * @param object $object + * @return array + */ + protected function extractByReference($object) + { + $fieldNames = array_merge($this->metadata->getFieldNames(), $this->metadata->getAssociationNames()); + $refl = $this->metadata->getReflectionClass(); + $filter = $object instanceof FilterProviderInterface + ? $object->getFilter() + : $this->filterComposite; + + $data = []; + foreach ($fieldNames as $fieldName) { + if ($filter && !$filter->filter($fieldName)) { + continue; + } + $reflProperty = $refl->getProperty($fieldName); + $reflProperty->setAccessible(true); + + $dataFieldName = $this->computeExtractFieldName($fieldName); + $data[$dataFieldName] = $this->extractValue($fieldName, $reflProperty->getValue($object), $object); + } + + return $data; + } + + /** + * Hydrate the object using a by-value logic (this means that it uses the entity API, in this + * case, setters) + * + * @param array $data + * @param object $object + * @throws RuntimeException + * @return object + */ + protected function hydrateByValue(array $data, $object) + { + $tryObject = $this->tryConvertArrayToObject($data, $object); + $metadata = $this->metadata; + + if (is_object($tryObject)) { + $object = $tryObject; + } + + foreach ($data as $field => $value) { + $field = $this->computeHydrateFieldName($field); + $value = $this->handleTypeConversions($value, $metadata->getTypeOfField($field)); + $setter = 'set' . Inflector::classify($field); + + if ($metadata->hasAssociation($field)) { + $target = $metadata->getAssociationTargetClass($field); + + if ($metadata->isSingleValuedAssociation($field)) { + if (! method_exists($object, $setter)) { + continue; + } + + $value = $this->toOne($target, $this->hydrateValue($field, $value, $data)); + + if (null === $value + && !current($metadata->getReflectionClass()->getMethod($setter)->getParameters())->allowsNull() + ) { + continue; + } + + $object->$setter($value); + } elseif ($metadata->isCollectionValuedAssociation($field)) { + $this->toMany($object, $field, $target, $value); + } + } else { + if (! method_exists($object, $setter)) { + continue; + } + + $object->$setter($this->hydrateValue($field, $value, $data)); + } + } + + return $object; + } + + /** + * Hydrate the object using a by-reference logic (this means that values are modified directly without + * using the public API, in this case setters, and hence override any logic that could be done in those + * setters) + * + * @param array $data + * @param object $object + * @return object + */ + protected function hydrateByReference(array $data, $object) + { + $tryObject = $this->tryConvertArrayToObject($data, $object); + $metadata = $this->metadata; + $refl = $metadata->getReflectionClass(); + + if (is_object($tryObject)) { + $object = $tryObject; + } + + foreach ($data as $field => $value) { + $field = $this->computeHydrateFieldName($field); + + // Ignore unknown fields + if (!$refl->hasProperty($field)) { + continue; + } + + $value = $this->handleTypeConversions($value, $metadata->getTypeOfField($field)); + $reflProperty = $refl->getProperty($field); + $reflProperty->setAccessible(true); + + if ($metadata->hasAssociation($field)) { + $target = $metadata->getAssociationTargetClass($field); + + if ($metadata->isSingleValuedAssociation($field)) { + $value = $this->toOne($target, $this->hydrateValue($field, $value, $data)); + $reflProperty->setValue($object, $value); + } elseif ($metadata->isCollectionValuedAssociation($field)) { + $this->toMany($object, $field, $target, $value); + } + } else { + $reflProperty->setValue($object, $this->hydrateValue($field, $value, $data)); + } + } + + return $object; + } + + /** + * This function tries, given an array of data, to convert it to an object if the given array contains + * an identifier for the object. This is useful in a context of updating existing entities, without ugly + * tricks like setting manually the existing id directly into the entity + * + * @param array $data The data that may contain identifiers keys + * @param object $object + * @return object + */ + protected function tryConvertArrayToObject($data, $object) + { + $metadata = $this->metadata; + $identifierNames = $metadata->getIdentifierFieldNames($object); + $identifierValues = []; + + if (empty($identifierNames)) { + return $object; + } + + foreach ($identifierNames as $identifierName) { + if (!isset($data[$identifierName])) { + return $object; + } + + $identifierValues[$identifierName] = $data[$identifierName]; + } + + return $this->find($identifierValues, $metadata->getName()); + } + + /** + * Handle ToOne associations + * + * When $value is an array but is not the $target's identifiers, $value is + * most likely an array of fieldset data. The identifiers will be determined + * and a target instance will be initialized and then hydrated. The hydrated + * target will be returned. + * + * @param string $target + * @param mixed $value + * @return object + */ + protected function toOne($target, $value) + { + $metadata = $this->objectManager->getClassMetadata($target); + + if (is_array($value) && array_keys($value) != $metadata->getIdentifier()) { + // $value is most likely an array of fieldset data + $identifiers = array_intersect_key( + $value, + array_flip($metadata->getIdentifier()) + ); + $object = $this->find($identifiers, $target) ?: new $target; + return $this->hydrate($value, $object); + } + + return $this->find($value, $target); + } + + /** + * Handle ToMany associations. In proper Doctrine design, Collections should not be swapped, so + * collections are always handled by reference. Internally, every collection is handled using specials + * strategies that inherit from AbstractCollectionStrategy class, and that add or remove elements but without + * changing the collection of the object + * + * @param object $object + * @param mixed $collectionName + * @param string $target + * @param mixed $values + * + * @throws \InvalidArgumentException + * + * @return void + */ + protected function toMany($object, $collectionName, $target, $values) + { + $metadata = $this->objectManager->getClassMetadata(ltrim($target, '\\')); + $identifier = $metadata->getIdentifier(); + + if (!is_array($values) && !$values instanceof Traversable) { + $values = (array)$values; + } + + $collection = []; + + // If the collection contains identifiers, fetch the objects from database + foreach ($values as $value) { + if ($value instanceof $target) { + // assumes modifications have already taken place in object + $collection[] = $value; + continue; + } elseif (empty($value)) { + // assumes no id and retrieves new $target + $collection[] = $this->find($value, $target); + continue; + } + + $find = []; + if (is_array($identifier)) { + foreach ($identifier as $field) { + switch (gettype($value)) { + case 'object': + $getter = 'get' . ucfirst($field); + if (method_exists($value, $getter)) { + $find[$field] = $value->$getter(); + } elseif (property_exists($value, $field)) { + $find[$field] = $value->$field; + } + break; + case 'array': + if (array_key_exists($field, $value) && $value[$field] != null) { + $find[$field] = $value[$field]; + unset($value[$field]); // removed identifier from persistable data + } + break; + default: + $find[$field] = $value; + break; + } + } + } + + if (!empty($find) && $found = $this->find($find, $target)) { + $collection[] = (is_array($value)) ? $this->hydrate($value, $found) : $found; + } else { + $collection[] = (is_array($value)) ? $this->hydrate($value, new $target) : new $target; + } + } + + $collection = array_filter( + $collection, + function ($item) { + return null !== $item; + } + ); + + // Set the object so that the strategy can extract the Collection from it + + /** @var \DoctrineModule\Stdlib\Hydrator\Strategy\AbstractCollectionStrategy $collectionStrategy */ + $collectionStrategy = $this->getStrategy($collectionName); + $collectionStrategy->setObject($object); + + // We could directly call hydrate method from the strategy, but if people want to override + // hydrateValue function, they can do it and do their own stuff + $this->hydrateValue($collectionName, $collection, $values); + } + + /** + * Handle various type conversions that should be supported natively by Doctrine (like DateTime) + * + * @param mixed $value + * @param string $typeOfField + * @return DateTime|DateTimeImmutable + * @throws \Exception + */ + protected function handleTypeConversions($value, $typeOfField) + { + switch ($typeOfField) { + case 'datetimetz': + case 'datetime': + case 'time': + case 'date': + if ('' === $value) { + return null; + } + + if (is_int($value)) { + $dateTime = new DateTime(); + $dateTime->setTimestamp($value); + $value = $dateTime; + } elseif (is_string($value)) { + $value = new DateTime($value); + } + + break; + case 'datetimetz_immutable': + case 'datetime_immutable': + case 'time_immutable': + case 'date_immutable': + if ('' === $value) { + return null; + } + + if (is_int($value)) { + $dateTime = new DateTimeImmutable(); + $dateTime->setTimestamp($value); + $value = $dateTime; + } elseif (is_string($value)) { + $value = new DateTimeImmutable($value); + } + + break; + default: + } + + return $value; + } + + /** + * Find an object by a given target class and identifier + * + * @param mixed $identifiers + * @param string $targetClass + * + * @return object|null + */ + protected function find($identifiers, $targetClass) + { + if ($identifiers instanceof $targetClass) { + return $identifiers; + } + + if ($this->isNullIdentifier($identifiers)) { + return null; + } + + return $this->objectManager->find($targetClass, $identifiers); + } + + /** + * Verifies if a provided identifier is to be considered null + * + * @param mixed $identifier + * + * @return bool + */ + private function isNullIdentifier($identifier) + { + if (null === $identifier) { + return true; + } + + if ($identifier instanceof Traversable || is_array($identifier)) { + $nonNullIdentifiers = array_filter( + ArrayUtils::iteratorToArray($identifier), + function ($value) { + return null !== $value; + } + ); + + return empty($nonNullIdentifiers); + } + + return false; + } + + /** + * Applies the naming strategy if there is one set + * + * @param string $field + * + * @return string + */ + protected function computeHydrateFieldName($field) + { + if ($this->hasNamingStrategy()) { + $field = $this->getNamingStrategy()->hydrate($field); + } + return $field; + } + + /** + * Applies the naming strategy if there is one set + * + * @param string $field + * + * @return string + */ + protected function computeExtractFieldName($field) + { + if ($this->hasNamingStrategy()) { + $field = $this->getNamingStrategy()->extract($field); + } + return $field; + } +} diff --git a/src/DoctrineExpressiveModule/Hydrator/DoctrineObjectFactory.php b/src/DoctrineExpressiveModule/Hydrator/DoctrineObjectFactory.php new file mode 100644 index 0000000..d41e6c0 --- /dev/null +++ b/src/DoctrineExpressiveModule/Hydrator/DoctrineObjectFactory.php @@ -0,0 +1,15 @@ +get('doctrine.entity_manager.orm_default'); + return new DoctrineObject($em); + } +} diff --git a/src/DoctrineExpressiveModule/Hydrator/Filter/PropertyName.php b/src/DoctrineExpressiveModule/Hydrator/Filter/PropertyName.php new file mode 100644 index 0000000..c1c9067 --- /dev/null +++ b/src/DoctrineExpressiveModule/Hydrator/Filter/PropertyName.php @@ -0,0 +1,66 @@ +. + */ + +namespace DoctrineExpressiveModule\Hydrator\Filter; + +use Zend\Hydrator\Filter\FilterInterface; + +/** + * Provides a filter to restrict returned fields by whitelisting or + * blacklisting property names. + * + * @license MIT + * @link http://www.doctrine-project.org/ + * @author Liam O'Boyle + */ +class PropertyName implements FilterInterface +{ + /** + * The propteries to exclude. + * + * @var array + */ + protected $properties = []; + + /** + * Either an exclude or an include. + * + * @var bool + */ + protected $exclude = null; + + /** + * @param [ string | array ] $properties The properties to exclude or include. + * @param bool $exclude If the method should be excluded + */ + public function __construct($properties, $exclude = true) + { + $this->exclude = $exclude; + $this->properties = is_array($properties) + ? $properties + : [$properties]; + } + + public function filter($property) + { + return in_array($property, $this->properties) + ? !$this->exclude + : $this->exclude; + } +} diff --git a/src/DoctrineExpressiveModule/Hydrator/Strategy/AbstractCollectionStrategy.php b/src/DoctrineExpressiveModule/Hydrator/Strategy/AbstractCollectionStrategy.php new file mode 100644 index 0000000..2eff700 --- /dev/null +++ b/src/DoctrineExpressiveModule/Hydrator/Strategy/AbstractCollectionStrategy.php @@ -0,0 +1,190 @@ +. + */ + +namespace DoctrineExpressiveModule\Hydrator\Strategy; + +use InvalidArgumentException; +use Doctrine\Common\Collections\Collection; +use Doctrine\Common\Persistence\Mapping\ClassMetadata; +use Zend\Hydrator\Strategy\StrategyInterface; + +/** + * @license MIT + * @link http://www.doctrine-project.org/ + * @since 0.7.0 + * @author Michael Gallego + */ +abstract class AbstractCollectionStrategy implements StrategyInterface +{ + /** + * @var string + */ + protected $collectionName; + + /** + * @var ClassMetadata + */ + protected $metadata; + + /** + * @var object + */ + protected $object; + + + /** + * Set the name of the collection + * + * @param string $collectionName + * @return AbstractCollectionStrategy + */ + public function setCollectionName($collectionName) + { + $this->collectionName = (string) $collectionName; + return $this; + } + + /** + * Get the name of the collection + * + * @return string + */ + public function getCollectionName() + { + return $this->collectionName; + } + + /** + * Set the class metadata + * + * @param ClassMetadata $classMetadata + * @return AbstractCollectionStrategy + */ + public function setClassMetadata(ClassMetadata $classMetadata) + { + $this->metadata = $classMetadata; + return $this; + } + + /** + * Get the class metadata + * + * @return ClassMetadata + */ + public function getClassMetadata() + { + return $this->metadata; + } + + /** + * Set the object + * + * @param object $object + * + * @throws \InvalidArgumentException + * + * @return AbstractCollectionStrategy + */ + public function setObject($object) + { + if (!is_object($object)) { + throw new InvalidArgumentException( + sprintf('The parameter given to setObject method of %s class is not an object', get_called_class()) + ); + } + + $this->object = $object; + return $this; + } + + /** + * Get the object + * + * @return object + */ + public function getObject() + { + return $this->object; + } + + /** + * {@inheritDoc} + */ + public function extract($value) + { + return $value; + } + + /** + * Return the collection by value (using the public API) + * + * @throws \InvalidArgumentException + * + * @return Collection + */ + protected function getCollectionFromObjectByValue() + { + $object = $this->getObject(); + $getter = 'get' . ucfirst($this->getCollectionName()); + + if (!method_exists($object, $getter)) { + throw new InvalidArgumentException( + sprintf( + 'The getter %s to access collection %s in object %s does not exist', + $getter, + $this->getCollectionName(), + get_class($object) + ) + ); + } + + return $object->$getter(); + } + + /** + * Return the collection by reference (not using the public API) + * + * @return Collection + */ + protected function getCollectionFromObjectByReference() + { + $object = $this->getObject(); + $refl = $this->getClassMetadata()->getReflectionClass(); + $reflProperty = $refl->getProperty($this->getCollectionName()); + + $reflProperty->setAccessible(true); + + return $reflProperty->getValue($object); + } + + + /** + * This method is used internally by array_udiff to check if two objects are equal, according to their + * SPL hash. This is needed because the native array_diff only compare strings + * + * @param object $a + * @param object $b + * + * @return int + */ + protected function compareObjects($a, $b) + { + return strcmp(spl_object_hash($a), spl_object_hash($b)); + } +} diff --git a/src/DoctrineExpressiveModule/Hydrator/Strategy/AllowRemoveByReference.php b/src/DoctrineExpressiveModule/Hydrator/Strategy/AllowRemoveByReference.php new file mode 100644 index 0000000..94c33ef --- /dev/null +++ b/src/DoctrineExpressiveModule/Hydrator/Strategy/AllowRemoveByReference.php @@ -0,0 +1,58 @@ +. + */ + +namespace DoctrineExpressiveModule\Hydrator\Strategy; + +/** + * When this strategy is used for Collections, if the new collection does not contain elements that are present in + * the original collection, then this strategy remove elements from the original collection. For instance, if the + * collection initially contains elements A and B, and that the new collection contains elements B and C, then the + * final collection will contain elements B and C (while element A will be asked to be removed). + * + * This strategy is by reference, this means it won't use public API to add/remove elements to the collection + * + * @license MIT + * @link http://www.doctrine-project.org/ + * @since 0.7.0 + * @author Michael Gallego + */ +class AllowRemoveByReference extends AbstractCollectionStrategy +{ + /** + * {@inheritDoc} + */ + public function hydrate($value) + { + $collection = $this->getCollectionFromObjectByReference(); + $collectionArray = $collection->toArray(); + + $toAdd = array_udiff($value, $collectionArray, [$this, 'compareObjects']); + $toRemove = array_udiff($collectionArray, $value, [$this, 'compareObjects']); + + foreach ($toAdd as $element) { + $collection->add($element); + } + + foreach ($toRemove as $element) { + $collection->removeElement($element); + } + + return $collection; + } +} diff --git a/src/DoctrineExpressiveModule/Hydrator/Strategy/AllowRemoveByValue.php b/src/DoctrineExpressiveModule/Hydrator/Strategy/AllowRemoveByValue.php new file mode 100644 index 0000000..30a2806 --- /dev/null +++ b/src/DoctrineExpressiveModule/Hydrator/Strategy/AllowRemoveByValue.php @@ -0,0 +1,76 @@ +. + */ + +namespace DoctrineExpressiveModule\Hydrator\Strategy; + +use Doctrine\Common\Collections\Collection; +use LogicException; +use Doctrine\Common\Collections\ArrayCollection; + +/** + * When this strategy is used for Collections, if the new collection does not contain elements that are present in + * the original collection, then this strategy remove elements from the original collection. For instance, if the + * collection initially contains elements A and B, and that the new collection contains elements B and C, then the + * final collection will contain elements B and C (while element A will be asked to be removed). + * + * This strategy is by value, this means it will use the public API (in this case, adder and remover) + * + * @license MIT + * @link http://www.doctrine-project.org/ + * @since 0.7.0 + * @author Michael Gallego + */ +class AllowRemoveByValue extends AbstractCollectionStrategy +{ + /** + * {@inheritDoc} + */ + public function hydrate($value) + { + // AllowRemove strategy need "adder" and "remover" + $adder = 'add' . ucfirst($this->collectionName); + $remover = 'remove' . ucfirst($this->collectionName); + + if (!method_exists($this->object, $adder) || !method_exists($this->object, $remover)) { + throw new LogicException( + sprintf( + 'AllowRemove strategy for DoctrineModule hydrator requires both %s and %s to be defined in %s + entity domain code, but one or both seem to be missing', + $adder, + $remover, + get_class($this->object) + ) + ); + } + + $collection = $this->getCollectionFromObjectByValue(); + + if ($collection instanceof Collection) { + $collection = $collection->toArray(); + } + + $toAdd = new ArrayCollection(array_udiff($value, $collection, [$this, 'compareObjects'])); + $toRemove = new ArrayCollection(array_udiff($collection, $value, [$this, 'compareObjects'])); + + $this->object->$adder($toAdd); + $this->object->$remover($toRemove); + + return $collection; + } +} diff --git a/src/DoctrineExpressiveModule/Hydrator/Strategy/DisallowRemoveByReference.php b/src/DoctrineExpressiveModule/Hydrator/Strategy/DisallowRemoveByReference.php new file mode 100644 index 0000000..47eadc2 --- /dev/null +++ b/src/DoctrineExpressiveModule/Hydrator/Strategy/DisallowRemoveByReference.php @@ -0,0 +1,53 @@ +. + */ + +namespace DoctrineExpressiveModule\Hydrator\Strategy; + +/** + * When this strategy is used for Collections, if the new collection does not contain elements that are present in + * the original collection, then this strategy will not remove those elements. At most, it will add new elements. For + * instance, if the collection initially contains elements A and B, and that the new collection contains elements B + * and C, then the final collection will contain elements A, B and C. + * + * This strategy is by reference, this means it won't use the public API to remove elements + * + * @license MIT + * @link http://www.doctrine-project.org/ + * @since 0.7.0 + * @author Michael Gallego + */ +class DisallowRemoveByReference extends AbstractCollectionStrategy +{ + /** + * {@inheritDoc} + */ + public function hydrate($value) + { + $collection = $this->getCollectionFromObjectByReference(); + $collectionArray = $collection->toArray(); + + $toAdd = array_udiff($value, $collectionArray, [$this, 'compareObjects']); + + foreach ($toAdd as $element) { + $collection->add($element); + } + + return $collection; + } +} diff --git a/src/DoctrineExpressiveModule/Hydrator/Strategy/DisallowRemoveByValue.php b/src/DoctrineExpressiveModule/Hydrator/Strategy/DisallowRemoveByValue.php new file mode 100644 index 0000000..77df2be --- /dev/null +++ b/src/DoctrineExpressiveModule/Hydrator/Strategy/DisallowRemoveByValue.php @@ -0,0 +1,72 @@ +. + */ + +namespace DoctrineExpressiveModule\Hydrator\Strategy; + +use Doctrine\Common\Collections\Collection; +use LogicException; +use Doctrine\Common\Collections\ArrayCollection; + +/** + * When this strategy is used for Collections, if the new collection does not contain elements that are present in + * the original collection, then this strategy will not remove those elements. At most, it will add new elements. For + * instance, if the collection initially contains elements A and B, and that the new collection contains elements B + * and C, then the final collection will contain elements A, B and C. + * + * This strategy is by value, this means it will use the public API (in this case, remover) + * + * @license MIT + * @link http://www.doctrine-project.org/ + * @since 0.7.0 + * @author Michael Gallego + */ +class DisallowRemoveByValue extends AbstractCollectionStrategy +{ + /** + * {@inheritDoc} + */ + public function hydrate($value) + { + // AllowRemove strategy need "adder" + $adder = 'add' . ucfirst($this->collectionName); + + if (!method_exists($this->object, $adder)) { + throw new LogicException( + sprintf( + 'DisallowRemove strategy for DoctrineModule hydrator requires %s to + be defined in %s entity domain code, but it seems to be missing', + $adder, + get_class($this->object) + ) + ); + } + + $collection = $this->getCollectionFromObjectByValue(); + + if ($collection instanceof Collection) { + $collection = $collection->toArray(); + } + + $toAdd = new ArrayCollection(array_udiff($value, $collection, [$this, 'compareObjects'])); + + $this->object->$adder($toAdd); + + return $collection; + } +} diff --git a/src/DoctrineExpressiveModule/Validator/NoObjectExists.php b/src/DoctrineExpressiveModule/Validator/NoObjectExists.php new file mode 100644 index 0000000..a28b88a --- /dev/null +++ b/src/DoctrineExpressiveModule/Validator/NoObjectExists.php @@ -0,0 +1,43 @@ + + */ +class NoObjectExists extends ObjectExists +{ + /** + * Error constants + */ + const ERROR_OBJECT_FOUND = 'objectFound'; + + /** + * @var array Message templates + */ + protected $messageTemplates = [ + self::ERROR_OBJECT_FOUND => "An object matching '%value%' was found", + ]; + + /** + * {@inheritDoc} + */ + public function isValid($value) + { + $cleanedValue = $this->cleanSearchValue($value); + $match = $this->objectRepository->findOneBy($cleanedValue); + + if (is_object($match)) { + $this->error(self::ERROR_OBJECT_FOUND, $value); + + return false; + } + + return true; + } +} diff --git a/src/DoctrineExpressiveModule/Validator/ObjectExists.php b/src/DoctrineExpressiveModule/Validator/ObjectExists.php new file mode 100644 index 0000000..3b67ad0 --- /dev/null +++ b/src/DoctrineExpressiveModule/Validator/ObjectExists.php @@ -0,0 +1,175 @@ + + */ +class ObjectExists extends AbstractValidator +{ + /** + * Error constants + */ + const ERROR_NO_OBJECT_FOUND = 'noObjectFound'; + + /** + * @var array Message templates + */ + protected $messageTemplates = [ + self::ERROR_NO_OBJECT_FOUND => "No object matching '%value%' was found", + ]; + + /** + * ObjectRepository from which to search for entities + * + * @var ObjectRepository + */ + protected $objectRepository; + + /** + * Fields to be checked + * + * @var array + */ + protected $fields; + + /** + * Constructor + * + * @param array $options required keys are `object_repository`, which must be an instance of + * Doctrine\Common\Persistence\ObjectRepository, and `fields`, with either + * a string or an array of strings representing the fields to be matched by the validator. + * @throws \Zend\Validator\Exception\InvalidArgumentException + */ + public function __construct(array $options) + { + if (! isset($options['object_repository']) || ! $options['object_repository'] instanceof ObjectRepository) { + if (! array_key_exists('object_repository', $options)) { + $provided = 'nothing'; + } else { + if (is_object($options['object_repository'])) { + $provided = get_class($options['object_repository']); + } else { + $provided = getType($options['object_repository']); + } + } + + throw new Exception\InvalidArgumentException( + sprintf( + 'Option "object_repository" is required and must be an instance of' + . ' Doctrine\Common\Persistence\ObjectRepository, %s given', + $provided + ) + ); + } + + $this->objectRepository = $options['object_repository']; + + if (! isset($options['fields'])) { + throw new Exception\InvalidArgumentException( + 'Key `fields` must be provided and be a field or a list of fields to be used when searching for' + . ' existing instances' + ); + } + + $this->fields = $options['fields']; + $this->validateFields(); + + parent::__construct($options); + } + + /** + * Filters and validates the fields passed to the constructor + * + * @throws \Zend\Validator\Exception\InvalidArgumentException + * @return array + */ + private function validateFields() + { + $fields = (array) $this->fields; + + if (empty($fields)) { + throw new Exception\InvalidArgumentException('Provided fields list was empty!'); + } + + foreach ($fields as $key => $field) { + if (! is_string($field)) { + throw new Exception\InvalidArgumentException( + sprintf('Provided fields must be strings, %s provided for key %s', gettype($field), $key) + ); + } + } + + $this->fields = array_values($fields); + } + + /** + * @param string|array $value a field value or an array of field values if more fields have been configured to be + * matched + * @return array + * @throws \Zend\Validator\Exception\RuntimeException + */ + protected function cleanSearchValue($value) + { + $value = is_object($value) ? [$value] : (array) $value; + + if (ArrayUtils::isHashTable($value)) { + $matchedFieldsValues = []; + + foreach ($this->fields as $field) { + if (! array_key_exists($field, $value)) { + throw new Exception\RuntimeException( + sprintf( + 'Field "%s" was not provided, but was expected since the configured field lists needs' + . ' it for validation', + $field + ) + ); + } + + $matchedFieldsValues[$field] = $value[$field]; + } + } else { + $matchedFieldsValues = @array_combine($this->fields, $value); + + if (false === $matchedFieldsValues) { + throw new Exception\RuntimeException( + sprintf( + 'Provided values count is %s, while expected number of fields to be matched is %s', + count($value), + count($this->fields) + ) + ); + } + } + + return $matchedFieldsValues; + } + + /** + * {@inheritDoc} + */ + public function isValid($value) + { + $cleanedValue = $this->cleanSearchValue($value); + $match = $this->objectRepository->findOneBy($cleanedValue); + + if (is_object($match)) { + return true; + } + + $this->error(self::ERROR_NO_OBJECT_FOUND, $value); + + return false; + } +} diff --git a/src/DoctrineExpressiveModule/Validator/Service/AbstractValidatorFactory.php b/src/DoctrineExpressiveModule/Validator/Service/AbstractValidatorFactory.php new file mode 100644 index 0000000..d0a2bac --- /dev/null +++ b/src/DoctrineExpressiveModule/Validator/Service/AbstractValidatorFactory.php @@ -0,0 +1,121 @@ + + */ +abstract class AbstractValidatorFactory implements FactoryInterface +{ + const DEFAULT_OBJECTMANAGER_KEY = 'doctrine.entitymanager.orm_default'; + + protected $creationOptions = []; + + protected $validatorClass; + + /** + * @param ContainerInterface $container + * @param array $options + * @return \Doctrine\Common\Persistence\ObjectRepository + * @throws ServiceCreationException + */ + protected function getRepository(ContainerInterface $container, array $options) + { + if (empty($options['target_class'])) { + throw new ServiceCreationException(sprintf( + "Option 'target_class' is missing when creating validator %s", + __CLASS__ + )); + } + + $objectManager = $this->getObjectManager($container, $options); + $targetClassName = $options['target_class']; + $objectRepository = $objectManager->getRepository($targetClassName); + + return $objectRepository; + } + + /** + * @param ContainerInterface $container + * @param array $options + * @return \Doctrine\Common\Persistence\ObjectManager + */ + protected function getObjectManager(ContainerInterface $container, array $options) + { + $objectManager = ($options['object_manager']) ?? self::DEFAULT_OBJECTMANAGER_KEY; + + if (is_string($objectManager)) { + $objectManager = $container->get($objectManager); + } + + return $objectManager; + } + + /** + * @param array $options + * @return array + */ + protected function getFields(array $options) + { + if (isset($options['fields'])) { + return (array) $options['fields']; + } + + return []; + } + + /** + * Helper to merge options array passed to `__invoke` + * together with the options array created based on the above + * helper methods. + * + * @param array $previousOptions + * @param array $newOptions + * @return array + */ + protected function merge($previousOptions, $newOptions) + { + return ArrayUtils::merge($previousOptions, $newOptions, true); + } + + /** + * Helper method for ZF2 compatiblity. + * + * In ZF2 the plugin manager instance if passed to `createService` + * instead of the global service manager instance (as in ZF3). + * + * @param ContainerInterface $container + * @return ContainerInterface + */ + protected function container(ContainerInterface $container) + { + if ($container instanceof ServiceLocatorAwareInterface) { + $container = $container->getServiceLocator(); + } + + return $container; + } + + public function createService(ServiceLocatorInterface $serviceLocator) + { + return $this($serviceLocator, $this->validatorClass, $this->creationOptions); + } + + public function setCreationOptions(array $options) + { + $this->creationOptions = $options; + } +} diff --git a/src/DoctrineExpressiveModule/Validator/Service/Exception/ServiceCreationException.php b/src/DoctrineExpressiveModule/Validator/Service/Exception/ServiceCreationException.php new file mode 100644 index 0000000..62d76d6 --- /dev/null +++ b/src/DoctrineExpressiveModule/Validator/Service/Exception/ServiceCreationException.php @@ -0,0 +1,16 @@ + + */ +class ServiceCreationException extends BaseRuntimeException +{ +} diff --git a/src/DoctrineExpressiveModule/Validator/Service/NoObjectExistsFactory.php b/src/DoctrineExpressiveModule/Validator/Service/NoObjectExistsFactory.php new file mode 100644 index 0000000..84b9cae --- /dev/null +++ b/src/DoctrineExpressiveModule/Validator/Service/NoObjectExistsFactory.php @@ -0,0 +1,34 @@ + + */ +class NoObjectExistsFactory extends AbstractValidatorFactory +{ + protected $validatorClass = NoObjectExists::class; + + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) + { + $container = $this->container($container); + + $repository = $this->getRepository($container, $options); + + $validator = new NoObjectExists($this->merge($options, [ + 'object_repository' => $repository, + 'fields' => $this->getFields($options), + ])); + + return $validator; + } +} diff --git a/src/DoctrineExpressiveModule/Validator/Service/ObjectExistsFactory.php b/src/DoctrineExpressiveModule/Validator/Service/ObjectExistsFactory.php new file mode 100644 index 0000000..53d7ac2 --- /dev/null +++ b/src/DoctrineExpressiveModule/Validator/Service/ObjectExistsFactory.php @@ -0,0 +1,34 @@ + + */ +class ObjectExistsFactory extends AbstractValidatorFactory +{ + protected $validatorClass = ObjectExists::class; + + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) + { + $container = $this->container($container); + + $repository = $this->getRepository($container, $options); + + $validator = new ObjectExists($this->merge($options, [ + 'object_repository' => $repository, + 'fields' => $this->getFields($options), + ])); + + return $validator; + } +} diff --git a/src/DoctrineExpressiveModule/Validator/Service/UniqueObjectFactory.php b/src/DoctrineExpressiveModule/Validator/Service/UniqueObjectFactory.php new file mode 100644 index 0000000..c792c27 --- /dev/null +++ b/src/DoctrineExpressiveModule/Validator/Service/UniqueObjectFactory.php @@ -0,0 +1,28 @@ +container($container); + + $useContext = isset($options['use_context']) ? (boolean) $options['use_context'] : false; + + $validator = new UniqueObject($this->merge($options, [ + 'object_manager' => $this->getObjectManager($container, $options), + 'use_context' => $useContext, + 'object_repository' => $this->getRepository($container, $options), + 'fields' => $this->getFields($options), + ])); + + return $validator; + } +} diff --git a/src/DoctrineExpressiveModule/Validator/UniqueObject.php b/src/DoctrineExpressiveModule/Validator/UniqueObject.php new file mode 100644 index 0000000..a86e939 --- /dev/null +++ b/src/DoctrineExpressiveModule/Validator/UniqueObject.php @@ -0,0 +1,166 @@ + + */ +class UniqueObject extends ObjectExists +{ + /** + * Error constants + */ + const ERROR_OBJECT_NOT_UNIQUE = 'objectNotUnique'; + + /** + * @var array Message templates + */ + protected $messageTemplates = [ + self::ERROR_OBJECT_NOT_UNIQUE => "There is already another object matching '%value%'", + ]; + + /** + * @var ObjectManager + */ + protected $objectManager; + + /** + * @var boolean + */ + protected $useContext; + + /*** + * Constructor + * + * @param array $options required keys are `object_repository`, which must be an instance of + * Doctrine\Common\Persistence\ObjectRepository, `object_manager`, which + * must be an instance of Doctrine\Common\Persistence\ObjectManager, + * and `fields`, with either a string or an array of strings representing + * the fields to be matched by the validator. + * @throws Exception\InvalidArgumentException + */ + public function __construct(array $options) + { + parent::__construct($options); + + if (! isset($options['object_manager']) || ! $options['object_manager'] instanceof ObjectManager) { + if (! array_key_exists('object_manager', $options)) { + $provided = 'nothing'; + } else { + if (is_object($options['object_manager'])) { + $provided = get_class($options['object_manager']); + } else { + $provided = getType($options['object_manager']); + } + } + + throw new Exception\InvalidArgumentException( + sprintf( + 'Option "object_manager" is required and must be an instance of' + . ' Doctrine\Common\Persistence\ObjectManager, %s given', + $provided + ) + ); + } + + $this->objectManager = $options['object_manager']; + $this->useContext = isset($options['use_context']) ? (boolean) $options['use_context'] : false; + } + + /** + * Returns false if there is another object with the same field values but other identifiers. + * + * @param mixed $value + * @param array $context + * @return boolean + */ + public function isValid($value, $context = null) + { + if (! $this->useContext) { + $context = (array) $value; + } + + $cleanedValue = $this->cleanSearchValue($value); + $match = $this->objectRepository->findOneBy($cleanedValue); + + if (! is_object($match)) { + return true; + } + + $expectedIdentifiers = $this->getExpectedIdentifiers($context); + $foundIdentifiers = $this->getFoundIdentifiers($match); + + if (count(array_diff_assoc($expectedIdentifiers, $foundIdentifiers)) == 0) { + return true; + } + + $this->error(self::ERROR_OBJECT_NOT_UNIQUE, $value); + return false; + } + + /** + * Gets the identifiers from the matched object. + * + * @param object $match + * @return array + * @throws Exception\RuntimeException + */ + protected function getFoundIdentifiers($match) + { + return $this->objectManager + ->getClassMetadata($this->objectRepository->getClassName()) + ->getIdentifierValues($match); + } + + /** + * Gets the identifiers from the context. + * + * @param array|object $context + * @return array + * @throws Exception\RuntimeException + */ + protected function getExpectedIdentifiers($context = null) + { + if ($context === null) { + throw new Exception\RuntimeException( + 'Expected context to be an array but is null' + ); + } + + $className = $this->objectRepository->getClassName(); + + if ($context instanceof $className) { + return $this->objectManager + ->getClassMetadata($this->objectRepository->getClassName()) + ->getIdentifierValues($context); + } + + $result = []; + foreach ($this->getIdentifiers() as $identifierField) { + if (! array_key_exists($identifierField, $context)) { + throw new Exception\RuntimeException(\sprintf('Expected context to contain %s', $identifierField)); + } + + $result[$identifierField] = $context[$identifierField]; + } + return $result; + } + + + /** + * @return array the names of the identifiers + */ + protected function getIdentifiers() + { + return $this->objectManager + ->getClassMetadata($this->objectRepository->getClassName()) + ->getIdentifierFieldNames(); + } +} diff --git a/test/AppTest/Action/HomePageActionTest.php b/test/AppTest/Action/HomePageActionTest.php index a8e4384..9d839bd 100644 --- a/test/AppTest/Action/HomePageActionTest.php +++ b/test/AppTest/Action/HomePageActionTest.php @@ -2,7 +2,7 @@ namespace AppTest\Action; -use App\Action\HomePageAction; +use App\Handler\HomePageAction; use Interop\Http\ServerMiddleware\DelegateInterface; use PHPUnit\Framework\TestCase; use Prophecy\Argument; diff --git a/test/AppTest/Action/HomePageFactoryTest.php b/test/AppTest/Action/HomePageFactoryTest.php index 627a20c..7521ec5 100644 --- a/test/AppTest/Action/HomePageFactoryTest.php +++ b/test/AppTest/Action/HomePageFactoryTest.php @@ -2,8 +2,8 @@ namespace AppTest\Action; -use App\Action\HomePageAction; -use App\Action\HomePageFactory; +use App\Handler\HomePageAction; +use App\Handler\HomePageFactory; use Interop\Container\ContainerInterface; use PHPUnit\Framework\TestCase; use Zend\Expressive\Router\RouterInterface; diff --git a/test/AppTest/Action/PingActionTest.php b/test/AppTest/Action/PingActionTest.php index 71a22fb..60141be 100644 --- a/test/AppTest/Action/PingActionTest.php +++ b/test/AppTest/Action/PingActionTest.php @@ -2,7 +2,7 @@ namespace AppTest\Action; -use App\Action\PingAction; +use App\Handler\PingHandler; use Interop\Http\ServerMiddleware\DelegateInterface; use PHPUnit\Framework\TestCase; use Psr\Http\Message\ServerRequestInterface; @@ -12,7 +12,7 @@ class PingActionTest extends TestCase { public function testResponse() { - $pingAction = new PingAction(); + $pingAction = new PingHandler(); $response = $pingAction->process( $this->prophesize(ServerRequestInterface::class)->reveal(), $this->prophesize(DelegateInterface::class)->reveal()