From a4cf2485a42a2ee2e5092145ae9bccb4a1e9d0ed Mon Sep 17 00:00:00 2001 From: Michel Chowanski Date: Tue, 25 Feb 2020 11:57:16 +0100 Subject: [PATCH] DEN-219: Make bundle symfony 5 compatible / refactor to controller as a service --- README.md | 2 +- composer.json | 6 +- composer.lock | 1170 +++++++++++------ src/Controller/KitchensinkController.php | 98 +- .../BestItKitchensinkExtension.php | 20 +- src/DependencyInjection/Configuration.php | 33 +- src/Resources/config/routing.yml | 3 + src/Resources/config/services.yml | 8 + src/resources/config/routing.yml | 3 - tests/ContainerProviderTrait.php | 62 - .../Controller/KitchensinkControllerTest.php | 99 +- .../BestItKitchensinkExtensionTest.php | 105 +- 12 files changed, 942 insertions(+), 667 deletions(-) create mode 100644 src/Resources/config/routing.yml create mode 100644 src/Resources/config/services.yml delete mode 100644 src/resources/config/routing.yml delete mode 100644 tests/ContainerProviderTrait.php diff --git a/README.md b/README.md index 838af7e..9e91954 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,6 @@ best_it_kitchensink: ```yaml # routing_dev.yml best_it_kitchensink: - resource: "@BestItKitchensinkBundle/resources/config/routing.yml" + resource: "@BestItKitchensinkBundle/Resources/config/routing.yml" ``` diff --git a/composer.json b/composer.json index c937379..9aecadc 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,11 @@ }, "require": { "php": "^7.0", - "symfony/symfony": "^3.1" + "symfony/http-kernel": "^3.1 || ^4.0 || ^5.0", + "symfony/dependency-injection": "^3.1 || ^4.0 || ^5.0", + "symfony/config": "^3.1 || ^4.0 || ^5.0", + "symfony/yaml": "^3.1 || ^4.0 || ^5.0", + "twig/twig": "^2.12 || ^3.0" }, "require-dev": { "squizlabs/php_codesniffer": "^2.7", diff --git a/composer.lock b/composer.lock index 91b45b1..b38b044 100644 --- a/composer.lock +++ b/composer.lock @@ -1,37 +1,37 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e69c33e45d216259330d59e3aa8eb882", + "content-hash": "5d4e50b726c33205301ab73109bed019", "packages": [ { "name": "doctrine/annotations", - "version": "v1.4.0", + "version": "v1.8.0", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "54cacc9b81758b14e3ce750f205a393d52339e97" + "reference": "904dca4eb10715b92569fbcd79e201d5c349b6bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97", - "reference": "54cacc9b81758b14e3ce750f205a393d52339e97", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/904dca4eb10715b92569fbcd79e201d5c349b6bc", + "reference": "904dca4eb10715b92569fbcd79e201d5c349b6bc", "shasum": "" }, "require": { "doctrine/lexer": "1.*", - "php": "^5.6 || ^7.0" + "php": "^7.1" }, "require-dev": { "doctrine/cache": "1.*", - "phpunit/phpunit": "^5.7" + "phpunit/phpunit": "^7.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { @@ -44,6 +44,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -52,10 +56,6 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -72,37 +72,42 @@ "docblock", "parser" ], - "time": "2017-02-24T16:22:25+00:00" + "time": "2019-10-01T18:55:10+00:00" }, { "name": "doctrine/cache", - "version": "v1.6.1", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "b6f544a20f4807e81f7044d31e679ccbb1866dc3" + "reference": "382e7f4db9a12dc6c19431743a2b096041bcdd62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/b6f544a20f4807e81f7044d31e679ccbb1866dc3", - "reference": "b6f544a20f4807e81f7044d31e679ccbb1866dc3", + "url": "https://api.github.com/repos/doctrine/cache/zipball/382e7f4db9a12dc6c19431743a2b096041bcdd62", + "reference": "382e7f4db9a12dc6c19431743a2b096041bcdd62", "shasum": "" }, "require": { - "php": "~5.5|~7.0" + "php": "~7.1" }, "conflict": { "doctrine/common": ">2.2,<2.4" }, "require-dev": { - "phpunit/phpunit": "~4.8|~5.0", - "predis/predis": "~1.0", - "satooshi/php-coveralls": "~0.6" + "alcaeus/mongo-php-adapter": "^1.1", + "doctrine/coding-standard": "^6.0", + "mongodb/mongodb": "^1.1", + "phpunit/phpunit": "^7.0", + "predis/predis": "~1.0" + }, + "suggest": { + "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.9.x-dev" } }, "autoload": { @@ -115,6 +120,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -123,10 +132,6 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -136,44 +141,53 @@ "email": "schmittjoh@gmail.com" } ], - "description": "Caching library offering an object-oriented API for many cache backends", - "homepage": "http://www.doctrine-project.org", + "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", + "homepage": "https://www.doctrine-project.org/projects/cache.html", "keywords": [ + "abstraction", + "apcu", "cache", - "caching" - ], - "time": "2016-10-29T11:16:17+00:00" + "caching", + "couchdb", + "memcached", + "php", + "redis", + "xcache" + ], + "time": "2019-11-29T15:36:20+00:00" }, { "name": "doctrine/collections", - "version": "v1.4.0", + "version": "1.6.4", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba" + "reference": "6b1e4b2b66f6d6e49983cebfe23a21b7ccc5b0d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/1a4fb7e902202c33cce8c55989b945612943c2ba", - "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba", + "url": "https://api.github.com/repos/doctrine/collections/zipball/6b1e4b2b66f6d6e49983cebfe23a21b7ccc5b0d7", + "reference": "6b1e4b2b66f6d6e49983cebfe23a21b7ccc5b0d7", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.1.3" }, "require-dev": { - "doctrine/coding-standard": "~0.1@dev", - "phpunit/phpunit": "^5.7" + "doctrine/coding-standard": "^6.0", + "phpstan/phpstan-shim": "^0.9.2", + "phpunit/phpunit": "^7.0", + "vimeo/psalm": "^3.2.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { - "psr-0": { - "Doctrine\\Common\\Collections\\": "lib/" + "psr-4": { + "Doctrine\\Common\\Collections\\": "lib/Doctrine/Common/Collections" } }, "notification-url": "https://packagist.org/downloads/", @@ -181,6 +195,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -189,10 +207,6 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -202,44 +216,53 @@ "email": "schmittjoh@gmail.com" } ], - "description": "Collections Abstraction library", - "homepage": "http://www.doctrine-project.org", + "description": "PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.", + "homepage": "https://www.doctrine-project.org/projects/collections.html", "keywords": [ "array", "collections", - "iterator" + "iterators", + "php" ], - "time": "2017-01-03T10:49:41+00:00" + "time": "2019-11-13T13:07:11+00:00" }, { "name": "doctrine/common", - "version": "v2.7.2", + "version": "2.12.0", "source": { "type": "git", "url": "https://github.com/doctrine/common.git", - "reference": "930297026c8009a567ac051fd545bf6124150347" + "reference": "2053eafdf60c2172ee1373d1b9289ba1db7f1fc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/930297026c8009a567ac051fd545bf6124150347", - "reference": "930297026c8009a567ac051fd545bf6124150347", + "url": "https://api.github.com/repos/doctrine/common/zipball/2053eafdf60c2172ee1373d1b9289ba1db7f1fc6", + "reference": "2053eafdf60c2172ee1373d1b9289ba1db7f1fc6", "shasum": "" }, "require": { - "doctrine/annotations": "1.*", - "doctrine/cache": "1.*", - "doctrine/collections": "1.*", - "doctrine/inflector": "1.*", - "doctrine/lexer": "1.*", - "php": "~5.6|~7.0" + "doctrine/annotations": "^1.0", + "doctrine/cache": "^1.0", + "doctrine/collections": "^1.0", + "doctrine/event-manager": "^1.0", + "doctrine/inflector": "^1.0", + "doctrine/lexer": "^1.0", + "doctrine/persistence": "^1.1", + "doctrine/reflection": "^1.0", + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^5.4.6" + "doctrine/coding-standard": "^1.0", + "phpstan/phpstan": "^0.11", + "phpstan/phpstan-phpunit": "^0.11", + "phpunit/phpunit": "^7.0", + "squizlabs/php_codesniffer": "^3.0", + "symfony/phpunit-bridge": "^4.0.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7.x-dev" + "dev-master": "2.11.x-dev" } }, "autoload": { @@ -252,6 +275,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -260,10 +287,80 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "PHP Doctrine Common project is a library that provides additional functionality that other Doctrine projects depend on such as better reflection support, persistence interfaces, proxies, event system and much more.", + "homepage": "https://www.doctrine-project.org/projects/common.html", + "keywords": [ + "common", + "doctrine", + "php" + ], + "time": "2020-01-10T15:49:25+00:00" + }, + { + "name": "doctrine/event-manager", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/event-manager.git", + "reference": "629572819973f13486371cb611386eb17851e85c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/629572819973f13486371cb611386eb17851e85c", + "reference": "629572819973f13486371cb611386eb17851e85c", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "conflict": { + "doctrine/common": "<2.9@dev" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "lib/Doctrine/Common" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ { "name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com" }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -271,48 +368,52 @@ { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" } ], - "description": "Common Library for Doctrine projects", - "homepage": "http://www.doctrine-project.org", + "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.", + "homepage": "https://www.doctrine-project.org/projects/event-manager.html", "keywords": [ - "annotations", - "collections", - "eventmanager", - "persistence", - "spl" + "event", + "event dispatcher", + "event manager", + "event system", + "events" ], - "time": "2017-01-13T14:02:13+00:00" + "time": "2019-11-10T09:48:07+00:00" }, { "name": "doctrine/inflector", - "version": "v1.1.0", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "90b2128806bfde671b6952ab8bea493942c1fdae" + "reference": "ec3a55242203ffa6a4b27c58176da97ff0a7aec1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae", - "reference": "90b2128806bfde671b6952ab8bea493942c1fdae", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/ec3a55242203ffa6a4b27c58176da97ff0a7aec1", + "reference": "ec3a55242203ffa6a4b27c58176da97ff0a7aec1", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "4.*" + "phpunit/phpunit": "^6.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { - "psr-0": { - "Doctrine\\Common\\Inflector\\": "lib/" + "psr-4": { + "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" } }, "notification-url": "https://packagist.org/downloads/", @@ -320,6 +421,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -328,10 +433,6 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -349,34 +450,39 @@ "singularize", "string" ], - "time": "2015-11-06T14:35:42+00:00" + "time": "2019-10-30T19:59:35+00:00" }, { "name": "doctrine/lexer", - "version": "v1.0.1", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" + "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", + "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^7.2" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "phpstan/phpstan": "^0.11.8", + "phpunit/phpunit": "^8.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { - "psr-0": { - "Doctrine\\Common\\Lexer\\": "lib/" + "psr-4": { + "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" } }, "notification-url": "https://packagist.org/downloads/", @@ -384,55 +490,226 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "keywords": [ + "annotations", + "docblock", + "lexer", + "parser", + "php" + ], + "time": "2019-10-30T14:39:59+00:00" + }, + { + "name": "doctrine/persistence", + "version": "1.3.6", + "source": { + "type": "git", + "url": "https://github.com/doctrine/persistence.git", + "reference": "5dd3ac5eebef2d0b074daa4440bb18f93132dee4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/persistence/zipball/5dd3ac5eebef2d0b074daa4440bb18f93132dee4", + "reference": "5dd3ac5eebef2d0b074daa4440bb18f93132dee4", + "shasum": "" + }, + "require": { + "doctrine/annotations": "^1.0", + "doctrine/cache": "^1.0", + "doctrine/collections": "^1.0", + "doctrine/event-manager": "^1.0", + "doctrine/reflection": "^1.1", + "php": "^7.1" + }, + "conflict": { + "doctrine/common": "<2.10@dev" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "phpstan/phpstan": "^0.11", + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "lib/Doctrine/Common", + "Doctrine\\Persistence\\": "lib/Doctrine/Persistence" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ { "name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com" }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" } ], - "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "http://www.doctrine-project.org", + "description": "The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share.", + "homepage": "https://doctrine-project.org/projects/persistence.html", "keywords": [ - "lexer", - "parser" + "mapper", + "object", + "odm", + "orm", + "persistence" ], - "time": "2014-09-09T13:34:57+00:00" + "time": "2020-01-16T22:06:23+00:00" }, { - "name": "paragonie/random_compat", - "version": "v2.0.4", + "name": "doctrine/reflection", + "version": "v1.1.0", "source": { "type": "git", - "url": "https://github.com/paragonie/random_compat.git", - "reference": "a9b97968bcde1c4de2a5ec6cbd06a0f6c919b46e" + "url": "https://github.com/doctrine/reflection.git", + "reference": "bc420ead87fdfe08c03ecc3549db603a45b06d4c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/a9b97968bcde1c4de2a5ec6cbd06a0f6c919b46e", - "reference": "a9b97968bcde1c4de2a5ec6cbd06a0f6c919b46e", + "url": "https://api.github.com/repos/doctrine/reflection/zipball/bc420ead87fdfe08c03ecc3549db603a45b06d4c", + "reference": "bc420ead87fdfe08c03ecc3549db603a45b06d4c", "shasum": "" }, "require": { - "php": ">=5.2.0" + "doctrine/annotations": "^1.0", + "ext-tokenizer": "*", + "php": "^7.1" + }, + "conflict": { + "doctrine/common": "<2.9" }, "require-dev": { - "phpunit/phpunit": "4.*|5.*" + "doctrine/coding-standard": "^5.0", + "doctrine/common": "^2.10", + "phpstan/phpstan": "^0.11.0", + "phpstan/phpstan-phpunit": "^0.11.0", + "phpunit/phpunit": "^7.0" }, - "suggest": { - "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "lib/Doctrine/Common" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "The Doctrine Reflection project is a simple library used by the various Doctrine projects which adds some additional functionality on top of the reflection functionality that comes with PHP. It allows you to get the reflection information about classes, methods and properties statically.", + "homepage": "https://www.doctrine-project.org/projects/reflection.html", + "keywords": [ + "reflection", + "static" + ], + "time": "2020-01-08T19:53:19+00:00" + }, + { + "name": "fig/link-util", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/link-util.git", + "reference": "47f55860678a9e202206047bc02767556d298106" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/link-util/zipball/47f55860678a9e202206047bc02767556d298106", + "reference": "47f55860678a9e202206047bc02767556d298106", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "psr/link": "~1.0@dev" + }, + "provide": { + "psr/link-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.1", + "squizlabs/php_codesniffer": "^2.3.1" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, "autoload": { - "files": [ - "lib/random.php" - ] + "psr-4": { + "Fig\\Link\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -440,18 +717,20 @@ ], "authors": [ { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "description": "Common utility implementations for HTTP links", "keywords": [ - "csprng", - "pseudorandom", - "random" + "http", + "http-link", + "link", + "psr", + "psr-13", + "rest" ], - "time": "2016-11-07T23:38:38+00:00" + "time": "2019-12-18T15:40:05+00:00" }, { "name": "psr/cache", @@ -499,18 +778,116 @@ ], "time": "2016-08-06T20:24:11+00:00" }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/link", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/link.git", + "reference": "eea8e8662d5cd3ae4517c9b864493f59fca95562" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/link/zipball/eea8e8662d5cd3ae4517c9b864493f59fca95562", + "reference": "eea8e8662d5cd3ae4517c9b864493f59fca95562", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Link\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for HTTP links", + "keywords": [ + "http", + "http-link", + "link", + "psr", + "psr-13", + "rest" + ], + "time": "2016-10-28T16:06:13+00:00" + }, { "name": "psr/log", - "version": "1.0.2", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", "shasum": "" }, "require": { @@ -519,7 +896,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -544,39 +921,35 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2019-11-01T11:05:21+00:00" }, { - "name": "symfony/polyfill-intl-icu", - "version": "v1.3.0", + "name": "psr/simple-cache", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-intl-icu.git", - "reference": "2d6e2b20d457603eefb6e614286c22efca30fdb4" + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/2d6e2b20d457603eefb6e614286c22efca30fdb4", - "reference": "2d6e2b20d457603eefb6e614286c22efca30fdb4", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", "shasum": "" }, "require": { - "php": ">=5.3.3", - "symfony/intl": "~2.3|~3.0" - }, - "suggest": { - "ext-intl": "For best performance" + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { - "files": [ - "bootstrap.php" - ] + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -584,55 +957,49 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "Symfony polyfill for intl's ICU-related data and classes", - "homepage": "https://symfony.com", + "description": "Common interfaces for simple caching", "keywords": [ - "compatibility", - "icu", - "intl", - "polyfill", - "portable", - "shim" + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" ], - "time": "2016-11-14T01:06:16+00:00" + "time": "2017-10-23T01:57:42+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.3.0", + "name": "symfony/polyfill-ctype", + "version": "v1.14.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/fbdeaec0df06cf3d51c93de80c7eb76e271f5a38", + "reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38", "shasum": "" }, "require": { "php": ">=5.3.3" }, "suggest": { - "ext-mbstring": "For best performance" + "ext-ctype": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.14-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" + "Symfony\\Polyfill\\Ctype\\": "" }, "files": [ "bootstrap.php" @@ -644,53 +1011,52 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for the Mbstring extension", + "description": "Symfony polyfill for ctype functions", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "mbstring", + "ctype", "polyfill", - "portable", - "shim" + "portable" ], - "time": "2016-11-14T01:06:16+00:00" + "time": "2020-01-13T11:15:53+00:00" }, { - "name": "symfony/polyfill-php56", - "version": "v1.3.0", + "name": "symfony/polyfill-intl-icu", + "version": "v1.14.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php56.git", - "reference": "1dd42b9b89556f18092f3d1ada22cb05ac85383c" + "url": "https://github.com/symfony/polyfill-intl-icu.git", + "reference": "727b3bb5bfa7ca9eeb86416784cf1c08a6289b86" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/1dd42b9b89556f18092f3d1ada22cb05ac85383c", - "reference": "1dd42b9b89556f18092f3d1ada22cb05ac85383c", + "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/727b3bb5bfa7ca9eeb86416784cf1c08a6289b86", + "reference": "727b3bb5bfa7ca9eeb86416784cf1c08a6289b86", "shasum": "" }, "require": { "php": ">=5.3.3", - "symfony/polyfill-util": "~1.0" + "symfony/intl": "~2.3|~3.0|~4.0|~5.0" + }, + "suggest": { + "ext-intl": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.14-dev" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php56\\": "" - }, "files": [ "bootstrap.php" ] @@ -709,49 +1075,50 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions", + "description": "Symfony polyfill for intl's ICU-related data and classes", "homepage": "https://symfony.com", "keywords": [ "compatibility", + "icu", + "intl", "polyfill", "portable", "shim" ], - "time": "2016-11-14T01:06:16+00:00" + "time": "2020-01-13T11:15:53+00:00" }, { - "name": "symfony/polyfill-php70", - "version": "v1.3.0", + "name": "symfony/polyfill-mbstring", + "version": "v1.14.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "13ce343935f0f91ca89605a2f6ca6f5c2f3faac2" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "34094cfa9abe1f0f14f48f490772db7a775559f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/13ce343935f0f91ca89605a2f6ca6f5c2f3faac2", - "reference": "13ce343935f0f91ca89605a2f6ca6f5c2f3faac2", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/34094cfa9abe1f0f14f48f490772db7a775559f2", + "reference": "34094cfa9abe1f0f14f48f490772db7a775559f2", "shasum": "" }, "require": { - "paragonie/random_compat": "~1.0|~2.0", "php": ">=5.3.3" }, + "suggest": { + "ext-mbstring": "For best performance" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.14-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Php70\\": "" + "Symfony\\Polyfill\\Mbstring\\": "" }, "files": [ "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -768,28 +1135,29 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", + "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", "keywords": [ "compatibility", + "mbstring", "polyfill", "portable", "shim" ], - "time": "2016-11-14T01:06:16+00:00" + "time": "2020-01-13T11:15:53+00:00" }, { - "name": "symfony/polyfill-util", - "version": "v1.3.0", + "name": "symfony/polyfill-php72", + "version": "v1.14.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-util.git", - "reference": "746bce0fca664ac0a575e465f65c6643faddf7fb" + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "46ecacf4751dd0dc81e4f6bf01dbf9da1dc1dadf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/746bce0fca664ac0a575e465f65c6643faddf7fb", - "reference": "746bce0fca664ac0a575e465f65c6643faddf7fb", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/46ecacf4751dd0dc81e4f6bf01dbf9da1dc1dadf", + "reference": "46ecacf4751dd0dc81e4f6bf01dbf9da1dc1dadf", "shasum": "" }, "require": { @@ -798,13 +1166,16 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.14-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Util\\": "" - } + "Symfony\\Polyfill\\Php72\\": "" + }, + "files": [ + "bootstrap.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -820,54 +1191,60 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony utilities for portability of PHP codes", + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ - "compat", "compatibility", "polyfill", + "portable", "shim" ], - "time": "2016-11-14T01:06:16+00:00" + "time": "2020-01-13T11:15:53+00:00" }, { "name": "symfony/symfony", - "version": "v3.2.4", + "version": "v4.0.0", "source": { "type": "git", "url": "https://github.com/symfony/symfony.git", - "reference": "141569be5b33a7cf0d141fb88422649fe11b0c47" + "reference": "26ca7023b1c45dce951da7206ed70049267d27bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/symfony/zipball/141569be5b33a7cf0d141fb88422649fe11b0c47", - "reference": "141569be5b33a7cf0d141fb88422649fe11b0c47", + "url": "https://api.github.com/repos/symfony/symfony/zipball/26ca7023b1c45dce951da7206ed70049267d27bc", + "reference": "26ca7023b1c45dce951da7206ed70049267d27bc", "shasum": "" }, "require": { "doctrine/common": "~2.4", - "php": ">=5.5.9", + "ext-xml": "*", + "fig/link-util": "^1.0", + "php": "^7.1.3", "psr/cache": "~1.0", + "psr/container": "^1.0", + "psr/link": "^1.0", "psr/log": "~1.0", + "psr/simple-cache": "^1.0", "symfony/polyfill-intl-icu": "~1.0", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php56": "~1.0", - "symfony/polyfill-php70": "~1.0", - "symfony/polyfill-util": "~1.0", - "twig/twig": "~1.28|~2.0" + "symfony/polyfill-php72": "~1.5", + "twig/twig": "^1.35|^2.4.4" }, "conflict": { - "phpdocumentor/reflection-docblock": "<3.0", - "phpdocumentor/type-resolver": "<0.2.0" + "phpdocumentor/reflection-docblock": "<3.0||>=3.2.0,<3.2.2", + "phpdocumentor/type-resolver": "<0.2.1", + "phpunit/phpunit": "<5.4.3" }, "provide": { - "psr/cache-implementation": "1.0" + "psr/cache-implementation": "1.0", + "psr/container-implementation": "1.0", + "psr/log-implementation": "1.0", + "psr/simple-cache-implementation": "1.0" }, "replace": { "symfony/asset": "self.version", "symfony/browser-kit": "self.version", "symfony/cache": "self.version", - "symfony/class-loader": "self.version", "symfony/config": "self.version", "symfony/console": "self.version", "symfony/css-selector": "self.version", @@ -876,6 +1253,7 @@ "symfony/dependency-injection": "self.version", "symfony/doctrine-bridge": "self.version", "symfony/dom-crawler": "self.version", + "symfony/dotenv": "self.version", "symfony/event-dispatcher": "self.version", "symfony/expression-language": "self.version", "symfony/filesystem": "self.version", @@ -887,6 +1265,7 @@ "symfony/inflector": "self.version", "symfony/intl": "self.version", "symfony/ldap": "self.version", + "symfony/lock": "self.version", "symfony/monolog-bridge": "self.version", "symfony/options-resolver": "self.version", "symfony/process": "self.version", @@ -908,12 +1287,15 @@ "symfony/twig-bundle": "self.version", "symfony/validator": "self.version", "symfony/var-dumper": "self.version", + "symfony/web-link": "self.version", "symfony/web-profiler-bundle": "self.version", + "symfony/web-server-bundle": "self.version", "symfony/workflow": "self.version", "symfony/yaml": "self.version" }, "require-dev": { "cache/integration-tests": "dev-master", + "doctrine/annotations": "~1.0", "doctrine/cache": "~1.6", "doctrine/data-fixtures": "1.0.*", "doctrine/dbal": "~2.4", @@ -922,17 +1304,15 @@ "egulias/email-validator": "~1.2,>=1.2.8|~2.0", "monolog/monolog": "~1.11", "ocramius/proxy-manager": "~0.4|~1.0|~2.0", - "phpdocumentor/reflection-docblock": "^3.0", + "phpdocumentor/reflection-docblock": "^3.0|^4.0", "predis/predis": "~1.0", - "sensio/framework-extra-bundle": "^3.0.2", - "symfony/phpunit-bridge": "~3.2", - "symfony/polyfill-apcu": "~1.1", + "symfony/phpunit-bridge": "~3.4|~4.0", "symfony/security-acl": "~2.8|~3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -940,7 +1320,6 @@ "Symfony\\Bridge\\Doctrine\\": "src/Symfony/Bridge/Doctrine/", "Symfony\\Bridge\\Monolog\\": "src/Symfony/Bridge/Monolog/", "Symfony\\Bridge\\ProxyManager\\": "src/Symfony/Bridge/ProxyManager/", - "Symfony\\Bridge\\Swiftmailer\\": "src/Symfony/Bridge/Swiftmailer/", "Symfony\\Bridge\\Twig\\": "src/Symfony/Bridge/Twig/", "Symfony\\Bundle\\": "src/Symfony/Bundle/", "Symfony\\Component\\": "src/Symfony/Component/" @@ -971,40 +1350,43 @@ "keywords": [ "framework" ], - "time": "2017-02-17T00:00:43+00:00" + "time": "2017-11-30T17:44:08+00:00" }, { "name": "twig/twig", - "version": "v2.2.0", + "version": "v2.12.5", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "29bb02dde09ff56291d30f7687eb8696918023af" + "reference": "18772e0190734944277ee97a02a9a6c6555fcd94" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/29bb02dde09ff56291d30f7687eb8696918023af", - "reference": "29bb02dde09ff56291d30f7687eb8696918023af", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/18772e0190734944277ee97a02a9a6c6555fcd94", + "reference": "18772e0190734944277ee97a02a9a6c6555fcd94", "shasum": "" }, "require": { "php": "^7.0", - "symfony/polyfill-mbstring": "~1.0" + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-mbstring": "^1.3" }, "require-dev": { "psr/container": "^1.0", - "symfony/debug": "~2.7", - "symfony/phpunit-bridge": "~3.2" + "symfony/phpunit-bridge": "^4.4|^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-master": "2.12-dev" } }, "autoload": { "psr-0": { "Twig_": "lib/" + }, + "psr-4": { + "Twig\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1018,54 +1400,55 @@ "homepage": "http://fabien.potencier.org", "role": "Lead Developer" }, + { + "name": "Twig Team", + "role": "Contributors" + }, { "name": "Armin Ronacher", "email": "armin.ronacher@active-4.com", "role": "Project Founder" - }, - { - "name": "Twig Team", - "homepage": "http://twig.sensiolabs.org/contributors", - "role": "Contributors" } ], "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "http://twig.sensiolabs.org", + "homepage": "https://twig.symfony.com", "keywords": [ "templating" ], - "time": "2017-02-27T00:16:20+00:00" + "time": "2020-02-11T15:31:23+00:00" } ], "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.0.5", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1" }, "require-dev": { - "athletic/athletic": "~0.1.8", + "doctrine/coding-standard": "^6.0", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpbench/phpbench": "^0.13", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-shim": "^0.11", + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -1085,46 +1468,52 @@ } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", "keywords": [ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2019-10-21T16:45:58+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.6.0", + "version": "1.9.5", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe" + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/5a5a9fc8025a08d8919be87d6884d5a92520cefe", - "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef", + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" }, "require-dev": { - "doctrine/collections": "1.*", - "phpunit/phpunit": "~4.1" + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" }, "type": "library", "autoload": { "psr-4": { "DeepCopy\\": "src/DeepCopy/" - } + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "Create deep copies (clones) of your objects", - "homepage": "https://github.com/myclabs/DeepCopy", "keywords": [ "clone", "copy", @@ -1132,39 +1521,37 @@ "object", "object graph" ], - "time": "2017-01-26T22:05:40+00:00" + "time": "2020-01-17T21:11:47+00:00" }, { "name": "phpdocumentor/reflection-common", - "version": "1.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", + "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", "shasum": "" }, "require": { - "php": ">=5.5" + "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "^4.6" + "phpunit/phpunit": "~6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] + "phpDocumentor\\Reflection\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1186,38 +1573,42 @@ "reflection", "static analysis" ], - "time": "2015-12-27T11:43:31+00:00" + "time": "2018-08-07T13:53:10+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.1.1", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" + "reference": "a48807183a4b819072f26e347bbd0b5199a9d15f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/a48807183a4b819072f26e347bbd0b5199a9d15f", + "reference": "a48807183a4b819072f26e347bbd0b5199a9d15f", "shasum": "" }, "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.2.0", - "webmozart/assert": "^1.0" + "ext-filter": "^7.1", + "php": "^7.2", + "phpdocumentor/reflection-common": "^2.0", + "phpdocumentor/type-resolver": "^1.0", + "webmozart/assert": "^1" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" + "doctrine/instantiator": "^1", + "mockery/mockery": "^1" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1228,44 +1619,47 @@ { "name": "Mike van Riel", "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-09-30T07:12:33+00:00" + "time": "2020-02-09T09:16:15+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.2.1", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" + "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", + "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", "shasum": "" }, "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0" + "php": "^7.1", + "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" + "ext-tokenizer": "^7.1", + "mockery/mockery": "~1", + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1278,42 +1672,43 @@ "email": "me@mikevanriel.com" } ], - "time": "2016-11-25T06:54:22+00:00" + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "time": "2019-08-22T18:11:29+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.6.2", + "version": "v1.10.2", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "6c52c2722f8460122f96f86346600e1077ce22cb" + "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/6c52c2722f8460122f96f86346600e1077ce22cb", - "reference": "6c52c2722f8460122f96f86346600e1077ce22cb", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b4400efc9d206e83138e2bb97ed7f5b14b831cd9", + "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", - "sebastian/comparator": "^1.1", - "sebastian/recursion-context": "^1.0|^2.0" + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", + "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" }, "require-dev": { - "phpspec/phpspec": "^2.0", - "phpunit/phpunit": "^4.8 || ^5.6.5" + "phpspec/phpspec": "^2.5 || ^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.10.x-dev" } }, "autoload": { - "psr-0": { - "Prophecy\\": "src/" + "psr-4": { + "Prophecy\\": "src/Prophecy" } }, "notification-url": "https://packagist.org/downloads/", @@ -1341,39 +1736,39 @@ "spy", "stub" ], - "time": "2016-11-21T14:58:47+00:00" + "time": "2020-01-20T15:57:02+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "4.0.6", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ca060f645beeddebedb1885c97bf163e93264c35" + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ca060f645beeddebedb1885c97bf163e93264c35", - "reference": "ca060f645beeddebedb1885c97bf163e93264c35", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", "shasum": "" }, "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", "php": "^5.6 || ^7.0", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", "phpunit/php-token-stream": "^1.4.2 || ^2.0", - "sebastian/code-unit-reverse-lookup": "~1.0", + "sebastian/code-unit-reverse-lookup": "^1.0", "sebastian/environment": "^1.3.2 || ^2.0", - "sebastian/version": "~1.0|~2.0" + "sebastian/version": "^1.0 || ^2.0" }, "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "^5.4" + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" }, "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.4.0", - "ext-xmlwriter": "*" + "ext-xdebug": "^2.5.1" }, "type": "library", "extra": { @@ -1404,20 +1799,20 @@ "testing", "xunit" ], - "time": "2017-02-23T07:38:02+00:00" + "time": "2017-04-02T07:44:40+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": { @@ -1451,7 +1846,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03T07:40:28+00:00" + "time": "2017-11-27T13:52:08+00:00" }, { "name": "phpunit/php-text-template", @@ -1545,29 +1940,29 @@ }, { "name": "phpunit/php-token-stream", - "version": "1.4.10", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "284fb0679dd25fb5ffb56dad92c72860c0a22f1b" + "reference": "791198a2c6254db10131eecfe8c06670700904db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/284fb0679dd25fb5ffb56dad92c72860c0a22f1b", - "reference": "284fb0679dd25fb5ffb56dad92c72860c0a22f1b", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^6.2.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1590,20 +1985,20 @@ "keywords": [ "tokenizer" ], - "time": "2017-02-23T06:14:45+00:00" + "time": "2017-11-27T05:48:46+00:00" }, { "name": "phpunit/phpunit", - "version": "5.7.14", + "version": "5.7.27", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "4906b8faf23e42612182fd212eb6f4c0f2954b57" + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4906b8faf23e42612182fd212eb6f4c0f2954b57", - "reference": "4906b8faf23e42612182fd212eb6f4c0f2954b57", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", "shasum": "" }, "require": { @@ -1621,14 +2016,14 @@ "phpunit/php-timer": "^1.0.6", "phpunit/phpunit-mock-objects": "^3.2", "sebastian/comparator": "^1.2.4", - "sebastian/diff": "~1.2", + "sebastian/diff": "^1.4.3", "sebastian/environment": "^1.3.4 || ^2.0", "sebastian/exporter": "~2.0", "sebastian/global-state": "^1.1", "sebastian/object-enumerator": "~2.0", "sebastian/resource-operations": "~1.0", - "sebastian/version": "~1.0.3|~2.0", - "symfony/yaml": "~2.1|~3.0" + "sebastian/version": "^1.0.6|^2.0.1", + "symfony/yaml": "~2.1|~3.0|~4.0" }, "conflict": { "phpdocumentor/reflection-docblock": "3.0.2" @@ -1672,20 +2067,20 @@ "testing", "xunit" ], - "time": "2017-02-19T07:22:16+00:00" + "time": "2018-02-01T05:50:59+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "3.4.3", + "version": "3.4.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24" + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", - "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", "shasum": "" }, "require": { @@ -1731,27 +2126,28 @@ "mock", "xunit" ], - "time": "2016-12-08T20:27:08+00:00" + "abandoned": true, + "time": "2017-06-30T09:13:00+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe" + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/c36f5e7cfce482fde5bf8d10d41a53591e0198fe", - "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", "shasum": "" }, "require": { - "php": ">=5.6" + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~5" + "phpunit/phpunit": "^5.7 || ^6.0" }, "type": "library", "extra": { @@ -1776,7 +2172,7 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2016-02-13T06:45:14+00:00" + "time": "2017-03-04T06:30:41+00:00" }, { "name": "sebastian/comparator", @@ -1844,23 +2240,23 @@ }, { "name": "sebastian/diff", - "version": "1.4.1", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.8" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", "extra": { @@ -1892,7 +2288,7 @@ "keywords": [ "diff" ], - "time": "2015-12-08T07:14:41+00:00" + "time": "2017-05-22T07:24:03+00:00" }, { "name": "sebastian/environment", @@ -2248,16 +2644,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "2.8.0", + "version": "2.9.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "86dd55a522238211f9f3631e3361703578941d9a" + "reference": "2acf168de78487db620ab4bc524135a13cfe6745" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/86dd55a522238211f9f3631e3361703578941d9a", - "reference": "86dd55a522238211f9f3631e3361703578941d9a", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", + "reference": "2acf168de78487db620ab4bc524135a13cfe6745", "shasum": "" }, "require": { @@ -2322,35 +2718,33 @@ "phpcs", "standards" ], - "time": "2017-02-02T03:30:00+00:00" + "time": "2018-11-07T22:31:41+00:00" }, { "name": "webmozart/assert", - "version": "1.2.0", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" + "reference": "aed98a490f9a8f78468232db345ab9cf606cf598" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", + "url": "https://api.github.com/repos/webmozart/assert/zipball/aed98a490f9a8f78468232db345ab9cf606cf598", + "reference": "aed98a490f9a8f78468232db345ab9cf606cf598", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "vimeo/psalm": "<3.6.0" }, "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" + "phpunit/phpunit": "^4.8.36 || ^7.5.13" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -2372,7 +2766,7 @@ "check", "validate" ], - "time": "2016-11-23T20:04:58+00:00" + "time": "2020-02-14T12:15:55+00:00" } ], "aliases": [], diff --git a/src/Controller/KitchensinkController.php b/src/Controller/KitchensinkController.php index 5a65876..f2f7e3f 100644 --- a/src/Controller/KitchensinkController.php +++ b/src/Controller/KitchensinkController.php @@ -3,107 +3,87 @@ namespace BestIt\KitchensinkBundle\Controller; use BestIt\KitchensinkBundle\DataProviderInterface; -use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Response; +use Twig\Environment; +use Twig\Error\LoaderError; +use Twig\Error\RuntimeError; +use Twig\Error\SyntaxError; /** * Simple kitchensink controller. + * * @author blange * @package BestIt\KitchensinkBundle - * @subpackage Controller - * @version $id$ */ -class KitchensinkController extends Controller +class KitchensinkController { /** * The data provider. - * @var DataProviderInterface|void + * + * @var DataProviderInterface */ - private $dataProvider = null; + private $dataProvider; /** - * The template name. - * @var string + * The template engine + * + * @var Environment */ - private $templateName = ''; + private $templateEngine; /** - * Returns the data provider. - * @return DataProviderInterface + * The template name. + * + * @var string */ - public function getDataProvider(): DataProviderInterface - { - if (!$this->dataProvider) { - $this->setDataProvider($this->container->get('best_it_kitchensink.data_provider')); - } - - return $this->dataProvider; - } + private $templateName; /** - * Returns the template name. - * @return string + * KitchensinkController constructor. + * + * @param DataProviderInterface $provider + * @param Environment $engine + * @param string $template */ - public function getTemplateName(): string + public function __construct(DataProviderInterface $provider, Environment $engine, string $template) { - if (!$this->templateName) { - $this->setTemplateName($this->container->getParameter('best_it_kitchensink.template')); - } - - return $this->templateName; + $this->dataProvider = $provider; + $this->templateEngine = $engine; + $this->templateName = $template; } /** * Returns the view data from the data provider. + * * @return array */ - protected function getViewData(): array + private function getViewData(): array { - $dataProvider = $this->getDataProvider(); $viewData = []; - foreach ($dataProvider->getTemplateVars() as $key => $value) { + foreach ($this->dataProvider->getTemplateVars() as $key => $value) { $withGetter = !is_numeric($key); $viewData[!$withGetter ? $value : $key] = !$withGetter - ? $dataProvider->{'get' . ucfirst($value)}() - : $dataProvider->$value(); + ? $this->dataProvider->{'get' . ucfirst($value)}() + : $this->dataProvider->$value(); } return $viewData; } /** * Renders the template for the kitchensink. + * + * @throws LoaderError Error while loading + * @throws RuntimeError Runtime errors + * @throws SyntaxError Syntax errors + * * @return Response */ public function indexAction(): Response { - $viewData = $this->getViewData(); - - return $this->render($this->getTemplateName(), $viewData); - } - - /** - * Sets the data provider. - * @param DataProviderInterface $dataProvider - * @return KitchensinkController - */ - public function setDataProvider(DataProviderInterface $dataProvider): KitchensinkController - { - $this->dataProvider = $dataProvider; - - return $this; - } - - /** - * Sets the template name. - * @param string $templateName - * @return KitchensinkController - */ - public function setTemplateName(string $templateName): KitchensinkController - { - $this->templateName = $templateName; - - return $this; + return new Response( + $this->templateEngine->render($this->templateName, $this->getViewData()) + ); } } diff --git a/src/DependencyInjection/BestItKitchensinkExtension.php b/src/DependencyInjection/BestItKitchensinkExtension.php index 60d1d26..3aec18c 100644 --- a/src/DependencyInjection/BestItKitchensinkExtension.php +++ b/src/DependencyInjection/BestItKitchensinkExtension.php @@ -2,31 +2,41 @@ namespace BestIt\KitchensinkBundle\DependencyInjection; +use Exception; +use InvalidArgumentException; +use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\Extension; +use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; /** * Loading the bundle. + * * @author blange * @package BestIt\KitchensinkBundle - * @subpackage DependencyInjection - * @version $id$ */ class BestItKitchensinkExtension extends Extension { /** * Loads a specific configuration. + * * @param array $configs An array of configuration values * @param ContainerBuilder $container A ContainerBuilder instance - * @throws \InvalidArgumentException When provided tag is not defined in this extension + * + * @throws InvalidArgumentException When provided tag is not defined in this extension + * @throws Exception Unknown errors + * + * @return void */ public function load(array $configs, ContainerBuilder $container) { + $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); + $loader->load('services.yml'); + $config = $this->processConfiguration(new Configuration(), $configs); $container->setAlias('best_it_kitchensink.data_provider', $config['data_provider']); - - $container->setParameter('best_it_kitchensink.data_provider', $config['data_provider']); + $container->setAlias('best_it_kitchensink.template_engine', $config['template_engine']); $container->setParameter('best_it_kitchensink.template', $config['template']); } } diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 0302786..140b809 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -2,15 +2,16 @@ namespace BestIt\KitchensinkBundle\DependencyInjection; +use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; +use Symfony\Component\Config\Definition\Builder\NodeDefinition; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * Configuration for the bundle. + * * @author blange * @package BestIt\KitchensinkBundle - * @subpackage DependencyInjection - * @version $id$ */ class Configuration implements ConfigurationInterface { @@ -20,9 +21,10 @@ class Configuration implements ConfigurationInterface */ public function getConfigTreeBuilder() { - $builder = new TreeBuilder(); + $builder = new TreeBuilder('best_it_kitchensink'); - $builder->root('best_it_kitchensink') + $rootNode = $this->getRootNode($builder, 'best_it_kitchensink'); + $rootNode ->children() ->scalarNode('template') ->info('Which template should be used the render the kitchensink?') @@ -31,9 +33,32 @@ public function getConfigTreeBuilder() ->scalarNode('data_provider') ->info('The data provider service implementing the matching interface.') ->isRequired() + ->cannotBeEmpty() + ->end() + ->scalarNode('template_engine') + ->info('The template engine service id.') + ->defaultValue('twig') + ->cannotBeEmpty() ->end() ->end(); return $builder; } + + /** + * BC layer for symfony/config 4.1 and older + * + * @param TreeBuilder $treeBuilder + * @param $name + * + * @return ArrayNodeDefinition|NodeDefinition + */ + private function getRootNode(TreeBuilder $treeBuilder, $name) + { + if (!method_exists($treeBuilder, 'getRootNode')) { + return $treeBuilder->root($name); + } + + return $treeBuilder->getRootNode(); + } } diff --git a/src/Resources/config/routing.yml b/src/Resources/config/routing.yml new file mode 100644 index 0000000..4c20298 --- /dev/null +++ b/src/Resources/config/routing.yml @@ -0,0 +1,3 @@ +kitchensink_index: + path: /kitchensink + controller: BestIt\KitchensinkBundle\Controller\KitchensinkController::indexAction diff --git a/src/Resources/config/services.yml b/src/Resources/config/services.yml new file mode 100644 index 0000000..e49eed0 --- /dev/null +++ b/src/Resources/config/services.yml @@ -0,0 +1,8 @@ +services: + BestIt\KitchensinkBundle\Controller\KitchensinkController: + class: BestIt\KitchensinkBundle\Controller\KitchensinkController + tags: ['controller.service_arguments'] + arguments: + - '@best_it_kitchensink.data_provider' + - '@best_it_kitchensink.template_engine' + - '%best_it_kitchensink.template%' diff --git a/src/resources/config/routing.yml b/src/resources/config/routing.yml deleted file mode 100644 index 105d73b..0000000 --- a/src/resources/config/routing.yml +++ /dev/null @@ -1,3 +0,0 @@ -kitchensink_index: - path: /kitchensink - defaults: { _controller: BestItKitchensinkBundle:Kitchensink:index } diff --git a/tests/ContainerProviderTrait.php b/tests/ContainerProviderTrait.php deleted file mode 100644 index 1f3cdac..0000000 --- a/tests/ContainerProviderTrait.php +++ /dev/null @@ -1,62 +0,0 @@ - - * @category Tests - * @package BestIt\KitchensinkBundle - * @version $id$ - */ -trait ContainerProviderTrait -{ - /** - * Returns a container builder for this app. - * @return ContainerBuilder - */ - private function getContainer(): ContainerBuilder - { - $container = new ContainerBuilder(); - $container->setParameter('kernel.cache_dir', sys_get_temp_dir()); - $container->setParameter('kernel.bundles', ['BestItKitchensinkBundle' => BestItKitchensinkBundle::class]); - $container->set('bestit_kitchensink.data_provider.test_fake', new DataProviderFake()); - - return $container; - } - - /** - * Returns the full config. - * @return array - */ - private function getFullConfig(): array - { - $config = [ - 'best_it_kitchensink' => [ - 'data_provider' => 'bestit_kitchensink.data_provider.test_fake', - 'template' => 'kitchensink/index.html.twig' - ] - ]; - return $config; - } - - /** - * Checks the full load of the container. - * @param array|void $config Inject another config. - * @return ContainerBuilder - */ - public function getFullyLoadedContainer($config = null): ContainerBuilder - { - if ($config === null) { - $config = $this->getFullConfig(); - } - - (new BestItKitchensinkExtension())->load($config, $container = $this->getContainer()); - - return $container; - } -} diff --git a/tests/Controller/KitchensinkControllerTest.php b/tests/Controller/KitchensinkControllerTest.php index 2b49c35..c1ea5cc 100644 --- a/tests/Controller/KitchensinkControllerTest.php +++ b/tests/Controller/KitchensinkControllerTest.php @@ -3,110 +3,47 @@ namespace BestIt\KitchensinkBundle\Tests\Controller; use BestIt\KitchensinkBundle\Controller\KitchensinkController; -use BestIt\KitchensinkBundle\DataProviderInterface; -use BestIt\KitchensinkBundle\Tests\ContainerProviderTrait; +use BestIt\KitchensinkBundle\Tests\DataProviderFake; use PHPUnit\Framework\TestCase; -use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\HttpFoundation\Response; +use Twig\Environment; /** * Class KitchensinkControllerTest + * * @author blange - * @category Tests * @package BestIt\KitchensinkBundle - * @subpackage Controller - * @version $id$ */ class KitchensinkControllerTest extends TestCase { - use ContainerProviderTrait; - /** - * The used container. - * @var ContainerBuilder - */ - private $container = null; - - /** - * The tested class. - * @var KitchensinkController - */ - private $fixture = null; - - /** - * Sets up the test. - * @return void - */ - public function setUp() - { - $this->fixture = new KitchensinkController(); - - $this->fixture->setContainer($this->container = $this->getFullyLoadedContainer()); - } - - /** - * Checks if the response can be rendered. + * Test index action + * * @return void */ public function testIndexAction() { - $this->container->set('templating', $mock = static::createMock(EngineInterface::class)); + $controller = new KitchensinkController( + $provider = new DataProviderFake(), + $templateEngine = $this->createMock(Environment::class), + $templateName = uniqid() + ); - $mock - ->method('renderResponse') + $templateEngine + ->expects(static::once()) + ->method('render') ->with( - $this->fixture->getTemplateName(), + $templateName, [ 'foo' => 'BestIt\KitchensinkBundle\Tests\DataProviderFake::bar', 'foobar' => 'BestIt\KitchensinkBundle\Tests\DataProviderFake::getFoobar', 'foobarBaz' => 'BestIt\KitchensinkBundle\Tests\DataProviderFake::getFoobarBaz' ] ) - ->willReturn($response = static::createMock(Response::class)); - - static::assertSame($response, $this->fixture->indexAction()); - } + ->willReturn($result = uniqid()); - /** - * Checks the getter and setter for the template name. - * @covers KitchensinkController::getDataProvider() - * @covers KitchensinkController::setDataProvider() - * @return void - */ - public function testSetAndGetDataProvider() - { - static::assertInstanceOf( - DataProviderInterface::class, - $this->fixture->getDataProvider(), - 'Wrong default return.' - ); - - static::assertSame( - $this->fixture, - $this->fixture->setDataProvider($mock = static::createMock(DataProviderInterface::class)), - 'Fluent interface broken.' - ); - - static::assertSame($mock, $this->fixture->getDataProvider(), 'Value not saved.'); - } - - /** - * Checks the getter and setter for the template name. - * @covers KitchensinkController::getTemplateName() - * @covers KitchensinkController::setTemplateName() - * @return void - */ - public function testSetAndGetTemplateName() - { - static::assertSame('kitchensink/index.html.twig', $this->fixture->getTemplateName(), 'Wrong default return.'); - - static::assertSame( - $this->fixture, - $this->fixture->setTemplateName($mock = uniqid()), - 'Fluent interface broken.' - ); + $response = $controller->indexAction(); - static::assertSame($mock, $this->fixture->getTemplateName(), 'Value not saved.'); + static::assertSame($result, $response->getContent()); + static::assertSame(200, $response->getStatusCode()); } } diff --git a/tests/DependencyInjection/BestItKitchensinkExtensionTest.php b/tests/DependencyInjection/BestItKitchensinkExtensionTest.php index 04b8882..f3d8f10 100644 --- a/tests/DependencyInjection/BestItKitchensinkExtensionTest.php +++ b/tests/DependencyInjection/BestItKitchensinkExtensionTest.php @@ -3,91 +3,70 @@ namespace BestIt\KitchensinkBundle\Tests\DependencyInjection; use BestIt\KitchensinkBundle\DependencyInjection\BestItKitchensinkExtension; -use BestIt\KitchensinkBundle\Tests\ContainerProviderTrait; -use BestIt\KitchensinkBundle\Tests\DataProviderFake; +use Exception; use PHPUnit\Framework\TestCase; +use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; +use Symfony\Component\DependencyInjection\ContainerBuilder; /** * Class BestItKitchensinkExtensionTest + * * @author blange - * @category Tests * @package BestIt\KitchensinkBundle - * @subpackage DependencyInjection - * @version $id$ */ class BestItKitchensinkExtensionTest extends TestCase { - use ContainerProviderTrait; - - /** - * The used prefix in the bundle. - * @var string - */ - const BUNDLE_PREFIX = 'best_it_kitchensink'; - /** - * Returns some rules for the config value tests. - * @return array - */ - public function getConfigValueAssertions(): array - { - return [ - // key, wrong value, is required - ['data_provider', mt_rand(0, 1000), true], - ['template', null], - ]; - } - - /** - * Checks the config value. - * @dataProvider getConfigValueAssertions - * @param string $key + * Test container with all values + * + * @throws Exception Unknown errors + * + * @return void */ - public function testConfigValue(string $key) + public function testContainer() { - $config = $this->getFullConfig(); - - $container = $this->getFullyLoadedContainer($config); + $extension = new BestItKitchensinkExtension(); + $container = new ContainerBuilder(); - static::assertTrue( - $container->hasParameter(self::BUNDLE_PREFIX . '.' . $key), - 'Parameter is missing.' + $extension->load( + [ + [ + 'template' => $template = uniqid(), + 'data_provider' => $provider = uniqid(), + 'template_engine' => $engine = uniqid(), + ] + ], + $container ); - static::assertSame( - $config[self::BUNDLE_PREFIX][$key], - $container->getParameter(self::BUNDLE_PREFIX . '.' . $key), - 'Value was wrong.' - ); - } - - /** - * Checks if the data provider is loaded. - * @return void - */ - public function testDataProviderInstance() - { - $container = $this->getFullyLoadedContainer(); - - static::assertTrue($container->hasAlias(self::BUNDLE_PREFIX . '.data_provider')); - static::assertInstanceOf(DataProviderFake::class, $container->get(self::BUNDLE_PREFIX . '.data_provider')); + static::assertSame($template, $container->getParameter('best_it_kitchensink.template')); + static::assertTrue($container->hasAlias('best_it_kitchensink.template_engine')); + static::assertTrue($container->hasAlias('best_it_kitchensink.data_provider')); } /** - * Checks the default value of the template. - * @covers BestItKitchensinkExtension::load() - * @covers Configuration::getConfigTreeBuilder() + * Test missing data provider + * + * @throws Exception Unknown errors + * * @return void */ - public function testTemplateDefaultValue() + public function testMissingProvider() { - $config = $this->getFullConfig(); + $this->expectException(InvalidConfigurationException::class); + $this->expectExceptionMessageRegExp('/data_provider/'); - unset($config[self::BUNDLE_PREFIX]['template']); + $extension = new BestItKitchensinkExtension(); + $container = new ContainerBuilder(); - $container = $this->getFullyLoadedContainer($config); - - static::assertTrue($container->hasParameter(self::BUNDLE_PREFIX . '.template')); - static::assertSame('kitchensink/index.html.twig', $container->getParameter(self::BUNDLE_PREFIX . '.template')); + $extension->load( + [ + [ + 'template' => $template = uniqid(), + 'template_engine' => $engine = uniqid(), + ] + ], + $container + ); } }