diff --git a/.travis.yml b/.travis.yml index 4395c9d..53d348c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,15 +14,6 @@ cache: matrix: include: - - php: 7.1 - env: - - DEPS=lowest - - php: 7.1 - env: - - DEPS=locked - - php: 7.1 - env: - - DEPS=latest - php: 7.2 env: - DEPS=lowest diff --git a/composer.json b/composer.json index b7dc456..d9a8095 100644 --- a/composer.json +++ b/composer.json @@ -4,6 +4,8 @@ "type": "library", "keywords": [ "twig", + "twig2", + "twig3", "module", "zf", "zf3" @@ -23,8 +25,8 @@ } ], "require": { - "php": "^7.1", - "twig/twig": "^2.8.1", + "php": "^7.2.9", + "twig/twig": "^3.0.0", "zendframework/zend-mvc": "^3.0", "zendframework/zend-view": "^2.7", "zendframework/zend-servicemanager": "^3.0", @@ -43,7 +45,7 @@ "require-dev": { "zendframework/zend-navigation": "^2.7", "zendframework/zend-modulemanager": "^2.7", - "phpunit/phpunit": "^7.5" + "phpunit/phpunit": "^8.4.3" }, "replace": { "zf-commons/zfc-twig": "self.version" diff --git a/composer.lock b/composer.lock index 86853ce..e078aad 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": "bcc6d1ec0085dc661beef48e61e82b70", + "content-hash": "01b05f21a89fb554674849200d50764f", "packages": [ { "name": "container-interop/container-interop", @@ -35,6 +35,7 @@ ], "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", "homepage": "https://github.com/container-interop/container-interop", + "abandoned": "psr/container", "time": "2017-02-14T19:40:03+00:00" }, { @@ -205,38 +206,35 @@ }, { "name": "twig/twig", - "version": "v2.11.3", + "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "699ed2342557c88789a15402de5eb834dedd6792" + "reference": "9b58bb8ac7a41d72fbb5a7dc643e07923e5ccc26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/699ed2342557c88789a15402de5eb834dedd6792", - "reference": "699ed2342557c88789a15402de5eb834dedd6792", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/9b58bb8ac7a41d72fbb5a7dc643e07923e5ccc26", + "reference": "9b58bb8ac7a41d72fbb5a7dc643e07923e5ccc26", "shasum": "" }, "require": { - "php": "^7.0", + "php": "^7.2.9", "symfony/polyfill-ctype": "^1.8", "symfony/polyfill-mbstring": "^1.3" }, "require-dev": { "psr/container": "^1.0", - "symfony/debug": "^2.7", - "symfony/phpunit-bridge": "^3.4.19|^4.1.8|^5.0" + "symfony/debug": "^3.4|^4.2|^5.0", + "symfony/phpunit-bridge": "^4.4@dev|^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.11-dev" + "dev-master": "3.0-dev" } }, "autoload": { - "psr-0": { - "Twig_": "lib/" - }, "psr-4": { "Twig\\": "src/" } @@ -252,15 +250,15 @@ "homepage": "http://fabien.potencier.org", "role": "Lead Developer" }, - { - "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com", - "role": "Project Founder" - }, { "name": "Twig Team", "homepage": "https://twig.symfony.com/contributors", "role": "Contributors" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" } ], "description": "Twig, the flexible, fast, and secure template language for PHP", @@ -268,7 +266,7 @@ "keywords": [ "templating" ], - "time": "2019-06-18T15:37:11+00:00" + "time": "2019-11-15T20:38:32+00:00" }, { "name": "zendframework/zend-config", @@ -486,16 +484,16 @@ }, { "name": "zendframework/zend-json", - "version": "3.1.1", + "version": "3.1.2", "source": { "type": "git", "url": "https://github.com/zendframework/zend-json.git", - "reference": "21c6027f3c4a5177cbef8ed08d1037b17188a0d8" + "reference": "e9ddb1192d93fe7fff846ac895249c39db75132b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-json/zipball/21c6027f3c4a5177cbef8ed08d1037b17188a0d8", - "reference": "21c6027f3c4a5177cbef8ed08d1037b17188a0d8", + "url": "https://api.github.com/repos/zendframework/zend-json/zipball/e9ddb1192d93fe7fff846ac895249c39db75132b", + "reference": "e9ddb1192d93fe7fff846ac895249c39db75132b", "shasum": "" }, "require": { @@ -532,7 +530,7 @@ "json", "zf" ], - "time": "2019-06-18T10:54:52+00:00" + "time": "2019-10-09T13:56:13+00:00" }, { "name": "zendframework/zend-loader", @@ -581,16 +579,16 @@ }, { "name": "zendframework/zend-modulemanager", - "version": "2.8.2", + "version": "2.8.4", "source": { "type": "git", "url": "https://github.com/zendframework/zend-modulemanager.git", - "reference": "394df6e12248ac430a312d4693f793ee7120baa6" + "reference": "b2596d24b9a4e36a3cd114d35d3ad0918db9a243" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-modulemanager/zipball/394df6e12248ac430a312d4693f793ee7120baa6", - "reference": "394df6e12248ac430a312d4693f793ee7120baa6", + "url": "https://api.github.com/repos/zendframework/zend-modulemanager/zipball/b2596d24b9a4e36a3cd114d35d3ad0918db9a243", + "reference": "b2596d24b9a4e36a3cd114d35d3ad0918db9a243", "shasum": "" }, "require": { @@ -600,7 +598,7 @@ "zendframework/zend-stdlib": "^3.1 || ^2.7" }, "require-dev": { - "phpunit/phpunit": "^6.0.8 || ^5.7.15", + "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.16", "zendframework/zend-coding-standard": "~1.0.0", "zendframework/zend-console": "^2.6", "zendframework/zend-di": "^2.6", @@ -617,8 +615,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev", - "dev-develop": "2.8-dev" + "dev-master": "2.8.x-dev", + "dev-develop": "2.9.x-dev" } }, "autoload": { @@ -631,13 +629,12 @@ "BSD-3-Clause" ], "description": "Modular application system for zend-mvc applications", - "homepage": "https://github.com/zendframework/zend-modulemanager", "keywords": [ "ZendFramework", "modulemanager", "zf" ], - "time": "2017-12-02T06:11:18+00:00" + "time": "2019-10-28T13:29:38+00:00" }, { "name": "zendframework/zend-mvc", @@ -713,23 +710,23 @@ }, { "name": "zendframework/zend-mvc-plugin-flashmessenger", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-mvc-plugin-flashmessenger.git", - "reference": "1af2e2d69500da5ca31868c4817b6b7eb7e1cf47" + "reference": "b66064eb59d3b124a133d259aac3d9dd7cb81706" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-mvc-plugin-flashmessenger/zipball/1af2e2d69500da5ca31868c4817b6b7eb7e1cf47", - "reference": "1af2e2d69500da5ca31868c4817b6b7eb7e1cf47", + "url": "https://api.github.com/repos/zendframework/zend-mvc-plugin-flashmessenger/zipball/b66064eb59d3b124a133d259aac3d9dd7cb81706", + "reference": "b66064eb59d3b124a133d259aac3d9dd7cb81706", "shasum": "" }, "require": { "php": "^5.6 || ^7.0", "zendframework/zend-mvc": "^3.0", "zendframework/zend-session": "^2.8.5", - "zendframework/zend-stdlib": "^2.7 || ^3.0", + "zendframework/zend-stdlib": "^3.2.1", "zendframework/zend-view": "^2.10" }, "conflict": { @@ -743,8 +740,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev", - "dev-develop": "1.2.x-dev" + "dev-master": "1.2.x-dev", + "dev-develop": "1.3.x-dev" }, "zf": { "component": "Zend\\Mvc\\Plugin\\FlashMessenger" @@ -765,7 +762,7 @@ "mvc", "zf" ], - "time": "2018-04-30T18:47:56+00:00" + "time": "2019-10-19T22:24:02+00:00" }, { "name": "zendframework/zend-router", @@ -899,16 +896,16 @@ }, { "name": "zendframework/zend-session", - "version": "2.9.0", + "version": "2.9.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-session.git", - "reference": "0a0c7ae4d8be608e30ecff714c86164ccca19ca3" + "reference": "c289c4d733ec23a389e25c7c451f4d062088511f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-session/zipball/0a0c7ae4d8be608e30ecff714c86164ccca19ca3", - "reference": "0a0c7ae4d8be608e30ecff714c86164ccca19ca3", + "url": "https://api.github.com/repos/zendframework/zend-session/zipball/c289c4d733ec23a389e25c7c451f4d062088511f", + "reference": "c289c4d733ec23a389e25c7c451f4d062088511f", "shasum": "" }, "require": { @@ -962,7 +959,7 @@ "session", "zf" ], - "time": "2019-09-20T12:50:51+00:00" + "time": "2019-10-28T19:40:43+00:00" }, { "name": "zendframework/zend-stdlib", @@ -1012,16 +1009,16 @@ }, { "name": "zendframework/zend-uri", - "version": "2.7.0", + "version": "2.7.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-uri.git", - "reference": "b2785cd38fe379a784645449db86f21b7739b1ee" + "reference": "bfc4a5b9a309711e968d7c72afae4ac50c650083" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-uri/zipball/b2785cd38fe379a784645449db86f21b7739b1ee", - "reference": "b2785cd38fe379a784645449db86f21b7739b1ee", + "url": "https://api.github.com/repos/zendframework/zend-uri/zipball/bfc4a5b9a309711e968d7c72afae4ac50c650083", + "reference": "bfc4a5b9a309711e968d7c72afae4ac50c650083", "shasum": "" }, "require": { @@ -1055,20 +1052,20 @@ "uri", "zf" ], - "time": "2019-02-27T21:39:04+00:00" + "time": "2019-10-07T13:35:33+00:00" }, { "name": "zendframework/zend-validator", - "version": "2.12.0", + "version": "2.12.2", "source": { "type": "git", "url": "https://github.com/zendframework/zend-validator.git", - "reference": "64c33668e5fa2d39c6289a878f927ea2b0850c30" + "reference": "fd24920c2afcf2a70d11f67c3457f8f509453a62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-validator/zipball/64c33668e5fa2d39c6289a878f927ea2b0850c30", - "reference": "64c33668e5fa2d39c6289a878f927ea2b0850c30", + "url": "https://api.github.com/repos/zendframework/zend-validator/zipball/fd24920c2afcf2a70d11f67c3457f8f509453a62", + "reference": "fd24920c2afcf2a70d11f67c3457f8f509453a62", "shasum": "" }, "require": { @@ -1122,26 +1119,26 @@ "license": [ "BSD-3-Clause" ], - "description": "provides a set of commonly needed validators", - "homepage": "https://github.com/zendframework/zend-validator", + "description": "Validation classes for a wide range of domains, and the ability to chain validators to create complex validation criteria", "keywords": [ + "ZendFramework", "validator", - "zf2" + "zf" ], - "time": "2019-01-30T14:26:10+00:00" + "time": "2019-10-29T08:33:25+00:00" }, { "name": "zendframework/zend-view", - "version": "2.11.2", + "version": "2.11.3", "source": { "type": "git", "url": "https://github.com/zendframework/zend-view.git", - "reference": "4f5cb653ed4c64bb8d9bf05b294300feb00c67f2" + "reference": "e766457bd6ce13c5354e443bb949511b6904d7f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-view/zipball/4f5cb653ed4c64bb8d9bf05b294300feb00c67f2", - "reference": "4f5cb653ed4c64bb8d9bf05b294300feb00c67f2", + "url": "https://api.github.com/repos/zendframework/zend-view/zipball/e766457bd6ce13c5354e443bb949511b6904d7f5", + "reference": "e766457bd6ce13c5354e443bb949511b6904d7f5", "shasum": "" }, "require": { @@ -1209,28 +1206,28 @@ "license": [ "BSD-3-Clause" ], - "description": "provides a system of helpers, output filters, and variable escaping", - "homepage": "https://github.com/zendframework/zend-view", + "description": "Flexible view layer supporting and providing multiple view layers, helpers, and more", "keywords": [ + "ZendFramework", "view", - "zf2" + "zf" ], - "time": "2019-02-19T17:40:15+00:00" + "time": "2019-10-11T21:10:04+00:00" } ], "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "a2c590166b2133a4633738648b6b064edae0814a" + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a", - "reference": "a2c590166b2133a4633738648b6b064edae0814a", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", "shasum": "" }, "require": { @@ -1273,7 +1270,7 @@ "constructor", "instantiate" ], - "time": "2019-03-17T17:37:11+00:00" + "time": "2019-10-21T16:45:58+00:00" }, { "name": "myclabs/deep-copy", @@ -1577,22 +1574,22 @@ }, { "name": "phpspec/prophecy", - "version": "1.8.1", + "version": "1.9.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76" + "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/1927e75f4ed19131ec9bcc3b002e07fb1173ee76", - "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203", + "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", "sebastian/comparator": "^1.1|^2.0|^3.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, @@ -1636,44 +1633,44 @@ "spy", "stub" ], - "time": "2019-06-13T12:50:23+00:00" + "time": "2019-10-03T11:07:50+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "6.1.4", + "version": "7.0.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" + "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", - "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f1884187926fbb755a9aaf0b3836ad3165b478bf", + "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^7.1", - "phpunit/php-file-iterator": "^2.0", + "php": "^7.2", + "phpunit/php-file-iterator": "^2.0.2", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.0", + "phpunit/php-token-stream": "^3.1.1", "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.1 || ^4.0", + "sebastian/environment": "^4.2.2", "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1" + "theseer/tokenizer": "^1.1.3" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^8.2.2" }, "suggest": { - "ext-xdebug": "^2.6.0" + "ext-xdebug": "^2.7.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.1-dev" + "dev-master": "7.0-dev" } }, "autoload": { @@ -1699,7 +1696,7 @@ "testing", "xunit" ], - "time": "2018-10-31T16:06:48+00:00" + "time": "2019-11-20T13:55:58+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1892,53 +1889,52 @@ }, { "name": "phpunit/phpunit", - "version": "7.5.16", + "version": "8.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "316afa6888d2562e04aeb67ea7f2017a0eb41661" + "reference": "67f9e35bffc0dd52d55d565ddbe4230454fd6a4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/316afa6888d2562e04aeb67ea7f2017a0eb41661", - "reference": "316afa6888d2562e04aeb67ea7f2017a0eb41661", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/67f9e35bffc0dd52d55d565ddbe4230454fd6a4e", + "reference": "67f9e35bffc0dd52d55d565ddbe4230454fd6a4e", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.1", + "doctrine/instantiator": "^1.2.0", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "^1.7", - "phar-io/manifest": "^1.0.2", - "phar-io/version": "^2.0", - "php": "^7.1", - "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^6.0.7", - "phpunit/php-file-iterator": "^2.0.1", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.9.1", + "phar-io/manifest": "^1.0.3", + "phar-io/version": "^2.0.1", + "php": "^7.2", + "phpspec/prophecy": "^1.8.1", + "phpunit/php-code-coverage": "^7.0.7", + "phpunit/php-file-iterator": "^2.0.2", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1", - "sebastian/comparator": "^3.0", - "sebastian/diff": "^3.0", - "sebastian/environment": "^4.0", - "sebastian/exporter": "^3.1", - "sebastian/global-state": "^2.0", + "phpunit/php-timer": "^2.1.2", + "sebastian/comparator": "^3.0.2", + "sebastian/diff": "^3.0.2", + "sebastian/environment": "^4.2.2", + "sebastian/exporter": "^3.1.1", + "sebastian/global-state": "^3.0.0", "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0", + "sebastian/resource-operations": "^2.0.1", + "sebastian/type": "^1.1.3", "sebastian/version": "^2.0.1" }, - "conflict": { - "phpunit/phpunit-mock-objects": "*" - }, "require-dev": { "ext-pdo": "*" }, "suggest": { "ext-soap": "*", "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0" + "phpunit/php-invoker": "^2.0.0" }, "bin": [ "phpunit" @@ -1946,7 +1942,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "7.5-dev" + "dev-master": "8.4-dev" } }, "autoload": { @@ -1972,7 +1968,7 @@ "testing", "xunit" ], - "time": "2019-09-14T09:08:39+00:00" + "time": "2019-11-06T09:42:23+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2141,16 +2137,16 @@ }, { "name": "sebastian/environment", - "version": "4.2.2", + "version": "4.2.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404" + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/f2a2c8e1c97c11ace607a7a667d73d47c19fe404", - "reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", "shasum": "" }, "require": { @@ -2190,7 +2186,7 @@ "environment", "hhvm" ], - "time": "2019-05-05T09:05:15+00:00" + "time": "2019-11-20T08:46:58+00:00" }, { "name": "sebastian/exporter", @@ -2261,23 +2257,26 @@ }, { "name": "sebastian/global-state", - "version": "2.0.0", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", + "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.2", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "ext-dom": "*", + "phpunit/phpunit": "^8.0" }, "suggest": { "ext-uopz": "*" @@ -2285,7 +2284,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -2308,7 +2307,7 @@ "keywords": [ "global state" ], - "time": "2017-04-27T15:39:26+00:00" + "time": "2019-02-01T05:30:01+00:00" }, { "name": "sebastian/object-enumerator", @@ -2497,6 +2496,52 @@ "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "time": "2018-10-04T04:07:39+00:00" }, + { + "name": "sebastian/type", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/3aaaa15fa71d27650d62a948be022fe3b48541a3", + "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3", + "shasum": "" + }, + "require": { + "php": "^7.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "time": "2019-07-02T08:10:15+00:00" + }, { "name": "sebastian/version", "version": "2.0.1", @@ -2705,10 +2750,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.1" + "php": "^7.2.9" }, - "platform-dev": [], - "platform-overrides": { - "php": "7.1.35" - } + "platform-dev": [] } diff --git a/src/Module.php b/src/Module.php index 1cbf213..09b5a21 100644 --- a/src/Module.php +++ b/src/Module.php @@ -17,9 +17,8 @@ class Module implements /** * @param EventInterface $e * @throws InvalidArgumentException - * @return array */ - public function onBootstrap(EventInterface $e) + public function onBootstrap(EventInterface $e): void { /** @var \Zend\Mvc\MvcEvent $e*/ $application = $e->getApplication(); @@ -51,7 +50,7 @@ public function onBootstrap(EventInterface $e) /** * @return array */ - public function getConfig() + public function getConfig(): array { return include __DIR__ . '/../config/module.config.php'; } diff --git a/src/ModuleOptions.php b/src/ModuleOptions.php index 34dfb8e..cd0f02d 100644 --- a/src/ModuleOptions.php +++ b/src/ModuleOptions.php @@ -9,12 +9,12 @@ class ModuleOptions extends AbstractOptions /** * @var string */ - protected $environmentLoader; + protected $environmentLoader = ''; /** * @var string */ - protected $environmentClass; + protected $environmentClass = ''; /** * @var array @@ -39,7 +39,7 @@ class ModuleOptions extends AbstractOptions /** * @var string */ - protected $suffix; + protected $suffix = ''; /** * @var bool @@ -58,9 +58,9 @@ class ModuleOptions extends AbstractOptions /** * @param boolean $disableZfmodel - * @return self + * @return $this */ - public function setDisableZfmodel($disableZfmodel) + public function setDisableZfmodel(bool $disableZfmodel): self { $this->disableZfmodel = $disableZfmodel; return $this; @@ -69,16 +69,16 @@ public function setDisableZfmodel($disableZfmodel) /** * @return boolean */ - public function getDisableZfmodel() + public function getDisableZfmodel(): bool { return $this->disableZfmodel; } /** * @param boolean $enableFallbackFunctions - * @return self + * @return $this */ - public function setEnableFallbackFunctions($enableFallbackFunctions) + public function setEnableFallbackFunctions(bool $enableFallbackFunctions): self { $this->enableFallbackFunctions = $enableFallbackFunctions; return $this; @@ -87,34 +87,34 @@ public function setEnableFallbackFunctions($enableFallbackFunctions) /** * @return boolean */ - public function getEnableFallbackFunctions() + public function getEnableFallbackFunctions(): bool { return $this->enableFallbackFunctions; } /** - * @param mixed $environmentLoader - * @return self + * @param string $environmentLoader + * @return $this */ - public function setEnvironmentLoader($environmentLoader) + public function setEnvironmentLoader(string $environmentLoader): self { $this->environmentLoader = $environmentLoader; return $this; } /** - * @return mixed + * @return string */ - public function getEnvironmentLoader() + public function getEnvironmentLoader(): string { return $this->environmentLoader; } /** * @param array $environmentOptions - * @return self + * @return $this */ - public function setEnvironmentOptions($environmentOptions) + public function setEnvironmentOptions(array $environmentOptions): self { $this->environmentOptions = $environmentOptions; return $this; @@ -123,16 +123,16 @@ public function setEnvironmentOptions($environmentOptions) /** * @return array */ - public function getEnvironmentOptions() + public function getEnvironmentOptions(): array { return $this->environmentOptions; } /** * @param array $extensions - * @return self + * @return $this */ - public function setExtensions($extensions) + public function setExtensions($extensions): self { $this->extensions = $extensions; return $this; @@ -141,16 +141,16 @@ public function setExtensions($extensions) /** * @return array */ - public function getExtensions() + public function getExtensions(): array { return $this->extensions; } /** * @param array $helperManager - * @return self + * @return $this */ - public function setHelperManager($helperManager) + public function setHelperManager($helperManager): self { $this->helperManager = $helperManager; return $this; @@ -159,16 +159,16 @@ public function setHelperManager($helperManager) /** * @return array */ - public function getHelperManager() + public function getHelperManager(): array { return $this->helperManager; } /** * @param array $loaderChain - * @return self + * @return $this */ - public function setLoaderChain($loaderChain) + public function setLoaderChain(array $loaderChain): self { $this->loaderChain = $loaderChain; return $this; @@ -177,16 +177,16 @@ public function setLoaderChain($loaderChain) /** * @return array */ - public function getLoaderChain() + public function getLoaderChain(): array { return $this->loaderChain; } /** * @param string $suffix - * @return self + * @return $this */ - public function setSuffix($suffix) + public function setSuffix(string $suffix): self { $this->suffix = $suffix; return $this; @@ -195,7 +195,7 @@ public function setSuffix($suffix) /** * @return string */ - public function getSuffix() + public function getSuffix(): string { return $this->suffix; } @@ -203,7 +203,7 @@ public function getSuffix() /** * @param string $environmentClass */ - public function setEnvironmentClass($environmentClass) + public function setEnvironmentClass(string $environmentClass) { $this->environmentClass = $environmentClass; } @@ -211,7 +211,7 @@ public function setEnvironmentClass($environmentClass) /** * @return string */ - public function getEnvironmentClass() + public function getEnvironmentClass(): string { return $this->environmentClass; } @@ -219,7 +219,7 @@ public function getEnvironmentClass() /** * @param array $globals */ - public function setGlobals($globals) + public function setGlobals(array $globals) { $this->globals = $globals; } @@ -227,7 +227,7 @@ public function setGlobals($globals) /** * @return array */ - public function getGlobals() + public function getGlobals(): array { return $this->globals; } diff --git a/src/Twig/EnvironmentFactory.php b/src/Twig/EnvironmentFactory.php index c0d925f..8e71c6b 100644 --- a/src/Twig/EnvironmentFactory.php +++ b/src/Twig/EnvironmentFactory.php @@ -5,6 +5,7 @@ use Interop\Container\ContainerInterface; use RuntimeException; use Twig\Environment; +use Twig\TwigFunction; use Zend\ServiceManager\Factory\FactoryInterface; use ZfcTwig\ModuleOptions; use function sprintf; @@ -40,7 +41,15 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o $env->registerUndefinedFunctionCallback( function ($name) use ($helperPluginManager) { if ($helperPluginManager->has($name)) { - return new FallbackFunction($name); + return new TwigFunction( + $name, + sprintf( + '$this->env->getExtension("%s")->getRenderer()->plugin("%s")->__invoke', + Extension::class, + $name + ), + ['is_safe' => ['all']] + ); } return false; } diff --git a/src/Twig/Extension.php b/src/Twig/Extension.php index 6cad5d7..1768d6e 100644 --- a/src/Twig/Extension.php +++ b/src/Twig/Extension.php @@ -23,7 +23,7 @@ public function __construct(TwigRenderer $renderer) /** * @return TwigRenderer */ - public function getRenderer() + public function getRenderer(): TwigRenderer { return $this->renderer; } @@ -33,7 +33,7 @@ public function getRenderer() * * @return string The extension name */ - public function getName() + public function getName(): string { return __CLASS__; } diff --git a/src/Twig/FallbackFunction.php b/src/Twig/FallbackFunction.php deleted file mode 100644 index 46a6096..0000000 --- a/src/Twig/FallbackFunction.php +++ /dev/null @@ -1,40 +0,0 @@ -helper = $helper; - - parent::__construct($helper, $this->compile(), ['is_safe' => ['all']]); - } - - /** - * Compiles a function. - * - * @return string The PHP code for the function - */ - public function compile() - { - return sprintf( - '$this->env->getExtension("%s")->getRenderer()->plugin("%s")->__invoke', Extension::class, $this->helper - ); - } - -} diff --git a/src/Twig/MapLoader.php b/src/Twig/MapLoader.php index ea53bb4..0214218 100644 --- a/src/Twig/MapLoader.php +++ b/src/Twig/MapLoader.php @@ -11,7 +11,7 @@ use function filemtime; use function sprintf; -class MapLoader implements Loader\LoaderInterface, Loader\SourceContextLoaderInterface +class MapLoader implements Loader\LoaderInterface { /** * Array of templates to filenames. @@ -27,7 +27,7 @@ class MapLoader implements Loader\LoaderInterface, Loader\SourceContextLoaderInt * @throws Error\LoaderError * @return MapLoader */ - public function add($name, $path) + public function add(string $name, string $path): MapLoader { if ($this->exists($name)) { throw new Error\LoaderError(sprintf( @@ -42,7 +42,7 @@ public function add($name, $path) /** * {@inheritDoc} */ - public function exists($name) + public function exists(string $name): bool { return array_key_exists($name, $this->map); } @@ -50,7 +50,7 @@ public function exists($name) /** * {@inheritDoc} */ - public function getSourceContext($name) + public function getSourceContext(string $name): Source { if (!$this->exists($name)) { throw new Error\LoaderError(sprintf( @@ -70,7 +70,7 @@ public function getSourceContext($name) /** * {@inheritDoc} */ - public function getCacheKey($name) + public function getCacheKey(string $name): string { return $name; } @@ -78,7 +78,7 @@ public function getCacheKey($name) /** * {@inheritDoc} */ - public function isFresh($name, $time) + public function isFresh(string $name, int $time): bool { return filemtime($this->map[$name]) <= $time; } diff --git a/src/Twig/StackLoader.php b/src/Twig/StackLoader.php index 486d60c..6165bc2 100644 --- a/src/Twig/StackLoader.php +++ b/src/Twig/StackLoader.php @@ -38,7 +38,7 @@ class StackLoader extends Loader\FilesystemLoader * * @return StackLoader */ - public function setDefaultSuffix($defaultSuffix) + public function setDefaultSuffix(string $defaultSuffix) { $this->defaultSuffix = (string)$defaultSuffix; $this->defaultSuffix = ltrim($this->defaultSuffix, '.'); @@ -51,7 +51,7 @@ public function setDefaultSuffix($defaultSuffix) * * @return string */ - public function getDefaultSuffix() + public function getDefaultSuffix(): string { return $this->defaultSuffix; } @@ -60,30 +60,30 @@ public function getDefaultSuffix() * {@inheritDoc} * @throws Error\LoaderError */ - protected function findTemplate($name, $throw = true) + protected function findTemplate(string $name, bool $throw = true): ?string { $name = (string)$name; // normalize name $name = preg_replace('#/{2,}#', '/', strtr($name, '\\', '/')); + // Ensure we have the expected file extension + $defaultSuffix = $this->getDefaultSuffix(); + if (pathinfo($name, PATHINFO_EXTENSION) != $defaultSuffix) { + $name .= '.' . $defaultSuffix; + } + if (isset($this->cache[$name])) { return $this->cache[$name]; } if (isset($this->errorCache[$name])) { if (!$throw) { - return false; + return $this->cache[$name] = null; } throw new Error\LoaderError($this->errorCache[$name]); } - // Ensure we have the expected file extension - $defaultSuffix = $this->getDefaultSuffix(); - if (pathinfo($name, PATHINFO_EXTENSION) != $defaultSuffix) { - $name .= '.' . $defaultSuffix; - } - $this->validateName($name); $namespace = '__main__'; @@ -95,7 +95,7 @@ protected function findTemplate($name, $throw = true) ); if (!$throw) { - return false; + return $this->cache[$name] = null; } throw new Error\LoaderError($this->errorCache[$name]); @@ -110,7 +110,7 @@ protected function findTemplate($name, $throw = true) $this->errorCache[$name] = sprintf('There are no registered paths for namespace "%s".', $namespace); if (!$throw) { - return false; + return $this->cache[$name] = null; } throw new Error\LoaderError($this->errorCache[$name]); } @@ -131,7 +131,7 @@ protected function findTemplate($name, $throw = true) ); if (!$throw) { - return false; + return $this->cache[$name] = null; } throw new Error\LoaderError($this->errorCache[$name]); @@ -141,7 +141,7 @@ protected function findTemplate($name, $throw = true) * @param string $name * @throws Error\LoaderError */ - private function validateName($name) + private function validateName(string $name): void { if (false !== strpos($name, "\0")) { throw new Error\LoaderError('A template name cannot contain NUL bytes.'); diff --git a/src/View/TwigRenderer.php b/src/View/TwigRenderer.php index 590561c..0cd7a40 100644 --- a/src/View/TwigRenderer.php +++ b/src/View/TwigRenderer.php @@ -88,7 +88,7 @@ public function __construct( * @param array $argv * @return mixed */ - public function __call($method, $argv) + public function __call(string $method, array $argv) { if (!isset($this->__pluginCache[$method])) { $this->__pluginCache[$method] = $this->plugin($method); @@ -101,9 +101,9 @@ public function __call($method, $argv) /** * @param boolean $canRenderTrees - * @return TwigRenderer + * @return $this */ - public function setCanRenderTrees($canRenderTrees) + public function setCanRenderTrees(bool $canRenderTrees): self { $this->canRenderTrees = $canRenderTrees; return $this; @@ -112,7 +112,7 @@ public function setCanRenderTrees($canRenderTrees) /** * @return boolean */ - public function canRenderTrees() + public function canRenderTrees(): bool { return $this->canRenderTrees; } @@ -124,7 +124,7 @@ public function canRenderTrees() * @param null|array $options Options to pass to plugin constructor (if not already instantiated) * @return \Zend\View\Helper\AbstractHelper */ - public function plugin($name, array $options = null) + public function plugin(string $name, array $options = null) { $helper = $this->getHelperPluginManager() ->setRenderer($this); @@ -143,7 +143,7 @@ public function plugin($name, array $options = null) * @return bool * @see \ZfcTwig\Twig\Environment::canLoadTemplate() */ - public function canRender($name) + public function canRender(string $name): bool { return $this->loader->exists($name); } @@ -157,7 +157,7 @@ public function canRender($name) * * @return Environment */ - public function getEngine() + public function getEngine(): Environment { return $this->environment; } @@ -166,9 +166,9 @@ public function getEngine() * Set the resolver used to map a template name to a resource the renderer may consume. * * @param ResolverInterface $resolver - * @return TwigRenderer + * @return $this */ - public function setResolver(ResolverInterface $resolver) + public function setResolver(ResolverInterface $resolver): self { $this->resolver = $resolver; return $this; @@ -176,9 +176,9 @@ public function setResolver(ResolverInterface $resolver) /** * @param HelperPluginManager $helperPluginManager - * @return TwigRenderer + * @return $this */ - public function setHelperPluginManager(HelperPluginManager $helperPluginManager) + public function setHelperPluginManager(HelperPluginManager $helperPluginManager): self { $helperPluginManager->setRenderer($this); $this->helperPluginManager = $helperPluginManager; @@ -186,9 +186,9 @@ public function setHelperPluginManager(HelperPluginManager $helperPluginManager) } /** - * @return \Zend\View\HelperPluginManager + * @return HelperPluginManager */ - public function getHelperPluginManager() + public function getHelperPluginManager(): HelperPluginManager { return $this->helperPluginManager; } @@ -196,16 +196,16 @@ public function getHelperPluginManager() /** * @return HelperPluginManager */ - public function getZendHelperPluginManager() + public function getZendHelperPluginManager(): HelperPluginManager { return $this->zendHelperPluginManager; } /** * @param HelperPluginManager $zendHelperPluginManager - * @return self + * @return $this */ - public function setZendHelperPluginManager($zendHelperPluginManager) + public function setZendHelperPluginManager(HelperPluginManager $zendHelperPluginManager): self { $this->zendHelperPluginManager = $zendHelperPluginManager; return $this; @@ -219,7 +219,7 @@ public function setZendHelperPluginManager($zendHelperPluginManager) * @return string|null The script output. * @throws \Zend\View\Exception\DomainException */ - public function render($nameOrModel, $values = null) + public function render($nameOrModel, $values = null): ?string { $model = null; diff --git a/tests/ZfcTwigTest/View/TwigRendererTest.php b/tests/ZfcTwigTest/View/TwigRendererTest.php index c22dffb..0f57038 100644 --- a/tests/ZfcTwigTest/View/TwigRendererTest.php +++ b/tests/ZfcTwigTest/View/TwigRendererTest.php @@ -15,7 +15,7 @@ class TwigRendererTest extends TestCase /** @var TwigRenderer */ protected $renderer; - public function setUp() + public function setUp(): void { parent::setUp(); @@ -43,7 +43,7 @@ public function testRenderWithNameAndValues() public function testRenderWithModelAndValues() { - /** @var \PHPUnit_Framework_MockObject_MockObject|ModelInterface $model */ + /** @var \PHPUnit\Framework\MockObject\MockObject|ModelInterface $model */ $model = $this->getMockBuilder(ModelInterface::class)->getMock(); $model->expects($this->exactly(1)) ->method('getTemplate') diff --git a/tests/ZfcTwigTest/View/TwigResolverTest.php b/tests/ZfcTwigTest/View/TwigResolverTest.php index 2986ce1..092580c 100644 --- a/tests/ZfcTwigTest/View/TwigResolverTest.php +++ b/tests/ZfcTwigTest/View/TwigResolverTest.php @@ -4,6 +4,7 @@ use PHPUnit\Framework\TestCase; use Twig\Environment; +use Twig\Error\LoaderError; use Twig\Loader; use Twig\TemplateWrapper; use ZfcTwig\View\TwigResolver; @@ -13,7 +14,7 @@ class TwigResolverTest extends TestCase /** @var TwigResolver */ protected $resolver; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -28,12 +29,10 @@ public function testResolve() $this->assertInstanceOf(TemplateWrapper::class, $this->resolver->resolve('key1')); } - /** - * @expectedException \Twig_Error_Loader - * @expectedExceptionMessage Template "key2" is not defined. - */ public function testResolveError() { + $this->expectException(LoaderError::class); + $this->expectExceptionMessage('Template "key2" is not defined.'); $this->assertInstanceOf(TemplateWrapper::class, $this->resolver->resolve('key2')); } diff --git a/tests/ZfcTwigTest/View/TwigStrategyTest.php b/tests/ZfcTwigTest/View/TwigStrategyTest.php index 23767cc..bf367b3 100644 --- a/tests/ZfcTwigTest/View/TwigStrategyTest.php +++ b/tests/ZfcTwigTest/View/TwigStrategyTest.php @@ -19,7 +19,7 @@ class TwigStrategyTest extends TestCase /** @var TwigStrategy */ protected $strategy; - public function setUp() + public function setUp(): void { parent::setUp(); @@ -32,7 +32,7 @@ public function setUp() public function testSelectRendererWhenTemplateFound() { - /** @var \PHPUnit_Framework_MockObject_MockObject|ModelInterface $model */ + /** @var \PHPUnit\Framework\MockObject\MockObject|ModelInterface $model */ $model = $this->getMockBuilder(ModelInterface::class)->getMock(); $model->expects($this->at(0)) ->method('getTemplate')