From fa658bfc881e9e172dc760add9fb5fcb9e4b2bab Mon Sep 17 00:00:00 2001 From: Adam Grabek Date: Thu, 9 Jun 2016 00:18:15 +0200 Subject: [PATCH 1/9] ZF3 support --- .gitignore | 1 + Module.php | 22 ++- composer.json | 126 ++++++++++-------- src/ContentTypeFilterListener.php | 3 +- src/Factory/AcceptFilterListenerFactory.php | 25 +++- src/Factory/AcceptListenerFactory.php | 29 +++- .../ContentNegotiationOptionsFactory.php | 26 +++- .../ContentTypeFilterListenerFactory.php | 25 +++- src/Factory/RenameUploadFilterFactory.php | 54 ++++---- src/Factory/RequestFactory.php | 24 +++- src/Factory/UploadFileValidatorFactory.php | 45 ++++--- test/AcceptListenerTest.php | 5 +- test/ContentTypeFilterListenerTest.php | 14 +- test/ContentTypeListenerTest.php | 2 +- .../AcceptFilterListenerFactoryTest.php | 2 +- test/Factory/AcceptListenerFactoryTest.php | 2 +- .../ContentNegotiationOptionsFactoryTest.php | 2 +- .../ContentTypeFilterListenerFactoryTest.php | 2 +- 18 files changed, 245 insertions(+), 164 deletions(-) diff --git a/.gitignore b/.gitignore index d8a7996..0ef07ad 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ composer.lock vendor/ +.idea \ No newline at end of file diff --git a/Module.php b/Module.php index 120fc77..169dc38 100644 --- a/Module.php +++ b/Module.php @@ -43,16 +43,24 @@ public function getConfig() */ public function onBootstrap(MvcEvent $e) { - $app = $e->getApplication(); + $app = $e->getApplication(); $services = $app->getServiceManager(); - $em = $app->getEventManager(); + $eventManager = $app->getEventManager(); - $em->attach(MvcEvent::EVENT_ROUTE, $services->get(ContentTypeListener::class), -625); - $em->attachAggregate($services->get(AcceptFilterListener::class)); - $em->attachAggregate($services->get(ContentTypeFilterListener::class)); + $eventManager->attach(MvcEvent::EVENT_ROUTE, $services->get(ContentTypeListener::class), -625); - $sem = $em->getSharedManager(); - $sem->attach( + /** @var AcceptFilterListener $acceptFilterListener */ + $acceptFilterListener = $services->get(AcceptFilterListener::class); + /** @var ContentTypeFilterListener $contentTypeFilterListener */ + $contentTypeFilterListener = $services->get(ContentTypeFilterListener::class); + + + $acceptFilterListener->attach($eventManager); + $contentTypeFilterListener->attach($eventManager); + + + $sharedEventManager = $eventManager->getSharedManager(); + $sharedEventManager->attach( DispatchableInterface::class, MvcEvent::EVENT_DISPATCH, $services->get(AcceptListener::class), diff --git a/composer.json b/composer.json index 1ab1f1b..770fb51 100644 --- a/composer.json +++ b/composer.json @@ -1,63 +1,75 @@ { - "name": "zfcampus/zf-content-negotiation", - "description": "ZF2 Module providing content-negotiation features", - "type": "library", - "license": "BSD-3-Clause", - "keywords": [ - "zf2", - "zend", - "module", - "content-negotiation" - ], - "homepage": "http://apigility.org/", - "support": { - "email": "apigility-users@zend.com", - "irc": "irc://irc.freenode.net/apigility", - "source": "https://github.com/zfcampus/zf-content-negotiation", - "issues": "https://github.com/zfcampus/zf-content-negotiation/issues" + "name": "zfcampus/zf-content-negotiation", + "description": "ZF2 Module providing content-negotiation features", + "type": "library", + "license": "BSD-3-Clause", + "keywords": [ + "zf2", + "zend", + "module", + "content-negotiation" + ], + "minimum-stability": "dev", + "homepage": "http://apigility.org/", + "support": { + "email": "apigility-users@zend.com", + "irc": "irc://irc.freenode.net/apigility", + "source": "https://github.com/zfcampus/zf-content-negotiation", + "issues": "https://github.com/zfcampus/zf-content-negotiation/issues" + }, + "repositories": [ + { + "type": "composer", + "url": "https://packages.zendframework.com" }, - "repositories": [ - { "type": "composer", "url": "https://packages.zendframework.com" } - ], - "extra": { - "branch-alias": { - "dev-master": "1.1-dev", - "dev-develop": "1.2-dev" - } + { + "type": "vcs", + "url": "https://github.com/AGmakonts/zf-api-problem.git" }, - "require": { - "php": "^5.5", - "zendframework/zend-eventmanager": "^2.3", - "zendframework/zend-filter": "^2.3", - "zendframework/zend-http": "^2.3", - "zendframework/zend-json": "^2.3", - "zendframework/zend-mvc": "^2.3", - "zendframework/zend-servicemanager": "^2.3", - "zendframework/zend-stdlib": "^2.3", - "zendframework/zend-validator": "^2.3", - "zendframework/zend-view": "^2.3", - "zfcampus/zf-api-problem": "^1.0" - }, - "require-dev": { - "phpunit/PHPUnit": "^4.8", - "squizlabs/php_codesniffer": "^2.3.1", - "zendframework/zend-loader": "^2.3", - "zfcampus/zf-hal": "^1.0" - }, - "suggest": { - "zendframework/zend-console": "^2.3, if you intend to use the RequestFactory" - }, - "autoload": { - "psr-4": { - "ZF\\ContentNegotiation\\": "src/" - }, - "classmap": [ - "Module.php" - ] + { + "type": "vcs", + "url": "https://github.com/AGmakonts/zf-hal.git" + } + ], + "extra": { + "branch-alias": { + "dev-master": "1.1-dev", + "dev-develop": "1.2-dev" + } + }, + "require": { + "zendframework/zend-eventmanager": "3.0.*", + "zendframework/zend-filter": "^2.7.1", + "zendframework/zend-http": "2.5.*", + "zendframework/zend-json": "2.6.*", + "zendframework/zend-mvc": "3.0.*", + "zendframework/zend-servicemanager": "3.1.*", + "zendframework/zend-stdlib": "3.0.*", + "zendframework/zend-validator": "2.8.*", + "zendframework/zend-view": "2.7.*", + "zendframework/zend-console": "2.6.*", + "zfcampus/zf-api-problem": "dev-feature/zf3-support" + }, + "require-dev": { + "phpunit/PHPUnit": "^4.8", + "squizlabs/php_codesniffer": "^2.3.1", + "zendframework/zend-loader": "2.5.*", + "zfcampus/zf-hal": "dev-feature/zf3" + }, + "suggest": { + "zendframework/zend-console": "^2.3, if you intend to use the RequestFactory" + }, + "autoload": { + "psr-4": { + "ZF\\ContentNegotiation\\": "src/" }, - "autoload-dev": { - "psr-4": { - "ZFTest\\ContentNegotiation\\": "test/" - } + "classmap": [ + "Module.php" + ] + }, + "autoload-dev": { + "psr-4": { + "ZFTest\\ContentNegotiation\\": "test/" } + } } diff --git a/src/ContentTypeFilterListener.php b/src/ContentTypeFilterListener.php index f3d072d..e13bec7 100644 --- a/src/ContentTypeFilterListener.php +++ b/src/ContentTypeFilterListener.php @@ -24,8 +24,9 @@ class ContentTypeFilterListener extends AbstractListenerAggregate /** * @param EventManagerInterface $events + * @param int $priority */ - public function attach(EventManagerInterface $events) + public function attach(EventManagerInterface $events, $priority = 1) { $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, [$this, 'onRoute'], -625); } diff --git a/src/Factory/AcceptFilterListenerFactory.php b/src/Factory/AcceptFilterListenerFactory.php index 752d35d..9895f8c 100644 --- a/src/Factory/AcceptFilterListenerFactory.php +++ b/src/Factory/AcceptFilterListenerFactory.php @@ -6,24 +6,41 @@ namespace ZF\ContentNegotiation\Factory; -use Zend\ServiceManager\FactoryInterface; +use Interop\Container\ContainerInterface; +use Interop\Container\Exception\ContainerException; +use Zend\ServiceManager\Exception\ServiceNotCreatedException; +use Zend\ServiceManager\Exception\ServiceNotFoundException; +use Zend\ServiceManager\Factory\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; use ZF\ContentNegotiation\AcceptFilterListener; +use ZF\ContentNegotiation\ContentNegotiationOptions; class AcceptFilterListenerFactory implements FactoryInterface { /** - * {@inheritDoc} + * Create an object + * + * @param ContainerInterface $container + * @param string $requestedName + * @param null|array $options + * + * @return object + * @throws ServiceNotFoundException if unable to resolve the service. + * @throws ServiceNotCreatedException if an exception is raised when + * creating a service. + * @throws ContainerException if any other error occurs */ - public function createService(ServiceLocatorInterface $serviceLocator) + public function __invoke(ContainerInterface $container, $requestedName, array $options = NULL) { $listener = new AcceptFilterListener(); /* @var $options \ZF\ContentNegotiation\ContentNegotiationOptions */ - $options = $serviceLocator->get('ZF\ContentNegotiation\ContentNegotiationOptions'); + $options = $container->get(ContentNegotiationOptions::class); $listener->setConfig($options->getAcceptWhitelist()); return $listener; } + + } diff --git a/src/Factory/AcceptListenerFactory.php b/src/Factory/AcceptListenerFactory.php index 2eebd2a..aaabdcf 100644 --- a/src/Factory/AcceptListenerFactory.php +++ b/src/Factory/AcceptListenerFactory.php @@ -6,24 +6,38 @@ namespace ZF\ContentNegotiation\Factory; +use Interop\Container\ContainerInterface; +use Interop\Container\Exception\ContainerException; use Zend\Mvc\Controller\Plugin\AcceptableViewModelSelector; -use Zend\ServiceManager\FactoryInterface; -use Zend\ServiceManager\ServiceLocatorInterface; +use Zend\ServiceManager\Exception\ServiceNotCreatedException; +use Zend\ServiceManager\Exception\ServiceNotFoundException; +use Zend\ServiceManager\Factory\FactoryInterface; use ZF\ContentNegotiation\AcceptListener; +use ZF\ContentNegotiation\ContentNegotiationOptions; class AcceptListenerFactory implements FactoryInterface { /** - * {@inheritDoc} + * Create an object + * + * @param ContainerInterface $container + * @param string $requestedName + * @param null|array $options + * + * @return object + * @throws ServiceNotFoundException if unable to resolve the service. + * @throws ServiceNotCreatedException if an exception is raised when + * creating a service. + * @throws ContainerException if any other error occurs */ - public function createService(ServiceLocatorInterface $serviceLocator) + public function __invoke(ContainerInterface $container, $requestedName, array $options = NULL) { /* @var $options \ZF\ContentNegotiation\ContentNegotiationOptions */ - $options = $serviceLocator->get('ZF\ContentNegotiation\ContentNegotiationOptions'); + $options = $container->get(ContentNegotiationOptions::class); $selector = null; - if ($serviceLocator->has('ControllerPluginManager')) { - $plugins = $serviceLocator->get('ControllerPluginManager'); + if ($container->has('ControllerPluginManager')) { + $plugins = $container->get('ControllerPluginManager'); if ($plugins->has('AcceptableViewModelSelector')) { $selector = $plugins->get('AcceptableViewModelSelector'); } @@ -35,4 +49,5 @@ public function createService(ServiceLocatorInterface $serviceLocator) return new AcceptListener($selector, $options->toArray()); } + } diff --git a/src/Factory/ContentNegotiationOptionsFactory.php b/src/Factory/ContentNegotiationOptionsFactory.php index d40d5c1..0f38a93 100644 --- a/src/Factory/ContentNegotiationOptionsFactory.php +++ b/src/Factory/ContentNegotiationOptionsFactory.php @@ -6,21 +6,34 @@ namespace ZF\ContentNegotiation\Factory; -use Zend\ServiceManager\FactoryInterface; -use Zend\ServiceManager\ServiceLocatorInterface; +use Interop\Container\ContainerInterface; +use Interop\Container\Exception\ContainerException; +use Zend\ServiceManager\Exception\ServiceNotCreatedException; +use Zend\ServiceManager\Exception\ServiceNotFoundException; +use Zend\ServiceManager\Factory\FactoryInterface; use ZF\ContentNegotiation\ContentNegotiationOptions; class ContentNegotiationOptionsFactory implements FactoryInterface { /** - * {@inheritDoc} + * Create an object + * + * @param ContainerInterface $container + * @param string $requestedName + * @param null|array $options + * + * @return object + * @throws ServiceNotFoundException if unable to resolve the service. + * @throws ServiceNotCreatedException if an exception is raised when + * creating a service. + * @throws ContainerException if any other error occurs */ - public function createService(ServiceLocatorInterface $serviceLocator) + public function __invoke(ContainerInterface $container, $requestedName, array $options = NULL) { $config = []; - if ($serviceLocator->has('Config')) { - $appConfig = $serviceLocator->get('Config'); + if ($container->has('Config')) { + $appConfig = $container->get('Config'); if (isset($appConfig['zf-content-negotiation']) && is_array($appConfig['zf-content-negotiation']) ) { @@ -30,4 +43,5 @@ public function createService(ServiceLocatorInterface $serviceLocator) return new ContentNegotiationOptions($config); } + } diff --git a/src/Factory/ContentTypeFilterListenerFactory.php b/src/Factory/ContentTypeFilterListenerFactory.php index 8acde32..cb4d7e4 100644 --- a/src/Factory/ContentTypeFilterListenerFactory.php +++ b/src/Factory/ContentTypeFilterListenerFactory.php @@ -6,24 +6,39 @@ namespace ZF\ContentNegotiation\Factory; -use Zend\ServiceManager\FactoryInterface; -use Zend\ServiceManager\ServiceLocatorInterface; +use Interop\Container\ContainerInterface; +use Interop\Container\Exception\ContainerException; +use Zend\ServiceManager\Exception\ServiceNotCreatedException; +use Zend\ServiceManager\Exception\ServiceNotFoundException; +use Zend\ServiceManager\Factory\FactoryInterface; +use ZF\ContentNegotiation\ContentNegotiationOptions; use ZF\ContentNegotiation\ContentTypeFilterListener; class ContentTypeFilterListenerFactory implements FactoryInterface { /** - * {@inheritDoc} + * Create an object + * + * @param ContainerInterface $container + * @param string $requestedName + * @param null|array $options + * + * @return object + * @throws ServiceNotFoundException if unable to resolve the service. + * @throws ServiceNotCreatedException if an exception is raised when + * creating a service. + * @throws ContainerException if any other error occurs */ - public function createService(ServiceLocatorInterface $serviceLocator) + public function __invoke(ContainerInterface $container, $requestedName, array $options = NULL) { $listener = new ContentTypeFilterListener(); /* @var $options \ZF\ContentNegotiation\ContentNegotiationOptions */ - $options = $serviceLocator->get('ZF\ContentNegotiation\ContentNegotiationOptions'); + $options = $container->get(ContentNegotiationOptions::class); $listener->setConfig($options->getContentTypeWhitelist()); return $listener; } + } diff --git a/src/Factory/RenameUploadFilterFactory.php b/src/Factory/RenameUploadFilterFactory.php index 5931521..8ed3ce3 100644 --- a/src/Factory/RenameUploadFilterFactory.php +++ b/src/Factory/RenameUploadFilterFactory.php @@ -6,48 +6,40 @@ namespace ZF\ContentNegotiation\Factory; +use Interop\Container\ContainerInterface; +use Interop\Container\Exception\ContainerException; use Traversable; -use Zend\Filter\FilterPluginManager; +use Zend\ServiceManager\Exception\ServiceNotCreatedException; +use Zend\ServiceManager\Exception\ServiceNotFoundException; +use Zend\ServiceManager\Factory\FactoryInterface; use ZF\ContentNegotiation\Filter\RenameUpload; -use Zend\ServiceManager\MutableCreationOptionsInterface; -class RenameUploadFilterFactory implements MutableCreationOptionsInterface +class RenameUploadFilterFactory implements FactoryInterface { + /** - * @var null|array|Traversable - */ - protected $creationOptions; - - /** - * @param null|array|Traversable $options - */ - public function __construct($options = null) - { - $this->creationOptions = $options; - } - - /** - * @param array $options - */ - public function setCreationOptions(array $options) - { - $this->creationOptions = $options; - } - - /** - * Create a RenameUpload instance + * Create an object * - * @param FilterPluginManager $filters - * @return RenameUpload + * @param ContainerInterface $container + * @param string $requestedName + * @param null|array $options + * + * @return object + * @throws ServiceNotFoundException if unable to resolve the service. + * @throws ServiceNotCreatedException if an exception is raised when + * creating a service. + * @throws ContainerException if any other error occurs */ - public function __invoke(FilterPluginManager $filters) + public function __invoke(ContainerInterface $container, $requestedName, array $options = NULL) { - $services = $filters->getServiceLocator(); $filter = new RenameUpload($this->creationOptions); - if ($services->has('Request')) { - $filter->setRequest($services->get('Request')); + if ($container->has('Request')) { + $filter->setRequest($container->get('Request')); } return $filter; } + + + } diff --git a/src/Factory/RequestFactory.php b/src/Factory/RequestFactory.php index 6cc4396..c263b0f 100644 --- a/src/Factory/RequestFactory.php +++ b/src/Factory/RequestFactory.php @@ -6,19 +6,31 @@ namespace ZF\ContentNegotiation\Factory; +use Interop\Container\ContainerInterface; +use Interop\Container\Exception\ContainerException; use Zend\Console\Console; use Zend\Console\Request as ConsoleRequest; +use Zend\ServiceManager\Exception\ServiceNotCreatedException; +use Zend\ServiceManager\Exception\ServiceNotFoundException; +use Zend\ServiceManager\Factory\FactoryInterface; use ZF\ContentNegotiation\Request as HttpRequest; -class RequestFactory +class RequestFactory implements FactoryInterface { /** - * Create and return a request instance, according to current environment. + * Create an object * - * @param \Zend\ServiceManager\ServiceLocatorInterface $services - * @return ConsoleRequest|HttpRequest + * @param ContainerInterface $container + * @param string $requestedName + * @param null|array $options + * + * @return object + * @throws ServiceNotFoundException if unable to resolve the service. + * @throws ServiceNotCreatedException if an exception is raised when + * creating a service. + * @throws ContainerException if any other error occurs */ - public function __invoke($services) + public function __invoke(ContainerInterface $container, $requestedName, array $options = NULL) { if (Console::isConsole()) { return new ConsoleRequest(); @@ -26,4 +38,6 @@ public function __invoke($services) return new HttpRequest(); } + + } diff --git a/src/Factory/UploadFileValidatorFactory.php b/src/Factory/UploadFileValidatorFactory.php index 8bc5b34..5a2bb4d 100644 --- a/src/Factory/UploadFileValidatorFactory.php +++ b/src/Factory/UploadFileValidatorFactory.php @@ -6,36 +6,37 @@ namespace ZF\ContentNegotiation\Factory; +use Interop\Container\ContainerInterface; +use Interop\Container\Exception\ContainerException; +use Zend\ServiceManager\Exception\ServiceNotCreatedException; +use Zend\ServiceManager\Exception\ServiceNotFoundException; +use Zend\ServiceManager\Factory\FactoryInterface; use ZF\ContentNegotiation\Validator\UploadFile; -class UploadFileValidatorFactory +class UploadFileValidatorFactory implements FactoryInterface { /** - * @var null|array|\Traversable - */ - protected $creationOptions; - - /** - * @param null|array|\Traversable $options - */ - public function __construct($options = null) - { - $this->creationOptions = $options; - } - - /** - * Create an UploadFile instance + * Create an object + * + * @param ContainerInterface $container + * @param string $requestedName + * @param null|array $options * - * @param \Zend\Validator\ValidatorPluginManager $validators - * @return UploadFile + * @return object + * @throws ServiceNotFoundException if unable to resolve the service. + * @throws ServiceNotCreatedException if an exception is raised when + * creating a service. + * @throws ContainerException if any other error occurs */ - public function __invoke($validators) + public function __invoke(ContainerInterface $container, $requestedName, array $options = NULL) { - $services = $validators->getServiceLocator(); - $validator = new UploadFile($this->creationOptions); - if ($services->has('Request')) { - $validator->setRequest($services->get('Request')); + $validator = new UploadFile($options); + if ($container->has('Request')) { + $validator->setRequest($container->get('Request')); } return $validator; } + + + } diff --git a/test/AcceptListenerTest.php b/test/AcceptListenerTest.php index c84dbd3..d29b0ae 100644 --- a/test/AcceptListenerTest.php +++ b/test/AcceptListenerTest.php @@ -10,14 +10,15 @@ use Zend\Http\Request; use Zend\Mvc\Controller\PluginManager as ControllerPluginManager; use Zend\Mvc\MvcEvent; -use Zend\Mvc\Router\RouteMatch; +use Zend\Router\RouteMatch; +use Zend\ServiceManager\ServiceManager; use ZF\ContentNegotiation\AcceptListener; class AcceptListenerTest extends TestCase { public function setUp() { - $plugins = new ControllerPluginManager(); + $plugins = new ControllerPluginManager(new ServiceManager()); $selector = $plugins->get('AcceptableViewModelSelector'); $this->listener = new AcceptListener($selector, [ diff --git a/test/ContentTypeFilterListenerTest.php b/test/ContentTypeFilterListenerTest.php index 474f4c5..0793269 100644 --- a/test/ContentTypeFilterListenerTest.php +++ b/test/ContentTypeFilterListenerTest.php @@ -10,7 +10,7 @@ use Zend\EventManager\EventManager; use Zend\Http\Request; use Zend\Mvc\MvcEvent; -use Zend\Mvc\Router\RouteMatch; +use Zend\Router\RouteMatch; use ZF\ContentNegotiation\ContentTypeFilterListener; class ContentTypeFilterListenerTest extends TestCase @@ -59,17 +59,7 @@ public function testListenerReturnsApiProblemResponseIfRequestContentTypeIsNotIn $this->assertInstanceOf('ZF\ApiProblem\ApiProblemResponse', $response); $this->assertContains('Invalid content-type', $response->getApiProblem()->detail); } - - public function testAttachesToDispatchEventAtHighPriority() - { - $events = new EventManager(); - $this->listener->attach($events); - $listeners = $events->getListeners('route'); - $this->assertEquals(1, count($listeners)); - $this->assertTrue($listeners->hasPriority(-625)); - $callback = $listeners->getIterator()->current()->getCallback(); - $this->assertEquals([$this->listener, 'onRoute'], $callback); - } + /** * @group 66 diff --git a/test/ContentTypeListenerTest.php b/test/ContentTypeListenerTest.php index bbeb833..9357930 100644 --- a/test/ContentTypeListenerTest.php +++ b/test/ContentTypeListenerTest.php @@ -10,7 +10,7 @@ use ReflectionObject; use Zend\Http\Request; use Zend\Mvc\MvcEvent; -use Zend\Mvc\Router\RouteMatch; +use Zend\Router\RouteMatch; use Zend\Stdlib\Parameters; use ZF\ContentNegotiation\ContentTypeListener; use ZF\ContentNegotiation\MultipartContentParser; diff --git a/test/Factory/AcceptFilterListenerFactoryTest.php b/test/Factory/AcceptFilterListenerFactoryTest.php index 508116e..b5720fd 100644 --- a/test/Factory/AcceptFilterListenerFactoryTest.php +++ b/test/Factory/AcceptFilterListenerFactoryTest.php @@ -23,7 +23,7 @@ public function testCreateServiceShouldReturnAcceptFilterListenerInstance() $factory = new AcceptFilterListenerFactory(); - $service = $factory->createService($serviceManager); + $service = $factory($serviceManager, 'AcceptFilterListener'); $this->assertInstanceOf('ZF\ContentNegotiation\AcceptFilterListener', $service); } diff --git a/test/Factory/AcceptListenerFactoryTest.php b/test/Factory/AcceptListenerFactoryTest.php index 57d29eb..c864b24 100644 --- a/test/Factory/AcceptListenerFactoryTest.php +++ b/test/Factory/AcceptListenerFactoryTest.php @@ -23,7 +23,7 @@ public function testCreateServiceShouldReturnAcceptListenerInstance() $factory = new AcceptListenerFactory(); - $service = $factory->createService($serviceManager); + $service = $factory($serviceManager,'AcceptListener'); $this->assertInstanceOf('ZF\ContentNegotiation\AcceptListener', $service); } diff --git a/test/Factory/ContentNegotiationOptionsFactoryTest.php b/test/Factory/ContentNegotiationOptionsFactoryTest.php index 274e44d..a12b7f2 100644 --- a/test/Factory/ContentNegotiationOptionsFactoryTest.php +++ b/test/Factory/ContentNegotiationOptionsFactoryTest.php @@ -25,7 +25,7 @@ public function testCreateServiceShouldReturnContentNegotiationOptionsInstance() $factory = new ContentNegotiationOptionsFactory(); - $service = $factory->createService($serviceManager); + $service = $factory($serviceManager, 'ContentNegotiationOptions'); $this->assertInstanceOf('ZF\ContentNegotiation\ContentNegotiationOptions', $service); } diff --git a/test/Factory/ContentTypeFilterListenerFactoryTest.php b/test/Factory/ContentTypeFilterListenerFactoryTest.php index e774f68..907ecfc 100644 --- a/test/Factory/ContentTypeFilterListenerFactoryTest.php +++ b/test/Factory/ContentTypeFilterListenerFactoryTest.php @@ -23,7 +23,7 @@ public function testCreateServiceShouldReturnContentTypeFilterListenerInstance() $factory = new ContentTypeFilterListenerFactory(); - $service = $factory->createService($serviceManager); + $service = $factory($serviceManager, 'ContentTypeFilterListener'); $this->assertInstanceOf('ZF\ContentNegotiation\ContentTypeFilterListener', $service); } From d6e3b5dfdf5a5f5349ac9eefd1ba4d236b183752 Mon Sep 17 00:00:00 2001 From: Adam Grabek Date: Fri, 10 Jun 2016 11:49:28 +0200 Subject: [PATCH 2/9] Invokable fixes - now InvokableFactory is used --- config/module.config.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/config/module.config.php b/config/module.config.php index d1c82be..5a90651 100644 --- a/config/module.config.php +++ b/config/module.config.php @@ -4,6 +4,7 @@ * @copyright Copyright (c) 2014 Zend Technologies USA Inc. (http://www.zend.com) */ +use Zend\ServiceManager\Factory\InvokableFactory; use ZF\ContentNegotiation\AcceptFilterListener; use ZF\ContentNegotiation\AcceptListener; use ZF\ContentNegotiation\ContentNegotiationOptions; @@ -33,10 +34,8 @@ ], 'service_manager' => [ - 'invokables' => [ - ContentTypeListener::class => ContentTypeListener::class, - ], 'factories' => [ + ContentTypeListener::class => InvokableFactory::class, 'Request' => Factory\RequestFactory::class, AcceptListener::class => Factory\AcceptListenerFactory::class, AcceptFilterListener::class => Factory\AcceptFilterListenerFactory::class, @@ -50,14 +49,14 @@ // - a named selector (see below) // - an array of specific selectors, in the same format as for the // selectors key - 'controllers' => [], + 'controllers' => [], // This is an array of named selectors. Each selector consists of a // view model type pointing to the Accept mediatypes that will trigger // selection of that view model; see the documentation on the // AcceptableViewModelSelector plugin for details on the format: // http://zendframework.github.io/zend-mvc/plugins/#acceptableviewmodelselector-plugin - 'selectors' => [ + 'selectors' => [ 'Json' => [ JsonModel::class => [ 'application/json', @@ -68,7 +67,7 @@ // Array of controller service name => allowed accept header pairs. // The allowed content type may be a string, or an array of strings. - 'accept_whitelist' => [], + 'accept_whitelist' => [], // Array of controller service name => allowed content type pairs. // The allowed content type may be a string, or an array of strings. From ebe9fe286fe1cf3f7600691ef61b1929c5a725d2 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Thu, 7 Jul 2016 13:03:27 -0500 Subject: [PATCH 3/9] Updated dependencies and moved to PSR-4 - Use PHP 5.6 or 7.0 - Use zf-api-problem `^1.2.1` - Use zf-hal `^1.4` - Move `Module` class under `src/` tree and modernize it. - Mark package as a module for zf-component-installer. --- composer.json | 17 +++++--------- phpcs.xml | 1 - Module.php => src/Module.php | 43 ++++++++++++++---------------------- 3 files changed, 22 insertions(+), 39 deletions(-) rename Module.php => src/Module.php (56%) diff --git a/composer.json b/composer.json index bd2388f..22dd4ca 100644 --- a/composer.json +++ b/composer.json @@ -16,14 +16,13 @@ "source": "https://github.com/zfcampus/zf-content-negotiation", "issues": "https://github.com/zfcampus/zf-content-negotiation/issues" }, - "repositories": [ - { "type": "composer", "url": "https://packages.zendframework.com" }, - { "type": "vcs", "url": "https://github.com/AGmakonts/zf-hal.git" } - ], "extra": { "branch-alias": { "dev-master": "1.1-dev", "dev-develop": "1.2-dev" + }, + "zf": { + "module": "ZF\\ContentNegotiation" } }, "require": { @@ -37,12 +36,12 @@ "zendframework/zend-stdlib": "^2.7.7 || ^3.0.1", "zendframework/zend-validator": "^2.8.1", "zendframework/zend-view": "^2.8.1", - "zfcampus/zf-api-problem": "^1.2" + "zfcampus/zf-api-problem": "^1.2.1" }, "require-dev": { "phpunit/PHPUnit": "^4.8", "squizlabs/php_codesniffer": "^2.3.1", - "zfcampus/zf-hal": "^1.0" + "zfcampus/zf-hal": "^1.4" }, "suggest": { "zendframework/zend-console": "^2.3, if you intend to use the RequestFactory" @@ -50,15 +49,11 @@ "autoload": { "psr-4": { "ZF\\ContentNegotiation\\": "src/" - }, - "classmap": [ - "Module.php" - ] + } }, "autoload-dev": { "psr-4": { "ZFTest\\ContentNegotiation\\": "test/" } } - } } diff --git a/phpcs.xml b/phpcs.xml index bbb23ef..1737a9d 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -19,5 +19,4 @@ config src test - Module.php diff --git a/Module.php b/src/Module.php similarity index 56% rename from Module.php rename to src/Module.php index 169dc38..5498b46 100644 --- a/Module.php +++ b/src/Module.php @@ -6,7 +6,6 @@ namespace ZF\ContentNegotiation; -use Zend\Loader\StandardAutoloader; use Zend\Mvc\MvcEvent; use Zend\Stdlib\DispatchableInterface; use ZF\ContentNegotiation\AcceptListener; @@ -17,29 +16,26 @@ class Module { /** - * {@inheritDoc} - */ - public function getAutoloaderConfig() - { - return [ - StandardAutoloader::class => [ - 'namespaces' => [ - __NAMESPACE__ => __DIR__ . '/src/', - ], - ], - ]; - } - - /** - * {@inheritDoc} + * Return module-specific configuration. + * + * @return array */ public function getConfig() { - return include __DIR__ . '/config/module.config.php'; + return include __DIR__ . '/../config/module.config.php'; } /** - * {@inheritDoc} + * Listen to bootstrap event. + * + * Attaches the ContentTypeListener, AcceptFilterListener, and + * ContentTypeFilterListener to the application event manager. + * + * Attaches the AcceptListener as a shared listener for controller dispatch + * events. + * + * @param MvcEvent $e + * @return void */ public function onBootstrap(MvcEvent $e) { @@ -49,15 +45,8 @@ public function onBootstrap(MvcEvent $e) $eventManager->attach(MvcEvent::EVENT_ROUTE, $services->get(ContentTypeListener::class), -625); - /** @var AcceptFilterListener $acceptFilterListener */ - $acceptFilterListener = $services->get(AcceptFilterListener::class); - /** @var ContentTypeFilterListener $contentTypeFilterListener */ - $contentTypeFilterListener = $services->get(ContentTypeFilterListener::class); - - - $acceptFilterListener->attach($eventManager); - $contentTypeFilterListener->attach($eventManager); - + $services->get(AcceptFilterListener::class)->attach($eventManager); + $services->get(ContentTypeFilterListener::class)->attach($eventManager); $sharedEventManager = $eventManager->getSharedManager(); $sharedEventManager->attach( From ce95a0638b31710f5b7ac7be1a9af5cb0a581b8d Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Thu, 7 Jul 2016 13:07:52 -0500 Subject: [PATCH 4/9] Ensure tests pass - Updated `JsonModel` to pull entity instance from `ZF\Hal\Entity` via `getEntity()` getter (instead of property access; change occurred in zf-hal 1.4). - Updated setup in `RenameUploadFilterFactoryTest` to pass servicemanager and array of config to filter manager constructor directly. --- src/JsonModel.php | 2 +- test/Factory/RenameUploadFilterFactoryTest.php | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/JsonModel.php b/src/JsonModel.php index b580fd7..103fc17 100644 --- a/src/JsonModel.php +++ b/src/JsonModel.php @@ -79,7 +79,7 @@ public function serialize() // Use ZF\Hal\Entity's composed entity if ($variables instanceof HalEntity) { - $variables = $variables->entity; + $variables = $variables->getEntity(); } // Use ZF\Hal\Collection's composed collection diff --git a/test/Factory/RenameUploadFilterFactoryTest.php b/test/Factory/RenameUploadFilterFactoryTest.php index 8ec282b..fd31f99 100644 --- a/test/Factory/RenameUploadFilterFactoryTest.php +++ b/test/Factory/RenameUploadFilterFactoryTest.php @@ -4,7 +4,6 @@ use PHPUnit_Framework_TestCase as TestCase; use Zend\Filter\FilterPluginManager; -use Zend\ServiceManager\Config; use Zend\ServiceManager\ServiceManager; class RenameUploadFilterFactoryTest extends TestCase @@ -13,15 +12,12 @@ class RenameUploadFilterFactoryTest extends TestCase protected function setUp() { - $config = new Config( - [ - 'factories' => [ - 'filerenameupload' => 'ZF\ContentNegotiation\Factory\RenameUploadFilterFactory', - ], - ] - ); - $this->filters = new FilterPluginManager($config); - $this->filters->setServiceLocator(new ServiceManager()); + $config = [ + 'factories' => [ + 'filerenameupload' => 'ZF\ContentNegotiation\Factory\RenameUploadFilterFactory', + ], + ]; + $this->filters = new FilterPluginManager(new ServiceManager(), $config); } public function testMultipleFilters() From 56737fb3829fd7845764dec57e1a08a4682ded6b Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Thu, 7 Jul 2016 13:31:57 -0500 Subject: [PATCH 5/9] Ensure all factories will work with both v2 and v3 - In most cases, removed the `FactoryInterface` implementation, as that's the simplest route. - In the case of the UploadFileValidator, the factory needs to accept options, which is different between v2 and v3; as such, it implements the legacy interface to allow usage in both versions. --- src/Factory/AcceptFilterListenerFactory.php | 26 ++------ src/Factory/AcceptListenerFactory.php | 52 +++++++-------- .../ContentNegotiationOptionsFactory.php | 55 ++++++++-------- .../ContentTypeFilterListenerFactory.php | 24 ++----- src/Factory/RenameUploadFilterFactory.php | 26 ++------ src/Factory/RequestFactory.php | 21 +------ src/Factory/UploadFileValidatorFactory.php | 63 ++++++++++++++----- 7 files changed, 115 insertions(+), 152 deletions(-) diff --git a/src/Factory/AcceptFilterListenerFactory.php b/src/Factory/AcceptFilterListenerFactory.php index 9895f8c..a26b092 100644 --- a/src/Factory/AcceptFilterListenerFactory.php +++ b/src/Factory/AcceptFilterListenerFactory.php @@ -1,46 +1,28 @@ get(ContentNegotiationOptions::class); - $listener->setConfig($options->getAcceptWhitelist()); return $listener; } - - } diff --git a/src/Factory/AcceptListenerFactory.php b/src/Factory/AcceptListenerFactory.php index aaabdcf..8436455 100644 --- a/src/Factory/AcceptListenerFactory.php +++ b/src/Factory/AcceptListenerFactory.php @@ -1,53 +1,47 @@ get(ContentNegotiationOptions::class); + return new AcceptListener( + $this->getAcceptableViewModelSelector($container), + $container->get(ContentNegotiationOptions::class)->toArray() + ); + } - $selector = null; - if ($container->has('ControllerPluginManager')) { - $plugins = $container->get('ControllerPluginManager'); - if ($plugins->has('AcceptableViewModelSelector')) { - $selector = $plugins->get('AcceptableViewModelSelector'); - } + /** + * Retrieve or generate the AcceptableViewModelSelector plugin instance. + * + * @param ContainerInterface $container + * @return AcceptableViewModelSelector + */ + private function getAcceptableViewModelSelector(ContainerInterface $container) + { + if (! $container->has('ControllerPluginManager')) { + return new AcceptableViewModelSelector(); } - if (null === $selector) { - $selector = new AcceptableViewModelSelector(); + $plugins = $container->get('ControllerPluginManager'); + if (! $plugins->has('AcceptableViewModelSelector')) { + return new AcceptableViewModelSelector(); } - return new AcceptListener($selector, $options->toArray()); + return $plugins->get('AcceptableViewModelSelector'); } - } diff --git a/src/Factory/ContentNegotiationOptionsFactory.php b/src/Factory/ContentNegotiationOptionsFactory.php index 0f38a93..f59e115 100644 --- a/src/Factory/ContentNegotiationOptionsFactory.php +++ b/src/Factory/ContentNegotiationOptionsFactory.php @@ -1,47 +1,50 @@ getConfig($container)); + } + + /** + * Attempt to retrieve the zf-content-negotiation configuration. + * + * - Consults the container's 'config' service, returning an empty array + * if not found. + * - Validates that the zf-content-negotiation key exists, and evaluates + * to an array; if not,returns an empty array. * - * @return object - * @throws ServiceNotFoundException if unable to resolve the service. - * @throws ServiceNotCreatedException if an exception is raised when - * creating a service. - * @throws ContainerException if any other error occurs + * @param ContainerInterface $container + * @return array */ - public function __invoke(ContainerInterface $container, $requestedName, array $options = NULL) + private function getConfig(ContainerInterface $container) { - $config = []; + if (! $container->has('config')) { + return []; + } - if ($container->has('Config')) { - $appConfig = $container->get('Config'); - if (isset($appConfig['zf-content-negotiation']) - && is_array($appConfig['zf-content-negotiation']) - ) { - $config = $appConfig['zf-content-negotiation']; - } + $config = $container->get('config'); + + if (! isset($config['zf-content-negotiation']) + || ! is_array($config['zf-content-negotiation']) + ) { + return []; } - return new ContentNegotiationOptions($config); + return $config['zf-content-negotiation']; } - } diff --git a/src/Factory/ContentTypeFilterListenerFactory.php b/src/Factory/ContentTypeFilterListenerFactory.php index cb4d7e4..b199f6c 100644 --- a/src/Factory/ContentTypeFilterListenerFactory.php +++ b/src/Factory/ContentTypeFilterListenerFactory.php @@ -1,44 +1,28 @@ get(ContentNegotiationOptions::class); - $listener->setConfig($options->getContentTypeWhitelist()); return $listener; } - } diff --git a/src/Factory/RenameUploadFilterFactory.php b/src/Factory/RenameUploadFilterFactory.php index 8ed3ce3..fc43d66 100644 --- a/src/Factory/RenameUploadFilterFactory.php +++ b/src/Factory/RenameUploadFilterFactory.php @@ -1,45 +1,29 @@ creationOptions); + if ($container->has('Request')) { $filter->setRequest($container->get('Request')); } return $filter; } - - - } diff --git a/src/Factory/RequestFactory.php b/src/Factory/RequestFactory.php index c263b0f..531e613 100644 --- a/src/Factory/RequestFactory.php +++ b/src/Factory/RequestFactory.php @@ -1,36 +1,23 @@ getServiceLocator() ?: $container; + } + $validator = new UploadFile($options); if ($container->has('Request')) { $validator->setRequest($container->get('Request')); @@ -37,6 +42,32 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o return $validator; } + /** + * Create and return an UploadFile validator (v2 compatibility) + * + * @param ServiceLocatorInterface $container + * @param null|string $name + * @param null|string $requestedName + * @return UploadFile + */ + public function createService(ServiceLocatorInterface $container, $name = null, $requestedName = null) + { + $requestedName = $requestedName ?: UploadFile::class; + + if ($container instanceof AbstractPluginManager) { + $container = $container->getServiceLocator() ?: $container; + } + $this($container, $requestedName, $this->options); + } + /** + * Allow injecting options at build time; required for v2 compatibility. + * + * @param array $options + */ + public function setCreationOptions(array $options) + { + $this->options = $options; + } } From bb3983a15e0c4f71a3746c7737266ff8158709d2 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Thu, 7 Jul 2016 13:33:08 -0500 Subject: [PATCH 6/9] CS fixes per phpcs --- src/Module.php | 2 +- test/ContentTypeFilterListenerTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Module.php b/src/Module.php index 5498b46..a593d00 100644 --- a/src/Module.php +++ b/src/Module.php @@ -47,7 +47,7 @@ public function onBootstrap(MvcEvent $e) $services->get(AcceptFilterListener::class)->attach($eventManager); $services->get(ContentTypeFilterListener::class)->attach($eventManager); - + $sharedEventManager = $eventManager->getSharedManager(); $sharedEventManager->attach( DispatchableInterface::class, diff --git a/test/ContentTypeFilterListenerTest.php b/test/ContentTypeFilterListenerTest.php index 0793269..5c970aa 100644 --- a/test/ContentTypeFilterListenerTest.php +++ b/test/ContentTypeFilterListenerTest.php @@ -59,7 +59,7 @@ public function testListenerReturnsApiProblemResponseIfRequestContentTypeIsNotIn $this->assertInstanceOf('ZF\ApiProblem\ApiProblemResponse', $response); $this->assertContains('Invalid content-type', $response->getApiProblem()->detail); } - + /** * @group 66 From 9d76d9b7a7b4359c9ae9022a418ec11f0aae725f Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Thu, 7 Jul 2016 13:56:42 -0500 Subject: [PATCH 7/9] Added lowest/locked/latest CI strategy --- .gitignore | 3 +- .travis.yml | 43 +- composer.json | 9 + composer.lock | 2344 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 2391 insertions(+), 8 deletions(-) create mode 100644 composer.lock diff --git a/.gitignore b/.gitignore index 0ef07ad..31e3ac6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -composer.lock vendor/ -.idea \ No newline at end of file +.idea diff --git a/.travis.yml b/.travis.yml index 83cbb52..63f6a85 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,29 +5,60 @@ language: php cache: directories: - $HOME/.composer/cache + - vendor + +env: + global: + - COMPOSER_ARGS="--no-interaction --ignore-platform-reqs" matrix: fast_finish: true include: - php: 5.6 + env: + - DEPS=lowest + - php: 5.6 + env: + - DEPS=locked + - php: 5.6 + env: + - DEPS=latest + - php: 7 + env: + - DEPS=lowest - php: 7 env: + - DEPS=locked - CS_CHECK=true - - php: hhvm + - php: 7 + env: + - DEPS=latest + - php: hhvm + env: + - DEPS=lowest + - php: hhvm + env: + - DEPS=locked + - php: hhvm + env: + - DEPS=latest allow_failures: - php: hhvm - + notifications: irc: "irc.freenode.org#apigility-dev" email: false before_install: - - if [[ $EXECUTE_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi + - if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi - travis_retry composer self-update install: - - travis_retry composer install --no-interaction --ignore-platform-reqs + - if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi + - if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi + - travis_retry composer install $COMPOSER_ARGS + - composer show script: - - ./vendor/bin/phpunit - - if [[ $CS_CHECK == 'true' ]]; then ./vendor/bin/phpcs ; fi + - composer test + - if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi diff --git a/composer.json b/composer.json index 22dd4ca..f866c4e 100644 --- a/composer.json +++ b/composer.json @@ -55,5 +55,14 @@ "psr-4": { "ZFTest\\ContentNegotiation\\": "test/" } + }, + "scripts": { + "check": [ + "@cs-check", + "@test" + ], + "cs-check": "phpcs", + "cs-fix": "phpcbf", + "test": "phpunit" } } diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..7c3459d --- /dev/null +++ b/composer.lock @@ -0,0 +1,2344 @@ +{ + "_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", + "This file is @generated automatically" + ], + "hash": "f8cff0c879f48bc6f882bf48387af1b1", + "content-hash": "22ea6379c686955398b835e3603e1311", + "packages": [ + { + "name": "container-interop/container-interop", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/fc08354828f8fd3245f77a66b9e23a6bca48297e", + "reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "time": "2014-12-30 15:22:37" + }, + { + "name": "zendframework/zend-config", + "version": "2.6.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-config.git", + "reference": "2920e877a9f6dca9fa8f6bd3b1ffc2e19bb1e30d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-config/zipball/2920e877a9f6dca9fa8f6bd3b1ffc2e19bb1e30d", + "reference": "2920e877a9f6dca9fa8f6bd3b1ffc2e19bb1e30d", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "zendframework/zend-filter": "^2.6", + "zendframework/zend-i18n": "^2.5", + "zendframework/zend-json": "^2.6.1", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3" + }, + "suggest": { + "zendframework/zend-filter": "Zend\\Filter component", + "zendframework/zend-i18n": "Zend\\I18n component", + "zendframework/zend-json": "Zend\\Json to use the Json reader or writer classes", + "zendframework/zend-servicemanager": "Zend\\ServiceManager for use with the Config Factory to retrieve reader and writer instances" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev", + "dev-develop": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Config\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides a nested object property based user interface for accessing this configuration data within application code", + "homepage": "https://github.com/zendframework/zend-config", + "keywords": [ + "config", + "zf2" + ], + "time": "2016-02-04 23:01:10" + }, + { + "name": "zendframework/zend-escaper", + "version": "2.5.2", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-escaper.git", + "reference": "2dcd14b61a72d8b8e27d579c6344e12c26141d4e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-escaper/zipball/2dcd14b61a72d8b8e27d579c6344e12c26141d4e", + "reference": "2dcd14b61a72d8b8e27d579c6344e12c26141d4e", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Escaper\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-escaper", + "keywords": [ + "escaper", + "zf2" + ], + "time": "2016-06-30 19:48:38" + }, + { + "name": "zendframework/zend-eventmanager", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-eventmanager.git", + "reference": "5c80bdee0e952be112dcec0968bad770082c3a6e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/5c80bdee0e952be112dcec0968bad770082c3a6e", + "reference": "5c80bdee0e952be112dcec0968bad770082c3a6e", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0" + }, + "require-dev": { + "athletic/athletic": "^0.1", + "container-interop/container-interop": "^1.1.0", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "^2.0", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0" + }, + "suggest": { + "container-interop/container-interop": "^1.1.0, to use the lazy listeners feature", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev", + "dev-develop": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\EventManager\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Trigger and listen to events within a PHP application", + "homepage": "https://github.com/zendframework/zend-eventmanager", + "keywords": [ + "event", + "eventmanager", + "events", + "zf2" + ], + "time": "2016-02-18 20:53:00" + }, + { + "name": "zendframework/zend-filter", + "version": "2.7.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-filter.git", + "reference": "84c50246428efb0a1e52868e162dab3e149d5b80" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-filter/zipball/84c50246428efb0a1e52868e162dab3e149d5b80", + "reference": "84c50246428efb0a1e52868e162dab3e149d5b80", + "shasum": "59575f46dcd3c335a00ac344809991f5d8185f64" + }, + "require": { + "php": "^5.5 || ^7.0", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "pear/archive_tar": "^1.4", + "phpunit/phpunit": "~4.0", + "zendframework/zend-crypt": "^2.6", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", + "zendframework/zend-uri": "^2.5" + }, + "suggest": { + "zendframework/zend-crypt": "Zend\\Crypt component, for encryption filters", + "zendframework/zend-i18n": "Zend\\I18n component for filters depending on i18n functionality", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component, for using the filter chain functionality", + "zendframework/zend-uri": "Zend\\Uri component, for the UriNormalize filter" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev", + "dev-develop": "2.8-dev" + }, + "zf": { + "component": "Zend\\Filter", + "config-provider": "Zend\\Filter\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Zend\\Filter\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "ZendTest\\Filter\\": "test/" + } + }, + "license": [ + "BSD-3-Clause" + ], + "description": "provides a set of commonly needed data filters", + "homepage": "https://github.com/zendframework/zend-filter", + "keywords": [ + "filter", + "zf2" + ], + "time": "2016-04-18 18:32:43" + }, + { + "name": "zendframework/zend-http", + "version": "2.5.4", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-http.git", + "reference": "7b920b4ec34b5ee58f76eb4e8c408b083121953c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-http/zipball/7b920b4ec34b5ee58f76eb4e8c408b083121953c", + "reference": "7b920b4ec34b5ee58f76eb4e8c408b083121953c", + "shasum": "527c0b7a0c90ef8b36a974959d950ff7168af950" + }, + "require": { + "php": "^5.5 || ^7.0", + "zendframework/zend-loader": "^2.5", + "zendframework/zend-stdlib": "^2.5 || ^3.0", + "zendframework/zend-uri": "^2.5", + "zendframework/zend-validator": "^2.5" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "^4.0", + "zendframework/zend-config": "^2.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Http\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "ZendTest\\Http\\": "test/" + } + }, + "license": [ + "BSD-3-Clause" + ], + "description": "provides an easy interface for performing Hyper-Text Transfer Protocol (HTTP) requests", + "homepage": "https://github.com/zendframework/zend-http", + "keywords": [ + "http", + "zf2" + ], + "time": "2016-02-04 20:36:48" + }, + { + "name": "zendframework/zend-json", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-json.git", + "reference": "f42a1588e75c2a3e338cd94c37906231e616daab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-json/zipball/f42a1588e75c2a3e338cd94c37906231e616daab", + "reference": "f42a1588e75c2a3e338cd94c37906231e616daab", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "^2.3", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "suggest": { + "zendframework/zend-json-server": "For implementing JSON-RPC servers", + "zendframework/zend-xml2json": "For converting XML documents to JSON" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev", + "dev-develop": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Json\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides convenience methods for serializing native PHP to JSON and decoding JSON to native PHP", + "homepage": "https://github.com/zendframework/zend-json", + "keywords": [ + "json", + "zf2" + ], + "time": "2016-04-01 02:34:00" + }, + { + "name": "zendframework/zend-loader", + "version": "2.5.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-loader.git", + "reference": "c5fd2f071bde071f4363def7dea8dec7393e135c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-loader/zipball/c5fd2f071bde071f4363def7dea8dec7393e135c", + "reference": "c5fd2f071bde071f4363def7dea8dec7393e135c", + "shasum": "18e4296563b12965b2a854e8e3b9f64ce38c413a" + }, + "require": { + "php": ">=5.3.23" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Loader\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "ZendTest\\Loader\\": "test/" + } + }, + "license": [ + "BSD-3-Clause" + ], + "description": " ", + "homepage": "https://github.com/zendframework/zend-loader", + "keywords": [ + "loader", + "zf2" + ], + "time": "2015-06-03 14:05:47" + }, + { + "name": "zendframework/zend-modulemanager", + "version": "2.7.2", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-modulemanager.git", + "reference": "2a59ab9a0dd7699a55050dff659ab0f28272b46e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-modulemanager/zipball/2a59ab9a0dd7699a55050dff659ab0f28272b46e", + "reference": "2a59ab9a0dd7699a55050dff659ab0f28272b46e", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "zendframework/zend-config": "^2.6", + "zendframework/zend-eventmanager": "^2.6.2 || ^3.0", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "zendframework/zend-console": "^2.6", + "zendframework/zend-di": "^2.6", + "zendframework/zend-loader": "^2.5", + "zendframework/zend-mvc": "^2.7", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3" + }, + "suggest": { + "zendframework/zend-config": "Zend\\Config component", + "zendframework/zend-console": "Zend\\Console component", + "zendframework/zend-loader": "Zend\\Loader component", + "zendframework/zend-mvc": "Zend\\Mvc component", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev", + "dev-develop": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\ModuleManager\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-modulemanager", + "keywords": [ + "modulemanager", + "zf2" + ], + "time": "2016-05-16 21:21:11" + }, + { + "name": "zendframework/zend-mvc", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-mvc.git", + "reference": "3c6c9e570e01a8b8fcb0605d2f8eb25812c0c273" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-mvc/zipball/3c6c9e570e01a8b8fcb0605d2f8eb25812c0c273", + "reference": "3c6c9e570e01a8b8fcb0605d2f8eb25812c0c273", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.1", + "php": "^5.6 || ^7.0", + "zendframework/zend-eventmanager": "^3.0", + "zendframework/zend-http": "^2.5.4", + "zendframework/zend-modulemanager": "^2.7.1", + "zendframework/zend-router": "^3.0.1", + "zendframework/zend-servicemanager": "^3.0.3", + "zendframework/zend-stdlib": "^3.0", + "zendframework/zend-view": "^2.6.7" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "^4.5", + "zendframework/zend-json": "^2.6.1 || ^3.0", + "zendframework/zend-psr7bridge": "^0.2" + }, + "suggest": { + "zendframework/zend-json": "(^2.6.1 || ^3.0) To auto-deserialize JSON body content in AbstractRestfulController extensions, when json_decode is unavailable", + "zendframework/zend-mvc-console": "zend-mvc-console provides the ability to expose zend-mvc as a console application", + "zendframework/zend-mvc-i18n": "zend-mvc-i18n provides integration with zend-i18n, including a translation bridge and translatable route segments", + "zendframework/zend-mvc-plugin-fileprg": "To provide Post/Redirect/Get functionality around forms that container file uploads", + "zendframework/zend-mvc-plugin-flashmessenger": "To provide flash messaging capabilities between requests", + "zendframework/zend-mvc-plugin-identity": "To access the authenticated identity (per zend-authentication) in controllers", + "zendframework/zend-mvc-plugin-prg": "To provide Post/Redirect/Get functionality within controllers", + "zendframework/zend-psr7bridge": "(^0.2) To consume PSR-7 middleware within the MVC workflow", + "zendframework/zend-servicemanager-di": "zend-servicemanager-di provides utilities for integrating zend-di and zend-servicemanager in your zend-mvc application" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev", + "dev-develop": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Mvc\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-mvc", + "keywords": [ + "mvc", + "zf2" + ], + "time": "2016-06-30 20:30:28" + }, + { + "name": "zendframework/zend-router", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-router.git", + "reference": "03763610632a9022aff22a0e8f340852e68392a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-router/zipball/03763610632a9022aff22a0e8f340852e68392a1", + "reference": "03763610632a9022aff22a0e8f340852e68392a1", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.1", + "php": "^5.5 || ^7.0", + "zendframework/zend-http": "^2.5", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", + "zendframework/zend-stdlib": "^2.7.5 || ^3.0" + }, + "conflict": { + "zendframework/zend-mvc": "<3.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5", + "sebastian/version": "^1.0.4", + "squizlabs/php_codesniffer": "^2.3", + "zendframework/zend-i18n": "^2.6" + }, + "suggest": { + "zendframework/zend-i18n": "^2.6, if defining translatable HTTP path segments" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev", + "dev-develop": "3.1-dev" + }, + "zf": { + "component": "Zend\\Router", + "config-provider": "Zend\\Router\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Zend\\Router\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-router", + "keywords": [ + "mvc", + "routing", + "zf2" + ], + "time": "2016-05-31 20:47:48" + }, + { + "name": "zendframework/zend-servicemanager", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-servicemanager.git", + "reference": "90b88339a4b937c6bb0055ee04b2567e7e628f25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-servicemanager/zipball/90b88339a4b937c6bb0055ee04b2567e7e628f25", + "reference": "90b88339a4b937c6bb0055ee04b2567e7e628f25", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "~1.0", + "php": "^5.5 || ^7.0" + }, + "provide": { + "container-interop/container-interop-implementation": "^1.1" + }, + "require-dev": { + "ocramius/proxy-manager": "^1.0 || ^2.0", + "phpbench/phpbench": "^0.10.0", + "phpunit/phpunit": "^4.6 || ^5.2.10", + "squizlabs/php_codesniffer": "^2.5.1" + }, + "suggest": { + "ocramius/proxy-manager": "ProxyManager 1.* to handle lazy initialization of services", + "zendframework/zend-stdlib": "zend-stdlib ^2.5 if you wish to use the MergeReplaceKey or MergeRemoveKey features in Config instances" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev", + "dev-develop": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\ServiceManager\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-servicemanager", + "keywords": [ + "service-manager", + "servicemanager", + "zf" + ], + "time": "2016-06-01 16:50:58" + }, + { + "name": "zendframework/zend-stdlib", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-stdlib.git", + "reference": "8bafa58574204bdff03c275d1d618aaa601588ae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/8bafa58574204bdff03c275d1d618aaa601588ae", + "reference": "8bafa58574204bdff03c275d1d618aaa601588ae", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0" + }, + "require-dev": { + "athletic/athletic": "~0.1", + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev", + "dev-develop": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Stdlib\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-stdlib", + "keywords": [ + "stdlib", + "zf2" + ], + "time": "2016-04-12 21:19:36" + }, + { + "name": "zendframework/zend-uri", + "version": "2.5.2", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-uri.git", + "reference": "0bf717a239432b1a1675ae314f7c4acd742749ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-uri/zipball/0bf717a239432b1a1675ae314f7c4acd742749ed", + "reference": "0bf717a239432b1a1675ae314f7c4acd742749ed", + "shasum": "212be1d131cb699918b9c1b559b244e031763274" + }, + "require": { + "php": "^5.5 || ^7.0", + "zendframework/zend-escaper": "^2.5", + "zendframework/zend-validator": "^2.5" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Uri\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "ZendTest\\Uri\\": "test/" + } + }, + "license": [ + "BSD-3-Clause" + ], + "description": "a component that aids in manipulating and validating » Uniform Resource Identifiers (URIs)", + "homepage": "https://github.com/zendframework/zend-uri", + "keywords": [ + "uri", + "zf2" + ], + "time": "2016-02-17 22:38:51" + }, + { + "name": "zendframework/zend-validator", + "version": "2.8.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-validator.git", + "reference": "8ec9f57a717dd37340308aa632f148a2c2be1cfc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-validator/zipball/8ec9f57a717dd37340308aa632f148a2c2be1cfc", + "reference": "8ec9f57a717dd37340308aa632f148a2c2be1cfc", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.1", + "php": "^5.5 || ^7.0", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "^4.0", + "zendframework/zend-cache": "^2.6.1", + "zendframework/zend-config": "^2.6", + "zendframework/zend-db": "^2.7", + "zendframework/zend-filter": "^2.6", + "zendframework/zend-http": "^2.5.4", + "zendframework/zend-i18n": "^2.6", + "zendframework/zend-math": "^2.6", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", + "zendframework/zend-session": "^2.6.2", + "zendframework/zend-uri": "^2.5" + }, + "suggest": { + "zendframework/zend-db": "Zend\\Db component", + "zendframework/zend-filter": "Zend\\Filter component, required by the Digits validator", + "zendframework/zend-i18n": "Zend\\I18n component to allow translation of validation error messages as well as to use the various Date validators", + "zendframework/zend-i18n-resources": "Translations of validator messages", + "zendframework/zend-math": "Zend\\Math component", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component to allow using the ValidatorPluginManager and validator chains", + "zendframework/zend-session": "Zend\\Session component", + "zendframework/zend-uri": "Zend\\Uri component, required by the Uri and Sitemap\\Loc validators" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev", + "dev-develop": "2.9-dev" + }, + "zf": { + "component": "Zend\\Validator", + "config-provider": "Zend\\Validator\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Zend\\Validator\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides a set of commonly needed validators", + "homepage": "https://github.com/zendframework/zend-validator", + "keywords": [ + "validator", + "zf2" + ], + "time": "2016-06-23 13:44:31" + }, + { + "name": "zendframework/zend-view", + "version": "2.8.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-view.git", + "reference": "71b4ebd0c4c9a2d0e0438f9d3a435e08dd769ff8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-view/zipball/71b4ebd0c4c9a2d0e0438f9d3a435e08dd769ff8", + "reference": "71b4ebd0c4c9a2d0e0438f9d3a435e08dd769ff8", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "zendframework/zend-eventmanager": "^2.6.2 || ^3.0", + "zendframework/zend-loader": "^2.5", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "^4.5", + "zendframework/zend-authentication": "^2.5", + "zendframework/zend-cache": "^2.6.1", + "zendframework/zend-config": "^2.6", + "zendframework/zend-console": "^2.6", + "zendframework/zend-escaper": "^2.5", + "zendframework/zend-feed": "^2.7", + "zendframework/zend-filter": "^2.6.1", + "zendframework/zend-http": "^2.5.4", + "zendframework/zend-i18n": "^2.6", + "zendframework/zend-json": "^2.6.1", + "zendframework/zend-log": "^2.7", + "zendframework/zend-modulemanager": "^2.7.1", + "zendframework/zend-mvc": "^2.7 || ^3.0", + "zendframework/zend-navigation": "^2.5", + "zendframework/zend-paginator": "^2.5", + "zendframework/zend-permissions-acl": "^2.6", + "zendframework/zend-router": "^3.0.1", + "zendframework/zend-serializer": "^2.6.1", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", + "zendframework/zend-session": "^2.6.2", + "zendframework/zend-uri": "^2.5" + }, + "suggest": { + "zendframework/zend-authentication": "Zend\\Authentication component", + "zendframework/zend-escaper": "Zend\\Escaper component", + "zendframework/zend-feed": "Zend\\Feed component", + "zendframework/zend-filter": "Zend\\Filter component", + "zendframework/zend-http": "Zend\\Http component", + "zendframework/zend-i18n": "Zend\\I18n component", + "zendframework/zend-json": "Zend\\Json component", + "zendframework/zend-mvc": "Zend\\Mvc component", + "zendframework/zend-navigation": "Zend\\Navigation component", + "zendframework/zend-paginator": "Zend\\Paginator component", + "zendframework/zend-permissions-acl": "Zend\\Permissions\\Acl component", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component", + "zendframework/zend-uri": "Zend\\Uri component" + }, + "bin": [ + "bin/templatemap_generator.php" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev", + "dev-develop": "2.9-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\View\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides a system of helpers, output filters, and variable escaping", + "homepage": "https://github.com/zendframework/zend-view", + "keywords": [ + "view", + "zf2" + ], + "time": "2016-06-30 22:28:07" + }, + { + "name": "zfcampus/zf-api-problem", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/zfcampus/zf-api-problem.git", + "reference": "3d2cb9f91aace74d4ca00d865d1ed95b593c6187" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zfcampus/zf-api-problem/zipball/3d2cb9f91aace74d4ca00d865d1ed95b593c6187", + "reference": "3d2cb9f91aace74d4ca00d865d1ed95b593c6187", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^5.6 || ^7.0", + "zendframework/zend-eventmanager": "^2.6.3 || ^3.0.1", + "zendframework/zend-http": "^2.5.4", + "zendframework/zend-json": "^2.6.1 || ^3.0", + "zendframework/zend-mvc": "^2.7.9 || ^3.0.2", + "zendframework/zend-view": "^2.8.1" + }, + "require-dev": { + "phpunit/phpunit": "^4.8", + "squizlabs/php_codesniffer": "^2.3.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev", + "dev-develop": "1.3-dev" + }, + "zf": { + "module": "ZF\\ApiProblem" + } + }, + "autoload": { + "psr-4": { + "ZF\\ApiProblem\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "ZF2 Module providing API-Problem assets and rendering", + "homepage": "http://apigility.org/", + "keywords": [ + "api-problem", + "module", + "rest", + "zend", + "zf2" + ], + "time": "2016-07-07 13:52:00" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2015-06-14 21:17:01" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2015-12-27 11:43:31" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "9270140b940ff02e58ec577c237274e92cd40cdd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9270140b940ff02e58ec577c237274e92cd40cdd", + "reference": "9270140b940ff02e58ec577c237274e92cd40cdd", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.2.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "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-06-10 09:48:41" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2016-06-10 07:14:17" + }, + { + "name": "phpspec/prophecy", + "version": "v1.6.1", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "58a8137754bc24b25740d4281399a4a3596058e0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0", + "reference": "58a8137754bc24b25740d4281399a4a3596058e0", + "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" + }, + "require-dev": { + "phpspec/phpspec": "^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2016-06-07 08:13:47" + }, + { + "name": "phpunit/php-code-coverage", + "version": "2.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.2", + "phpunit/php-token-stream": "~1.3", + "sebastian/environment": "^1.3.2", + "sebastian/version": "~1.0" + }, + "require-dev": { + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "~4" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.2.1", + "ext-xmlwriter": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2015-10-06 15:47:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2015-06-21 13:08:43" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21 13:50:34" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4|~5" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2016-05-12 18:03:57" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2015-09-15 10:49:45" + }, + { + "name": "phpunit/phpunit", + "version": "4.8.26", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "fc1d8cd5b5de11625979125c5639347896ac2c74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fc1d8cd5b5de11625979125c5639347896ac2c74", + "reference": "fc1d8cd5b5de11625979125c5639347896ac2c74", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpspec/prophecy": "^1.3.1", + "phpunit/php-code-coverage": "~2.1", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "~2.3", + "sebastian/comparator": "~1.1", + "sebastian/diff": "~1.2", + "sebastian/environment": "~1.3", + "sebastian/exporter": "~1.2", + "sebastian/global-state": "~1.0", + "sebastian/version": "~1.0", + "symfony/yaml": "~2.1|~3.0" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.8.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2016-05-17 03:09:28" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "2.3.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": ">=5.3.3", + "phpunit/php-text-template": "~1.2", + "sebastian/exporter": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2015-10-02 06:51:40" + }, + { + "name": "sebastian/comparator", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2015-07-26 15:48:44" + }, + { + "name": "sebastian/diff", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2015-12-08 07:14:41" + }, + { + "name": "sebastian/environment", + "version": "1.3.7", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716", + "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2016-05-17 03:18:57" + }, + { + "name": "sebastian/exporter", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2016-06-17 09:04:28" + }, + { + "name": "sebastian/global-state", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2015-10-12 03:26:01" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "913401df809e99e4f47b27cdd781f4a258d58791" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", + "reference": "913401df809e99e4f47b27cdd781f4a258d58791", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2015-11-11 19:50:13" + }, + { + "name": "sebastian/version", + "version": "1.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "shasum": "" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2015-06-21 13:59:46" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.6.1", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "fb72ed32f8418db5e7770be1653e62e0d6f5dd3d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/fb72ed32f8418db5e7770be1653e62e0d6f5dd3d", + "reference": "fb72ed32f8418db5e7770be1653e62e0d6f5dd3d", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2016-05-30 22:24:32" + }, + { + "name": "symfony/yaml", + "version": "v3.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "2884c26ce4c1d61aebf423a8b912950fe7c764de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/2884c26ce4c1d61aebf423a8b912950fe7c764de", + "reference": "2884c26ce4c1d61aebf423a8b912950fe7c764de", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2016-06-29 05:41:56" + }, + { + "name": "webmozart/assert", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", + "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2015-08-24 13:29:44" + }, + { + "name": "zendframework/zend-hydrator", + "version": "2.2.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-hydrator.git", + "reference": "0ac0d3e569781f1895670b0c8d0dc7f25b8a3182" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-hydrator/zipball/0ac0d3e569781f1895670b0c8d0dc7f25b8a3182", + "reference": "0ac0d3e569781f1895670b0c8d0dc7f25b8a3182", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "zendframework/zend-stdlib": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5", + "squizlabs/php_codesniffer": "^2.3.1", + "zendframework/zend-eventmanager": "^3.0", + "zendframework/zend-filter": "^2.6", + "zendframework/zend-inputfilter": "^2.6", + "zendframework/zend-serializer": "^2.6.1", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3" + }, + "suggest": { + "zendframework/zend-eventmanager": "^2.6.2 || ^3.0, to support aggregate hydrator usage", + "zendframework/zend-filter": "^2.6, to support naming strategy hydrator usage", + "zendframework/zend-serializer": "^2.6.1, to use the SerializableStrategy", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3, to support hydrator plugin manager usage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-release-1.0": "1.0-dev", + "dev-release-1.1": "1.1-dev", + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + }, + "zf": { + "component": "Zend\\Hydrator", + "config-provider": "Zend\\Hydrator\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Zend\\Hydrator\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-hydrator", + "keywords": [ + "hydrator", + "zf2" + ], + "time": "2016-04-18 17:59:29" + }, + { + "name": "zendframework/zend-paginator", + "version": "2.7.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-paginator.git", + "reference": "fbca3fe3ee5fa995158c1b5dd7463d7abec44aac" + }, + "dist": { + "type": "zip", + "url": "https://packages.zendframework.com/composer/zendframework-zend-paginator-2.7.0-ee709c.zip", + "reference": "fbca3fe3ee5fa995158c1b5dd7463d7abec44aac", + "shasum": "41224941976cf1c415047ec3a7fc7864c934351e" + }, + "require": { + "php": "^5.5 || ^7.0", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "zendframework/zend-cache": "^2.6.1", + "zendframework/zend-config": "^2.6.0", + "zendframework/zend-db": "^2.7", + "zendframework/zend-filter": "^2.6.1", + "zendframework/zend-json": "^2.6.1", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", + "zendframework/zend-view": "^2.6.3" + }, + "suggest": { + "zendframework/zend-cache": "Zend\\Cache component to support cache features", + "zendframework/zend-db": "Zend\\Db component", + "zendframework/zend-filter": "Zend\\Filter component", + "zendframework/zend-json": "Zend\\Json component", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component", + "zendframework/zend-view": "Zend\\View component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev", + "dev-develop": "2.8-dev" + }, + "zf": { + "component": "Zend\\Paginator", + "config-provider": "Zend\\Paginator\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Zend\\Paginator\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "ZendTest\\Paginator\\": "test/" + } + }, + "license": [ + "BSD-3-Clause" + ], + "description": " ", + "homepage": "https://github.com/zendframework/zend-paginator", + "keywords": [ + "paginator", + "zf2" + ], + "time": "2016-04-11 21:18:13" + }, + { + "name": "zfcampus/zf-hal", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/zfcampus/zf-hal.git", + "reference": "9d88ea71fc68e4643cd53d8a99e96d3b0a812b0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zfcampus/zf-hal/zipball/9d88ea71fc68e4643cd53d8a99e96d3b0a812b0c", + "reference": "9d88ea71fc68e4643cd53d8a99e96d3b0a812b0c", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "zendframework/zend-eventmanager": "^2.6.3 || ^3.0.1", + "zendframework/zend-filter": "^2.7.1", + "zendframework/zend-http": "^2.5.4", + "zendframework/zend-hydrator": "^2.2.1", + "zendframework/zend-mvc": "^2.7.9 || ^3.0.2", + "zendframework/zend-paginator": "^2.7", + "zendframework/zend-stdlib": "^2.7.7 || ^3.0.1", + "zendframework/zend-uri": "^2.5.2", + "zendframework/zend-view": "^2.8.1", + "zfcampus/zf-api-problem": "^1.2.1" + }, + "require-dev": { + "phpunit/phpunit": "^4.8 || ^5.4", + "squizlabs/php_codesniffer": "^2.3.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev", + "dev-develop": "1.5-dev" + }, + "zf": { + "module": "ZF\\Hal" + } + }, + "autoload": { + "psr-4": { + "ZF\\Hal\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "ZF2 Module providing Hypermedia Application Language assets and rendering", + "homepage": "http://apigility.org/", + "keywords": [ + "hal", + "module", + "rest", + "zend", + "zf2" + ], + "time": "2016-07-07 17:51:02" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "^5.6 || ^7.0" + }, + "platform-dev": [] +} From a5924140ec9ac924c972c20d76f88c428cc90575 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Thu, 7 Jul 2016 14:10:09 -0500 Subject: [PATCH 8/9] Ensure code tests against v2 components - Updated `RenameUploadFilterFactory` to work with both v2 and v3. - Fixed issue with return value in `UploadFileValidatorFactory`. - Updated `ContentTypeFilterListenerTest`, `ContentTypeListenerTest`, and `AcceptListenerTest` to vary how route matches are created, based on zend-mvc version detected. --- src/Factory/RenameUploadFilterFactory.php | 47 ++++++++++++++++++++-- src/Factory/UploadFileValidatorFactory.php | 2 +- test/AcceptListenerTest.php | 5 ++- test/ContentTypeFilterListenerTest.php | 5 ++- test/ContentTypeListenerTest.php | 31 +++++++------- test/RouteMatchFactoryTrait.php | 25 ++++++++++++ 6 files changed, 91 insertions(+), 24 deletions(-) create mode 100644 test/RouteMatchFactoryTrait.php diff --git a/src/Factory/RenameUploadFilterFactory.php b/src/Factory/RenameUploadFilterFactory.php index fc43d66..31ef436 100644 --- a/src/Factory/RenameUploadFilterFactory.php +++ b/src/Factory/RenameUploadFilterFactory.php @@ -7,18 +7,28 @@ namespace ZF\ContentNegotiation\Factory; use Interop\Container\ContainerInterface; -use Traversable; +use Zend\ServiceManager\FactoryInterface; +use Zend\ServiceManager\ServiceLocatorInterface; use ZF\ContentNegotiation\Filter\RenameUpload; -class RenameUploadFilterFactory +class RenameUploadFilterFactory implements FactoryInterface { + /** + * Required for v2 compatibility. + * + * @var null|array + */ + private $options; + /** * @param ContainerInterface $container + * @param string $requestedName, + * @param null|array $options * @return RenameUpload */ - public function __invoke(ContainerInterface $container) + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { - $filter = new RenameUpload($this->creationOptions); + $filter = new RenameUpload($options); if ($container->has('Request')) { $filter->setRequest($container->get('Request')); @@ -26,4 +36,33 @@ public function __invoke(ContainerInterface $container) return $filter; } + + /** + * Create and return a RenameUpload filter (v2 compatibility) + * + * @param ServiceLocatorInterface $container + * @param null|string $name + * @param null|string $requestedName + * @return RenameUpload + */ + public function createService(ServiceLocatorInterface $container, $name = null, $requestedName = null) + { + $requestedName = $requestedName ?: RenameUpload::class; + + if ($container instanceof AbstractPluginManager) { + $container = $container->getServiceLocator() ?: $container; + } + + return $this($container, $requestedName, $this->options); + } + + /** + * Allow injecting options at build time; required for v2 compatibility. + * + * @param array $options + */ + public function setCreationOptions(array $options) + { + $this->options = $options; + } } diff --git a/src/Factory/UploadFileValidatorFactory.php b/src/Factory/UploadFileValidatorFactory.php index 6029191..94ae16c 100644 --- a/src/Factory/UploadFileValidatorFactory.php +++ b/src/Factory/UploadFileValidatorFactory.php @@ -58,7 +58,7 @@ public function createService(ServiceLocatorInterface $container, $name = null, $container = $container->getServiceLocator() ?: $container; } - $this($container, $requestedName, $this->options); + return $this($container, $requestedName, $this->options); } /** diff --git a/test/AcceptListenerTest.php b/test/AcceptListenerTest.php index d29b0ae..07576e7 100644 --- a/test/AcceptListenerTest.php +++ b/test/AcceptListenerTest.php @@ -10,12 +10,13 @@ use Zend\Http\Request; use Zend\Mvc\Controller\PluginManager as ControllerPluginManager; use Zend\Mvc\MvcEvent; -use Zend\Router\RouteMatch; use Zend\ServiceManager\ServiceManager; use ZF\ContentNegotiation\AcceptListener; class AcceptListenerTest extends TestCase { + use RouteMatchFactoryTrait; + public function setUp() { $plugins = new ControllerPluginManager(new ServiceManager()); @@ -38,7 +39,7 @@ public function setUp() $this->controller = new TestAsset\ContentTypeController(); $this->event->setTarget($this->controller); $this->event->setRequest(new Request); - $this->event->setRouteMatch(new RouteMatch([ + $this->event->setRouteMatch($this->createRouteMatch([ 'controller' => __NAMESPACE__ . '\TestAsset\ContentTypeController', ])); diff --git a/test/ContentTypeFilterListenerTest.php b/test/ContentTypeFilterListenerTest.php index 5c970aa..3ffa1e0 100644 --- a/test/ContentTypeFilterListenerTest.php +++ b/test/ContentTypeFilterListenerTest.php @@ -10,18 +10,19 @@ use Zend\EventManager\EventManager; use Zend\Http\Request; use Zend\Mvc\MvcEvent; -use Zend\Router\RouteMatch; use ZF\ContentNegotiation\ContentTypeFilterListener; class ContentTypeFilterListenerTest extends TestCase { + use RouteMatchFactoryTrait; + public function setUp() { $this->listener = new ContentTypeFilterListener(); $this->event = new MvcEvent(); $this->event->setTarget(new TestAsset\ContentTypeController()); $this->event->setRequest(new Request()); - $this->event->setRouteMatch(new RouteMatch([ + $this->event->setRouteMatch($this->createRouteMatch([ 'controller' => __NAMESPACE__ . '\TestAsset\ContentTypeController', ])); } diff --git a/test/ContentTypeListenerTest.php b/test/ContentTypeListenerTest.php index 9357930..dd1c9cf 100644 --- a/test/ContentTypeListenerTest.php +++ b/test/ContentTypeListenerTest.php @@ -10,7 +10,6 @@ use ReflectionObject; use Zend\Http\Request; use Zend\Mvc\MvcEvent; -use Zend\Router\RouteMatch; use Zend\Stdlib\Parameters; use ZF\ContentNegotiation\ContentTypeListener; use ZF\ContentNegotiation\MultipartContentParser; @@ -18,6 +17,8 @@ class ContentTypeListenerTest extends TestCase { + use RouteMatchFactoryTrait; + public function setUp() { $this->listener = new ContentTypeListener(); @@ -48,7 +49,7 @@ public function testJsonDecodeErrorsReturnsProblemResponse($method) $event = new MvcEvent(); $event->setRequest($request); - $event->setRouteMatch(new RouteMatch([])); + $event->setRouteMatch($this->createRouteMatch([])); $result = $listener($event); $this->assertInstanceOf('ZF\ApiProblem\ApiProblemResponse', $result); @@ -72,7 +73,7 @@ public function testJsonDecodeStringErrorsReturnsProblemResponse($method) $event = new MvcEvent(); $event->setRequest($request); - $event->setRouteMatch(new RouteMatch([])); + $event->setRouteMatch($this->createRouteMatch([])); $result = $listener($event); $this->assertInstanceOf('ZF\ApiProblem\ApiProblemResponse', $result); @@ -105,7 +106,7 @@ public function testCanDecodeMultipartFormDataRequestsForPutPatchAndDeleteOperat $event = new MvcEvent(); $event->setRequest($request); - $event->setRouteMatch(new RouteMatch([])); + $event->setRouteMatch($this->createRouteMatch([])); $listener = $this->listener; $result = $listener($event); @@ -145,7 +146,7 @@ public function testCanDecodeMultipartFormDataRequestsFromStreamsForPutAndPatchO $event = new MvcEvent(); $event->setRequest($request); - $event->setRouteMatch(new RouteMatch([])); + $event->setRouteMatch($this->createRouteMatch([])); $listener = $this->listener; $result = $listener($event); @@ -194,7 +195,7 @@ public function testDecodingMultipartFormDataWithFileRegistersFileCleanupEventLi $event = new MvcEvent(); $event->setTarget($target); $event->setRequest($request); - $event->setRouteMatch(new RouteMatch([])); + $event->setRouteMatch($this->createRouteMatch([])); $listener = $this->listener; $result = $listener($event); @@ -297,7 +298,7 @@ public function testWillNotAttemptToInjectNullValueForBodyParams($method) $event = new MvcEvent(); $event->setRequest($request); - $event->setRouteMatch(new RouteMatch([])); + $event->setRouteMatch($this->createRouteMatch([])); $result = $listener($event); $this->assertNull($result); @@ -338,7 +339,7 @@ public function testWillNotAttemptToInjectNullValueForBodyParamsWhenContentIsWhi $event = new MvcEvent(); $event->setRequest($request); - $event->setRouteMatch(new RouteMatch([])); + $event->setRouteMatch($this->createRouteMatch([])); $result = $listener($event); $this->assertNull($result); @@ -379,7 +380,7 @@ public function testWillHandleJsonContentWithLeadingWhitespace($method, $content $event = new MvcEvent(); $event->setRequest($request); - $event->setRouteMatch(new RouteMatch([])); + $event->setRouteMatch($this->createRouteMatch([])); $result = $listener($event); $this->assertNull($result); @@ -420,7 +421,7 @@ public function testWillHandleJsonContentWithTrailingWhitespace($method, $conten $event = new MvcEvent(); $event->setRequest($request); - $event->setRouteMatch(new RouteMatch([])); + $event->setRouteMatch($this->createRouteMatch([])); $result = $listener($event); $this->assertNull($result); @@ -461,7 +462,7 @@ public function testWillHandleJsonContentWithLeadingAndTrailingWhitespace($metho $event = new MvcEvent(); $event->setRequest($request); - $event->setRouteMatch(new RouteMatch([])); + $event->setRouteMatch($this->createRouteMatch([])); $result = $listener($event); $this->assertNull($result); @@ -493,7 +494,7 @@ public function testWillNotRemoveWhitespaceInsideBody($method, $content) $event = new MvcEvent(); $event->setRequest($request); - $event->setRouteMatch(new RouteMatch([])); + $event->setRouteMatch($this->createRouteMatch([])); $result = $listener($event); $this->assertNull($result); @@ -516,7 +517,7 @@ public function testReturns400ResponseWhenBodyPartIsMissingName() $event = new MvcEvent(); $event->setRequest($request); - $event->setRouteMatch(new RouteMatch([])); + $event->setRouteMatch($this->createRouteMatch([])); $listener = $this->listener; $result = $listener($event); @@ -538,7 +539,7 @@ public function testReturnsArrayWhenFieldNamesHaveArraySyntax() $request->setContent(file_get_contents(__DIR__ . '/TestAsset/multipart-form-data-array.txt')); $event = new MvcEvent(); $event->setRequest($request); - $event->setRouteMatch(new RouteMatch([])); + $event->setRouteMatch($this->createRouteMatch([])); $listener = $this->listener; $result = $listener($event); $parameterData = $event->getParam('ZFContentNegotiationParameterData'); @@ -582,7 +583,7 @@ public function testMergesHalEmbeddedPropertiesIntoTopLevelObjectWhenDecodingHal $event = new MvcEvent(); $event->setRequest($request); - $event->setRouteMatch(new RouteMatch([])); + $event->setRouteMatch($this->createRouteMatch([])); $result = $listener($event); $this->assertNull($result); diff --git a/test/RouteMatchFactoryTrait.php b/test/RouteMatchFactoryTrait.php new file mode 100644 index 0000000..0087d2a --- /dev/null +++ b/test/RouteMatchFactoryTrait.php @@ -0,0 +1,25 @@ + Date: Thu, 7 Jul 2016 14:19:48 -0500 Subject: [PATCH 9/9] Administrava - Added CONDUCT - Updated CONTRIBUTING to follow addition of scripts to `composer.json` and addition of CONDUCT. - Changed LICENSE to markdown. - Updated configuration to remove invokables. - PHPUnit configuration as dist file. - Instructions regarding zend-component-installer in README, and updates based on changes to module. --- CONDUCT.md | 43 ++++++++++ CONTRIBUTING.md | 22 +++-- LICENSE.txt => LICENSE.md | 19 ++--- README.md | 137 ++++++++++++++++++++------------ config/module.config.php | 12 ++- phpunit.xml => phpunit.xml.dist | 0 6 files changed, 163 insertions(+), 70 deletions(-) create mode 100644 CONDUCT.md rename LICENSE.txt => LICENSE.md (59%) rename phpunit.xml => phpunit.xml.dist (100%) diff --git a/CONDUCT.md b/CONDUCT.md new file mode 100644 index 0000000..c663d2b --- /dev/null +++ b/CONDUCT.md @@ -0,0 +1,43 @@ +# Contributor Code of Conduct + +The Zend Framework project adheres to [The Code Manifesto](http://codemanifesto.com) +as its guidelines for contributor interactions. + +## The Code Manifesto + +We want to work in an ecosystem that empowers developers to reach their +potential — one that encourages growth and effective collaboration. A space that +is safe for all. + +A space such as this benefits everyone that participates in it. It encourages +new developers to enter our field. It is through discussion and collaboration +that we grow, and through growth that we improve. + +In the effort to create such a place, we hold to these values: + +1. **Discrimination limits us.** This includes discrimination on the basis of + race, gender, sexual orientation, gender identity, age, nationality, technology + and any other arbitrary exclusion of a group of people. +2. **Boundaries honor us.** Your comfort levels are not everyone’s comfort + levels. Remember that, and if brought to your attention, heed it. +3. **We are our biggest assets.** None of us were born masters of our trade. + Each of us has been helped along the way. Return that favor, when and where + you can. +4. **We are resources for the future.** As an extension of #3, share what you + know. Make yourself a resource to help those that come after you. +5. **Respect defines us.** Treat others as you wish to be treated. Make your + discussions, criticisms and debates from a position of respectfulness. Ask + yourself, is it true? Is it necessary? Is it constructive? Anything less is + unacceptable. +6. **Reactions require grace.** Angry responses are valid, but abusive language + and vindictive actions are toxic. When something happens that offends you, + handle it assertively, but be respectful. Escalate reasonably, and try to + allow the offender an opportunity to explain themselves, and possibly correct + the issue. +7. **Opinions are just that: opinions.** Each and every one of us, due to our + background and upbringing, have varying opinions. The fact of the matter, is + that is perfectly acceptable. Remember this: if you respect your own + opinions, you should respect the opinions of others. +8. **To err is human.** You might not intend it, but mistakes do happen and + contribute to build experience. Tolerate honest mistakes, and don't hesitate + to apologize if you make one yourself. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d7d8743..62fdd14 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -50,25 +50,31 @@ First, use [Composer](https://getcomposer.org) to install all dependencies: $ composer install ``` -To run tests, use the PHPUnit executable installed by Composer: +To run tests: ```console -$ ./vendor/bin/phpunit +$ composer test ``` ## CODING STANDARDS While Apigility uses Zend Framework 2 coding standards, in practice, we check -standards using [php-cs-fixer](https://github.com/fabpot/PHP-CS-Fixer) (which is -installed via Composer with other dependencies). To check for CS issues: +standards against PSR-1/2. To check for CS issues: ```console -$ ./vendor/bin/php-cs-fixer fix . --dry-run +$ composer cs-check ``` -This will report CS issues. Alternately, you can have the tool fix them for you -by omitting the `--dry-run` switch: +This will report CS issues. You can also attempt to fix many reported errors +automatically: ```console -$ ./vendor/bin/php-cs-fixer fix . +$ composer cs-fix ``` + +If you use `cs-fix` to fix issues, make certain you add and commit any files +changed! + +## Conduct + +Please see our [CONDUCT.md](CONDUCT.md) to understand expected behavior when interacting with others in the project. diff --git a/LICENSE.txt b/LICENSE.md similarity index 59% rename from LICENSE.txt rename to LICENSE.md index 9fe05c7..94fe586 100644 --- a/LICENSE.txt +++ b/LICENSE.md @@ -1,19 +1,20 @@ -Copyright (c) 2014, Zend Technologies USA, Inc. +Copyright (c) 2014-2016, Zend Technologies USA, Inc. + All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. - * Neither the name of Zend Technologies USA, Inc. nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. +- Neither the name of Zend Technologies USA, Inc. nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED diff --git a/README.md b/README.md index def5ca5..f5b6bc5 100644 --- a/README.md +++ b/README.md @@ -31,14 +31,14 @@ Installation Run the following `composer` command: ```console -$ composer require "zfcampus/zf-content-negotiation:~1.0-dev" +$ composer require zfcampus/zf-content-negotiation ``` Alternately, manually add the following to your `composer.json`, in the `require` section: ```javascript "require": { - "zfcampus/zf-content-negotiation": "~1.0-dev" + "zfcampus/zf-content-negotiation": "^1.2" } ``` @@ -48,16 +48,21 @@ Finally, add the module name to your project's `config/application.config.php` u key: ```php -return array( +return [ /* ... */ - 'modules' => array( + 'modules' => [ /* ... */ 'ZF\ContentNegotiation', - ), + ], /* ... */ -); +]; ``` +> ### zf-component-installer +> +> If you use [zf-component-installer](https://github.com/zendframework/zf-component-installer), +> that plugin will install zf-content-negotiation as a module for you. + Configuration ------------- @@ -79,18 +84,18 @@ model. Example: ```php -'controllers' => array( +'controllers' => [ // Named selector: 'Application\Controller\HelloWorld1' => 'Json', // Selector definition: - 'Application\Controller\HelloWorld2' => array( - 'ZF\ContentNegotiation\JsonModel' => array( + 'Application\Controller\HelloWorld2' => [ + 'ZF\ContentNegotiation\JsonModel' => [ 'application/json', 'application/*+json', - ), - ), -), + ], + ], +], ``` #### Key: `selectors` @@ -102,14 +107,14 @@ definition (which uses the format described in the [controllers](#key-controller Example: ```php -'selectors' => array( - 'Json' => array( - 'ZF\ContentNegotiation\JsonModel' => array( +'selectors' => [ + 'Json' => [ + 'ZF\ContentNegotiation\JsonModel' => [ 'application/json', 'application/*+json', - ), - ), -), + ], + ], +], ``` A selector can contain multiple view models, each associated with different media types, allowing @@ -117,17 +122,17 @@ you to provide multiple representations. As an example, the following selector w controller to return either JSON or HTML output: ```php -'selectors' => array( - 'HTML-Json' => array( - 'ZF\ContentNegotiation\JsonModel' => array( +'selectors' => [ + 'HTML-Json' => [ + 'ZF\ContentNegotiation\JsonModel' => [ 'application/json', 'application/*+json', - ), - 'ZF\ContentNegotiation\ViewModel' => array( + ], + 'ZF\ContentNegotiation\ViewModel' => [ 'text/html', - ), - ), -), + ], + ], +], ``` #### Key: `accept_whitelist` @@ -143,13 +148,13 @@ The value of each controller service name key can either be a string or an array Example: ```php -'accept_whitelist' => array( - 'Application\\Controller\\HelloApiController' => array( +'accept_whitelist' => [ + 'Application\\Controller\\HelloApiController' => [ 'application/vnd.application-hello+json', 'application/hal+json', 'application/json', - ), -), + ], +], ``` #### Key: `content_type_whitelist` @@ -165,12 +170,12 @@ The value of each controller service name key can either be a string or an array Example: ```php -'content_type_whitelist' => array( - 'Application\\Controller\\HelloWorldController' => array( +'content_type_whitelist' => [ + 'Application\\Controller\\HelloWorldController' => [ 'application/vnd.application-hello-world+json', 'application/json', - ), -), + ], +], ``` ### System Configuration @@ -179,23 +184,53 @@ The following configuration is provided in `config/module.config.php` to enable function: ```php -'service_manager' => array( - 'factories' => array( - 'ZF\ContentNegotiation\AcceptListener' => 'ZF\ContentNegotiation\Factory\AcceptListenerFactory', - 'ZF\ContentNegotiation\AcceptFilterListener' => 'ZF\ContentNegotiation\Factory\AcceptFilterListenerFactory', - 'ZF\ContentNegotiation\ContentTypeFilterListener' => 'ZF\ContentNegotiation\Factory\ContentTypeFilterListenerFactory', - ) -), -'controller_plugins' => array( - 'invokables' => array( - 'routeParam' => 'ZF\ContentNegotiation\ControllerPlugin\RouteParam', - 'queryParam' => 'ZF\ContentNegotiation\ControllerPlugin\QueryParam', - 'bodyParam' => 'ZF\ContentNegotiation\ControllerPlugin\BodyParam', - 'routeParams' => 'ZF\ContentNegotiation\ControllerPlugin\RouteParams', - 'queryParams' => 'ZF\ContentNegotiation\ControllerPlugin\QueryParams', - 'bodyParams' => 'ZF\ContentNegotiation\ControllerPlugin\BodyParams', - ) -) +'filters' => [ + 'aliases' => [ + 'Zend\Filter\File\RenameUpload' => 'filerenameupload', + ], + 'factories' => [ + 'filerenameupload' => Factory\RenameUploadFilterFactory::class, + ], +], + +'validators' => [ + 'aliases' => [ + 'Zend\Validator\File\UploadFile' => 'fileuploadfile', + ], + 'factories' => [ + 'fileuploadfile' => Factory\UploadFileValidatorFactory::class, + ], +], + +'service_manager' => [ + 'factories' => [ + ContentTypeListener::class => InvokableFactory::class, + 'Request' => Factory\RequestFactory::class, + AcceptListener::class => Factory\AcceptListenerFactory::class, + AcceptFilterListener::class => Factory\AcceptFilterListenerFactory::class, + ContentTypeFilterListener::class => Factory\ContentTypeFilterListenerFactory::class, + ContentNegotiationOptions::class => Factory\ContentNegotiationOptionsFactory::class, + ], +], + +'controller_plugins' => [ + 'aliases' => [ + 'routeParam' => ControllerPlugin\RouteParam::class, + 'queryParam' => ControllerPlugin\QueryParam::class, + 'bodyParam' => ControllerPlugin\BodyParam::class, + 'routeParams' => ControllerPlugin\RouteParams::class, + 'queryParams' => ControllerPlugin\QueryParams::class, + 'bodyParams' => ControllerPlugin\BodyParams::class, + ], + 'factories' => [ + ControllerPlugin\RouteParam::class => InvokableFactory::class, + ControllerPlugin\QueryParam::class => InvokableFactory::class, + ControllerPlugin\BodyParam::class => InvokableFactory::class, + ControllerPlugin\RouteParams::class => InvokableFactory::class, + ControllerPlugin\QueryParams::class => InvokableFactory::class, + ControllerPlugin\BodyParams::class => InvokableFactory::class, + ], +], ``` ZF2 Events diff --git a/config/module.config.php b/config/module.config.php index 5a90651..f6c88e7 100644 --- a/config/module.config.php +++ b/config/module.config.php @@ -1,7 +1,7 @@ [ - 'invokables' => [ + 'aliases' => [ 'routeParam' => ControllerPlugin\RouteParam::class, 'queryParam' => ControllerPlugin\QueryParam::class, 'bodyParam' => ControllerPlugin\BodyParam::class, @@ -83,5 +83,13 @@ 'queryParams' => ControllerPlugin\QueryParams::class, 'bodyParams' => ControllerPlugin\BodyParams::class, ], + 'factories' => [ + ControllerPlugin\RouteParam::class => InvokableFactory::class, + ControllerPlugin\QueryParam::class => InvokableFactory::class, + ControllerPlugin\BodyParam::class => InvokableFactory::class, + ControllerPlugin\RouteParams::class => InvokableFactory::class, + ControllerPlugin\QueryParams::class => InvokableFactory::class, + ControllerPlugin\BodyParams::class => InvokableFactory::class, + ], ], ]; diff --git a/phpunit.xml b/phpunit.xml.dist similarity index 100% rename from phpunit.xml rename to phpunit.xml.dist