diff --git a/composer.json b/composer.json index bdcbbaac8..19ff14cb5 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,6 @@ "ext-dom": "*", "laminas/laminas-authentication": "^2.5", "laminas/laminas-coding-standard": "~2.3.0", - "laminas/laminas-console": "^2.6", "laminas/laminas-escaper": "^2.5", "laminas/laminas-feed": "^2.15", "laminas/laminas-filter": "^2.13.0", diff --git a/composer.lock b/composer.lock index 90de23f62..73a28d297 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a003c15d0428178d28dd954a18766ec9", + "content-hash": "056eb15670952bcf290c11cdaf208c21", "packages": [ { "name": "laminas/laminas-eventmanager", @@ -135,16 +135,16 @@ }, { "name": "laminas/laminas-stdlib", - "version": "3.7.0", + "version": "3.7.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-stdlib.git", - "reference": "cba75fad2053bb5dc8d3e7f5e62b61d75eecfaf1" + "reference": "bcd869e2fe88d567800057c1434f2380354fe325" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/cba75fad2053bb5dc8d3e7f5e62b61d75eecfaf1", - "reference": "cba75fad2053bb5dc8d3e7f5e62b61d75eecfaf1", + "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/bcd869e2fe88d567800057c1434f2380354fe325", + "reference": "bcd869e2fe88d567800057c1434f2380354fe325", "shasum": "" }, "require": { @@ -190,7 +190,7 @@ "type": "community_bridge" } ], - "time": "2022-01-10T11:18:55+00:00" + "time": "2022-01-21T15:50:46+00:00" } ], "packages-dev": [ @@ -405,16 +405,16 @@ }, { "name": "composer/package-versions-deprecated", - "version": "1.11.99.4", + "version": "1.11.99.5", "source": { "type": "git", "url": "https://github.com/composer/package-versions-deprecated.git", - "reference": "b174585d1fe49ceed21928a945138948cb394600" + "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b174585d1fe49ceed21928a945138948cb394600", - "reference": "b174585d1fe49ceed21928a945138948cb394600", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b4f54f74ef3453349c24a845d22392cd31e65f1d", + "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d", "shasum": "" }, "require": { @@ -458,7 +458,7 @@ "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", "support": { "issues": "https://github.com/composer/package-versions-deprecated/issues", - "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.4" + "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.5" }, "funding": [ { @@ -474,27 +474,27 @@ "type": "tidelift" } ], - "time": "2021-09-13T08:41:34+00:00" + "time": "2022-01-17T14:14:24+00:00" }, { "name": "composer/pcre", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "3d322d715c43a1ac36c7fe215fa59336265500f2" + "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/3d322d715c43a1ac36c7fe215fa59336265500f2", - "reference": "3d322d715c43a1ac36c7fe215fa59336265500f2", + "url": "https://api.github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560", + "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1", + "phpstan/phpstan": "^1.3", "phpstan/phpstan-strict-rules": "^1.1", "symfony/phpunit-bridge": "^4.2 || ^5" }, @@ -529,7 +529,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/1.0.0" + "source": "https://github.com/composer/pcre/tree/1.0.1" }, "funding": [ { @@ -545,7 +545,7 @@ "type": "tidelift" } ], - "time": "2021-12-06T15:17:27+00:00" + "time": "2022-01-21T20:24:37+00:00" }, { "name": "composer/semver", @@ -1204,72 +1204,6 @@ ], "time": "2021-10-01T16:07:46+00:00" }, - { - "name": "laminas/laminas-console", - "version": "2.8.0", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-console.git", - "reference": "478a6ceac3e31fb38d6314088abda8b239ee23a5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-console/zipball/478a6ceac3e31fb38d6314088abda8b239ee23a5", - "reference": "478a6ceac3e31fb38d6314088abda8b239ee23a5", - "shasum": "" - }, - "require": { - "laminas/laminas-stdlib": "^3.2.1", - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0" - }, - "replace": { - "zendframework/zend-console": "self.version" - }, - "require-dev": { - "laminas/laminas-coding-standard": "~1.0.0", - "laminas/laminas-filter": "^2.7.2", - "laminas/laminas-json": "^2.6 || ^3.0", - "laminas/laminas-validator": "^2.10.1", - "phpunit/phpunit": "^5.7.23 || ^6.4.3" - }, - "suggest": { - "laminas/laminas-filter": "To support DefaultRouteMatcher usage", - "laminas/laminas-validator": "To support DefaultRouteMatcher usage" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8.x-dev", - "dev-develop": "2.9.x-dev" - } - }, - "autoload": { - "psr-4": { - "Laminas\\Console\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Build console applications using getopt syntax or routing, complete with prompts", - "homepage": "https://laminas.dev", - "keywords": [ - "console", - "laminas" - ], - "support": { - "chat": "https://laminas.dev/chat", - "docs": "https://docs.laminas.dev/laminas-console/", - "forum": "https://discourse.laminas.dev", - "issues": "https://github.com/laminas/laminas-console/issues", - "rss": "https://github.com/laminas/laminas-console/releases.atom", - "source": "https://github.com/laminas/laminas-console" - }, - "abandoned": "laminas/laminas-cli", - "time": "2019-12-31T16:31:45+00:00" - }, { "name": "laminas/laminas-escaper", "version": "2.9.0", @@ -2073,16 +2007,16 @@ }, { "name": "laminas/laminas-paginator", - "version": "2.12.1", + "version": "2.12.2", "source": { "type": "git", "url": "https://github.com/laminas/laminas-paginator.git", - "reference": "fe51fdf2c938f7f8299e67c6f19628d890ef6868" + "reference": "e2e5a17e2b6ca750e4a75b8f34763c63cc6bf8fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-paginator/zipball/fe51fdf2c938f7f8299e67c6f19628d890ef6868", - "reference": "fe51fdf2c938f7f8299e67c6f19628d890ef6868", + "url": "https://api.github.com/repos/laminas/laminas-paginator/zipball/e2e5a17e2b6ca750e4a75b8f34763c63cc6bf8fa", + "reference": "e2e5a17e2b6ca750e4a75b8f34763c63cc6bf8fa", "shasum": "" }, "require": { @@ -2148,7 +2082,7 @@ "type": "community_bridge" } ], - "time": "2021-12-17T16:45:14+00:00" + "time": "2022-01-11T18:09:02+00:00" }, { "name": "laminas/laminas-permissions-acl", @@ -2513,16 +2447,16 @@ }, { "name": "laminas/laminas-validator", - "version": "2.15.1", + "version": "2.16.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-validator.git", - "reference": "fbd87f30c0a27aaeeee8adb2f934c14fb6046c80" + "reference": "329900ab7674c198e91e85b2e09080cdf493ce07" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-validator/zipball/fbd87f30c0a27aaeeee8adb2f934c14fb6046c80", - "reference": "fbd87f30c0a27aaeeee8adb2f934c14fb6046c80", + "url": "https://api.github.com/repos/laminas/laminas-validator/zipball/329900ab7674c198e91e85b2e09080cdf493ce07", + "reference": "329900ab7674c198e91e85b2e09080cdf493ce07", "shasum": "" }, "require": { @@ -2599,69 +2533,7 @@ "type": "community_bridge" } ], - "time": "2021-12-02T14:23:06+00:00" - }, - { - "name": "laminas/laminas-zendframework-bridge", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-zendframework-bridge.git", - "reference": "88bf037259869891afce6504cacc4f8a07b24d0f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-zendframework-bridge/zipball/88bf037259869891afce6504cacc4f8a07b24d0f", - "reference": "88bf037259869891afce6504cacc4f8a07b24d0f", - "shasum": "" - }, - "require": { - "php": "^7.3 || ~8.0.0 || ~8.1.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3", - "psalm/plugin-phpunit": "^0.15.1", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.6" - }, - "type": "library", - "extra": { - "laminas": { - "module": "Laminas\\ZendFrameworkBridge" - } - }, - "autoload": { - "files": [ - "src/autoload.php" - ], - "psr-4": { - "Laminas\\ZendFrameworkBridge\\": "src//" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Alias legacy ZF class names to Laminas Project equivalents.", - "keywords": [ - "ZendFramework", - "autoloading", - "laminas", - "zf" - ], - "support": { - "forum": "https://discourse.laminas.dev/", - "issues": "https://github.com/laminas/laminas-zendframework-bridge/issues", - "rss": "https://github.com/laminas/laminas-zendframework-bridge/releases.atom", - "source": "https://github.com/laminas/laminas-zendframework-bridge" - }, - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], - "time": "2021-12-21T14:34:37+00:00" + "time": "2022-01-21T14:30:01+00:00" }, { "name": "myclabs/deep-copy", @@ -3640,16 +3512,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.11", + "version": "9.5.13", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "2406855036db1102126125537adb1406f7242fdd" + "reference": "597cb647654ede35e43b137926dfdfef0fb11743" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2406855036db1102126125537adb1406f7242fdd", - "reference": "2406855036db1102126125537adb1406f7242fdd", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/597cb647654ede35e43b137926dfdfef0fb11743", + "reference": "597cb647654ede35e43b137926dfdfef0fb11743", "shasum": "" }, "require": { @@ -3727,7 +3599,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.11" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.13" }, "funding": [ { @@ -3739,7 +3611,7 @@ "type": "github" } ], - "time": "2021-12-25T07:07:57+00:00" + "time": "2022-01-24T07:33:35+00:00" }, { "name": "psalm/plugin-phpunit", @@ -4982,16 +4854,16 @@ }, { "name": "symfony/console", - "version": "v5.4.2", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a2c6b7ced2eb7799a35375fb9022519282b5405e" + "reference": "a2a86ec353d825c75856c6fd14fac416a7bdb6b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a2c6b7ced2eb7799a35375fb9022519282b5405e", - "reference": "a2c6b7ced2eb7799a35375fb9022519282b5405e", + "url": "https://api.github.com/repos/symfony/console/zipball/a2a86ec353d825c75856c6fd14fac416a7bdb6b8", + "reference": "a2a86ec353d825c75856c6fd14fac416a7bdb6b8", "shasum": "" }, "require": { @@ -5061,7 +4933,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.2" + "source": "https://github.com/symfony/console/tree/v5.4.3" }, "funding": [ { @@ -5077,7 +4949,7 @@ "type": "tidelift" } ], - "time": "2021-12-20T16:11:12+00:00" + "time": "2022-01-26T16:28:35+00:00" }, { "name": "symfony/deprecation-contracts", @@ -5723,16 +5595,16 @@ }, { "name": "symfony/string", - "version": "v5.4.2", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d" + "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d", - "reference": "e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d", + "url": "https://api.github.com/repos/symfony/string/zipball/92043b7d8383e48104e411bc9434b260dbeb5a10", + "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10", "shasum": "" }, "require": { @@ -5789,7 +5661,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.2" + "source": "https://github.com/symfony/string/tree/v5.4.3" }, "funding": [ { @@ -5805,7 +5677,7 @@ "type": "tidelift" } ], - "time": "2021-12-16T21:52:00+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "theseer/tokenizer", @@ -5859,16 +5731,16 @@ }, { "name": "vimeo/psalm", - "version": "4.18.1", + "version": "4.19.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "dda05fa913f4dc6eb3386f2f7ce5a45d37a71bcb" + "reference": "a2ad69ae4f5ab1f7d225a8dc4e2ec2d9415ed599" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/dda05fa913f4dc6eb3386f2f7ce5a45d37a71bcb", - "reference": "dda05fa913f4dc6eb3386f2f7ce5a45d37a71bcb", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/a2ad69ae4f5ab1f7d225a8dc4e2ec2d9415ed599", + "reference": "a2ad69ae4f5ab1f7d225a8dc4e2ec2d9415ed599", "shasum": "" }, "require": { @@ -5959,9 +5831,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/4.18.1" + "source": "https://github.com/vimeo/psalm/tree/4.19.0" }, - "time": "2022-01-08T21:21:26+00:00" + "time": "2022-01-27T19:00:37+00:00" }, { "name": "webimpress/coding-standard", diff --git a/src/Model/ConsoleModel.php b/src/Model/ConsoleModel.php deleted file mode 100644 index 4edfc1b09..000000000 --- a/src/Model/ConsoleModel.php +++ /dev/null @@ -1,73 +0,0 @@ -options['errorLevel'] = $errorLevel; - return $this; - } - - /** - * @return int - */ - public function getErrorLevel() - { - if (array_key_exists('errorLevel', $this->options)) { - return $this->options['errorLevel']; - } - } - - /** - * Set result text. - * - * @param string $text - * @return ConsoleModel - */ - public function setResult($text) - { - $this->setVariable(self::RESULT, $text); - return $this; - } - - /** - * Get result text. - * - * @return mixed - */ - public function getResult() - { - return $this->getVariable(self::RESULT); - } -} diff --git a/src/Renderer/ConsoleRenderer.php b/src/Renderer/ConsoleRenderer.php deleted file mode 100644 index da4eb946b..000000000 --- a/src/Renderer/ConsoleRenderer.php +++ /dev/null @@ -1,145 +0,0 @@ -init(); - } - - /** @return $this */ - public function setResolver(ResolverInterface $resolver) - { - return $this; - } - - /** - * Return the template engine object - * - * Returns the object instance, as it is its own template engine - * - * @return ConsoleRenderer - */ - public function getEngine() - { - return $this; - } - - /** - * Allow custom object initialization when extending ConsoleRenderer - * - * Triggered by {@link __construct() the constructor} as its final action. - * - * @return void - */ - public function init() - { - } - - /** - * Set filter chain - * - * @return ConsoleRenderer - */ - public function setFilterChain(FilterChain $filters) - { - $this->__filterChain = $filters; - return $this; - } - - /** - * Retrieve filter chain for post-filtering script content - * - * @return FilterChain - */ - public function getFilterChain() - { - if (null === $this->__filterChain) { - $this->__filterChain = new FilterChain(); - } - return $this->__filterChain; - } - - /** - * Recursively processes all ViewModels and returns output. - * - * @param string|ModelInterface $model A ViewModel instance. - * @param null|array|Traversable $values Values to use when rendering. If none - * provided, uses those in the composed - * variables container. - * @return string Console output. - */ - public function render($model, $values = null) - { - if (! $model instanceof ModelInterface) { - return ''; - } - - $result = ''; - $options = $model->getOptions(); - foreach ($options as $setting => $value) { - $method = 'set' . $setting; - if (method_exists($this, $method)) { - $this->$method($value); - } - unset($method, $setting, $value); - } - unset($options); - - $values = $model->getVariables(); - - if (isset($values['result'])) { - // filter and append the result - $result .= $this->getFilterChain()->filter($values['result']); - } - - if ($model->hasChildren()) { - // recursively render all children - foreach ($model->getChildren() as $child) { - $result .= $this->render($child, $values); - } - } - - return $result; - } - - /** - * @see \Laminas\View\Renderer\TreeRendererInterface - * - * @return bool - */ - public function canRenderTrees() - { - return true; - } -} diff --git a/test/Helper/UrlIntegrationTest.php b/test/Helper/UrlIntegrationTest.php index 4e0216407..1f003947b 100644 --- a/test/Helper/UrlIntegrationTest.php +++ b/test/Helper/UrlIntegrationTest.php @@ -4,8 +4,6 @@ namespace LaminasTest\View\Helper; -use Laminas\Console\Console; -use Laminas\Console\Request as ConsoleRequest; use Laminas\Http\Request as HttpRequest; use Laminas\Mvc\Service\ServiceListenerFactory; use Laminas\Mvc\Service\ServiceManagerConfig; @@ -80,7 +78,6 @@ protected function setUp(): void public function testUrlHelperWorksUnderNormalHttpParadigms(): void { - Console::overrideIsConsole(false); $this->serviceManager->get('Application')->bootstrap(); $request = $this->serviceManager->get('Request'); $this->assertInstanceOf(HttpRequest::class, $request); @@ -92,7 +89,6 @@ public function testUrlHelperWorksUnderNormalHttpParadigms(): void public function testUrlHelperWorksWithForceCanonicalFlag(): void { - Console::overrideIsConsole(false); $this->serviceManager->get('Application')->bootstrap(); $request = $this->serviceManager->get('Request'); $this->assertInstanceOf(HttpRequest::class, $request); @@ -104,18 +100,4 @@ public function testUrlHelperWorksWithForceCanonicalFlag(): void $test = $urlHelper('test', [], ['force_canonical' => true]); $this->assertStringContainsString('/test', $test); } - - public function testUrlHelperUnderConsoleParadigmShouldReturnHttpRoutes(): void - { - Console::overrideIsConsole(true); - $this->serviceManager->setAllowOverride(true); - $this->serviceManager->setService('Request', new ConsoleRequest()); - $this->serviceManager->get('Application')->bootstrap(); - $request = $this->serviceManager->get('Request'); - $this->assertInstanceOf(ConsoleRequest::class, $request); - $viewHelpers = $this->serviceManager->get('ViewHelperManager'); - $urlHelper = $viewHelpers->get('url'); - $test = $urlHelper('test'); - $this->assertEquals('/test', $test); - } } diff --git a/test/Model/ConsoleModelTest.php b/test/Model/ConsoleModelTest.php deleted file mode 100644 index 0d38876f4..000000000 --- a/test/Model/ConsoleModelTest.php +++ /dev/null @@ -1,30 +0,0 @@ -assertInstanceOf(ModelInterface::class, $model); - } - - /** - * @see https://github.com/zendframework/zend-view/issues/152 - */ - public function testSetErrorLevelImplementsFluentInterface(): void - { - /** @psalm-suppress DeprecatedClass */ - $model = new ConsoleModel(); - $actual = $model->setErrorLevel(0); - $this->assertSame($model, $actual); - } -}