diff --git a/.travis.yml b/.travis.yml index 3c5f852b5..49bc879bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,26 +13,6 @@ env: matrix: include: - - php: 5.6 - env: - - DEPS=lowest - - php: 5.6 - env: - - DEPS=locked - - LEGACY_DEPS="phpunit/phpunit" - - php: 5.6 - env: - - DEPS=latest - - php: 7 - env: - - DEPS=lowest - - php: 7 - env: - - DEPS=locked - - LEGACY_DEPS="phpunit/phpunit" - - php: 7 - env: - - DEPS=latest - php: 7.1 env: - DEPS=lowest @@ -58,8 +38,7 @@ before_install: - if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi install: - - travis_retry composer install $COMPOSER_ARGS --ignore-platform-reqs - - if [[ $LEGACY_DEPS != '' ]]; then travis_retry composer update $COMPOSER_ARGS --with-dependencies $LEGACY_DEPS ; fi + - travis_retry composer install $COMPOSER_ARGS - if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi - if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi - if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi diff --git a/LICENSE.md b/LICENSE.md index 63df4102c..d44ab5dc7 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2005-2017, Zend Technologies USA, Inc. +Copyright (c) 2005-2018, Zend Technologies USA, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, diff --git a/composer.json b/composer.json index e34462775..bb95dfcb2 100644 --- a/composer.json +++ b/composer.json @@ -16,8 +16,8 @@ "forum": "https://discourse.zendframework.com/c/questions/components" }, "require": { + "php": "^7.1", "container-interop/container-interop": "^1.2", - "php": "^5.6 || ^7.0", "zendframework/zend-eventmanager": "^3.2", "zendframework/zend-http": "^2.7", "zendframework/zend-modulemanager": "^2.8", @@ -28,9 +28,9 @@ }, "require-dev": { "http-interop/http-middleware": "^0.4.1", - "phpunit/phpunit": "^6.4.4 || ^5.7.14", + "phpunit/phpunit": "^7.0", "zendframework/zend-coding-standard": "~1.0.0", - "zendframework/zend-json": "^2.6.1 || ^3.0", + "zendframework/zend-json": "^3.0", "zendframework/zend-psr7bridge": "^1.0", "zendframework/zend-stratigility": "^2.0.1" }, @@ -57,10 +57,7 @@ "autoload-dev": { "psr-4": { "ZendTest\\Mvc\\": "test/" - }, - "files": [ - "test/_autoload.php" - ] + } }, "config": { "sort-packages": true diff --git a/composer.lock b/composer.lock index 0087b6629..881f41b57 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "4dca15262833c4fd34ad940c5472e161", + "content-hash": "fb6ba17cab04ae71783b41718f15f852", "packages": [ { "name": "container-interop/container-interop", @@ -343,23 +343,23 @@ }, { "name": "zendframework/zend-modulemanager", - "version": "2.8.1", + "version": "2.8.2", "source": { "type": "git", "url": "https://github.com/zendframework/zend-modulemanager.git", - "reference": "710c13353b1ff0975777dbeb39bbf1c85e3353a3" + "reference": "394df6e12248ac430a312d4693f793ee7120baa6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-modulemanager/zipball/710c13353b1ff0975777dbeb39bbf1c85e3353a3", - "reference": "710c13353b1ff0975777dbeb39bbf1c85e3353a3", + "url": "https://api.github.com/repos/zendframework/zend-modulemanager/zipball/394df6e12248ac430a312d4693f793ee7120baa6", + "reference": "394df6e12248ac430a312d4693f793ee7120baa6", "shasum": "" }, "require": { "php": "^5.6 || ^7.0", "zendframework/zend-config": "^3.1 || ^2.6", "zendframework/zend-eventmanager": "^3.2 || ^2.6.3", - "zendframework/zend-stdlib": "^3.0 || ^2.7" + "zendframework/zend-stdlib": "^3.1 || ^2.7" }, "require-dev": { "phpunit/phpunit": "^6.0.8 || ^5.7.15", @@ -367,7 +367,7 @@ "zendframework/zend-console": "^2.6", "zendframework/zend-di": "^2.6", "zendframework/zend-loader": "^2.5", - "zendframework/zend-mvc": "^2.7", + "zendframework/zend-mvc": "^3.0 || ^2.7", "zendframework/zend-servicemanager": "^3.0.3 || ^2.7.5" }, "suggest": { @@ -379,8 +379,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev", - "dev-develop": "2.9-dev" + "dev-master": "2.7-dev", + "dev-develop": "2.8-dev" } }, "autoload": { @@ -392,12 +392,14 @@ "license": [ "BSD-3-Clause" ], + "description": "Modular application system for zend-mvc applications", "homepage": "https://github.com/zendframework/zend-modulemanager", "keywords": [ + "ZendFramework", "modulemanager", - "zf2" + "zf" ], - "time": "2017-11-01T18:30:41+00:00" + "time": "2017-12-02T06:11:18+00:00" }, { "name": "zendframework/zend-router", @@ -462,16 +464,16 @@ }, { "name": "zendframework/zend-servicemanager", - "version": "3.3.0", + "version": "3.3.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-servicemanager.git", - "reference": "c3036efb81f71bfa36cc9962ee5d4474f36581d0" + "reference": "0fa3d3cf588dde0850fff1efa60d44a7aa3c3ab7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-servicemanager/zipball/c3036efb81f71bfa36cc9962ee5d4474f36581d0", - "reference": "c3036efb81f71bfa36cc9962ee5d4474f36581d0", + "url": "https://api.github.com/repos/zendframework/zend-servicemanager/zipball/0fa3d3cf588dde0850fff1efa60d44a7aa3c3ab7", + "reference": "0fa3d3cf588dde0850fff1efa60d44a7aa3c3ab7", "shasum": "" }, "require": { @@ -503,7 +505,7 @@ "extra": { "branch-alias": { "dev-master": "3.3-dev", - "dev-develop": "3.4-dev" + "dev-develop": "4.0-dev" } }, "autoload": { @@ -521,7 +523,7 @@ "servicemanager", "zf" ], - "time": "2017-03-01T22:08:02+00:00" + "time": "2017-11-27T18:11:25+00:00" }, { "name": "zendframework/zend-stdlib", @@ -1085,29 +1087,35 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.1.1", + "version": "4.3.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2" + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/2d3d238c433cf69caeb4842e97a3223a116f94b2", - "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", "shasum": "" }, "require": { "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/reflection-common": "^1.0.0", "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, "autoload": { "psr-4": { "phpDocumentor\\Reflection\\": [ @@ -1126,7 +1134,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-08-30T18:51:59+00:00" + "time": "2017-11-30T07:14:17+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -1177,16 +1185,16 @@ }, { "name": "phpspec/prophecy", - "version": "v1.7.2", + "version": "1.7.3", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6" + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", - "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", "shasum": "" }, "require": { @@ -1198,7 +1206,7 @@ }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8 || ^5.6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7" }, "type": "library", "extra": { @@ -1236,45 +1244,44 @@ "spy", "stub" ], - "time": "2017-09-04T11:05:03+00:00" + "time": "2017-11-24T13:59:53+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "5.2.3", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "8e1d2397d8adf59a3f12b2878a3aaa66d1ab189d" + "reference": "f8ca4b604baf23dab89d87773c28cc07405189ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/8e1d2397d8adf59a3f12b2878a3aaa66d1ab189d", - "reference": "8e1d2397d8adf59a3f12b2878a3aaa66d1ab189d", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f8ca4b604baf23dab89d87773c28cc07405189ba", + "reference": "f8ca4b604baf23dab89d87773c28cc07405189ba", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^7.0", + "php": "^7.1", "phpunit/php-file-iterator": "^1.4.2", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^2.0", + "phpunit/php-token-stream": "^3.0", "sebastian/code-unit-reverse-lookup": "^1.0.1", "sebastian/environment": "^3.0", "sebastian/version": "^2.0.1", "theseer/tokenizer": "^1.1" }, "require-dev": { - "ext-xdebug": "^2.5", - "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.2.x-dev" + "dev-master": "6.0-dev" } }, "autoload": { @@ -1289,7 +1296,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -1300,20 +1307,20 @@ "testing", "xunit" ], - "time": "2017-11-03T13:47:33+00:00" + "time": "2018-02-02T07:01:41+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.2", + "version": "1.4.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", "shasum": "" }, "require": { @@ -1347,7 +1354,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03T07:40:28+00:00" + "time": "2017-11-27T13:52:08+00:00" }, { "name": "phpunit/php-text-template", @@ -1392,28 +1399,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": { @@ -1428,7 +1435,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -1437,33 +1444,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.1", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0" + "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9a02332089ac48e704c70f6cefed30c224e3c0b0", - "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/21ad88bbba7c3d93530d93994e0a33cd45f02ace", + "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace", "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": { @@ -1486,20 +1493,20 @@ "keywords": [ "tokenizer" ], - "time": "2017-08-20T05:47:52+00:00" + "time": "2018-02-01T13:16:43+00:00" }, { "name": "phpunit/phpunit", - "version": "6.4.4", + "version": "7.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "562f7dc75d46510a4ed5d16189ae57fbe45a9932" + "reference": "9b3373439fdf2f3e9d1578f5e408a3a0d161c3bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/562f7dc75d46510a4ed5d16189ae57fbe45a9932", - "reference": "562f7dc75d46510a4ed5d16189ae57fbe45a9932", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9b3373439fdf2f3e9d1578f5e408a3a0d161c3bc", + "reference": "9b3373439fdf2f3e9d1578f5e408a3a0d161c3bc", "shasum": "" }, "require": { @@ -1511,15 +1518,15 @@ "myclabs/deep-copy": "^1.6.1", "phar-io/manifest": "^1.0.1", "phar-io/version": "^1.0", - "php": "^7.0", + "php": "^7.1", "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^5.2.2", - "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-code-coverage": "^6.0", + "phpunit/php-file-iterator": "^1.4.3", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^1.0.9", - "phpunit/phpunit-mock-objects": "^4.0.3", - "sebastian/comparator": "^2.0.2", - "sebastian/diff": "^2.0", + "phpunit/php-timer": "^2.0", + "phpunit/phpunit-mock-objects": "^6.0", + "sebastian/comparator": "^2.1", + "sebastian/diff": "^3.0", "sebastian/environment": "^3.1", "sebastian/exporter": "^3.1", "sebastian/global-state": "^2.0", @@ -1527,16 +1534,12 @@ "sebastian/resource-operations": "^1.0", "sebastian/version": "^2.0.1" }, - "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2", - "phpunit/dbunit": "<3.0" - }, "require-dev": { "ext-pdo": "*" }, "suggest": { "ext-xdebug": "*", - "phpunit/php-invoker": "^1.1" + "phpunit/php-invoker": "^2.0" }, "bin": [ "phpunit" @@ -1544,7 +1547,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.4.x-dev" + "dev-master": "7.0-dev" } }, "autoload": { @@ -1570,33 +1573,30 @@ "testing", "xunit" ], - "time": "2017-11-08T11:26:09+00:00" + "time": "2018-02-02T05:04:08+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "4.0.4", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "2f789b59ab89669015ad984afa350c4ec577ade0" + "reference": "e495e5d3660321b62c294d8c0e954d02d6ce2573" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/2f789b59ab89669015ad984afa350c4ec577ade0", - "reference": "2f789b59ab89669015ad984afa350c4ec577ade0", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/e495e5d3660321b62c294d8c0e954d02d6ce2573", + "reference": "e495e5d3660321b62c294d8c0e954d02d6ce2573", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.5", - "php": "^7.0", + "php": "^7.1", "phpunit/php-text-template": "^1.2.1", - "sebastian/exporter": "^3.0" - }, - "conflict": { - "phpunit/phpunit": "<6.0" + "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^7.0" }, "suggest": { "ext-soap": "*" @@ -1604,7 +1604,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "6.0.x-dev" } }, "autoload": { @@ -1619,7 +1619,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -1629,7 +1629,7 @@ "mock", "xunit" ], - "time": "2017-08-03T14:08:16+00:00" + "time": "2018-02-01T13:11:13+00:00" }, { "name": "psr/http-message", @@ -1728,21 +1728,21 @@ }, { "name": "sebastian/comparator", - "version": "2.1.0", + "version": "2.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1174d9018191e93cb9d719edec01257fc05f8158" + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1174d9018191e93cb9d719edec01257fc05f8158", - "reference": "1174d9018191e93cb9d719edec01257fc05f8158", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", "shasum": "" }, "require": { "php": "^7.0", - "sebastian/diff": "^2.0", + "sebastian/diff": "^2.0 || ^3.0", "sebastian/exporter": "^3.1" }, "require-dev": { @@ -1788,32 +1788,33 @@ "compare", "equality" ], - "time": "2017-11-03T07:16:52+00:00" + "time": "2018-02-01T13:46:46+00:00" }, { "name": "sebastian/diff", - "version": "2.0.1", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" + "reference": "e09160918c66281713f1c324c1f4c4c3037ba1e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/e09160918c66281713f1c324c1f4c4c3037ba1e8", + "reference": "e09160918c66281713f1c324c1f4c4c3037ba1e8", "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": { @@ -1838,9 +1839,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-02-01T13:45:15+00:00" }, { "name": "sebastian/environment", @@ -2448,20 +2452,21 @@ "psr-15", "webimpress" ], + "abandoned": "psr/http-server-middleware", "time": "2017-10-17T17:31:10+00:00" }, { "name": "webmozart/assert", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", "shasum": "" }, "require": { @@ -2498,7 +2503,7 @@ "check", "validate" ], - "time": "2016-11-23T20:04:58+00:00" + "time": "2018-01-29T19:49:41+00:00" }, { "name": "zendframework/zend-coding-standard", @@ -2531,16 +2536,16 @@ }, { "name": "zendframework/zend-diactoros", - "version": "1.6.1", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-diactoros.git", - "reference": "c8664b92a6d5bc229e48b0923486c097e45a7877" + "reference": "ed6ce7e2105c400ca10277643a8327957c0384b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/c8664b92a6d5bc229e48b0923486c097e45a7877", - "reference": "c8664b92a6d5bc229e48b0923486c097e45a7877", + "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/ed6ce7e2105c400ca10277643a8327957c0384b7", + "reference": "ed6ce7e2105c400ca10277643a8327957c0384b7", "shasum": "" }, "require": { @@ -2559,8 +2564,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6-dev", - "dev-develop": "1.7-dev" + "dev-master": "1.7.x-dev", + "dev-develop": "1.8.x-dev" } }, "autoload": { @@ -2579,29 +2584,29 @@ "psr", "psr-7" ], - "time": "2017-10-12T15:24:51+00:00" + "time": "2018-01-04T18:21:48+00:00" }, { "name": "zendframework/zend-json", - "version": "3.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-json.git", - "reference": "f42a1588e75c2a3e338cd94c37906231e616daab" + "reference": "4dd940e8e6f32f1d36ea6b0677ea57c540c7c19c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-json/zipball/f42a1588e75c2a3e338cd94c37906231e616daab", - "reference": "f42a1588e75c2a3e338cd94c37906231e616daab", + "url": "https://api.github.com/repos/zendframework/zend-json/zipball/4dd940e8e6f32f1d36ea6b0677ea57c540c7c19c", + "reference": "4dd940e8e6f32f1d36ea6b0677ea57c540c7c19c", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0" + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "^2.3", - "zendframework/zend-stdlib": "^2.7 || ^3.0" + "phpunit/phpunit": "^5.7.23 || ^6.4.3", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-stdlib": "^2.7.7 || ^3.1" }, "suggest": { "zendframework/zend-json-server": "For implementing JSON-RPC servers", @@ -2610,8 +2615,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": { @@ -2624,25 +2629,25 @@ "BSD-3-Clause" ], "description": "provides convenience methods for serializing native PHP to JSON and decoding JSON to native PHP", - "homepage": "https://github.com/zendframework/zend-json", "keywords": [ + "ZendFramework", "json", - "zf2" + "zf" ], - "time": "2016-04-01T02:34:00+00:00" + "time": "2018-01-04T17:51:34+00:00" }, { "name": "zendframework/zend-psr7bridge", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-psr7bridge.git", - "reference": "935721336ded76fd5ba90ba7637c7d85b4d0cf68" + "reference": "93494337a475135a457d86f6b150c67aa4f31aea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-psr7bridge/zipball/935721336ded76fd5ba90ba7637c7d85b4d0cf68", - "reference": "935721336ded76fd5ba90ba7637c7d85b4d0cf68", + "url": "https://api.github.com/repos/zendframework/zend-psr7bridge/zipball/93494337a475135a457d86f6b150c67aa4f31aea", + "reference": "93494337a475135a457d86f6b150c67aa4f31aea", "shasum": "" }, "require": { @@ -2680,7 +2685,7 @@ "psr-7", "zend" ], - "time": "2017-08-02T15:52:02+00:00" + "time": "2017-12-18T11:59:51+00:00" }, { "name": "zendframework/zend-stratigility", @@ -2743,7 +2748,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^5.6 || ^7.0" + "php": "^7.1" }, "platform-dev": [] } diff --git a/docs/book/intro.md b/docs/book/intro.md index 178e64aea..859635af2 100644 --- a/docs/book/intro.md +++ b/docs/book/intro.md @@ -25,7 +25,7 @@ Within the MVC layer, several sub-components are exposed: - `Zend\Mvc\Controller`, a set of abstract "controller" classes with basic responsibilities such as event wiring, action dispatching, etc., as well as controller plugins. -- `Zend\Mvc\Service` provides a set of zend-servicemanager factories and +- `Zend\Mvc\Container` provides a set of zend-servicemanager factories and definitions for the default application workflow. - `Zend\Mvc\View` provides default wiring for renderer selection, view script resolution, helper registration, and more; additionally, it provides a @@ -271,7 +271,7 @@ services available by default yet. You can greatly simplify things by using the ```php use Zend\Loader\AutoloaderFactory; -use Zend\Mvc\Service\ServiceManagerConfig; +use Zend\Mvc\Container\ServiceManagerConfig; use Zend\ServiceManager\ServiceManager; // setup autoloader @@ -300,7 +300,7 @@ You can make this even simpler by using the `init()` method of the ```php use Zend\Loader\AutoloaderFactory; use Zend\Mvc\Application; -use Zend\Mvc\Service\ServiceManagerConfig; +use Zend\Mvc\Container\ServiceManagerConfig; use Zend\ServiceManager\ServiceManager; // setup autoloader diff --git a/docs/book/services.md b/docs/book/services.md index 1e3a82e66..5cd543c7b 100644 --- a/docs/book/services.md +++ b/docs/book/services.md @@ -1,7 +1,7 @@ # Default Services The default and recommended way to write zend-mvc applications uses a set of -services defined in the `Zend\Mvc\Service` namespace. This chapter details what +services defined in the `Zend\Mvc\Container` namespace. This chapter details what each of those services are, the classes they represent, and the configuration options available. @@ -17,17 +17,17 @@ somewhat complex set of services and their factories has been created. We'll try to give a simplified explanation of the process. When a `Zend\Mvc\Application` is created, a `Zend\ServiceManager\ServiceManager` -object is created and configured via `Zend\Mvc\Service\ServiceManagerConfig`. +object is created and configured via `Zend\Mvc\Container\ServiceManagerConfig`. The `ServiceManagerConfig` gets the configuration from `config/application.config.php` (or some other application configuration you passed to the `Application` when creating it). From all the service and -factories provided in the `Zend\Mvc\Service` namespace, `ServiceManagerConfig` +factories provided in the `Zend\Mvc\Container` namespace, `ServiceManagerConfig` is responsible of configuring only three: `SharedEventManager`, `EventManager`, and `ModuleManager`. After this, the `Application` fetches the `ModuleManager`. At this point, the `ModuleManager` further configures the `ServiceManager` with services and -factories provided in `Zend\Mvc\Service\ServiceListenerFactory`. This approach +factories provided in `Zend\Mvc\Container\ServiceListenerFactory`. This approach allows us to keep the main application configuration concise, and to give the developer the power to configure different parts of the MVC system from within the modules, overriding any default configuration in these MVC services. @@ -84,14 +84,14 @@ services configured out of the box. ### Factories -- `Application`, mapping to `Zend\Mvc\Service\ApplicationFactory`. +- `Application`, mapping to `Zend\Mvc\Container\ApplicationFactory`. -- `Config`, mapping to `Zend\Mvc\Service\ConfigFactory`. Internally, this +- `Config`, mapping to `Zend\Mvc\Container\ConfigFactory`. Internally, this pulls the `ModuleManager` service, calls its `loadModules()` method, and retrieves the merged configuration from the module event. As such, this service contains the entire, merged application configuration. -- `ControllerManager`, mapping to `Zend\Mvc\Service\ControllerLoaderFactory`. +- `ControllerManager`, mapping to `Zend\Mvc\Container\ControllerManagerFactory`. This creates an instance of `Zend\Mvc\Controller\ControllerManager`, passing the service manager instance. Additionally, it uses the `DiStrictAbstractServiceFactory` service, effectively allowing you to fall @@ -112,7 +112,7 @@ services configured out of the box. service, as long as the `setPluginManager` method is implemented. - `ControllerPluginManager`, mapping to - `Zend\Mvc\Service\ControllerPluginManagerFactory`. This instantiates the + `Zend\Mvc\Container\ControllerPluginManagerFactory`. This instantiates the `Zend\Mvc\Controller\PluginManager` instance, passing it the service manager instance. It also uses the `DiAbstractServiceFactory` service, effectively allowing you to fall back to DI in order to retrieve your [controller plugins](plugins.md). @@ -158,13 +158,13 @@ services configured out of the box. This creates an instance of `Zend\Mvc\Service\DiStrictAbstractServiceFactoryFactory`, injecting the `Di` service instance. -- `EventManager`, mapping to `Zend\Mvc\Service\EventManagerFactory`. This +- `EventManager`, mapping to `Zend\Mvc\Container\EventManagerFactory`. This factory returns a *discrete* instance of `Zend\EventManager\EventManager` on each request. This service is not shared by default, allowing the ability to have an `EventManager` per service, with a shared `SharedEventManager` injected in each. -- `FilterManager`, mapping to `Zend\Mvc\Service\FilterManagerFactory`. This +- `FilterManager`, mapping to `Zend\Mvc\Container\FilterManagerFactory`. This instantiates the `Zend\Filter\FilterPluginManager` instance, passing it the service manager instance; this is used to manage filters for [filter chains](http://docs.zendframework.com/zend-filter/filter-chains/). It also uses the `DiAbstractServiceFactory` service, effectively allowing @@ -180,7 +180,7 @@ services configured out of the box. the `Config` service, and pulls from the `router` key, configuring a `Zend\Router\Http\TreeRouteStack` instance. -- `HttpViewManager`, mapping to `Zend\Mvc\Service\HttpViewManagerFactory`. +- `HttpViewManager`, mapping to `Zend\Mvc\Container\HttpViewManagerFactory`. This creates and returns an instance of `Zend\Mvc\View\Http\ViewManager`, which in turn registers and initializes a number of HTTP-specific view services. @@ -193,14 +193,14 @@ services configured out of the box. This creates and returns an instance of `Zend\InputFilter\InputFilterPluginManager`, which can be used to manage and persist input filter instances. -- `ModuleManager`, mapping to `Zend\Mvc\Service\ModuleManagerFactory`. This is +- `ModuleManager`, mapping to `Zend\Mvc\Container\ModuleManagerFactory`. This is perhaps the most complex factory in the MVC stack. It expects that an `ApplicationConfig` service has been injected, with keys for `module_listener_options` and `modules`; see the quick start for samples. It creates an instance of `Zend\ModuleManager\Listener\DefaultListenerAggregate`, using the `module_listener_options` retrieved. It then checks if a service with the name `ServiceListener` exists; if not, it sets a factory with that - name mapping to `Zend\Mvc\Service\ServiceListenerFactory`. A bunch of + name mapping to `Zend\Mvc\Container\ServiceListenerFactory`. A bunch of service listeners will be added to the `ServiceListener`, like listeners for the `getServiceConfig`, `getControllerConfig`, `getControllerPluginConfig`, and `getViewHelperConfig` module methods. Next, it retrieves the @@ -216,20 +216,20 @@ services configured out of the box. allowing the instance to be used anywhere a translator may be required in the framework. -- `PaginatorPluginManager`, mapping to `Zend\Mvc\Service\PaginatorPluginManagerFactory`. +- `PaginatorPluginManager`, mapping to `Zend\Mvc\Container\PaginatorPluginManagerFactory`. This instantiates the `Zend\Paginator\AdapterPluginManager` instance, passing it the service manager instance. This is used to manage [paginator adapters](https://docs.zendframework.com/zend-paginator/advanced/#custom-data-source-adapters). It also uses the `DiAbstractServiceFactory` service, effectively allowing you to fall back to DI in order to retrieve paginator adapters. -- `Request`, mapping to `Zend\Mvc\Service\RequestFactory`. The factory is used +- `Request`, mapping to `Zend\Mvc\Container\RequestFactory`. The factory is used to create and return a request instance, according to the current environment. If the current environment is a console environment, it will create a `Zend\Console\Request`; otherwise, for HTTP environments, it creates a `Zend\Http\PhpEnvironment\Request`. -- `Response`, mapping to `Zend\Mvc\Service\ResponseFactory`. The factory is +- `Response`, mapping to `Zend\Mvc\Container\ResponseFactory`. The factory is used to create and return a response instance, according to the current environment. If the current environment is a console environment, it will create a `Zend\Console\Response`; otherwise, for HTTP environments, it @@ -249,7 +249,7 @@ services configured out of the box. which returns an instance of `Zend\Serializer\AdapterPluginManager`. This is a plugin manager for managing serializer adapter instances. -- `ServiceListener`, mapping to `Zend\Mvc\Service\ServiceListenerFactory`. The +- `ServiceListener`, mapping to `Zend\Mvc\Container\ServiceListenerFactory`. The factory is used to instantiate the `ServiceListener`, while allowing easy extending. It checks if a service with the name `ServiceListenerInterface` exists, which must implement `Zend\ModuleManager\Listener\ServiceListenerInterface`, @@ -266,15 +266,15 @@ services configured out of the box. It also uses the `DiAbstractServiceFactory` service, effectively allowing you to fall back to DI in order to retrieve validators. -- `ViewFeedRenderer`, mapping to `Zend\Mvc\Service\ViewFeedRendererFactory`, +- `ViewFeedRenderer`, mapping to `Zend\Mvc\Container\ViewFeedRendererFactory`, which returns an instance of `Zend\View\Renderer\FeedRenderer`, used to render feeds. -- `ViewFeedStrategy`, mapping to `Zend\Mvc\Service\ViewFeedStrategyFactory`, +- `ViewFeedStrategy`, mapping to `Zend\Mvc\Container\ViewFeedStrategyFactory`, which returns an instance of `Zend\View\Strategy\FeedStrategy`, used to select the `ViewFeedRenderer` given the appropriate criteria. -- `ViewHelperManager`, mapping to `Zend\Mvc\Service\ViewHelperManagerFactory`, +- `ViewHelperManager`, mapping to `Zend\Mvc\Container\ViewHelperManagerFactory`, which returns an instance of `Zend\View\HelperManager`. This is a plugin manager for managing view helper instances. @@ -282,24 +282,24 @@ services configured out of the box. which returns an instance of `Zend\View\Renderer\JsonRenderer`, used to render JSON structures. -- `ViewJsonStrategy`, mapping to `Zend\Mvc\Service\ViewJsonStrategyFactory`, +- `ViewJsonStrategy`, mapping to `Zend\Mvc\Container\ViewJsonStrategyFactory`, which returns an instance of `Zend\View\Strategy\JsonStrategy`, used to select the `ViewJsonRenderer` given the appropriate criteria. -- `ViewManager`, mapping to `Zend\Mvc\Service\ViewManagerFactory`. The factory +- `ViewManager`, mapping to `Zend\Mvc\Container\ViewManagerFactory`. The factory is used to create and return a view manager, according to the current environment. If the current environment is a console environment, it will create a `Zend\Mvc\View\Console\ViewManager`; otherwise, for HTTP environments, it returns a `Zend\Mvc\View\Http\ViewManager`. -- `ViewResolver`, mapping to `Zend\Mvc\Service\ViewResolverFactory`, which +- `ViewResolver`, mapping to `Zend\Mvc\Container\ViewResolverFactory`, which creates and returns the aggregate view resolver. It also attaches the `ViewTemplateMapResolver` and `ViewTemplatePathStack` services to it. -- `ViewTemplateMapResolver`, mapping to `Zend\Mvc\Service\ViewTemplateMapResolverFactory`, +- `ViewTemplateMapResolver`, mapping to `Zend\Mvc\Container\ViewTemplateMapResolverFactory`, which creates, configures and returns the `Zend\View\Resolver\TemplateMapResolver`. -- `ViewTemplatePathStack`, mapping to `Zend\Mvc\Service\ViewTemplatePathStackFactory`, +- `ViewTemplatePathStack`, mapping to `Zend\Mvc\Container\ViewTemplatePathStackFactory`, which creates, configures and returns the `Zend\View\Resolver\TemplatePathStack`. ### Abstract factories @@ -519,7 +519,7 @@ created and managed by the `ViewManager`: - `ViewHelperManager`, representing and aliased to `Zend\View\HelperPluginManager`. It is seeded with the `ServiceManager`. Created via the - `Zend\Mvc\Service\ViewHelperManagerFactory`. + `Zend\Mvc\Container\ViewHelperManagerFactory`. - The `Router` service is retrieved, and injected into the `Url` helper. diff --git a/mkdocs.yml b/mkdocs.yml index 1d2f5d300..50551655c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -23,4 +23,4 @@ pages: site_name: zend-mvc site_description: 'zend-mvc: MVC application provider' repo_url: 'https://github.com/zendframework/zend-mvc' -copyright: 'Copyright (c) 2005-2017 Zend Technologies USA Inc.' +copyright: 'Copyright (c) 2005-2018 Zend Technologies USA Inc.' diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 2cffbef67..1668ad5a4 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,34 +1,22 @@ - - ./test/ + + ./test - - - disable - - - - + ./src - - - - diff --git a/src/Application.php b/src/Application.php index cc66cbb22..c6d42e113 100644 --- a/src/Application.php +++ b/src/Application.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc; use Zend\EventManager\EventManagerAwareInterface; @@ -252,7 +254,7 @@ public static function init($configuration = []) { // Prepare the service manager $smConfig = isset($configuration['service_manager']) ? $configuration['service_manager'] : []; - $smConfig = new Service\ServiceManagerConfig($smConfig); + $smConfig = new Container\ServiceManagerConfig($smConfig); $serviceManager = new ServiceManager(); $smConfig->configureServiceManager($serviceManager); diff --git a/src/ApplicationInterface.php b/src/ApplicationInterface.php index 6f8c4062f..99807c4c6 100644 --- a/src/ApplicationInterface.php +++ b/src/ApplicationInterface.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc; use Zend\EventManager\EventsCapableInterface; diff --git a/src/Service/ApplicationFactory.php b/src/Container/ApplicationFactory.php similarity index 73% rename from src/Service/ApplicationFactory.php rename to src/Container/ApplicationFactory.php index 2871cc334..4e261f140 100644 --- a/src/Service/ApplicationFactory.php +++ b/src/Container/ApplicationFactory.php @@ -5,11 +5,15 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Mvc\Application; +use Zend\Mvc\Exception\RuntimeException; use Zend\ServiceManager\Factory\FactoryInterface; +use Zend\ServiceManager\ServiceManager; class ApplicationFactory implements FactoryInterface { @@ -26,6 +30,10 @@ class ApplicationFactory implements FactoryInterface */ public function __invoke(ContainerInterface $container, $name, array $options = null) { + if (! $container instanceof ServiceManager) { + // @TODO convert Application to use ContainerInterface + throw new RuntimeException('Mvc Application requires ServiceManager as ContainerInterface implementation'); + } return new Application( $container, $container->get('EventManager'), diff --git a/src/Service/ConfigFactory.php b/src/Container/ConfigFactory.php similarity index 95% rename from src/Service/ConfigFactory.php rename to src/Container/ConfigFactory.php index 4b9fbcbe6..bd9b38cd4 100644 --- a/src/Service/ConfigFactory.php +++ b/src/Container/ConfigFactory.php @@ -5,7 +5,9 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Traversable; diff --git a/src/Service/ControllerManagerFactory.php b/src/Container/ControllerManagerFactory.php similarity index 96% rename from src/Service/ControllerManagerFactory.php rename to src/Container/ControllerManagerFactory.php index a1dd50812..ce294a6a7 100644 --- a/src/Service/ControllerManagerFactory.php +++ b/src/Container/ControllerManagerFactory.php @@ -5,7 +5,9 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Mvc\Controller\ControllerManager; diff --git a/src/Service/ControllerPluginManagerFactory.php b/src/Container/ControllerPluginManagerFactory.php similarity index 82% rename from src/Service/ControllerPluginManagerFactory.php rename to src/Container/ControllerPluginManagerFactory.php index 3b5c5a5fe..a8793b28d 100644 --- a/src/Service/ControllerPluginManagerFactory.php +++ b/src/Container/ControllerPluginManagerFactory.php @@ -5,9 +5,12 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Zend\Mvc\Controller\PluginManager as ControllerPluginManager; +use Zend\Mvc\Service\AbstractPluginManagerFactory; class ControllerPluginManagerFactory extends AbstractPluginManagerFactory { diff --git a/src/Service/HttpDefaultRenderingStrategyFactory.php b/src/Container/DefaultRenderingStrategyFactory.php similarity index 90% rename from src/Service/HttpDefaultRenderingStrategyFactory.php rename to src/Container/DefaultRenderingStrategyFactory.php index 21a47daae..58993c4e1 100644 --- a/src/Service/HttpDefaultRenderingStrategyFactory.php +++ b/src/Container/DefaultRenderingStrategyFactory.php @@ -5,16 +5,18 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Mvc\View\Http\DefaultRenderingStrategy; use Zend\ServiceManager\Factory\FactoryInterface; use Zend\View\View; -class HttpDefaultRenderingStrategyFactory implements FactoryInterface +class DefaultRenderingStrategyFactory implements FactoryInterface { - use HttpViewManagerConfigTrait; + use ViewManagerConfigTrait; /** * @param ContainerInterface $container diff --git a/src/Service/DispatchListenerFactory.php b/src/Container/DispatchListenerFactory.php similarity index 93% rename from src/Service/DispatchListenerFactory.php rename to src/Container/DispatchListenerFactory.php index 5d4aa99f5..05aac4e32 100644 --- a/src/Service/DispatchListenerFactory.php +++ b/src/Container/DispatchListenerFactory.php @@ -5,7 +5,9 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Mvc\DispatchListener; diff --git a/src/Service/EventManagerFactory.php b/src/Container/EventManagerFactory.php similarity index 94% rename from src/Service/EventManagerFactory.php rename to src/Container/EventManagerFactory.php index 98bc186a6..deca72a86 100644 --- a/src/Service/EventManagerFactory.php +++ b/src/Container/EventManagerFactory.php @@ -5,7 +5,9 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\EventManager\EventManager; diff --git a/src/Service/HttpExceptionStrategyFactory.php b/src/Container/ExceptionStrategyFactory.php similarity index 92% rename from src/Service/HttpExceptionStrategyFactory.php rename to src/Container/ExceptionStrategyFactory.php index 6798f5a0a..b4d2ef231 100644 --- a/src/Service/HttpExceptionStrategyFactory.php +++ b/src/Container/ExceptionStrategyFactory.php @@ -5,15 +5,17 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Mvc\View\Http\ExceptionStrategy; use Zend\ServiceManager\Factory\FactoryInterface; -class HttpExceptionStrategyFactory implements FactoryInterface +class ExceptionStrategyFactory implements FactoryInterface { - use HttpViewManagerConfigTrait; + use ViewManagerConfigTrait; /** * @param ContainerInterface $container diff --git a/src/Service/HttpMethodListenerFactory.php b/src/Container/HttpMethodListenerFactory.php similarity index 95% rename from src/Service/HttpMethodListenerFactory.php rename to src/Container/HttpMethodListenerFactory.php index 7562ac9b8..6a90dced9 100644 --- a/src/Service/HttpMethodListenerFactory.php +++ b/src/Container/HttpMethodListenerFactory.php @@ -5,7 +5,9 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Mvc\HttpMethodListener; diff --git a/src/Service/HttpViewManagerFactory.php b/src/Container/HttpViewManagerFactory.php similarity index 93% rename from src/Service/HttpViewManagerFactory.php rename to src/Container/HttpViewManagerFactory.php index 07745e372..33a1a0e93 100644 --- a/src/Service/HttpViewManagerFactory.php +++ b/src/Container/HttpViewManagerFactory.php @@ -5,7 +5,9 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Mvc\View\Http\ViewManager as HttpViewManager; diff --git a/src/Service/InjectTemplateListenerFactory.php b/src/Container/InjectTemplateListenerFactory.php similarity index 95% rename from src/Service/InjectTemplateListenerFactory.php rename to src/Container/InjectTemplateListenerFactory.php index effd137a3..6f5a2183e 100644 --- a/src/Service/InjectTemplateListenerFactory.php +++ b/src/Container/InjectTemplateListenerFactory.php @@ -5,7 +5,9 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Mvc\View\Http\InjectTemplateListener; diff --git a/src/Service/ModuleManagerFactory.php b/src/Container/ModuleManagerFactory.php similarity index 98% rename from src/Service/ModuleManagerFactory.php rename to src/Container/ModuleManagerFactory.php index 2d50ea820..e4282e414 100644 --- a/src/Service/ModuleManagerFactory.php +++ b/src/Container/ModuleManagerFactory.php @@ -5,7 +5,9 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\ModuleManager\Listener\DefaultListenerAggregate; diff --git a/src/Service/PaginatorPluginManagerFactory.php b/src/Container/PaginatorPluginManagerFactory.php similarity index 82% rename from src/Service/PaginatorPluginManagerFactory.php rename to src/Container/PaginatorPluginManagerFactory.php index eac7de893..c77e55bcf 100644 --- a/src/Service/PaginatorPluginManagerFactory.php +++ b/src/Container/PaginatorPluginManagerFactory.php @@ -5,8 +5,11 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); +namespace Zend\Mvc\Container; + +use Zend\Mvc\Service\AbstractPluginManagerFactory; use Zend\Paginator\AdapterPluginManager as PaginatorPluginManager; class PaginatorPluginManagerFactory extends AbstractPluginManagerFactory diff --git a/src/Service/RequestFactory.php b/src/Container/RequestFactory.php similarity index 93% rename from src/Service/RequestFactory.php rename to src/Container/RequestFactory.php index df3f39aee..e2711a026 100644 --- a/src/Service/RequestFactory.php +++ b/src/Container/RequestFactory.php @@ -5,7 +5,9 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Http\PhpEnvironment\Request as HttpRequest; diff --git a/src/Service/ResponseFactory.php b/src/Container/ResponseFactory.php similarity index 93% rename from src/Service/ResponseFactory.php rename to src/Container/ResponseFactory.php index ff917299c..9ad9de7b6 100644 --- a/src/Service/ResponseFactory.php +++ b/src/Container/ResponseFactory.php @@ -5,7 +5,9 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Http\PhpEnvironment\Response as HttpResponse; diff --git a/src/Service/HttpRouteNotFoundStrategyFactory.php b/src/Container/RouteNotFoundStrategyFactory.php similarity index 93% rename from src/Service/HttpRouteNotFoundStrategyFactory.php rename to src/Container/RouteNotFoundStrategyFactory.php index a426d1aea..c60778885 100644 --- a/src/Service/HttpRouteNotFoundStrategyFactory.php +++ b/src/Container/RouteNotFoundStrategyFactory.php @@ -5,15 +5,17 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Mvc\View\Http\RouteNotFoundStrategy; use Zend\ServiceManager\Factory\FactoryInterface; -class HttpRouteNotFoundStrategyFactory implements FactoryInterface +class RouteNotFoundStrategyFactory implements FactoryInterface { - use HttpViewManagerConfigTrait; + use ViewManagerConfigTrait; /** * @param ContainerInterface $container diff --git a/src/Service/SendResponseListenerFactory.php b/src/Container/SendResponseListenerFactory.php similarity index 92% rename from src/Service/SendResponseListenerFactory.php rename to src/Container/SendResponseListenerFactory.php index c94b559af..0c9bcc3b9 100644 --- a/src/Service/SendResponseListenerFactory.php +++ b/src/Container/SendResponseListenerFactory.php @@ -5,7 +5,9 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Mvc\SendResponseListener; diff --git a/src/Service/ServiceListenerFactory.php b/src/Container/ServiceListenerFactory.php similarity index 78% rename from src/Service/ServiceListenerFactory.php rename to src/Container/ServiceListenerFactory.php index 4416fb6e8..f05aafd05 100644 --- a/src/Service/ServiceListenerFactory.php +++ b/src/Container/ServiceListenerFactory.php @@ -5,16 +5,20 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\ModuleManager\Listener\ServiceListener; use Zend\ModuleManager\Listener\ServiceListenerInterface; +use Zend\Mvc\Exception\RuntimeException; use Zend\Mvc\View; use Zend\ServiceManager\Exception\ServiceNotCreatedException; use Zend\ServiceManager\Factory\FactoryInterface; use Zend\ServiceManager\Factory\InvokableFactory; use Zend\ServiceManager\ServiceLocatorInterface; +use Zend\ServiceManager\ServiceManager; class ServiceListenerFactory implements FactoryInterface { @@ -62,27 +66,27 @@ class ServiceListenerFactory implements FactoryInterface 'invokables' => [], 'factories' => [ 'Application' => ApplicationFactory::class, - 'config' => 'Zend\Mvc\Service\ConfigFactory', - 'ControllerManager' => 'Zend\Mvc\Service\ControllerManagerFactory', - 'ControllerPluginManager' => 'Zend\Mvc\Service\ControllerPluginManagerFactory', - 'DispatchListener' => 'Zend\Mvc\Service\DispatchListenerFactory', - 'HttpExceptionStrategy' => HttpExceptionStrategyFactory::class, - 'HttpMethodListener' => 'Zend\Mvc\Service\HttpMethodListenerFactory', - 'HttpRouteNotFoundStrategy' => HttpRouteNotFoundStrategyFactory::class, - 'HttpViewManager' => 'Zend\Mvc\Service\HttpViewManagerFactory', - 'InjectTemplateListener' => 'Zend\Mvc\Service\InjectTemplateListenerFactory', - 'PaginatorPluginManager' => 'Zend\Mvc\Service\PaginatorPluginManagerFactory', - 'Request' => 'Zend\Mvc\Service\RequestFactory', - 'Response' => 'Zend\Mvc\Service\ResponseFactory', - 'ViewHelperManager' => 'Zend\Mvc\Service\ViewHelperManagerFactory', - View\Http\DefaultRenderingStrategy::class => HttpDefaultRenderingStrategyFactory::class, - 'ViewFeedStrategy' => 'Zend\Mvc\Service\ViewFeedStrategyFactory', - 'ViewJsonStrategy' => 'Zend\Mvc\Service\ViewJsonStrategyFactory', - 'ViewManager' => 'Zend\Mvc\Service\ViewManagerFactory', - 'ViewResolver' => 'Zend\Mvc\Service\ViewResolverFactory', - 'ViewTemplateMapResolver' => 'Zend\Mvc\Service\ViewTemplateMapResolverFactory', - 'ViewTemplatePathStack' => 'Zend\Mvc\Service\ViewTemplatePathStackFactory', - 'ViewPrefixPathStackResolver' => 'Zend\Mvc\Service\ViewPrefixPathStackResolverFactory', + 'config' => 'Zend\Mvc\Container\ConfigFactory', + 'ControllerManager' => 'Zend\Mvc\Container\ControllerManagerFactory', + 'ControllerPluginManager' => 'Zend\Mvc\Container\ControllerPluginManagerFactory', + 'DispatchListener' => 'Zend\Mvc\Container\DispatchListenerFactory', + 'HttpExceptionStrategy' => ExceptionStrategyFactory::class, + 'HttpMethodListener' => 'Zend\Mvc\Container\HttpMethodListenerFactory', + 'HttpRouteNotFoundStrategy' => RouteNotFoundStrategyFactory::class, + 'HttpViewManager' => 'Zend\Mvc\Container\HttpViewManagerFactory', + 'InjectTemplateListener' => 'Zend\Mvc\Container\InjectTemplateListenerFactory', + 'PaginatorPluginManager' => 'Zend\Mvc\Container\PaginatorPluginManagerFactory', + 'Request' => 'Zend\Mvc\Container\RequestFactory', + 'Response' => 'Zend\Mvc\Container\ResponseFactory', + 'ViewHelperManager' => 'Zend\Mvc\Container\ViewHelperManagerFactory', + View\Http\DefaultRenderingStrategy::class => DefaultRenderingStrategyFactory::class, + 'ViewFeedStrategy' => 'Zend\Mvc\Container\ViewFeedStrategyFactory', + 'ViewJsonStrategy' => 'Zend\Mvc\Container\ViewJsonStrategyFactory', + 'ViewManager' => 'Zend\Mvc\Container\ViewManagerFactory', + 'ViewResolver' => 'Zend\Mvc\Container\ViewResolverFactory', + 'ViewTemplateMapResolver' => 'Zend\Mvc\Container\ViewTemplateMapResolverFactory', + 'ViewTemplatePathStack' => 'Zend\Mvc\Container\ViewTemplatePathStackFactory', + 'ViewPrefixPathStackResolver' => 'Zend\Mvc\Container\ViewPrefixPathStackResolverFactory', 'Zend\Mvc\MiddlewareListener' => InvokableFactory::class, 'Zend\Mvc\RouteListener' => InvokableFactory::class, 'Zend\Mvc\SendResponseListener' => SendResponseListenerFactory::class, @@ -121,9 +125,16 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o { $configuration = $container->get('ApplicationConfig'); - $serviceListener = $container->has('ServiceListenerInterface') - ? $container->get('ServiceListenerInterface') - : new ServiceListener($container); + if ($container->has('ServiceListenerInterface')) { + $serviceListener = $container->get('ServiceListenerInterface'); + } elseif ($container instanceof ServiceManager) { + $serviceListener = new ServiceListener($container); + } else { + // @TODO update ServiceListener to accept ContainerInterface + throw new RuntimeException( + 'Container is not a ServiceManager and ServiceListenerInterface was not provided' + ); + } if (! $serviceListener instanceof ServiceListenerInterface) { throw new ServiceNotCreatedException( diff --git a/src/Service/ServiceManagerConfig.php b/src/Container/ServiceManagerConfig.php similarity index 99% rename from src/Service/ServiceManagerConfig.php rename to src/Container/ServiceManagerConfig.php index dc1073a4e..aed858ce8 100644 --- a/src/Service/ServiceManagerConfig.php +++ b/src/Container/ServiceManagerConfig.php @@ -5,7 +5,9 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\EventManager\EventManager; diff --git a/src/Service/ViewFactory.php b/src/Container/ViewFactory.php similarity index 94% rename from src/Service/ViewFactory.php rename to src/Container/ViewFactory.php index ed5852752..015c076b4 100644 --- a/src/Service/ViewFactory.php +++ b/src/Container/ViewFactory.php @@ -5,7 +5,9 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\ServiceManager\Factory\FactoryInterface; diff --git a/src/Service/ViewFeedStrategyFactory.php b/src/Container/ViewFeedStrategyFactory.php similarity index 95% rename from src/Service/ViewFeedStrategyFactory.php rename to src/Container/ViewFeedStrategyFactory.php index 61a0d6c1a..4e102abbd 100644 --- a/src/Service/ViewFeedStrategyFactory.php +++ b/src/Container/ViewFeedStrategyFactory.php @@ -5,7 +5,9 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\ServiceManager\Factory\FactoryInterface; diff --git a/src/Service/ViewHelperManagerFactory.php b/src/Container/ViewHelperManagerFactory.php similarity index 93% rename from src/Service/ViewHelperManagerFactory.php rename to src/Container/ViewHelperManagerFactory.php index 371885b19..5a233a0c3 100644 --- a/src/Service/ViewHelperManagerFactory.php +++ b/src/Container/ViewHelperManagerFactory.php @@ -5,10 +5,14 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; +use Zend\Mvc\Service\AbstractPluginManagerFactory; use Zend\Router\RouteMatch; +use Zend\ServiceManager\AbstractPluginManager; use Zend\ServiceManager\Exception\ServiceNotCreatedException; use Zend\View\Helper as ViewHelper; use Zend\View\HelperPluginManager; @@ -31,7 +35,7 @@ class ViewHelperManagerFactory extends AbstractPluginManagerFactory * Create and return the view helper manager * * @param ContainerInterface $container - * @return HelperPluginManager + * @return AbstractPluginManager * @throws ServiceNotCreatedException */ public function __invoke(ContainerInterface $container, $requestedName, array $options = null) @@ -49,11 +53,11 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o /** * Inject override factories into the plugin manager. * - * @param HelperPluginManager $plugins + * @param AbstractPluginManager $plugins * @param ContainerInterface $services - * @return HelperPluginManager + * @return AbstractPluginManager */ - private function injectOverrideFactories(HelperPluginManager $plugins, ContainerInterface $services) + private function injectOverrideFactories(AbstractPluginManager $plugins, ContainerInterface $services) { // Configure URL view helper $urlFactory = $this->createUrlHelperFactory($services); diff --git a/src/Service/ViewJsonStrategyFactory.php b/src/Container/ViewJsonStrategyFactory.php similarity index 95% rename from src/Service/ViewJsonStrategyFactory.php rename to src/Container/ViewJsonStrategyFactory.php index 1f5615031..b973c36c2 100644 --- a/src/Service/ViewJsonStrategyFactory.php +++ b/src/Container/ViewJsonStrategyFactory.php @@ -5,7 +5,9 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\ServiceManager\Factory\FactoryInterface; diff --git a/src/Service/HttpViewManagerConfigTrait.php b/src/Container/ViewManagerConfigTrait.php similarity index 88% rename from src/Service/HttpViewManagerConfigTrait.php rename to src/Container/ViewManagerConfigTrait.php index 6c6efa62d..a0650bae9 100644 --- a/src/Service/HttpViewManagerConfigTrait.php +++ b/src/Container/ViewManagerConfigTrait.php @@ -5,18 +5,20 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use ArrayAccess; use Interop\Container\ContainerInterface; -trait HttpViewManagerConfigTrait +trait ViewManagerConfigTrait { /** * Retrieve view_manager configuration, if present. * * @param ContainerInterface $container - * @return array + * @return array|ArrayAccess */ private function getConfig(ContainerInterface $container) { diff --git a/src/Service/ViewManagerFactory.php b/src/Container/ViewManagerFactory.php similarity index 93% rename from src/Service/ViewManagerFactory.php rename to src/Container/ViewManagerFactory.php index 28c1ecb76..bbac26db2 100644 --- a/src/Service/ViewManagerFactory.php +++ b/src/Container/ViewManagerFactory.php @@ -5,7 +5,9 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Mvc\View\Http\ViewManager as HttpViewManager; diff --git a/src/Service/ViewPhpRendererFactory.php b/src/Container/ViewPhpRendererFactory.php similarity index 94% rename from src/Service/ViewPhpRendererFactory.php rename to src/Container/ViewPhpRendererFactory.php index 3cd3d836b..2016b23b9 100644 --- a/src/Service/ViewPhpRendererFactory.php +++ b/src/Container/ViewPhpRendererFactory.php @@ -5,7 +5,9 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\ServiceManager\Factory\FactoryInterface; diff --git a/src/Service/ViewPhpRendererStrategyFactory.php b/src/Container/ViewPhpRendererStrategyFactory.php similarity index 93% rename from src/Service/ViewPhpRendererStrategyFactory.php rename to src/Container/ViewPhpRendererStrategyFactory.php index 6b83c7254..550c6b993 100644 --- a/src/Service/ViewPhpRendererStrategyFactory.php +++ b/src/Container/ViewPhpRendererStrategyFactory.php @@ -5,7 +5,9 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\ServiceManager\Factory\FactoryInterface; diff --git a/src/Service/ViewPrefixPathStackResolverFactory.php b/src/Container/ViewPrefixPathStackResolverFactory.php similarity index 95% rename from src/Service/ViewPrefixPathStackResolverFactory.php rename to src/Container/ViewPrefixPathStackResolverFactory.php index 08e9f49e1..5ceb59adb 100644 --- a/src/Service/ViewPrefixPathStackResolverFactory.php +++ b/src/Container/ViewPrefixPathStackResolverFactory.php @@ -5,7 +5,9 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\ServiceManager\Factory\FactoryInterface; diff --git a/src/Service/ViewResolverFactory.php b/src/Container/ViewResolverFactory.php similarity index 97% rename from src/Service/ViewResolverFactory.php rename to src/Container/ViewResolverFactory.php index ae743b8d2..abd326a52 100644 --- a/src/Service/ViewResolverFactory.php +++ b/src/Container/ViewResolverFactory.php @@ -5,7 +5,9 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\ServiceManager\Factory\FactoryInterface; diff --git a/src/Service/ViewTemplateMapResolverFactory.php b/src/Container/ViewTemplateMapResolverFactory.php similarity index 95% rename from src/Service/ViewTemplateMapResolverFactory.php rename to src/Container/ViewTemplateMapResolverFactory.php index 18146d50f..ea8e83eaa 100644 --- a/src/Service/ViewTemplateMapResolverFactory.php +++ b/src/Container/ViewTemplateMapResolverFactory.php @@ -5,7 +5,9 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\ServiceManager\Factory\FactoryInterface; diff --git a/src/Service/ViewTemplatePathStackFactory.php b/src/Container/ViewTemplatePathStackFactory.php similarity index 96% rename from src/Service/ViewTemplatePathStackFactory.php rename to src/Container/ViewTemplatePathStackFactory.php index cf7f01af0..081531c57 100644 --- a/src/Service/ViewTemplatePathStackFactory.php +++ b/src/Container/ViewTemplatePathStackFactory.php @@ -5,7 +5,9 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +declare(strict_types=1); + +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\ServiceManager\Factory\FactoryInterface; diff --git a/src/Controller/AbstractActionController.php b/src/Controller/AbstractActionController.php index 54277ab31..0c6fa4704 100644 --- a/src/Controller/AbstractActionController.php +++ b/src/Controller/AbstractActionController.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Controller; use Zend\Mvc\Exception; @@ -42,7 +44,10 @@ public function notFoundAction() { $event = $this->getEvent(); $routeMatch = $event->getRouteMatch(); - $routeMatch->setParam('action', 'not-found'); + if ($routeMatch) { + // @TODO figure out what is the course of action in case of missing RouteMatch + $routeMatch->setParam('action', 'not-found'); + } $helper = $this->plugin('createHttpNotFoundModel'); return $helper($event->getResponse()); diff --git a/src/Controller/AbstractController.php b/src/Controller/AbstractController.php index da634c5c6..383f9e694 100644 --- a/src/Controller/AbstractController.php +++ b/src/Controller/AbstractController.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Controller; use Zend\EventManager\EventInterface as Event; @@ -55,7 +57,7 @@ abstract class AbstractController implements protected $response; /** - * @var Event + * @var MvcEvent */ protected $event; diff --git a/src/Controller/AbstractRestfulController.php b/src/Controller/AbstractRestfulController.php index cff21f6db..d40345b12 100644 --- a/src/Controller/AbstractRestfulController.php +++ b/src/Controller/AbstractRestfulController.php @@ -4,6 +4,9 @@ * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (http://www.zend.com) * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ + +declare(strict_types=1); + namespace Zend\Mvc\Controller; use Zend\Http\Request as HttpRequest; @@ -74,9 +77,9 @@ abstract class AbstractRestfulController extends AbstractController * @param string $name * @return self */ - public function setIdentifierName($name) + public function setIdentifierName(string $name) { - $this->identifierName = (string) $name; + $this->identifierName = $name; return $this; } diff --git a/src/Controller/ControllerManager.php b/src/Controller/ControllerManager.php index 20e721655..02de0a7df 100644 --- a/src/Controller/ControllerManager.php +++ b/src/Controller/ControllerManager.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Controller; use Interop\Container\ContainerInterface; diff --git a/src/Controller/LazyControllerAbstractFactory.php b/src/Controller/LazyControllerAbstractFactory.php index 0cd0f23d8..219e23731 100644 --- a/src/Controller/LazyControllerAbstractFactory.php +++ b/src/Controller/LazyControllerAbstractFactory.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Controller; use Interop\Container\ContainerInterface; diff --git a/src/Controller/MiddlewareController.php b/src/Controller/MiddlewareController.php index aee5e269d..3060f64d9 100644 --- a/src/Controller/MiddlewareController.php +++ b/src/Controller/MiddlewareController.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Controller; use Psr\Http\Message\ResponseInterface; diff --git a/src/Controller/Plugin/AbstractPlugin.php b/src/Controller/Plugin/AbstractPlugin.php index c00a570cf..0c092763b 100644 --- a/src/Controller/Plugin/AbstractPlugin.php +++ b/src/Controller/Plugin/AbstractPlugin.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Controller\Plugin; use Zend\Stdlib\DispatchableInterface as Dispatchable; diff --git a/src/Controller/Plugin/AcceptableViewModelSelector.php b/src/Controller/Plugin/AcceptableViewModelSelector.php index 7a7a5efe7..c629eaca6 100644 --- a/src/Controller/Plugin/AcceptableViewModelSelector.php +++ b/src/Controller/Plugin/AcceptableViewModelSelector.php @@ -5,10 +5,13 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Controller\Plugin; use Zend\Http\Header\Accept\FieldValuePart\AbstractFieldValuePart; use Zend\Http\Request; +use Zend\Mvc\Exception\RuntimeException; use Zend\Mvc\InjectApplicationEventInterface; use Zend\Mvc\MvcEvent; use Zend\Mvc\Exception\DomainException; @@ -42,7 +45,7 @@ class AcceptableViewModelSelector extends AbstractPlugin /** * Default array to match against. * - * @var Array + * @var array|null */ protected $defaultMatchAgainst; @@ -86,7 +89,7 @@ public function getViewModel( $name = $this->getViewModelName($matchAgainst, $returnDefault, $resultReference); if (! $name) { - return; + return null; } if (! class_exists($name)) { @@ -102,7 +105,7 @@ public function getViewModel( * @param array $matchAgainst (optional) The Array to match against * @param bool $returnDefault (optional) If no match is available. Return default instead * @param AbstractFieldValuePart|null $resultReference (optional) The object that was matched. - * @return ModelInterface|null Returns null if $returnDefault = false and no match could be made + * @return string|null Returns null if $returnDefault = false and no match could be made */ public function getViewModelName( array $matchAgainst = null, @@ -132,7 +135,7 @@ public function match(array $matchAgainst = null) $headers = $request->getHeaders(); if ((! $matchAgainst && ! $this->defaultMatchAgainst) || ! $headers->has('accept')) { - return; + return null; } if (! $matchAgainst) { @@ -148,11 +151,12 @@ public function match(array $matchAgainst = null) /** @var $accept \Zend\Http\Header\Accept */ $accept = $headers->get('Accept'); - if (($res = $accept->match($matchAgainstString)) === false) { - return; + $res = $accept->match($matchAgainstString); + if ($res instanceof AbstractFieldValuePart) { + return $res; } - return $res; + return null; } /** @@ -160,9 +164,9 @@ public function match(array $matchAgainst = null) * @param string $defaultViewModelName The default View Model name * @return AcceptableViewModelSelector provides fluent interface */ - public function setDefaultViewModelName($defaultViewModelName) + public function setDefaultViewModelName(string $defaultViewModelName) { - $this->defaultViewModelName = (string) $defaultViewModelName; + $this->defaultViewModelName = $defaultViewModelName; return $this; } @@ -220,7 +224,11 @@ protected function injectViewModelName($modelAcceptString, $modelName) */ protected function extractViewModelName(AbstractFieldValuePart $res) { - $modelName = $res->getMatchedAgainst()->params[self::INJECT_VIEWMODEL_NAME]; + $matched = $res->getMatchedAgainst(); + if (! $matched) { + throw new RuntimeException('Matched field value part is not set'); + } + $modelName = $matched->params[self::INJECT_VIEWMODEL_NAME]; return str_replace('|', '\\', $modelName); } diff --git a/src/Controller/Plugin/CreateHttpNotFoundModel.php b/src/Controller/Plugin/CreateHttpNotFoundModel.php index dd35143e2..126c3eec9 100644 --- a/src/Controller/Plugin/CreateHttpNotFoundModel.php +++ b/src/Controller/Plugin/CreateHttpNotFoundModel.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Controller\Plugin; use Zend\Http\Response; diff --git a/src/Controller/Plugin/Forward.php b/src/Controller/Plugin/Forward.php index 32f2d8273..35068bde8 100644 --- a/src/Controller/Plugin/Forward.php +++ b/src/Controller/Plugin/Forward.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Controller\Plugin; use Zend\EventManager\SharedEventManagerInterface as SharedEvents; @@ -56,9 +58,9 @@ public function __construct(ControllerManager $controllers) * @param int $maxNestedForwards * @return self */ - public function setMaxNestedForwards($maxNestedForwards) + public function setMaxNestedForwards(integer $maxNestedForwards) { - $this->maxNestedForwards = (int) $maxNestedForwards; + $this->maxNestedForwards = $maxNestedForwards; return $this; } diff --git a/src/Controller/Plugin/Layout.php b/src/Controller/Plugin/Layout.php index 89e41588e..7171ba66c 100644 --- a/src/Controller/Plugin/Layout.php +++ b/src/Controller/Plugin/Layout.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Controller\Plugin; use Zend\Mvc\Exception; @@ -25,10 +27,10 @@ class Layout extends AbstractPlugin * @param string $template * @return Layout */ - public function setTemplate($template) + public function setTemplate(string $template) { $viewModel = $this->getViewModel(); - $viewModel->setTemplate((string) $template); + $viewModel->setTemplate($template); return $this; } diff --git a/src/Controller/Plugin/Params.php b/src/Controller/Plugin/Params.php index eeed5456b..ecc5d0f9f 100644 --- a/src/Controller/Plugin/Params.php +++ b/src/Controller/Plugin/Params.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Controller\Plugin; use Zend\Mvc\Exception\RuntimeException; diff --git a/src/Controller/Plugin/PluginInterface.php b/src/Controller/Plugin/PluginInterface.php index 1a9fdaffa..bea869aa4 100644 --- a/src/Controller/Plugin/PluginInterface.php +++ b/src/Controller/Plugin/PluginInterface.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Controller\Plugin; use Zend\Stdlib\DispatchableInterface as Dispatchable; diff --git a/src/Controller/Plugin/Redirect.php b/src/Controller/Plugin/Redirect.php index df9b650d4..faa7fd9a7 100644 --- a/src/Controller/Plugin/Redirect.php +++ b/src/Controller/Plugin/Redirect.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Controller\Plugin; use Zend\Http\Response; diff --git a/src/Controller/Plugin/Service/ForwardFactory.php b/src/Controller/Plugin/Service/ForwardFactory.php index 2bf729545..606a70747 100644 --- a/src/Controller/Plugin/Service/ForwardFactory.php +++ b/src/Controller/Plugin/Service/ForwardFactory.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Controller\Plugin\Service; use Interop\Container\ContainerInterface; diff --git a/src/Controller/Plugin/Url.php b/src/Controller/Plugin/Url.php index 7a050a175..ad68005d0 100644 --- a/src/Controller/Plugin/Url.php +++ b/src/Controller/Plugin/Url.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Controller\Plugin; use Traversable; @@ -68,6 +70,8 @@ public function fromRoute($route = null, $params = [], $options = [], $reuseMatc if (3 == func_num_args() && is_bool($options)) { $reuseMatchedParams = $options; $options = []; + } elseif (\is_bool($options)) { + $options = []; } if ($route === null) { @@ -75,6 +79,9 @@ public function fromRoute($route = null, $params = [], $options = [], $reuseMatc throw new Exception\RuntimeException('No RouteMatch instance present'); } + /** + * @var string|null + */ $route = $matches->getMatchedRouteName(); if ($route === null) { diff --git a/src/Controller/PluginManager.php b/src/Controller/PluginManager.php index 5a9295903..1322697e1 100644 --- a/src/Controller/PluginManager.php +++ b/src/Controller/PluginManager.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Controller; use Zend\ServiceManager\AbstractPluginManager; diff --git a/src/DispatchListener.php b/src/DispatchListener.php index ed7c7fe68..c0d2df72b 100644 --- a/src/DispatchListener.php +++ b/src/DispatchListener.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc; use ArrayObject; @@ -87,10 +89,11 @@ public function onDispatch(MvcEvent $e) $controllerManager = $this->controllerManager; + $return = null; // Query abstract controllers, too! if (! $controllerManager->has($controllerName)) { $return = $this->marshalControllerNotFoundEvent( - $application::ERROR_CONTROLLER_NOT_FOUND, + Application::ERROR_CONTROLLER_NOT_FOUND, $controllerName, $e, $application @@ -102,7 +105,7 @@ public function onDispatch(MvcEvent $e) $controller = $controllerManager->get($controllerName); } catch (Exception\InvalidControllerException $exception) { $return = $this->marshalControllerNotFoundEvent( - $application::ERROR_CONTROLLER_INVALID, + Application::ERROR_CONTROLLER_INVALID, $controllerName, $e, $application, @@ -111,7 +114,7 @@ public function onDispatch(MvcEvent $e) return $this->complete($return, $e); } catch (InvalidServiceException $exception) { $return = $this->marshalControllerNotFoundEvent( - $application::ERROR_CONTROLLER_INVALID, + Application::ERROR_CONTROLLER_INVALID, $controllerName, $e, $application, @@ -144,7 +147,7 @@ public function onDispatch(MvcEvent $e) if ($caughtException !== null) { $e->setName(MvcEvent::EVENT_DISPATCH_ERROR); - $e->setError($application::ERROR_EXCEPTION); + $e->setError(Application::ERROR_EXCEPTION); $e->setController($controllerName); $e->setControllerClass(get_class($controller)); $e->setParam('exception', $caughtException); @@ -200,7 +203,7 @@ protected function complete($return, MvcEvent $event) * @param string $type * @param string $controllerName * @param MvcEvent $event - * @param Application $application + * @param ApplicationInterface $application * @param \Throwable|\Exception $exception * @return mixed */ @@ -208,7 +211,7 @@ protected function marshalControllerNotFoundEvent( $type, $controllerName, MvcEvent $event, - Application $application, + ApplicationInterface $application, $exception = null ) { $event->setName(MvcEvent::EVENT_DISPATCH_ERROR); @@ -233,18 +236,18 @@ protected function marshalControllerNotFoundEvent( * * @param string $controllerName * @param MvcEvent $event - * @param Application $application + * @param ApplicationInterface $application * @param \Throwable|\Exception $exception * @return mixed */ protected function marshalBadControllerEvent( $controllerName, MvcEvent $event, - Application $application, + ApplicationInterface $application, $exception ) { $event->setName(MvcEvent::EVENT_DISPATCH_ERROR); - $event->setError($application::ERROR_EXCEPTION); + $event->setError(Application::ERROR_EXCEPTION); $event->setController($controllerName); $event->setParam('exception', $exception); diff --git a/src/Exception/BadMethodCallException.php b/src/Exception/BadMethodCallException.php index 50c951c8c..76d9c4825 100644 --- a/src/Exception/BadMethodCallException.php +++ b/src/Exception/BadMethodCallException.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Exception; class BadMethodCallException extends \BadMethodCallException implements ExceptionInterface diff --git a/src/Exception/DomainException.php b/src/Exception/DomainException.php index 8988e676d..fcf8b7c5b 100644 --- a/src/Exception/DomainException.php +++ b/src/Exception/DomainException.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Exception; class DomainException extends \DomainException implements ExceptionInterface diff --git a/src/Exception/ExceptionInterface.php b/src/Exception/ExceptionInterface.php index 28c62d879..7000e1d3e 100644 --- a/src/Exception/ExceptionInterface.php +++ b/src/Exception/ExceptionInterface.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Exception; interface ExceptionInterface diff --git a/src/Exception/InvalidArgumentException.php b/src/Exception/InvalidArgumentException.php index fd7c910cd..c66f779da 100644 --- a/src/Exception/InvalidArgumentException.php +++ b/src/Exception/InvalidArgumentException.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Exception; class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface diff --git a/src/Exception/InvalidControllerException.php b/src/Exception/InvalidControllerException.php index 51afa29e5..225e5dfcb 100644 --- a/src/Exception/InvalidControllerException.php +++ b/src/Exception/InvalidControllerException.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Exception; class InvalidControllerException extends \Exception implements ExceptionInterface diff --git a/src/Exception/InvalidMiddlewareException.php b/src/Exception/InvalidMiddlewareException.php index 5e4982e8c..f76f9493c 100644 --- a/src/Exception/InvalidMiddlewareException.php +++ b/src/Exception/InvalidMiddlewareException.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Exception; final class InvalidMiddlewareException extends RuntimeException @@ -18,9 +20,8 @@ final class InvalidMiddlewareException extends RuntimeException * @param string $middlewareName * @return self */ - public static function fromMiddlewareName($middlewareName) + public static function fromMiddlewareName(string $middlewareName) { - $middlewareName = (string)$middlewareName; $instance = new self(sprintf('Cannot dispatch middleware %s', $middlewareName)); $instance->middlewareName = $middlewareName; return $instance; diff --git a/src/Exception/InvalidPluginException.php b/src/Exception/InvalidPluginException.php index bb3f3cd00..9f69dbe83 100644 --- a/src/Exception/InvalidPluginException.php +++ b/src/Exception/InvalidPluginException.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Exception; class InvalidPluginException extends \Exception implements ExceptionInterface diff --git a/src/Exception/MissingLocatorException.php b/src/Exception/MissingLocatorException.php index 359d14c3e..93cc33f97 100644 --- a/src/Exception/MissingLocatorException.php +++ b/src/Exception/MissingLocatorException.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Exception; class MissingLocatorException extends RuntimeException diff --git a/src/Exception/ReachedFinalHandlerException.php b/src/Exception/ReachedFinalHandlerException.php index 874d48b80..b90239def 100644 --- a/src/Exception/ReachedFinalHandlerException.php +++ b/src/Exception/ReachedFinalHandlerException.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Exception; class ReachedFinalHandlerException extends RuntimeException diff --git a/src/Exception/RuntimeException.php b/src/Exception/RuntimeException.php index 4469264e8..1a1171450 100644 --- a/src/Exception/RuntimeException.php +++ b/src/Exception/RuntimeException.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Exception; class RuntimeException extends \RuntimeException implements ExceptionInterface diff --git a/src/HttpMethodListener.php b/src/HttpMethodListener.php index 77e8e007d..917d65d25 100644 --- a/src/HttpMethodListener.php +++ b/src/HttpMethodListener.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc; use Zend\EventManager\AbstractListenerAggregate; @@ -37,7 +39,7 @@ class HttpMethodListener extends AbstractListenerAggregate /** * @param bool $enabled - * @param array $allowedMethods + * @param null|array $allowedMethods */ public function __construct($enabled = true, $allowedMethods = []) { @@ -66,7 +68,7 @@ public function attach(EventManagerInterface $events, $priority = 1) /** * @param MvcEvent $e - * @return void|HttpResponse + * @return null|HttpResponse */ public function onRoute(MvcEvent $e) { @@ -74,13 +76,13 @@ public function onRoute(MvcEvent $e) $response = $e->getResponse(); if (! $request instanceof HttpRequest || ! $response instanceof HttpResponse) { - return; + return null; } $method = $request->getMethod(); if (in_array($method, $this->getAllowedMethods())) { - return; + return null; } $response->setStatusCode(405); @@ -118,8 +120,8 @@ public function isEnabled() /** * @param bool $enabled */ - public function setEnabled($enabled) + public function setEnabled(bool $enabled) { - $this->enabled = (bool) $enabled; + $this->enabled = $enabled; } } diff --git a/src/InjectApplicationEventInterface.php b/src/InjectApplicationEventInterface.php index 18ae5af1c..c99e67d4a 100644 --- a/src/InjectApplicationEventInterface.php +++ b/src/InjectApplicationEventInterface.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc; use Zend\EventManager\EventInterface as Event; diff --git a/src/MiddlewareListener.php b/src/MiddlewareListener.php index 618325451..146437baa 100644 --- a/src/MiddlewareListener.php +++ b/src/MiddlewareListener.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc; use Interop\Container\ContainerInterface; @@ -48,6 +50,9 @@ public function onDispatch(MvcEvent $event) } $routeMatch = $event->getRouteMatch(); + if (! $routeMatch) { + return; + } $middleware = $routeMatch->getParam('middleware', false); if (false === $middleware) { return; @@ -55,6 +60,9 @@ public function onDispatch(MvcEvent $event) $request = $event->getRequest(); $application = $event->getApplication(); + /* + * @var $response \Zend\Http\Response + */ $response = $application->getResponse(); $serviceManager = $application->getServiceManager(); @@ -68,7 +76,7 @@ public function onDispatch(MvcEvent $event) ); } catch (InvalidMiddlewareException $invalidMiddlewareException) { $return = $this->marshalInvalidMiddleware( - $application::ERROR_MIDDLEWARE_CANNOT_DISPATCH, + Application::ERROR_MIDDLEWARE_CANNOT_DISPATCH, $invalidMiddlewareException->toMiddlewareName(), $event, $application, @@ -79,6 +87,7 @@ public function onDispatch(MvcEvent $event) } $caughtException = null; + $return = null; try { $return = (new MiddlewareController( $pipe, @@ -94,7 +103,7 @@ public function onDispatch(MvcEvent $event) if ($caughtException !== null) { $event->setName(MvcEvent::EVENT_DISPATCH_ERROR); - $event->setError($application::ERROR_EXCEPTION); + $event->setError(Application::ERROR_EXCEPTION); $event->setParam('exception', $caughtException); $events = $application->getEventManager(); @@ -157,7 +166,7 @@ private function createPipeFromSpec( * @param string $type * @param string $middlewareName * @param MvcEvent $event - * @param Application $application + * @param ApplicationInterface $application * @param \Exception $exception * @return mixed */ @@ -165,7 +174,7 @@ protected function marshalInvalidMiddleware( $type, $middlewareName, MvcEvent $event, - Application $application, + ApplicationInterface $application, \Exception $exception = null ) { $event->setName(MvcEvent::EVENT_DISPATCH_ERROR); diff --git a/src/ModuleRouteListener.php b/src/ModuleRouteListener.php index 02fc72be9..c13ea714c 100644 --- a/src/ModuleRouteListener.php +++ b/src/ModuleRouteListener.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc; use Zend\EventManager\AbstractListenerAggregate; @@ -36,7 +38,7 @@ public function attach(EventManagerInterface $events, $priority = 1) * the matched controller parameter. * * @param MvcEvent $e - * @return null + * @return void */ public function onRoute(MvcEvent $e) { diff --git a/src/MvcEvent.php b/src/MvcEvent.php index f9918377c..b48d8d521 100644 --- a/src/MvcEvent.php +++ b/src/MvcEvent.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc; use Zend\EventManager\Event; @@ -193,7 +195,7 @@ public function setViewModel(Model $viewModel) * * @return Model */ - public function getViewModel() + public function getViewModel() : Model { if (null === $this->viewModel) { $this->setViewModel(new ViewModel()); diff --git a/src/ResponseSender/AbstractResponseSender.php b/src/ResponseSender/AbstractResponseSender.php index ed719d5d0..38f58c821 100644 --- a/src/ResponseSender/AbstractResponseSender.php +++ b/src/ResponseSender/AbstractResponseSender.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\ResponseSender; use Zend\Http\Header\MultipleHeaderInterface; diff --git a/src/ResponseSender/HttpResponseSender.php b/src/ResponseSender/HttpResponseSender.php index 1131cab3f..9a797f852 100644 --- a/src/ResponseSender/HttpResponseSender.php +++ b/src/ResponseSender/HttpResponseSender.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\ResponseSender; use Zend\Http\Response; @@ -41,8 +43,8 @@ public function __invoke(SendResponseEvent $event) return $this; } - $this->sendHeaders($event) - ->sendContent($event); + $this->sendHeaders($event); + $this->sendContent($event); $event->stopPropagation(true); return $this; } diff --git a/src/ResponseSender/PhpEnvironmentResponseSender.php b/src/ResponseSender/PhpEnvironmentResponseSender.php index 5309e11f0..69f55340b 100644 --- a/src/ResponseSender/PhpEnvironmentResponseSender.php +++ b/src/ResponseSender/PhpEnvironmentResponseSender.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\ResponseSender; use Zend\Http\PhpEnvironment\Response; @@ -24,8 +26,8 @@ public function __invoke(SendResponseEvent $event) return $this; } - $this->sendHeaders($event) - ->sendContent($event); + $this->sendHeaders($event); + $this->sendContent($event); $event->stopPropagation(true); return $this; } diff --git a/src/ResponseSender/ResponseSenderInterface.php b/src/ResponseSender/ResponseSenderInterface.php index 8322ae631..2e9faebd6 100644 --- a/src/ResponseSender/ResponseSenderInterface.php +++ b/src/ResponseSender/ResponseSenderInterface.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\ResponseSender; interface ResponseSenderInterface diff --git a/src/ResponseSender/SendResponseEvent.php b/src/ResponseSender/SendResponseEvent.php index e7f74215b..3fc02c273 100644 --- a/src/ResponseSender/SendResponseEvent.php +++ b/src/ResponseSender/SendResponseEvent.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\ResponseSender; use Zend\EventManager\Event; diff --git a/src/ResponseSender/SimpleStreamResponseSender.php b/src/ResponseSender/SimpleStreamResponseSender.php index 3d1be8f75..76bff6274 100644 --- a/src/ResponseSender/SimpleStreamResponseSender.php +++ b/src/ResponseSender/SimpleStreamResponseSender.php @@ -5,9 +5,12 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\ResponseSender; use Zend\Http\Response\Stream; +use Zend\Mvc\Exception\DomainException; class SimpleStreamResponseSender extends AbstractResponseSender { @@ -23,6 +26,9 @@ public function sendStream(SendResponseEvent $event) return $this; } $response = $event->getResponse(); + if (! $response instanceof Stream) { + throw new DomainException('Attempting to send stream of non-stream response'); + } $stream = $response->getStream(); fpassthru($stream); $event->setContentSent(); diff --git a/src/RouteListener.php b/src/RouteListener.php index 4fd1fc37f..1f0ffbfb8 100644 --- a/src/RouteListener.php +++ b/src/RouteListener.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc; use Zend\EventManager\AbstractListenerAggregate; @@ -34,7 +36,7 @@ public function attach(EventManagerInterface $events, $priority = 1) * Seeds the event with the route match on completion. * * @param MvcEvent $event - * @return null|RouteMatch + * @return null|RouteMatch|mixed */ public function onRoute(MvcEvent $event) { diff --git a/src/SendResponseListener.php b/src/SendResponseListener.php index 1b939ef6e..eaa5faf12 100644 --- a/src/SendResponseListener.php +++ b/src/SendResponseListener.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc; use Zend\EventManager\AbstractListenerAggregate; @@ -109,7 +111,7 @@ public function getEvent() * Set the send response event * * @param SendResponseEvent $e - * @return SendResponseEvent + * @return SendResponseListener */ public function setEvent(SendResponseEvent $e) { diff --git a/src/Service/AbstractPluginManagerFactory.php b/src/Service/AbstractPluginManagerFactory.php index 0224eb99e..8e2a9c4d7 100644 --- a/src/Service/AbstractPluginManagerFactory.php +++ b/src/Service/AbstractPluginManagerFactory.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\Service; use Interop\Container\ContainerInterface; diff --git a/src/View/Http/CreateViewModelListener.php b/src/View/Http/CreateViewModelListener.php index f75186110..744ddd50a 100644 --- a/src/View/Http/CreateViewModelListener.php +++ b/src/View/Http/CreateViewModelListener.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\View\Http; use Zend\EventManager\AbstractListenerAggregate; diff --git a/src/View/Http/DefaultRenderingStrategy.php b/src/View/Http/DefaultRenderingStrategy.php index 5031966c8..0268abe1f 100644 --- a/src/View/Http/DefaultRenderingStrategy.php +++ b/src/View/Http/DefaultRenderingStrategy.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\View\Http; use Zend\EventManager\AbstractListenerAggregate; @@ -55,9 +57,9 @@ public function attach(EventManagerInterface $events, $priority = 1) * @param string $layoutTemplate * @return DefaultRenderingStrategy */ - public function setLayoutTemplate($layoutTemplate) + public function setLayoutTemplate(string $layoutTemplate) { - $this->layoutTemplate = (string) $layoutTemplate; + $this->layoutTemplate = $layoutTemplate; return $this; } @@ -90,7 +92,7 @@ public function render(MvcEvent $e) $response = $e->getResponse(); $viewModel = $e->getViewModel(); if (! $viewModel instanceof ViewModel) { - return; + return null; } $view = $this->view; diff --git a/src/View/Http/ExceptionStrategy.php b/src/View/Http/ExceptionStrategy.php index 440358210..d420670a7 100644 --- a/src/View/Http/ExceptionStrategy.php +++ b/src/View/Http/ExceptionStrategy.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\View\Http; use Zend\EventManager\AbstractListenerAggregate; @@ -44,9 +46,9 @@ public function attach(EventManagerInterface $events, $priority = 1) * @param bool $displayExceptions * @return ExceptionStrategy */ - public function setDisplayExceptions($displayExceptions) + public function setDisplayExceptions(bool $displayExceptions) { - $this->displayExceptions = (bool) $displayExceptions; + $this->displayExceptions = $displayExceptions; return $this; } @@ -66,9 +68,9 @@ public function displayExceptions() * @param string $exceptionTemplate * @return ExceptionStrategy */ - public function setExceptionTemplate($exceptionTemplate) + public function setExceptionTemplate(string $exceptionTemplate) { - $this->exceptionTemplate = (string) $exceptionTemplate; + $this->exceptionTemplate = $exceptionTemplate; return $this; } diff --git a/src/View/Http/InjectRoutematchParamsListener.php b/src/View/Http/InjectRoutematchParamsListener.php index adcaf29b9..bc641d6f1 100644 --- a/src/View/Http/InjectRoutematchParamsListener.php +++ b/src/View/Http/InjectRoutematchParamsListener.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\View\Http; use Zend\EventManager\AbstractListenerAggregate; @@ -12,6 +14,7 @@ use Zend\Http\Request as HttpRequest; use Zend\Mvc\MvcEvent; +// @TODO looks like this is obsolete unused piece of code. Make sure it is so and remove it class InjectRoutematchParamsListener extends AbstractListenerAggregate { /** @@ -37,7 +40,11 @@ public function attach(EventManagerInterface $events, $priority = 1) */ public function injectParams(MvcEvent $e) { - $routeMatchParams = $e->getRouteMatch()->getParams(); + $routeMatch = $e->getRouteMatch(); + $routeMatchParams = $routeMatch ? $routeMatch->getParams() : []; + /** + * @var HttpRequest + */ $request = $e->getRequest(); if (! $request instanceof HttpRequest) { @@ -45,7 +52,8 @@ public function injectParams(MvcEvent $e) return; } - $params = $request->get(); + // @TODO get() does not exist on Http\Request, was it meant to be getQuery()? + $params = $request->getQuery(); if ($this->overwrite) { // Overwrite existing parameters, or create new ones if not present. diff --git a/src/View/Http/InjectTemplateListener.php b/src/View/Http/InjectTemplateListener.php index 3b110a787..e6f62ca54 100644 --- a/src/View/Http/InjectTemplateListener.php +++ b/src/View/Http/InjectTemplateListener.php @@ -5,11 +5,14 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\View\Http; use Zend\EventManager\AbstractListenerAggregate; use Zend\EventManager\EventManagerInterface as Events; use Zend\Mvc\MvcEvent; +use Zend\Router\RouteMatch; use Zend\Stdlib\StringUtils; use Zend\View\Model\ModelInterface as ViewModel; @@ -58,6 +61,9 @@ public function injectTemplate(MvcEvent $e) return; } + /** + * @var RouteMatch + */ $routeMatch = $e->getRouteMatch(); if ($preferRouteMatchController = $routeMatch->getParam('prefer_route_match_controller', false)) { $this->setPreferRouteMatchController($preferRouteMatchController); @@ -99,7 +105,7 @@ public function setControllerMap(array $map) * Maps controller to template if controller namespace is whitelisted or mapped * * @param string $controller controller FQCN - * @return string|false template name or false if controller was not matched + * @return string template name */ public function mapController($controller) { @@ -187,9 +193,9 @@ protected function deriveControllerClass($controller) * * @param boolean $preferRouteMatchController */ - public function setPreferRouteMatchController($preferRouteMatchController) + public function setPreferRouteMatchController(bool $preferRouteMatchController) { - $this->preferRouteMatchController = (bool) $preferRouteMatchController; + $this->preferRouteMatchController = $preferRouteMatchController; } /** diff --git a/src/View/Http/InjectViewModelListener.php b/src/View/Http/InjectViewModelListener.php index 6a61a9b32..0eac32ef3 100644 --- a/src/View/Http/InjectViewModelListener.php +++ b/src/View/Http/InjectViewModelListener.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\View\Http; use Zend\EventManager\AbstractListenerAggregate; diff --git a/src/View/Http/RouteNotFoundStrategy.php b/src/View/Http/RouteNotFoundStrategy.php index 12d397f92..df63c3a90 100644 --- a/src/View/Http/RouteNotFoundStrategy.php +++ b/src/View/Http/RouteNotFoundStrategy.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\View\Http; use Zend\EventManager\AbstractListenerAggregate; @@ -61,9 +63,9 @@ public function attach(EventManagerInterface $events, $priority = 1) * @param bool $displayExceptions * @return RouteNotFoundStrategy */ - public function setDisplayExceptions($displayExceptions) + public function setDisplayExceptions(bool $displayExceptions) { - $this->displayExceptions = (bool) $displayExceptions; + $this->displayExceptions = $displayExceptions; return $this; } @@ -83,9 +85,9 @@ public function displayExceptions() * @param bool $displayNotFoundReason * @return RouteNotFoundStrategy */ - public function setDisplayNotFoundReason($displayNotFoundReason) + public function setDisplayNotFoundReason(bool $displayNotFoundReason) { - $this->displayNotFoundReason = (bool) $displayNotFoundReason; + $this->displayNotFoundReason = $displayNotFoundReason; return $this; } @@ -105,9 +107,9 @@ public function displayNotFoundReason() * @param string $notFoundTemplate * @return RouteNotFoundStrategy */ - public function setNotFoundTemplate($notFoundTemplate) + public function setNotFoundTemplate(string $notFoundTemplate) { - $this->notFoundTemplate = (string) $notFoundTemplate; + $this->notFoundTemplate = $notFoundTemplate; return $this; } diff --git a/src/View/Http/ViewManager.php b/src/View/Http/ViewManager.php index 67802c5ac..b2091dcf9 100644 --- a/src/View/Http/ViewManager.php +++ b/src/View/Http/ViewManager.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Zend\Mvc\View\Http; use ArrayAccess; diff --git a/test/Application/AllowsReturningEarlyFromRoutingTest.php b/test/Application/AllowsReturningEarlyFromRoutingTest.php index 77b0f560f..daee26c5f 100644 --- a/test/Application/AllowsReturningEarlyFromRoutingTest.php +++ b/test/Application/AllowsReturningEarlyFromRoutingTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Application; use PHPUnit\Framework\TestCase; diff --git a/test/Application/BadControllerTrait.php b/test/Application/BadControllerTrait.php index 5d2f57d75..8c7f6c88b 100644 --- a/test/Application/BadControllerTrait.php +++ b/test/Application/BadControllerTrait.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Application; use ReflectionProperty; @@ -12,8 +14,8 @@ use Zend\Http\PhpEnvironment\Response; use Zend\Mvc\Application; use Zend\Mvc\Controller\ControllerManager; -use Zend\Mvc\Service\ServiceManagerConfig; -use Zend\Mvc\Service\ServiceListenerFactory; +use Zend\Mvc\Container\ServiceManagerConfig; +use Zend\Mvc\Container\ServiceListenerFactory; use Zend\Router; use Zend\ServiceManager\ServiceManager; use Zend\Stdlib\ArrayUtils; diff --git a/test/Application/ControllerIsDispatchedTest.php b/test/Application/ControllerIsDispatchedTest.php index 42aed39bb..06be86ae0 100644 --- a/test/Application/ControllerIsDispatchedTest.php +++ b/test/Application/ControllerIsDispatchedTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Application; use PHPUnit\Framework\TestCase; diff --git a/test/Application/ExceptionsRaisedInDispatchableShouldRaiseDispatchErrorEventTest.php b/test/Application/ExceptionsRaisedInDispatchableShouldRaiseDispatchErrorEventTest.php index 105137ff3..d3262ce2e 100644 --- a/test/Application/ExceptionsRaisedInDispatchableShouldRaiseDispatchErrorEventTest.php +++ b/test/Application/ExceptionsRaisedInDispatchableShouldRaiseDispatchErrorEventTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Application; use PHPUnit\Framework\TestCase; diff --git a/test/Application/InabilityToRetrieveControllerShouldTriggerDispatchErrorTest.php b/test/Application/InabilityToRetrieveControllerShouldTriggerDispatchErrorTest.php index 614124c3d..bbdefcd77 100644 --- a/test/Application/InabilityToRetrieveControllerShouldTriggerDispatchErrorTest.php +++ b/test/Application/InabilityToRetrieveControllerShouldTriggerDispatchErrorTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Application; use PHPUnit\Framework\TestCase; diff --git a/test/Application/InabilityToRetrieveControllerShouldTriggerExceptionTest.php b/test/Application/InabilityToRetrieveControllerShouldTriggerExceptionTest.php index d7983a1d9..38552fd0c 100644 --- a/test/Application/InabilityToRetrieveControllerShouldTriggerExceptionTest.php +++ b/test/Application/InabilityToRetrieveControllerShouldTriggerExceptionTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Application; use PHPUnit\Framework\TestCase; diff --git a/test/Application/InitializationIntegrationTest.php b/test/Application/InitializationIntegrationTest.php index bd60864f4..372d08ba1 100644 --- a/test/Application/InitializationIntegrationTest.php +++ b/test/Application/InitializationIntegrationTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Application; use PHPUnit\Framework\TestCase; diff --git a/test/Application/InvalidControllerTypeShouldTriggerDispatchErrorTest.php b/test/Application/InvalidControllerTypeShouldTriggerDispatchErrorTest.php index 709f7be06..295ab8619 100644 --- a/test/Application/InvalidControllerTypeShouldTriggerDispatchErrorTest.php +++ b/test/Application/InvalidControllerTypeShouldTriggerDispatchErrorTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Application; use PHPUnit\Framework\TestCase; diff --git a/test/Application/InvalidControllerTypeTrait.php b/test/Application/InvalidControllerTypeTrait.php index 5478a638a..a94f541b7 100644 --- a/test/Application/InvalidControllerTypeTrait.php +++ b/test/Application/InvalidControllerTypeTrait.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Application; use ReflectionProperty; @@ -13,8 +15,8 @@ use Zend\Http\PhpEnvironment\Response; use Zend\Mvc\Application; use Zend\Mvc\Controller\ControllerManager; -use Zend\Mvc\Service\ServiceManagerConfig; -use Zend\Mvc\Service\ServiceListenerFactory; +use Zend\Mvc\Container\ServiceManagerConfig; +use Zend\Mvc\Container\ServiceListenerFactory; use Zend\Router; use Zend\ServiceManager\ServiceManager; use Zend\Stdlib\ArrayUtils; diff --git a/test/Application/MissingControllerTrait.php b/test/Application/MissingControllerTrait.php index 8921b78ea..455ce9cee 100644 --- a/test/Application/MissingControllerTrait.php +++ b/test/Application/MissingControllerTrait.php @@ -5,14 +5,16 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Application; use ReflectionProperty; use Zend\Http\PhpEnvironment\Request; use Zend\Http\PhpEnvironment\Response; use Zend\Mvc\Application; -use Zend\Mvc\Service\ServiceManagerConfig; -use Zend\Mvc\Service\ServiceListenerFactory; +use Zend\Mvc\Container\ServiceManagerConfig; +use Zend\Mvc\Container\ServiceListenerFactory; use Zend\Router; use Zend\ServiceManager\ServiceManager; use Zend\Stdlib\ArrayUtils; diff --git a/test/Application/PathControllerTrait.php b/test/Application/PathControllerTrait.php index f511e8684..6626830f6 100644 --- a/test/Application/PathControllerTrait.php +++ b/test/Application/PathControllerTrait.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Application; use ReflectionProperty; @@ -12,8 +14,8 @@ use Zend\Http\PhpEnvironment\Response; use Zend\Mvc\Application; use Zend\Mvc\Controller\ControllerManager; -use Zend\Mvc\Service\ServiceManagerConfig; -use Zend\Mvc\Service\ServiceListenerFactory; +use Zend\Mvc\Container\ServiceManagerConfig; +use Zend\Mvc\Container\ServiceListenerFactory; use Zend\Router; use Zend\ServiceManager\ServiceManager; use Zend\Stdlib\ArrayUtils; diff --git a/test/Application/RoutingSuccessTest.php b/test/Application/RoutingSuccessTest.php index d2c05d6af..08c96065a 100644 --- a/test/Application/RoutingSuccessTest.php +++ b/test/Application/RoutingSuccessTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Application; use PHPUnit\Framework\TestCase; diff --git a/test/Application/TestAsset/modules/Application/Module.php b/test/Application/TestAsset/modules/Application/Module.php index 0cb6a0fe9..59a66d23d 100644 --- a/test/Application/TestAsset/modules/Application/Module.php +++ b/test/Application/TestAsset/modules/Application/Module.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Application; use Zend\Loader\StandardAutoloader; diff --git a/test/Application/TestAsset/modules/Application/config/module.config.php b/test/Application/TestAsset/modules/Application/config/module.config.php index db068ccca..f38dee849 100644 --- a/test/Application/TestAsset/modules/Application/config/module.config.php +++ b/test/Application/TestAsset/modules/Application/config/module.config.php @@ -5,11 +5,13 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Application; use Zend\Http\PhpEnvironment\Request as HttpRequest; use Zend\Http\PhpEnvironment\Response as HttpResponse; -use Zend\Mvc\Service\HttpViewManagerFactory; +use Zend\Mvc\Container\HttpViewManagerFactory; use Zend\Router\Http\HttpRouterFactory; return [ diff --git a/test/Application/TestAsset/modules/Application/src/Application/Controller/PathController.php b/test/Application/TestAsset/modules/Application/src/Application/Controller/PathController.php index fd9db7fe9..09cc1f581 100644 --- a/test/Application/TestAsset/modules/Application/src/Application/Controller/PathController.php +++ b/test/Application/TestAsset/modules/Application/src/Application/Controller/PathController.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace Application\Controller; use Zend\Http\Response as HttpResponse; diff --git a/test/ApplicationTest.php b/test/ApplicationTest.php index 35da58855..2d8586683 100644 --- a/test/ApplicationTest.php +++ b/test/ApplicationTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc; use PHPUnit\Framework\TestCase; @@ -21,8 +23,8 @@ use Zend\Mvc\Application; use Zend\Mvc\Controller\ControllerManager; use Zend\Mvc\MvcEvent; -use Zend\Mvc\Service\ServiceManagerConfig; -use Zend\Mvc\Service\ServiceListenerFactory; +use Zend\Mvc\Container\ServiceManagerConfig; +use Zend\Mvc\Container\ServiceListenerFactory; use Zend\Router; use Zend\ServiceManager\ServiceManager; use Zend\Stdlib\ArrayUtils; @@ -146,7 +148,7 @@ public function testConfigIsPopulated() $this->assertEquals( $smConfig, $appConfig, - sprintf('SM config: %s; App config: %s', var_export($smConfig, 1), var_export($appConfig, 1)) + sprintf('SM config: %s; App config: %s', var_export($smConfig, true), var_export($appConfig, true)) ); } diff --git a/test/Service/ControllerManagerFactoryTest.php b/test/Container/ControllerManagerFactoryTest.php similarity index 94% rename from test/Service/ControllerManagerFactoryTest.php rename to test/Container/ControllerManagerFactoryTest.php index 39aa57ddc..da249fff3 100644 --- a/test/Service/ControllerManagerFactoryTest.php +++ b/test/Container/ControllerManagerFactoryTest.php @@ -5,19 +5,22 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +declare(strict_types=1); + +namespace ZendTest\Mvc\Container; use PHPUnit\Framework\TestCase; use Zend\EventManager\SharedEventManager; -use Zend\Mvc\Service\ControllerManagerFactory; -use Zend\Mvc\Service\ControllerPluginManagerFactory; -use Zend\Mvc\Service\EventManagerFactory; +use Zend\Mvc\Container\ControllerManagerFactory; +use Zend\Mvc\Container\ControllerPluginManagerFactory; +use Zend\Mvc\Container\EventManagerFactory; use Zend\ServiceManager\Config; use Zend\ServiceManager\Exception; use Zend\ServiceManager\Factory\InvokableFactory; use Zend\ServiceManager\ServiceManager; use ZendTest\Mvc\Controller\Plugin\TestAsset\SamplePlugin; use ZendTest\Mvc\Controller\TestAsset\SampleController; +use ZendTest\Mvc\Service\TestAsset; use ZendTest\Mvc\Service\TestAsset\InvalidDispatchableClass; class ControllerManagerFactoryTest extends TestCase diff --git a/test/Service/HttpMethodListenerFactoryTest.php b/test/Container/HttpMethodListenerFactoryTest.php similarity index 91% rename from test/Service/HttpMethodListenerFactoryTest.php rename to test/Container/HttpMethodListenerFactoryTest.php index 230ad0ae4..3234fad36 100644 --- a/test/Service/HttpMethodListenerFactoryTest.php +++ b/test/Container/HttpMethodListenerFactoryTest.php @@ -5,16 +5,18 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +declare(strict_types=1); + +namespace ZendTest\Mvc\Container; use Interop\Container\ContainerInterface; use PHPUnit\Framework\TestCase; use PHPUnit_Framework_MockObject_MockObject as MockObject; -use Zend\Mvc\Service\HttpMethodListenerFactory; +use Zend\Mvc\Container\HttpMethodListenerFactory; use Zend\ServiceManager\ServiceLocatorInterface; /** - * @covers Zend\Mvc\Service\HttpMethodListenerFactory + * @covers \Zend\Mvc\Container\HttpMethodListenerFactory */ class HttpMethodListenerFactoryTest extends TestCase { diff --git a/test/Service/InjectTemplateListenerFactoryTest.php b/test/Container/InjectTemplateListenerFactoryTest.php similarity index 90% rename from test/Service/InjectTemplateListenerFactoryTest.php rename to test/Container/InjectTemplateListenerFactoryTest.php index 2fb0b4e0d..ddc6004d9 100644 --- a/test/Service/InjectTemplateListenerFactoryTest.php +++ b/test/Container/InjectTemplateListenerFactoryTest.php @@ -5,19 +5,21 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +declare(strict_types=1); + +namespace ZendTest\Mvc\Container; use ArrayObject; use Interop\Container\ContainerInterface; use PHPUnit\Framework\TestCase; -use Zend\Mvc\Service\InjectTemplateListenerFactory; +use Zend\Mvc\Container\InjectTemplateListenerFactory; use Zend\Mvc\View\Http\InjectTemplateListener; use Zend\ServiceManager\ServiceLocatorInterface; /** - * Tests for {@see \Zend\Mvc\Service\InjectTemplateListenerFactory} + * Tests for {@see \Zend\Mvc\Container\InjectTemplateListenerFactory} * - * @covers \Zend\Mvc\Service\InjectTemplateListenerFactory + * @covers \Zend\Mvc\Container\InjectTemplateListenerFactory */ class InjectTemplateListenerFactoryTest extends TestCase { diff --git a/test/Service/RequestFactoryTest.php b/test/Container/RequestFactoryTest.php similarity index 87% rename from test/Service/RequestFactoryTest.php rename to test/Container/RequestFactoryTest.php index bf3382e6c..9969b7928 100644 --- a/test/Service/RequestFactoryTest.php +++ b/test/Container/RequestFactoryTest.php @@ -5,12 +5,14 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +declare(strict_types=1); + +namespace ZendTest\Mvc\Container; use Interop\Container\ContainerInterface; use PHPUnit\Framework\TestCase; use Zend\Http\Request as HttpRequest; -use Zend\Mvc\Service\RequestFactory; +use Zend\Mvc\Container\RequestFactory; class RequestFactoryTest extends TestCase { diff --git a/test/Service/ResponseFactoryTest.php b/test/Container/ResponseFactoryTest.php similarity index 87% rename from test/Service/ResponseFactoryTest.php rename to test/Container/ResponseFactoryTest.php index 47c6a6142..485990997 100644 --- a/test/Service/ResponseFactoryTest.php +++ b/test/Container/ResponseFactoryTest.php @@ -5,12 +5,14 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +declare(strict_types=1); + +namespace ZendTest\Mvc\Container; use Interop\Container\ContainerInterface; use PHPUnit\Framework\TestCase; use Zend\Http\Response as HttpResponse; -use Zend\Mvc\Service\ResponseFactory; +use Zend\Mvc\Container\ResponseFactory; class ResponseFactoryTest extends TestCase { diff --git a/test/Service/SendResponseListenerFactoryTest.php b/test/Container/SendResponseListenerFactoryTest.php similarity index 95% rename from test/Service/SendResponseListenerFactoryTest.php rename to test/Container/SendResponseListenerFactoryTest.php index e9adc2f22..18a7a8ec5 100644 --- a/test/Service/SendResponseListenerFactoryTest.php +++ b/test/Container/SendResponseListenerFactoryTest.php @@ -5,19 +5,21 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +declare(strict_types=1); + +namespace ZendTest\Mvc\Container; use Interop\Container\ContainerInterface; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Zend\EventManager\EventManagerInterface; use Zend\EventManager\SharedEventManagerInterface; +use Zend\Mvc\Container\SendResponseListenerFactory; use Zend\Mvc\ResponseSender\HttpResponseSender; use Zend\Mvc\ResponseSender\PhpEnvironmentResponseSender; use Zend\Mvc\ResponseSender\SendResponseEvent; use Zend\Mvc\ResponseSender\SimpleStreamResponseSender; use Zend\Mvc\SendResponseListener; -use Zend\Mvc\Service\SendResponseListenerFactory; class SendResponseListenerFactoryTest extends TestCase { diff --git a/test/Service/ServiceListenerFactoryTest.php b/test/Container/ServiceListenerFactoryTest.php similarity index 98% rename from test/Service/ServiceListenerFactoryTest.php rename to test/Container/ServiceListenerFactoryTest.php index 0d71cb93a..0c31bc110 100644 --- a/test/Service/ServiceListenerFactoryTest.php +++ b/test/Container/ServiceListenerFactoryTest.php @@ -5,12 +5,12 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +declare(strict_types=1); + +namespace ZendTest\Mvc\Container; use PHPUnit\Framework\TestCase; -use ReflectionClass; -use ReflectionProperty; -use Zend\Mvc\Service\ServiceListenerFactory; +use Zend\Mvc\Container\ServiceListenerFactory; use Zend\ServiceManager\ServiceManager; class ServiceListenerFactoryTest extends TestCase diff --git a/test/Service/ServiceManagerConfigTest.php b/test/Container/ServiceManagerConfigTest.php similarity index 96% rename from test/Service/ServiceManagerConfigTest.php rename to test/Container/ServiceManagerConfigTest.php index c767403e8..186d6c75d 100644 --- a/test/Service/ServiceManagerConfigTest.php +++ b/test/Container/ServiceManagerConfigTest.php @@ -5,22 +5,22 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +declare(strict_types=1); + +namespace ZendTest\Mvc\Container; use PHPUnit\Framework\TestCase; -use ReflectionClass; use stdClass; use Zend\EventManager\EventManager; use Zend\EventManager\EventManagerAwareInterface; use Zend\EventManager\SharedEventManagerInterface; -use Zend\Mvc\Controller\PluginManager; -use Zend\Mvc\Service\ServiceManagerConfig; +use Zend\Mvc\Container\ServiceManagerConfig; use Zend\ServiceManager\Factory\InvokableFactory; use Zend\ServiceManager\ServiceManager; use ZendTest\Mvc\Service\TestAsset\EventManagerAwareObject; /** - * @covers \Zend\Mvc\Service\ServiceManagerConfig + * @covers \Zend\Mvc\Container\ServiceManagerConfig */ class ServiceManagerConfigTest extends TestCase { diff --git a/test/Service/ViewFeedStrategyFactoryTest.php b/test/Container/ViewFeedStrategyFactoryTest.php similarity index 90% rename from test/Service/ViewFeedStrategyFactoryTest.php rename to test/Container/ViewFeedStrategyFactoryTest.php index d6f24b7e9..e65b351b4 100644 --- a/test/Service/ViewFeedStrategyFactoryTest.php +++ b/test/Container/ViewFeedStrategyFactoryTest.php @@ -5,11 +5,13 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +declare(strict_types=1); + +namespace ZendTest\Mvc\Container; use Interop\Container\ContainerInterface; use PHPUnit\Framework\TestCase; -use Zend\Mvc\Service\ViewFeedStrategyFactory; +use Zend\Mvc\Container\ViewFeedStrategyFactory; use Zend\View\Renderer\FeedRenderer; use Zend\View\Strategy\FeedStrategy; diff --git a/test/Service/ViewHelperManagerFactoryTest.php b/test/Container/ViewHelperManagerFactoryTest.php similarity index 98% rename from test/Service/ViewHelperManagerFactoryTest.php rename to test/Container/ViewHelperManagerFactoryTest.php index fc9b3a15b..15ead72c6 100644 --- a/test/Service/ViewHelperManagerFactoryTest.php +++ b/test/Container/ViewHelperManagerFactoryTest.php @@ -5,13 +5,15 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +declare(strict_types=1); + +namespace ZendTest\Mvc\Container; use PHPUnit\Framework\TestCase; use Zend\Http\PhpEnvironment\Request; use Zend\Mvc\Application; +use Zend\Mvc\Container\ViewHelperManagerFactory; use Zend\Mvc\MvcEvent; -use Zend\Mvc\Service\ViewHelperManagerFactory; use Zend\Router\RouteMatch; use Zend\Router\RouteStackInterface; use Zend\ServiceManager\ServiceManager; diff --git a/test/Service/ViewJsonStrategyFactoryTest.php b/test/Container/ViewJsonStrategyFactoryTest.php similarity index 90% rename from test/Service/ViewJsonStrategyFactoryTest.php rename to test/Container/ViewJsonStrategyFactoryTest.php index 0768537c9..2781059c1 100644 --- a/test/Service/ViewJsonStrategyFactoryTest.php +++ b/test/Container/ViewJsonStrategyFactoryTest.php @@ -5,11 +5,13 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +declare(strict_types=1); + +namespace ZendTest\Mvc\Container; use Interop\Container\ContainerInterface; use PHPUnit\Framework\TestCase; -use Zend\Mvc\Service\ViewJsonStrategyFactory; +use Zend\Mvc\Container\ViewJsonStrategyFactory; use Zend\View\Renderer\JsonRenderer; use Zend\View\Strategy\JsonStrategy; diff --git a/test/Service/ViewManagerFactoryTest.php b/test/Container/ViewManagerFactoryTest.php similarity index 91% rename from test/Service/ViewManagerFactoryTest.php rename to test/Container/ViewManagerFactoryTest.php index 2d28a13d0..818b878de 100644 --- a/test/Service/ViewManagerFactoryTest.php +++ b/test/Container/ViewManagerFactoryTest.php @@ -5,11 +5,13 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +declare(strict_types=1); + +namespace ZendTest\Mvc\Container; use Interop\Container\ContainerInterface; use PHPUnit\Framework\TestCase; -use Zend\Mvc\Service\ViewManagerFactory; +use Zend\Mvc\Container\ViewManagerFactory; use Zend\Mvc\View\Http\ViewManager as HttpViewManager; class ViewManagerFactoryTest extends TestCase diff --git a/test/Service/ViewPrefixPathStackResolverFactoryTest.php b/test/Container/ViewPrefixPathStackResolverFactoryTest.php similarity index 90% rename from test/Service/ViewPrefixPathStackResolverFactoryTest.php rename to test/Container/ViewPrefixPathStackResolverFactoryTest.php index e0dedba2c..f041879fb 100644 --- a/test/Service/ViewPrefixPathStackResolverFactoryTest.php +++ b/test/Container/ViewPrefixPathStackResolverFactoryTest.php @@ -5,11 +5,13 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +declare(strict_types=1); + +namespace ZendTest\Mvc\Container; use Interop\Container\ContainerInterface; use PHPUnit\Framework\TestCase; -use Zend\Mvc\Service\ViewPrefixPathStackResolverFactory; +use Zend\Mvc\Container\ViewPrefixPathStackResolverFactory; use Zend\ServiceManager\ServiceLocatorInterface; use Zend\View\Resolver\PrefixPathStackResolver; diff --git a/test/Controller/AbstractControllerTest.php b/test/Controller/AbstractControllerTest.php index c7a2f2867..a90f101f2 100644 --- a/test/Controller/AbstractControllerTest.php +++ b/test/Controller/AbstractControllerTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller; use PHPUnit\Framework\TestCase; diff --git a/test/Controller/ActionControllerTest.php b/test/Controller/ActionControllerTest.php index c1d5f0dc0..8faa183b9 100644 --- a/test/Controller/ActionControllerTest.php +++ b/test/Controller/ActionControllerTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller; use PHPUnit\Framework\TestCase; @@ -65,7 +67,7 @@ public function testDispatchInvokesNotFoundActionWhenNoActionPresentInRouteMatch $this->assertInstanceOf(ModelInterface::class, $result); $this->assertEquals('content', $result->captureTo()); $vars = $result->getVariables(); - $this->assertArrayHasKey('content', $vars, var_export($vars, 1)); + $this->assertArrayHasKey('content', $vars, var_export($vars, true)); $this->assertContains('Page not found', $vars['content']); } @@ -78,7 +80,7 @@ public function testDispatchInvokesNotFoundActionWhenInvalidActionPresentInRoute $this->assertInstanceOf(ModelInterface::class, $result); $this->assertEquals('content', $result->captureTo()); $vars = $result->getVariables(); - $this->assertArrayHasKey('content', $vars, var_export($vars, 1)); + $this->assertArrayHasKey('content', $vars, var_export($vars, true)); $this->assertContains('Page not found', $vars['content']); } diff --git a/test/Controller/ControllerManagerTest.php b/test/Controller/ControllerManagerTest.php index b4aac9522..97be79208 100644 --- a/test/Controller/ControllerManagerTest.php +++ b/test/Controller/ControllerManagerTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller; use PHPUnit\Framework\TestCase; diff --git a/test/Controller/IntegrationTest.php b/test/Controller/IntegrationTest.php index a6569a88a..70221902e 100644 --- a/test/Controller/IntegrationTest.php +++ b/test/Controller/IntegrationTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller; use PHPUnit\Framework\TestCase; diff --git a/test/Controller/LazyControllerAbstractFactoryTest.php b/test/Controller/LazyControllerAbstractFactoryTest.php index 6e3e385cc..037cfbbe8 100644 --- a/test/Controller/LazyControllerAbstractFactoryTest.php +++ b/test/Controller/LazyControllerAbstractFactoryTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller; use Interop\Container\ContainerInterface; diff --git a/test/Controller/MiddlewareControllerTest.php b/test/Controller/MiddlewareControllerTest.php index b76d1769b..7ce27829a 100644 --- a/test/Controller/MiddlewareControllerTest.php +++ b/test/Controller/MiddlewareControllerTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller; use PHPUnit\Framework\TestCase; diff --git a/test/Controller/Plugin/AcceptableViewModelSelectorTest.php b/test/Controller/Plugin/AcceptableViewModelSelectorTest.php index 40320a29a..0b1c4e676 100644 --- a/test/Controller/Plugin/AcceptableViewModelSelectorTest.php +++ b/test/Controller/Plugin/AcceptableViewModelSelectorTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\Plugin; use PHPUnit\Framework\TestCase; diff --git a/test/Controller/Plugin/CreateHttpNotFoundModelTest.php b/test/Controller/Plugin/CreateHttpNotFoundModelTest.php index 953f9166d..8b2f83e7a 100644 --- a/test/Controller/Plugin/CreateHttpNotFoundModelTest.php +++ b/test/Controller/Plugin/CreateHttpNotFoundModelTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\Plugin; use PHPUnit\Framework\TestCase; diff --git a/test/Controller/Plugin/ForwardTest.php b/test/Controller/Plugin/ForwardTest.php index b8a928b96..6b61fda61 100644 --- a/test/Controller/Plugin/ForwardTest.php +++ b/test/Controller/Plugin/ForwardTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\Plugin; use PHPUnit\Framework\TestCase; diff --git a/test/Controller/Plugin/LayoutTest.php b/test/Controller/Plugin/LayoutTest.php index 225df0533..150990c1c 100644 --- a/test/Controller/Plugin/LayoutTest.php +++ b/test/Controller/Plugin/LayoutTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\Plugin; use PHPUnit\Framework\TestCase; diff --git a/test/Controller/Plugin/ParamsTest.php b/test/Controller/Plugin/ParamsTest.php index 9f578d452..47db170d9 100644 --- a/test/Controller/Plugin/ParamsTest.php +++ b/test/Controller/Plugin/ParamsTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\Plugin; use PHPUnit\Framework\TestCase; diff --git a/test/Controller/Plugin/RedirectTest.php b/test/Controller/Plugin/RedirectTest.php index 64f68051d..e6787d7d4 100644 --- a/test/Controller/Plugin/RedirectTest.php +++ b/test/Controller/Plugin/RedirectTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\Plugin; use PHPUnit\Framework\TestCase; diff --git a/test/Controller/Plugin/TestAsset/ListenerStub.php b/test/Controller/Plugin/TestAsset/ListenerStub.php index cf0455d38..bd0fe2bac 100644 --- a/test/Controller/Plugin/TestAsset/ListenerStub.php +++ b/test/Controller/Plugin/TestAsset/ListenerStub.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\Plugin\TestAsset; class ListenerStub diff --git a/test/Controller/Plugin/TestAsset/SamplePlugin.php b/test/Controller/Plugin/TestAsset/SamplePlugin.php index f5fcfbb35..1fad2dd3f 100644 --- a/test/Controller/Plugin/TestAsset/SamplePlugin.php +++ b/test/Controller/Plugin/TestAsset/SamplePlugin.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\Plugin\TestAsset; use Zend\Mvc\Controller\Plugin\AbstractPlugin; diff --git a/test/Controller/Plugin/TestAsset/SamplePluginFactory.php b/test/Controller/Plugin/TestAsset/SamplePluginFactory.php index d6def1829..6eca684d3 100644 --- a/test/Controller/Plugin/TestAsset/SamplePluginFactory.php +++ b/test/Controller/Plugin/TestAsset/SamplePluginFactory.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\Plugin\TestAsset; use Interop\Container\ContainerInterface; diff --git a/test/Controller/Plugin/TestAsset/SamplePluginWithConstructor.php b/test/Controller/Plugin/TestAsset/SamplePluginWithConstructor.php index 3404a54fe..9abd205e8 100644 --- a/test/Controller/Plugin/TestAsset/SamplePluginWithConstructor.php +++ b/test/Controller/Plugin/TestAsset/SamplePluginWithConstructor.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\Plugin\TestAsset; use Zend\Mvc\Controller\Plugin\AbstractPlugin; diff --git a/test/Controller/Plugin/TestAsset/SamplePluginWithConstructorFactory.php b/test/Controller/Plugin/TestAsset/SamplePluginWithConstructorFactory.php index a4c1f4a89..9374133e4 100644 --- a/test/Controller/Plugin/TestAsset/SamplePluginWithConstructorFactory.php +++ b/test/Controller/Plugin/TestAsset/SamplePluginWithConstructorFactory.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\Plugin\TestAsset; use Interop\Container\ContainerInterface; diff --git a/test/Controller/Plugin/UrlTest.php b/test/Controller/Plugin/UrlTest.php index 393d3fa7a..a7a09e519 100644 --- a/test/Controller/Plugin/UrlTest.php +++ b/test/Controller/Plugin/UrlTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\Plugin; use PHPUnit\Framework\TestCase; diff --git a/test/Controller/PluginManagerTest.php b/test/Controller/PluginManagerTest.php index 596589602..28b7d6cc1 100644 --- a/test/Controller/PluginManagerTest.php +++ b/test/Controller/PluginManagerTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller; use PHPUnit\Framework\TestCase; diff --git a/test/Controller/RestfulControllerTest.php b/test/Controller/RestfulControllerTest.php index a7ca8186b..edc47a8bf 100644 --- a/test/Controller/RestfulControllerTest.php +++ b/test/Controller/RestfulControllerTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller; use PHPUnit\Framework\TestCase; diff --git a/test/Controller/TestAsset/BadController.php b/test/Controller/TestAsset/BadController.php index 72d39f857..41bd15674 100644 --- a/test/Controller/TestAsset/BadController.php +++ b/test/Controller/TestAsset/BadController.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\TestAsset; use Zend\Mvc\Controller\AbstractActionController; diff --git a/test/Controller/TestAsset/ControllerAcceptingConfigToConstructor.php b/test/Controller/TestAsset/ControllerAcceptingConfigToConstructor.php index 4f68b91e1..3f312ff12 100644 --- a/test/Controller/TestAsset/ControllerAcceptingConfigToConstructor.php +++ b/test/Controller/TestAsset/ControllerAcceptingConfigToConstructor.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\TestAsset; use Zend\Mvc\Controller\AbstractActionController; diff --git a/test/Controller/TestAsset/ControllerAcceptingWellKnownServicesAsConstructorParameters.php b/test/Controller/TestAsset/ControllerAcceptingWellKnownServicesAsConstructorParameters.php index 5e4a48fd8..65384d936 100644 --- a/test/Controller/TestAsset/ControllerAcceptingWellKnownServicesAsConstructorParameters.php +++ b/test/Controller/TestAsset/ControllerAcceptingWellKnownServicesAsConstructorParameters.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\TestAsset; use Zend\Mvc\Controller\AbstractActionController; diff --git a/test/Controller/TestAsset/ControllerLoaderAbstractFactory.php b/test/Controller/TestAsset/ControllerLoaderAbstractFactory.php index d5626ec8e..4d174062e 100644 --- a/test/Controller/TestAsset/ControllerLoaderAbstractFactory.php +++ b/test/Controller/TestAsset/ControllerLoaderAbstractFactory.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\TestAsset; use Interop\Container\ContainerInterface; diff --git a/test/Controller/TestAsset/ControllerWithEmptyConstructor.php b/test/Controller/TestAsset/ControllerWithEmptyConstructor.php index ec791c2a5..651a69674 100644 --- a/test/Controller/TestAsset/ControllerWithEmptyConstructor.php +++ b/test/Controller/TestAsset/ControllerWithEmptyConstructor.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\TestAsset; use Zend\Mvc\Controller\AbstractActionController; diff --git a/test/Controller/TestAsset/ControllerWithMixedConstructorParameters.php b/test/Controller/TestAsset/ControllerWithMixedConstructorParameters.php index ed2f2408b..0ddfb8208 100644 --- a/test/Controller/TestAsset/ControllerWithMixedConstructorParameters.php +++ b/test/Controller/TestAsset/ControllerWithMixedConstructorParameters.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\TestAsset; use Zend\Mvc\Controller\AbstractActionController; diff --git a/test/Controller/TestAsset/ControllerWithScalarParameters.php b/test/Controller/TestAsset/ControllerWithScalarParameters.php index 7cde14553..3cea036cf 100644 --- a/test/Controller/TestAsset/ControllerWithScalarParameters.php +++ b/test/Controller/TestAsset/ControllerWithScalarParameters.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\TestAsset; use Zend\Mvc\Controller\AbstractActionController; diff --git a/test/Controller/TestAsset/ControllerWithTypeHintedConstructorParameter.php b/test/Controller/TestAsset/ControllerWithTypeHintedConstructorParameter.php index 204fb1c2d..1c3bdfc0b 100644 --- a/test/Controller/TestAsset/ControllerWithTypeHintedConstructorParameter.php +++ b/test/Controller/TestAsset/ControllerWithTypeHintedConstructorParameter.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\TestAsset; use Zend\Mvc\Controller\AbstractActionController; diff --git a/test/Controller/TestAsset/ForwardController.php b/test/Controller/TestAsset/ForwardController.php index 89dfd49c9..d2dc91b99 100644 --- a/test/Controller/TestAsset/ForwardController.php +++ b/test/Controller/TestAsset/ForwardController.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\TestAsset; use Zend\Mvc\Controller\AbstractActionController; diff --git a/test/Controller/TestAsset/Request.php b/test/Controller/TestAsset/Request.php index 837f3a405..16695aa77 100644 --- a/test/Controller/TestAsset/Request.php +++ b/test/Controller/TestAsset/Request.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\TestAsset; use Zend\Http\Request as HttpRequest; diff --git a/test/Controller/TestAsset/RestfulContentTypeTestController.php b/test/Controller/TestAsset/RestfulContentTypeTestController.php index 67c8767a9..fb8179ecc 100644 --- a/test/Controller/TestAsset/RestfulContentTypeTestController.php +++ b/test/Controller/TestAsset/RestfulContentTypeTestController.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\TestAsset; use Zend\Mvc\Controller\AbstractRestfulController; diff --git a/test/Controller/TestAsset/RestfulMethodNotAllowedTestController.php b/test/Controller/TestAsset/RestfulMethodNotAllowedTestController.php index c65efd817..6cccfb4d8 100644 --- a/test/Controller/TestAsset/RestfulMethodNotAllowedTestController.php +++ b/test/Controller/TestAsset/RestfulMethodNotAllowedTestController.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\TestAsset; use Zend\Mvc\Controller\AbstractRestfulController; diff --git a/test/Controller/TestAsset/RestfulTestController.php b/test/Controller/TestAsset/RestfulTestController.php index 2ea70f296..620478132 100644 --- a/test/Controller/TestAsset/RestfulTestController.php +++ b/test/Controller/TestAsset/RestfulTestController.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\TestAsset; use Zend\Mvc\Controller\AbstractRestfulController; diff --git a/test/Controller/TestAsset/SampleController.php b/test/Controller/TestAsset/SampleController.php index 5fb42d06d..16ce21afe 100644 --- a/test/Controller/TestAsset/SampleController.php +++ b/test/Controller/TestAsset/SampleController.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\TestAsset; use Zend\Mvc\Controller\AbstractActionController; diff --git a/test/Controller/TestAsset/SampleInterface.php b/test/Controller/TestAsset/SampleInterface.php index 995e5119a..cee2dfa6b 100644 --- a/test/Controller/TestAsset/SampleInterface.php +++ b/test/Controller/TestAsset/SampleInterface.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\TestAsset; interface SampleInterface diff --git a/test/Controller/TestAsset/UneventfulController.php b/test/Controller/TestAsset/UneventfulController.php index 1444147e3..cb8a1cde0 100644 --- a/test/Controller/TestAsset/UneventfulController.php +++ b/test/Controller/TestAsset/UneventfulController.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\TestAsset; use Zend\Stdlib\DispatchableInterface; diff --git a/test/Controller/TestAsset/UnlocatableControllerLoaderAbstractFactory.php b/test/Controller/TestAsset/UnlocatableControllerLoaderAbstractFactory.php index c9d2648a9..b8e5d4bcf 100644 --- a/test/Controller/TestAsset/UnlocatableControllerLoaderAbstractFactory.php +++ b/test/Controller/TestAsset/UnlocatableControllerLoaderAbstractFactory.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\TestAsset; use Interop\Container\ContainerInterface; diff --git a/test/Controller/TestAsset/UnlocatableEventfulController.php b/test/Controller/TestAsset/UnlocatableEventfulController.php index 98c3cfb78..5b74ee745 100644 --- a/test/Controller/TestAsset/UnlocatableEventfulController.php +++ b/test/Controller/TestAsset/UnlocatableEventfulController.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Controller\TestAsset; use Zend\EventManager\EventInterface as Event; diff --git a/test/DispatchListenerTest.php b/test/DispatchListenerTest.php index 41da5d19f..ed576d415 100644 --- a/test/DispatchListenerTest.php +++ b/test/DispatchListenerTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc; use PHPUnit\Framework\TestCase; @@ -59,7 +61,7 @@ public function testControllerManagerUsingAbstractFactory() $return = $listener->onDispatch($event); - $this->assertEmpty($log, var_export($log, 1)); + $this->assertEmpty($log, var_export($log, true)); $this->assertSame($event->getResponse(), $return); $this->assertSame(200, $return->getStatusCode()); } diff --git a/test/Exception/InvalidMiddlewareExceptionTest.php b/test/Exception/InvalidMiddlewareExceptionTest.php index 8311d7945..87b35fe25 100644 --- a/test/Exception/InvalidMiddlewareExceptionTest.php +++ b/test/Exception/InvalidMiddlewareExceptionTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc; use PHPUnit\Framework\TestCase; diff --git a/test/Exception/ReachedFinalHandlerExceptionTest.php b/test/Exception/ReachedFinalHandlerExceptionTest.php index 8628ddd5c..b420173a6 100644 --- a/test/Exception/ReachedFinalHandlerExceptionTest.php +++ b/test/Exception/ReachedFinalHandlerExceptionTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc; use PHPUnit\Framework\TestCase; diff --git a/test/HttpMethodListenerTest.php b/test/HttpMethodListenerTest.php index 86d033994..8bd545505 100644 --- a/test/HttpMethodListenerTest.php +++ b/test/HttpMethodListenerTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc; use PHPUnit\Framework\TestCase; diff --git a/test/MiddlewareListenerTest.php b/test/MiddlewareListenerTest.php index c11c7165c..d9b4c8713 100644 --- a/test/MiddlewareListenerTest.php +++ b/test/MiddlewareListenerTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc; use Interop\Container\ContainerInterface; diff --git a/test/ModuleRouteListenerTest.php b/test/ModuleRouteListenerTest.php index 622f54f05..aa9d5e2cc 100644 --- a/test/ModuleRouteListenerTest.php +++ b/test/ModuleRouteListenerTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc; use PHPUnit\Framework\TestCase; diff --git a/test/ResponseSender/AbstractResponseSenderTest.php b/test/ResponseSender/AbstractResponseSenderTest.php index 05f14bb2d..e700aeb41 100644 --- a/test/ResponseSender/AbstractResponseSenderTest.php +++ b/test/ResponseSender/AbstractResponseSenderTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\ResponseSender; use PHPUnit\Framework\TestCase; diff --git a/test/ResponseSender/PhpEnvironmentResponseSenderTest.php b/test/ResponseSender/PhpEnvironmentResponseSenderTest.php index be983e243..ac1c8bc93 100644 --- a/test/ResponseSender/PhpEnvironmentResponseSenderTest.php +++ b/test/ResponseSender/PhpEnvironmentResponseSenderTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\ResponseSender; use PHPUnit\Framework\TestCase; diff --git a/test/ResponseSender/SendResponseEventTest.php b/test/ResponseSender/SendResponseEventTest.php index e8eb9d2bc..cafc62863 100644 --- a/test/ResponseSender/SendResponseEventTest.php +++ b/test/ResponseSender/SendResponseEventTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\ResponseSender; use PHPUnit\Framework\TestCase; diff --git a/test/ResponseSender/SimpleStreamResponseSenderTest.php b/test/ResponseSender/SimpleStreamResponseSenderTest.php index aca16d9ed..87745a707 100644 --- a/test/ResponseSender/SimpleStreamResponseSenderTest.php +++ b/test/ResponseSender/SimpleStreamResponseSenderTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\ResponseSender; use PHPUnit\Framework\TestCase; diff --git a/test/SendResponseListenerTest.php b/test/SendResponseListenerTest.php index d0b75d0a2..998520a74 100644 --- a/test/SendResponseListenerTest.php +++ b/test/SendResponseListenerTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc; use PHPUnit\Framework\TestCase; diff --git a/test/Service/TestAsset/ControllerWithDependencies.php b/test/Service/TestAsset/ControllerWithDependencies.php index b7b4c41eb..24da43149 100644 --- a/test/Service/TestAsset/ControllerWithDependencies.php +++ b/test/Service/TestAsset/ControllerWithDependencies.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Service\TestAsset; use Zend\Stdlib\DispatchableInterface; diff --git a/test/Service/TestAsset/Dispatchable.php b/test/Service/TestAsset/Dispatchable.php index 4c5de0272..e9f861470 100644 --- a/test/Service/TestAsset/Dispatchable.php +++ b/test/Service/TestAsset/Dispatchable.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Service\TestAsset; use Zend\Mvc\Controller\AbstractActionController; diff --git a/test/Service/TestAsset/EventManagerAwareObject.php b/test/Service/TestAsset/EventManagerAwareObject.php index 61478abde..ce278fa2c 100644 --- a/test/Service/TestAsset/EventManagerAwareObject.php +++ b/test/Service/TestAsset/EventManagerAwareObject.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Service\TestAsset; use Zend\EventManager\EventManagerAwareInterface; diff --git a/test/Service/TestAsset/InvalidDispatchableClass.php b/test/Service/TestAsset/InvalidDispatchableClass.php index 6e01df4a9..2596c162b 100644 --- a/test/Service/TestAsset/InvalidDispatchableClass.php +++ b/test/Service/TestAsset/InvalidDispatchableClass.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\Service\TestAsset; use DomainException; diff --git a/test/TestAsset/Locator.php b/test/TestAsset/Locator.php index 0300e06d5..499a67b26 100644 --- a/test/TestAsset/Locator.php +++ b/test/TestAsset/Locator.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\TestAsset; use Zend\ServiceManager\ServiceLocatorInterface; diff --git a/test/TestAsset/Middleware.php b/test/TestAsset/Middleware.php index 289bc3b12..da19fe083 100644 --- a/test/TestAsset/Middleware.php +++ b/test/TestAsset/Middleware.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\TestAsset; use Psr\Http\Message\ServerRequestInterface; diff --git a/test/TestAsset/MiddlewareAbstractFactory.php b/test/TestAsset/MiddlewareAbstractFactory.php index ccde7d726..d6456387f 100644 --- a/test/TestAsset/MiddlewareAbstractFactory.php +++ b/test/TestAsset/MiddlewareAbstractFactory.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\TestAsset; use Interop\Container\ContainerInterface; diff --git a/test/TestAsset/MockSendResponseListener.php b/test/TestAsset/MockSendResponseListener.php index 850314031..02d4f5c1d 100644 --- a/test/TestAsset/MockSendResponseListener.php +++ b/test/TestAsset/MockSendResponseListener.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\TestAsset; use Zend\EventManager\AbstractListenerAggregate; diff --git a/test/TestAsset/MockViewManager.php b/test/TestAsset/MockViewManager.php index d97a52256..6e6a02f6c 100644 --- a/test/TestAsset/MockViewManager.php +++ b/test/TestAsset/MockViewManager.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\TestAsset; use Zend\EventManager\AbstractListenerAggregate; diff --git a/test/TestAsset/PathController.php b/test/TestAsset/PathController.php index 44e7631e3..3a82ea397 100644 --- a/test/TestAsset/PathController.php +++ b/test/TestAsset/PathController.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\TestAsset; use Zend\Stdlib\DispatchableInterface; diff --git a/test/TestAsset/StubBootstrapListener.php b/test/TestAsset/StubBootstrapListener.php index b3a8528fb..f8c15946b 100644 --- a/test/TestAsset/StubBootstrapListener.php +++ b/test/TestAsset/StubBootstrapListener.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\TestAsset; use Zend\EventManager\ListenerAggregateInterface; diff --git a/test/View/CreateViewModelListenerTest.php b/test/View/CreateViewModelListenerTest.php index dc2eb7fa1..894437b95 100644 --- a/test/View/CreateViewModelListenerTest.php +++ b/test/View/CreateViewModelListenerTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\View; use PHPUnit\Framework\TestCase; diff --git a/test/View/DefaultRendereringStrategyTest.php b/test/View/DefaultRendereringStrategyTest.php index a608877dd..16bee4dd4 100644 --- a/test/View/DefaultRendereringStrategyTest.php +++ b/test/View/DefaultRendereringStrategyTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\View; use PHPUnit\Framework\TestCase; diff --git a/test/View/ExceptionStrategyTest.php b/test/View/ExceptionStrategyTest.php index e61b6e450..d22fb5530 100644 --- a/test/View/ExceptionStrategyTest.php +++ b/test/View/ExceptionStrategyTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\View; use PHPUnit\Framework\TestCase; diff --git a/test/View/InjectTemplateListenerTest.php b/test/View/InjectTemplateListenerTest.php index 8636bfde8..9e07eece1 100644 --- a/test/View/InjectTemplateListenerTest.php +++ b/test/View/InjectTemplateListenerTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\View; use PHPUnit\Framework\TestCase; diff --git a/test/View/InjectViewModelListenerTest.php b/test/View/InjectViewModelListenerTest.php index e8401d87a..1e841e46b 100644 --- a/test/View/InjectViewModelListenerTest.php +++ b/test/View/InjectViewModelListenerTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\View; use PHPUnit\Framework\TestCase; diff --git a/test/View/RouteNotFoundStrategyTest.php b/test/View/RouteNotFoundStrategyTest.php index 5766ddad3..24c597fdd 100644 --- a/test/View/RouteNotFoundStrategyTest.php +++ b/test/View/RouteNotFoundStrategyTest.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\View; use PHPUnit\Framework\TestCase; diff --git a/test/View/TestAsset/DumbStrategy.php b/test/View/TestAsset/DumbStrategy.php index 3369410ca..217c96889 100644 --- a/test/View/TestAsset/DumbStrategy.php +++ b/test/View/TestAsset/DumbStrategy.php @@ -5,6 +5,8 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ +declare(strict_types=1); + namespace ZendTest\Mvc\View\TestAsset; use ArrayObject; diff --git a/test/_autoload.php b/test/_autoload.php deleted file mode 100644 index a496a8f6a..000000000 --- a/test/_autoload.php +++ /dev/null @@ -1,12 +0,0 @@ -