From b7103c0a742a2906a9f591b46c8aa9f13839ac20 Mon Sep 17 00:00:00 2001 From: Christophe G <1050197+cgaube@users.noreply.github.com> Date: Sun, 10 Jul 2022 15:57:53 -0700 Subject: [PATCH 01/20] refactor(service-manager): improve Resolver --- composer.json | 13 +- composer.lock | 225 +++++++++--------- packages/cache/src/ConfigProvider.php | 4 +- .../cache/src/Factory/ChainAdapterFactory.php | 4 +- .../src/Factory/MemcachedAdapterFactory.php | 4 +- .../cache/src/Factory/RedisAdapterFactory.php | 4 +- .../src/Factory/TagAwareAdapterFactory.php | 4 +- .../src/Factory/DiskAbstractFactory.php | 4 +- .../src/Factory/S3AdapterFactory.php | 4 +- .../src/Factory/ChannelAbstractFactory.php | 4 +- .../service-manager/{README.MD => README.md} | 90 +++++-- .../service-manager/src/ConfigProvider.php | 5 + ...actory.php => ResolverAbstractFactory.php} | 8 +- packages/service-manager/src/Resolver.php | 130 +++++----- ...st.php => ResolverAbstractFactoryTest.php} | 12 +- .../service-manager/tests/ResolverTest.php | 193 +++++++-------- tests/Feature/Messenger/MessengerTest.php | 5 +- .../Messenger/Queues/TransportsTest.php | 5 +- tests/FeatureTestCase.php | 8 + 19 files changed, 388 insertions(+), 338 deletions(-) rename packages/service-manager/{README.MD => README.md} (53%) rename packages/service-manager/src/Factory/{ReflectionAbstractFactory.php => ResolverAbstractFactory.php} (92%) rename packages/service-manager/tests/Factory/{ReflectionAbstractFactoryTest.php => ResolverAbstractFactoryTest.php} (83%) diff --git a/composer.json b/composer.json index fa77bf0..9909da9 100755 --- a/composer.json +++ b/composer.json @@ -4,12 +4,16 @@ "license": "BSD-3-Clause", "require": { "php": "^8.1", + "cebe/php-openapi": "^1.7.0", "illuminate/database": "^9.0", "illuminate/support": "^9.0", + "laminas/laminas-config": "^3.7.0", + "laminas/laminas-config-aggregator": "^1.7.0", "laminas/laminas-servicemanager": "^3.12.0", "laminas/laminas-stdlib": "^3.1", "league/flysystem": "^3.0.0", "monolog/monolog": "^3.1.0", + "ocramius/package-versions": "^2.5.1", "psr/container": "^1.1 || ^2.0", "psr/http-server-middleware": "^1.0", "robmorgan/phinx": "^0.12.9", @@ -18,11 +22,11 @@ "symfony/messenger": "^6.0", "symfony/property-access": "^6.0", "symfony/property-info": "^6.0", - "symfony/serializer": "^6.0" + "symfony/serializer": "^6.0", + "symfony/yaml": "^6.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.3.2", - "laminas/laminas-config-aggregator": "^1.1", "league/flysystem-aws-s3-v3": "^3.0", "league/flysystem-ftp": "^3.0", "league/flysystem-memory": "^3.0", @@ -35,6 +39,7 @@ }, "autoload": { "classmap": [ + "packages/api/src/", "packages/cache/src/", "packages/console/src/", "packages/db-eloquent/src/", @@ -45,6 +50,7 @@ "packages/service-manager/src/" ], "psr-4": { + "AftDev\\Api\\": "packages/api/src/", "AftDev\\Cache\\": "packages/cache/src/", "AftDev\\Console\\": "packages/console/src/", "AftDev\\DbEloquent\\": "packages/db-eloquent/src/", @@ -57,6 +63,7 @@ }, "autoload-dev": { "psr-4": { + "AftDevTest\\Api\\": "packages/api/tests/", "AftDevTest\\Cache\\": "packages/cache/tests/", "AftDevTest\\Console\\": "packages/console/tests/", "AftDevTest\\DbEloquent\\": "packages/db-eloquent/tests/", @@ -69,6 +76,7 @@ } }, "replace": { + "aftdev/api": "self.version", "aftdev/cache-manager": "1.0.0", "aftdev/console-manager": "1.0.0", "aftdev/db-eloquent": "1.0.0", @@ -105,6 +113,7 @@ "AftDev\\Cache\\ConfigProvider", "AftDev\\Console\\ConfigProvider", "AftDev\\Messenger\\ConfigProvider", + "AftDev\\Api\\ConfigProvider", "AftDev\\Log\\ConfigProvider" ] } diff --git a/composer.lock b/composer.lock index 378f7de..925526f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,57 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "88c288a646b2aa60e2b2b5a2e85a05e7", + "content-hash": "41c97abd2a311edf65776a3304626530", "packages": [ + { + "name": "brick/varexporter", + "version": "0.3.6", + "source": { + "type": "git", + "url": "https://github.com/brick/varexporter.git", + "reference": "3361a8a30e807c0841a7ca98e5c72b6bffc73463" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/brick/varexporter/zipball/3361a8a30e807c0841a7ca98e5c72b6bffc73463", + "reference": "3361a8a30e807c0841a7ca98e5c72b6bffc73463", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.0", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.2", + "phpunit/phpunit": "^8.5 || ^9.0", + "vimeo/psalm": "4.23.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Brick\\VarExporter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A powerful alternative to var_export(), which can export closures and objects without __set_state()", + "keywords": [ + "var_export" + ], + "support": { + "issues": "https://github.com/brick/varexporter/issues", + "source": "https://github.com/brick/varexporter/tree/0.3.6" + }, + "funding": [ + { + "url": "https://github.com/BenMorel", + "type": "github" + } + ], + "time": "2022-06-15T23:51:29+00:00" + }, { "name": "cakephp/core", "version": "4.4.4", @@ -3402,6 +3451,65 @@ } ], "time": "2022-03-08T17:03:00+00:00" + }, + { + "name": "webimpress/safe-writer", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/webimpress/safe-writer.git", + "reference": "9d37cc8bee20f7cb2f58f6e23e05097eab5072e6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webimpress/safe-writer/zipball/9d37cc8bee20f7cb2f58f6e23e05097eab5072e6", + "reference": "9d37cc8bee20f7cb2f58f6e23e05097eab5072e6", + "shasum": "" + }, + "require": { + "php": "^7.3 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.5.4", + "vimeo/psalm": "^4.7", + "webimpress/coding-standard": "^1.2.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2.x-dev", + "dev-develop": "2.3.x-dev", + "dev-release-1.0": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Webimpress\\SafeWriter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "description": "Tool to write files safely, to avoid race conditions", + "keywords": [ + "concurrent write", + "file writer", + "race condition", + "safe writer", + "webimpress" + ], + "support": { + "issues": "https://github.com/webimpress/safe-writer/issues", + "source": "https://github.com/webimpress/safe-writer/tree/2.2.0" + }, + "funding": [ + { + "url": "https://github.com/michalbundyra", + "type": "github" + } + ], + "time": "2021-04-19T16:34:45+00:00" } ], "packages-dev": [ @@ -4831,62 +4939,6 @@ ], "time": "2022-03-03T13:19:32+00:00" }, - { - "name": "nikic/php-parser", - "version": "v4.14.0", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=7.0" - }, - "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.14.0" - }, - "time": "2022-05-31T20:59:12+00:00" - }, { "name": "phar-io/manifest", "version": "2.0.3", @@ -7599,65 +7651,6 @@ ], "time": "2021-07-28T10:34:58+00:00" }, - { - "name": "webimpress/safe-writer", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/webimpress/safe-writer.git", - "reference": "9d37cc8bee20f7cb2f58f6e23e05097eab5072e6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webimpress/safe-writer/zipball/9d37cc8bee20f7cb2f58f6e23e05097eab5072e6", - "reference": "9d37cc8bee20f7cb2f58f6e23e05097eab5072e6", - "shasum": "" - }, - "require": { - "php": "^7.3 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.5.4", - "vimeo/psalm": "^4.7", - "webimpress/coding-standard": "^1.2.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev", - "dev-develop": "2.3.x-dev", - "dev-release-1.0": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Webimpress\\SafeWriter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "description": "Tool to write files safely, to avoid race conditions", - "keywords": [ - "concurrent write", - "file writer", - "race condition", - "safe writer", - "webimpress" - ], - "support": { - "issues": "https://github.com/webimpress/safe-writer/issues", - "source": "https://github.com/webimpress/safe-writer/tree/2.2.0" - }, - "funding": [ - { - "url": "https://github.com/michalbundyra", - "type": "github" - } - ], - "time": "2021-04-19T16:34:45+00:00" - }, { "name": "webmozart/assert", "version": "1.11.0", diff --git a/packages/cache/src/ConfigProvider.php b/packages/cache/src/ConfigProvider.php index 78f4f1a..1cdb9a6 100755 --- a/packages/cache/src/ConfigProvider.php +++ b/packages/cache/src/ConfigProvider.php @@ -2,7 +2,7 @@ namespace AftDev\Cache; -use AftDev\ServiceManager\Factory\ReflectionAbstractFactory; +use Laminas\ServiceManager\AbstractFactory\ReflectionBasedAbstractFactory; use Psr\Cache\CacheItemPoolInterface; use Psr\SimpleCache\CacheInterface as SimpleCacheInterface; use Symfony\Contracts\Cache\CacheInterface; @@ -52,7 +52,7 @@ public function getCacheManagerConfig() ], ], 'abstract_factories' => [ - 'default' => ReflectionAbstractFactory::class, + 'default' => ReflectionBasedAbstractFactory::class, ], ]; } diff --git a/packages/cache/src/Factory/ChainAdapterFactory.php b/packages/cache/src/Factory/ChainAdapterFactory.php index 45bf6f5..7787b22 100755 --- a/packages/cache/src/Factory/ChainAdapterFactory.php +++ b/packages/cache/src/Factory/ChainAdapterFactory.php @@ -3,12 +3,12 @@ namespace AftDev\Cache\Factory; use AftDev\Cache\CacheManager; -use AftDev\ServiceManager\Factory\ReflectionAbstractFactory; use Laminas\ServiceManager\Exception\ServiceNotCreatedException; +use Laminas\ServiceManager\Factory\FactoryInterface; use Psr\Container\ContainerInterface; use Symfony\Component\Cache\Adapter\ChainAdapter; -class ChainAdapterFactory extends ReflectionAbstractFactory +class ChainAdapterFactory implements FactoryInterface { public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { diff --git a/packages/cache/src/Factory/MemcachedAdapterFactory.php b/packages/cache/src/Factory/MemcachedAdapterFactory.php index bf61762..4733ee3 100755 --- a/packages/cache/src/Factory/MemcachedAdapterFactory.php +++ b/packages/cache/src/Factory/MemcachedAdapterFactory.php @@ -2,11 +2,11 @@ namespace AftDev\Cache\Factory; -use AftDev\ServiceManager\Factory\ReflectionAbstractFactory; +use AftDev\ServiceManager\Factory\ResolverAbstractFactory; use Psr\Container\ContainerInterface; use Symfony\Component\Cache\Adapter\MemcachedAdapter; -class MemcachedAdapterFactory extends ReflectionAbstractFactory +class MemcachedAdapterFactory extends ResolverAbstractFactory { /** * {@inheritdoc} diff --git a/packages/cache/src/Factory/RedisAdapterFactory.php b/packages/cache/src/Factory/RedisAdapterFactory.php index 3f9580c..8ee63eb 100755 --- a/packages/cache/src/Factory/RedisAdapterFactory.php +++ b/packages/cache/src/Factory/RedisAdapterFactory.php @@ -2,11 +2,11 @@ namespace AftDev\Cache\Factory; -use AftDev\ServiceManager\Factory\ReflectionAbstractFactory; +use AftDev\ServiceManager\Factory\ResolverAbstractFactory; use Psr\Container\ContainerInterface; use Symfony\Component\Cache\Adapter\RedisAdapter; -class RedisAdapterFactory extends ReflectionAbstractFactory +class RedisAdapterFactory extends ResolverAbstractFactory { /** * {@inheritdoc} diff --git a/packages/cache/src/Factory/TagAwareAdapterFactory.php b/packages/cache/src/Factory/TagAwareAdapterFactory.php index de9f1e2..334cd61 100755 --- a/packages/cache/src/Factory/TagAwareAdapterFactory.php +++ b/packages/cache/src/Factory/TagAwareAdapterFactory.php @@ -3,12 +3,12 @@ namespace AftDev\Cache\Factory; use AftDev\Cache\CacheManager; -use AftDev\ServiceManager\Factory\ReflectionAbstractFactory; +use AftDev\ServiceManager\Factory\ResolverAbstractFactory; use Laminas\ServiceManager\Exception\ServiceNotCreatedException; use Psr\Container\ContainerInterface; use Symfony\Component\Cache\Adapter\TagAwareAdapter; -class TagAwareAdapterFactory extends ReflectionAbstractFactory +class TagAwareAdapterFactory extends ResolverAbstractFactory { public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { diff --git a/packages/filesystem/src/Factory/DiskAbstractFactory.php b/packages/filesystem/src/Factory/DiskAbstractFactory.php index 68775d9..2b57704 100755 --- a/packages/filesystem/src/Factory/DiskAbstractFactory.php +++ b/packages/filesystem/src/Factory/DiskAbstractFactory.php @@ -2,11 +2,11 @@ namespace AftDev\Filesystem\Factory; -use AftDev\ServiceManager\Factory\ReflectionAbstractFactory; +use AftDev\ServiceManager\Factory\ResolverAbstractFactory; use League\Flysystem\Filesystem; use Psr\Container\ContainerInterface; -class DiskAbstractFactory extends ReflectionAbstractFactory +class DiskAbstractFactory extends ResolverAbstractFactory { use GetConfigTrait; diff --git a/packages/filesystem/src/Factory/S3AdapterFactory.php b/packages/filesystem/src/Factory/S3AdapterFactory.php index 8b4a533..aee9b9d 100644 --- a/packages/filesystem/src/Factory/S3AdapterFactory.php +++ b/packages/filesystem/src/Factory/S3AdapterFactory.php @@ -2,13 +2,13 @@ namespace AftDev\Filesystem\Factory; -use AftDev\ServiceManager\Factory\ReflectionAbstractFactory; +use AftDev\ServiceManager\Factory\ResolverAbstractFactory; use Aws\S3\S3Client; use Illuminate\Support\Arr; use League\Flysystem\Filesystem; use Psr\Container\ContainerInterface; -class S3AdapterFactory extends ReflectionAbstractFactory +class S3AdapterFactory extends ResolverAbstractFactory { use GetConfigTrait; diff --git a/packages/log/src/Factory/ChannelAbstractFactory.php b/packages/log/src/Factory/ChannelAbstractFactory.php index b1b8fe3..f63efc4 100755 --- a/packages/log/src/Factory/ChannelAbstractFactory.php +++ b/packages/log/src/Factory/ChannelAbstractFactory.php @@ -2,13 +2,13 @@ namespace AftDev\Log\Factory; -use AftDev\ServiceManager\Factory\ReflectionAbstractFactory; +use AftDev\ServiceManager\Factory\ResolverAbstractFactory; use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\LineFormatter; use Monolog\Logger; use Psr\Container\ContainerInterface; -class ChannelAbstractFactory extends ReflectionAbstractFactory +class ChannelAbstractFactory extends ResolverAbstractFactory { public function __invoke(ContainerInterface $container, $handlerName, array $options = null) { diff --git a/packages/service-manager/README.MD b/packages/service-manager/README.md similarity index 53% rename from packages/service-manager/README.MD rename to packages/service-manager/README.md index 66d3b85..b417baf 100755 --- a/packages/service-manager/README.MD +++ b/packages/service-manager/README.md @@ -6,13 +6,13 @@ manager](https://docs.laminas.dev/laminas-servicemanager/). ## Configurable Service Manager Extends the Laminas Plugin Manager. -Allow definition of plugin configuration/settings. +Allows definition of plugin configuration/settings. To easily create configurable services/plugins. ```php [ + 'manager_x' => [ 'default' => 'adapter_1', 'default_options' => [ 'option_default' => 'Default', @@ -49,13 +49,22 @@ $config = [ ]; ``` -## Service Resolver +```php +class YourManager extends AbstractManager { + +} + +$pluginManager = new YourManager($container, $config['manager_x']); +$pluginManager->get('adapter_2'); +``` -Use the Resolver to automatically inject dependencies when calling function. -This is based on the laravel container [functionality](https://laravel.com/docs/8.x/container#method-invocation-and-injection). +## Resolver + +### Service Resolver + +This service automatically resolve services dependencies. ```php -resolveClass(ServiceA::class); -$resolver->call([$serviceA, 'handle']); - -// Create service and call handle function shortcut. -$resolver->call(ServiceA::class.'@handle'); - ``` -## Reflection Abstract Factory +### Resolver Abstract Factory + +A Laminas abstract factory that will auto inject dependencies of your services by +using the resolver. -Abstract factory that will auto inject dependencies of your services. -Add it to your laminas service manager configuration under +Add it to your laminas service manager configuration in the 'abstract_factories' +section. That way any unregistered services will be automatically created with +all of their dependencies injected. ```php [], 'aliases' => [], 'abstract_factories' => [ - 'default' => ReflectionAbstractFactory::class, + 'default' => ResolverAbstractFactory::class, ], ]; +``` + +Note: This factory is automatically added if you are using this package +service ConfigProvider. + +### Contextual Binding / Binding Primitives + +Primitives variables cannot be auto-discovered by the service manager and thus would +require context binding. + +```php +class ServiceA +{ + public function __construct( + private DependencyClass $dependency, + private array $primitiveArray, + private int $primitiveInt + ) +} + +$resolver->when(ServiceA::class)->needs(DependencyClass::class)->give( new DependencyClass()) +$resolver->when(ServiceA::class)->needs('primitiveArray')->give(['a','b','c']) +$resolver->when(ServiceA::class)->needs('primitiveInt')->give(1) + + +$serviceA = $resolver->resolveClass(ServiceA::class); + +$serviceA->dependency; // DependencyClass +$serviceA->primitiveArray; // ['a','b','c'] +$serviceA->primitiveInt; // 1 +``` + +### Method Invocation & Injection + +Use the Resolver to automatically inject dependencies when calling functions. +This is based on the laravel container [functionality](https://laravel.com/docs/9.x/container#method-invocation-and-injection). + + +```php +$resolver->call(function(Dependency $dependency) { + return $dependency->doSomething(); +}); +``` +Automatically fetch a service from the container and invoke its function +(default is __invoke) but you can customize the function to use: + +```php +$resolver->call(ServiceA::class); +$resolver->call([ServiceA::class, 'handle']); +$resolver->call(ServiceA::class.'@handle'); ``` diff --git a/packages/service-manager/src/ConfigProvider.php b/packages/service-manager/src/ConfigProvider.php index 2476322..70ba539 100755 --- a/packages/service-manager/src/ConfigProvider.php +++ b/packages/service-manager/src/ConfigProvider.php @@ -2,6 +2,8 @@ namespace AftDev\ServiceManager; +use AftDev\ServiceManager\Factory\ResolverAbstractFactory; + class ConfigProvider { public function __invoke() @@ -17,6 +19,9 @@ public function getDependencies() 'factories' => [ Resolver::class => Resolver\ResolverFactory::class, ], + 'abstract_factories' => [ + 'default' => ResolverAbstractFactory::class, + ], ]; } } diff --git a/packages/service-manager/src/Factory/ReflectionAbstractFactory.php b/packages/service-manager/src/Factory/ResolverAbstractFactory.php similarity index 92% rename from packages/service-manager/src/Factory/ReflectionAbstractFactory.php rename to packages/service-manager/src/Factory/ResolverAbstractFactory.php index 03ef34e..116a16d 100755 --- a/packages/service-manager/src/Factory/ReflectionAbstractFactory.php +++ b/packages/service-manager/src/Factory/ResolverAbstractFactory.php @@ -4,15 +4,17 @@ use AftDev\ServiceManager\Resolver; use Laminas\ServiceManager\Exception\ServiceNotFoundException; -use Laminas\ServiceManager\Factory\AbstractFactoryInterface; use Psr\Container\ContainerInterface; use ReflectionClass; use ReflectionException; +use Laminas\ServiceManager\Factory\AbstractFactoryInterface; -class ReflectionAbstractFactory implements AbstractFactoryInterface +class ResolverAbstractFactory implements AbstractFactoryInterface { public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { + $options ??= []; + /** @var Resolver $resolver */ $resolver = $container->has(Resolver::class) ? $container->get(Resolver::class) : new Resolver($container); @@ -32,6 +34,8 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o /** * {@inheritdoc} + * + * @return bool */ public function canCreate(ContainerInterface $container, $requestedName) { diff --git a/packages/service-manager/src/Resolver.php b/packages/service-manager/src/Resolver.php index f5dc1c1..333f463 100755 --- a/packages/service-manager/src/Resolver.php +++ b/packages/service-manager/src/Resolver.php @@ -12,24 +12,14 @@ class Resolver { - /** - * @var ContainerInterface - */ - protected $container; - /** * Array of rules on how to resolve parameters. - * - * @var array */ - protected $rules; + protected array $rules = []; - /** - * Resolver constructor. - */ - public function __construct(ContainerInterface $container) - { - $this->container = $container; + public function __construct( + protected ContainerInterface $container + ) { } /** @@ -37,28 +27,21 @@ public function __construct(ContainerInterface $container) * * @throws ReflectionException If a parameter cannot be resolved. */ - public function resolveClass(string $requestedName, array $parameters = []): object + public function resolveClass(string $requestedName, array $params = []): object { $reflectionClass = new ReflectionClass($requestedName); + $constructor = $reflectionClass->getConstructor(); + $constructorParams = $constructor ? $constructor->getParameters() : []; - if (null === ($constructor = $reflectionClass->getConstructor())) { + if (empty($constructorParams)) { return new $requestedName(); } - $reflectionParameters = $constructor->getParameters(); - - if (empty($reflectionParameters)) { - return new $requestedName(); - } - - $constructorParameters = array_map(function (ReflectionParameter $parameter) use ($requestedName, $parameters) { - $parameterName = $parameter->getName(); - if (array_key_exists($parameterName, $parameters)) { - return $this->getParameterValue($parameters[$parameterName]); - } - - return $this->getServiceParameter($requestedName, $parameter); - }, $reflectionParameters); + $parameterValues = array_merge($params, $this->rules[$requestedName] ?? []); + $constructorParameters = array_map( + fn (ReflectionParameter $parameter) => $this->mapParameter($parameter, $parameterValues), + $constructorParams + ); return new $requestedName(...$constructorParameters); } @@ -67,11 +50,11 @@ public function resolveClass(string $requestedName, array $parameters = []): obj * Automatically call a function with all parameters injected from the container. * * @param array|callable|string $function - The function name or an array class,function name. - * @param array $parameters - List of Hard coded values. + * @param array $parameters - List of hard coded values. * * @throws ReflectionException If a parameter cannot be resolved. */ - public function call($function, array $parameters = []) + public function call(array|callable|string $function, array $parameters = []): mixed { // Check if callable if (is_callable($function)) { @@ -87,19 +70,15 @@ public function call($function, array $parameters = []) $functionName = $exploded[1] ?? '__invoke'; $reflection = new ReflectionMethod($className, $functionName); - $function = [$this->resolveClass($className, $parameters), $functionName]; + $function = [$this->container->get($className), $functionName]; } $reflectionParameters = $reflection->getParameters(); - $parameters = array_map(function (ReflectionParameter $parameter) use ($parameters) { - $parameterName = $parameter->getName(); - if (array_key_exists($parameterName, $parameters)) { - return $this->getParameterValue($parameters[$parameterName]); - } - - return $this->resolveParameter($parameter); - }, $reflectionParameters); + $parameters = array_map( + fn (ReflectionParameter $parameter) => $this->mapParameter($parameter, $parameters), + $reflectionParameters + ); return call_user_func($function, ...$parameters); } @@ -117,59 +96,66 @@ public function when(string $serviceName): RuleBuilder * * @param mixed $implementation */ - public function addServiceRule(string $serviceName, string $parameter, $implementation) + public function addServiceRule(string $serviceName, string $parameter, $implementation): void { $this->rules[$serviceName][$parameter] = $implementation; } /** - * Get value for a service parameter. + * Map function parameter to the given list. * * @throws ReflectionException If parameter cannot be resolved. - * - * @return mixed */ - protected function getServiceParameter(string $serviceName, ReflectionParameter $parameter) + protected function mapParameter(ReflectionParameter $parameter, array $parameters = []) { $parameterName = $parameter->getName(); - if (isset($this->rules[$serviceName]) && array_key_exists($parameterName, $this->rules[$serviceName])) { - return $this->getParameterValue($this->rules[$serviceName][$parameterName]); + + // Primitives. + $primitiveName = $parameterName; + if (array_key_exists($primitiveName, $parameters)) { + return $this->getParameterValue($parameters[$primitiveName]); } - return $this->resolveParameter($parameter); - } + // By TypeHint. + $type = $parameter->hasType() ? $parameter->getType() : null; - protected function getParameterValue($value) - { - return $value instanceof \Closure ? $value() : $value; - } + $types = $type + ? ($type instanceof (\ReflectionUnionType::class) ? $type->getTypes() : [$type]) + : [] + ; - /** - * @throws ReflectionException If parameter cannot be resolved. - */ - protected function resolveParameter(ReflectionParameter $parameter) - { - $parameterName = $parameter->getName(); + foreach ($types as $type) { + if ($type->isBuiltin()) { + continue; + } - // Check that we have the value in the container. - $type = $parameter->getType() ?? null; - $notBuildIn = $type && !$type->isBuiltin(); - if ($type && $notBuildIn && $this->container->has($type->getName())) { - return $this->container->get($type->getName()); + // Rule on type? + $parameterTypeName = $type->getName(); + if (array_key_exists($parameterTypeName, $parameters)) { + return $this->getParameterValue($parameters[$parameterTypeName]); + } + + // Can the type be fetched from container? + if ($this->container->has($parameterTypeName)) { + return $this->container->get($parameterTypeName); + } } - try { - // Finally check for default value. - return $parameter->getDefaultValue(); - } catch (ReflectionException $e) { + // Finally check for default value. + if (!$parameter->isOptional()) { throw new ReflectionException( - sprintf( + message: sprintf( 'Unable to resolve parameter "%s"', $parameterName ), - 0, - $e ); } + + return $parameter->getDefaultValue(); + } + + protected function getParameterValue($value) + { + return $value instanceof \Closure ? $value() : $value; } } diff --git a/packages/service-manager/tests/Factory/ReflectionAbstractFactoryTest.php b/packages/service-manager/tests/Factory/ResolverAbstractFactoryTest.php similarity index 83% rename from packages/service-manager/tests/Factory/ReflectionAbstractFactoryTest.php rename to packages/service-manager/tests/Factory/ResolverAbstractFactoryTest.php index 6e10779..fddd79b 100755 --- a/packages/service-manager/tests/Factory/ReflectionAbstractFactoryTest.php +++ b/packages/service-manager/tests/Factory/ResolverAbstractFactoryTest.php @@ -2,7 +2,7 @@ namespace AftDevTest\ServiceManager\Factory; -use AftDev\ServiceManager\Factory\ReflectionAbstractFactory; +use AftDev\ServiceManager\Factory\ResolverAbstractFactory; use AftDev\ServiceManager\Resolver; use AftDev\Test\TestCase; use Laminas\ServiceManager\Exception\ServiceNotFoundException; @@ -10,10 +10,10 @@ /** * @internal - * @covers \AftDev\ServiceManager\Factory\ReflectionAbstractFactory + * @covers \AftDev\ServiceManager\Factory\ResolverAbstractFactory * @covers \AftDev\ServiceManager\Resolver */ -class ReflectionAbstractFactoryTest extends TestCase +class ResolverAbstractFactoryTest extends TestCase { public function testFactory() { @@ -33,7 +33,7 @@ public function testFactory() ->willReturn($resolver->reveal()) ; - $built = (new ReflectionAbstractFactory())($container->reveal(), PublicConstructor::class, []); + $built = (new ResolverAbstractFactory())($container->reveal(), PublicConstructor::class, []); $this->assertSame($returned, $built); } @@ -58,7 +58,7 @@ public function testInvalidOption() ; $this->expectException(ServiceNotFoundException::class); - (new ReflectionAbstractFactory())($container->reveal(), PublicConstructor::class); + (new ResolverAbstractFactory())($container->reveal(), PublicConstructor::class); } /** @@ -67,7 +67,7 @@ public function testInvalidOption() public function testCanCreate() { $container = $this->prophesize(ContainerInterface::class); - $factory = new ReflectionAbstractFactory(); + $factory = new ResolverAbstractFactory(); $canCreate = $factory->canCreate($container->reveal(), PublicConstructor::class); $this->assertTrue($canCreate); diff --git a/packages/service-manager/tests/ResolverTest.php b/packages/service-manager/tests/ResolverTest.php index 62f9142..eb8e961 100755 --- a/packages/service-manager/tests/ResolverTest.php +++ b/packages/service-manager/tests/ResolverTest.php @@ -2,12 +2,10 @@ namespace AftDevTest\ServiceManager; +use AftDev\ServiceManager\Factory\ResolverAbstractFactory; use AftDev\ServiceManager\Resolver; use AftDev\Test\TestCase; -use Prophecy\Argument; -use Prophecy\PhpUnit\ProphecyTrait; -use Prophecy\Prophecy\ObjectProphecy; -use Psr\Container\ContainerInterface; +use Laminas\ServiceManager\ServiceManager; /** * @internal @@ -15,63 +13,64 @@ */ class ResolverTest extends TestCase { - use ProphecyTrait; + protected ServiceManager $container; - /** - * @var ObjectProphecy - */ - protected $container; - - /** - * @var Resolver - */ - protected $resolver; + protected Resolver $resolver; public function setUp(): void { - $this->container = $this->prophesize(ContainerInterface::class); - - $this->resolver = new Resolver($this->container->reveal()); + $container = new \Laminas\ServiceManager\ServiceManager([ + 'services' => [ + ExistingServiceB::class => new ExistingServiceB(), + ExistingServiceC::class => new ExistingServiceC(), + ], + 'factories' => [ + Resolver::class => Resolver\ResolverFactory::class, + ], + 'abstract_factories' => [ + ResolverAbstractFactory::class, + ], + ]); + + $this->resolver = $container->get(Resolver::class); + $this->container = $container; } public function testResolveClass() { - $this->container->has(Argument::any()) - ->will(function ($params) { - if (ExistingServiceB::class === $params[0]) { - return true; - } - - return false; - }) - ; - - $serviceB = new ExistingServiceB(); - $this->container - ->get(ExistingServiceB::class) - ->willReturn($serviceB) - ; - - $options = [ - 'optionsA' => 'A', - 'optionsB' => ['a', 'b', 'c'], - 'optionsC' => 1, - 'optionsD' => 'mooh2', - 'optionCallable' => function () { - return 'fromCallable'; - }, - ]; + $this->resolver->when(TestService::class)->needs('optionsA')->give('options'); + $this->resolver->when(TestService::class)->needs('optionsB')->give(['a', 'b']); + $this->resolver->when(TestService::class)->needs('optionsC')->give(1); + $this->resolver->when(TestService::class)->needs('optionCallable')->give(function () { + return 'fromCallable'; + }); + + $testClass = $this->resolver->resolveClass(TestService::class); - $class = $this->resolver->resolveClass(TestService::class, $options); + $this->assertSame($this->container->get(ExistingServiceB::class), $testClass->serviceB); + $this->assertSame('options', $testClass->optionsA); + $this->assertSame(['a', 'b'], $testClass->optionsB); + $this->assertSame(1, $testClass->optionsC); + $this->assertSame('fromCallable', $testClass->optionCallable); + + // Test type-hint Override. + $overrideServiceB = new ExistingServiceB(); + $this->resolver->when(TestService::class)->needs(ExistingServiceB::class)->give($overrideServiceB); + + $withOverride = $this->resolver->resolveClass(TestService::class); + $this->assertSame($overrideServiceB, $withOverride->serviceB); + } + + public function testMultipleType() + { + $serviceB = $this->container->get(ExistingServiceB::class); + $this->resolver->when(TestServiceComplex::class)->needs('intOrArray')->give(1); - $this->assertInstanceOf(TestService::class, $class); + $testClass = $this->resolver->resolveClass(TestServiceComplex::class); - $this->assertSame($serviceB, $class->serviceB); - $this->assertSame($options['optionsA'], $class->optionsA); - $this->assertSame($options['optionsB'], $class->optionsB); - $this->assertSame($options['optionsC'], $class->optionsC); - $this->assertSame($options['optionsD'], $class->optionsD); - $this->assertSame('fromCallable', $class->optionCallable); + $this->assertSame($serviceB, $testClass->serviceB); + $this->assertSame(1, $testClass->intOrArray); + $this->assertSame($serviceB, $testClass->intOrExistingServiceB); } /** @@ -79,23 +78,29 @@ public function testResolveClass() */ public function testNoConstructorAndConstructorWithoutParams() { - $options = []; - - $service = $this->resolver->resolveClass(ExistingServiceB::class, $options); + $service = $this->resolver->resolveClass(ExistingServiceB::class); $this->assertInstanceOf(ExistingServiceB::class, $service); - $serviceNoParams = $this->resolver->resolveClass(ExistingServiceC::class, $options); + $serviceNoParams = $this->resolver->resolveClass(ExistingServiceC::class); $this->assertInstanceOf(ExistingServiceC::class, $serviceNoParams); } public function testCallFunction() { $serviceC = new ExistingServiceC(); - $this->container->has(ExistingServiceC::class)->willReturn(true); - $this->container - ->get(ExistingServiceC::class) - ->willReturn($serviceC) - ; + $container = new \Laminas\ServiceManager\ServiceManager([ + 'services' => [ + ExistingServiceC::class => $serviceC, + ], + 'factories' => [ + Resolver::class => Resolver\ResolverFactory::class, + ], + 'abstract_factories' => [ + ResolverAbstractFactory::class, + ], + ]); + + $this->resolver = $container->get(Resolver::class); $testClass = $this->resolver->resolveClass(ExistingServiceB::class); @@ -136,30 +141,6 @@ public function testCallFunction() ], $returnValue3); } - public function testWhen() - { - $serviceB = new ExistingServiceB(); - $serviceC = new ExistingServiceC(); - - $this->resolver->when(TestService::class)->needs('serviceB')->give($serviceB); - $this->resolver->when(TestService::class)->needs('optionsA')->give('options'); - $this->resolver->when(TestService::class)->needs('optionsB')->give(['a', 'b']); - $this->resolver->when(TestService::class)->needs('optionsC')->give(1); - $this->resolver->when(TestService::class)->needs('optionCallable')->give(function () { - return 'callable'; - }); - - $this->resolver->when(ExistingServiceB::class)->needs('serviceC')->give($serviceC); - - $testClass = $this->resolver->resolveClass(TestService::class); - - $this->assertSame($serviceB, $testClass->serviceB); - $this->assertSame('options', $testClass->optionsA); - $this->assertSame(['a', 'b'], $testClass->optionsB); - $this->assertSame(1, $testClass->optionsC); - $this->assertSame('callable', $testClass->optionCallable); - } - /** * Test that the resolver will throw an exception. */ @@ -168,31 +149,34 @@ public function testUnknownDependency() $this->expectException(\ReflectionException::class); $this->resolver->resolveClass(NotAutodiscoverable::class); } + + public function testNoType() + { + $this->expectException(\ReflectionException::class); + $this->resolver->resolveClass(NoType::class); + } } class TestService { - public $serviceB; - public $optionsA; - public $optionsB; - public $optionsC; - public $optionsD; - public $optionCallable; + public function __construct( + public ExistingServiceB $serviceB, + public string $optionsA, + public array $optionsB, + public int $optionsC, + public string $optionsD = 'mooh', + public $optionCallable = null + ) { + } +} +class TestServiceComplex +{ public function __construct( - ExistingServiceB $serviceB, - string $optionsA, - array $optionsB, - int $optionsC, - string $optionsD = 'mooh', - $optionCallable = null + public ExistingServiceB $serviceB, + public int|array $intOrArray, + public int|ExistingServiceB $intOrExistingServiceB, ) { - $this->serviceB = $serviceB; - $this->optionsA = $optionsA; - $this->optionsB = $optionsB; - $this->optionsC = $optionsC; - $this->optionsD = $optionsD; - $this->optionCallable = $optionCallable; } } @@ -228,3 +212,10 @@ public function __construct(array $test) { } } + +class NoType +{ + public function __construct($test) + { + } +} diff --git a/tests/Feature/Messenger/MessengerTest.php b/tests/Feature/Messenger/MessengerTest.php index 768412c..1f86336 100755 --- a/tests/Feature/Messenger/MessengerTest.php +++ b/tests/Feature/Messenger/MessengerTest.php @@ -10,7 +10,6 @@ use AftDev\Messenger\Queue\QueueManager; use AftDev\Test\Feature\Messenger\Messages\TestQueuableCommand; use AftDev\Test\FeatureTestCase; -use Illuminate\Support\Arr; use Prophecy\Argument; use Psr\Log\LoggerInterface; use Symfony\Component\Messenger\Stamp\DelayStamp; @@ -42,10 +41,8 @@ public function setUp(): void { parent::setUp(); - $config = $this->container->get('config'); - // Create another transport for tests. - Arr::set($config, 'messenger.queues.plugins.memory_two.service', 'memory'); + $this->overrideConfig('messenger.queues.plugins.memory_two.service', 'memory'); $this->messenger = $this->container->get(Messenger::class); } diff --git a/tests/Feature/Messenger/Queues/TransportsTest.php b/tests/Feature/Messenger/Queues/TransportsTest.php index 3f6d00a..8cd2506 100755 --- a/tests/Feature/Messenger/Queues/TransportsTest.php +++ b/tests/Feature/Messenger/Queues/TransportsTest.php @@ -5,7 +5,6 @@ use AftDev\Messenger\Queue\QueueManager; use AftDev\Test\Feature\Messenger\Messages\TestCommand; use AftDev\Test\FeatureTestCase; -use Illuminate\Support\Arr; use Laminas\ServiceManager\Exception\ServiceNotCreatedException; use Symfony\Component\Messenger\Envelope; use Symfony\Component\Messenger\Transport\TransportInterface; @@ -50,9 +49,7 @@ public function transportProviders() public function testInvalidTransport(): void { - $config = $this->container->get('config'); - - Arr::set($config, 'messenger.queues.plugins.invalid.dsn', 'invalid://sdfdf'); + $this->overrideConfig('messenger.queues.plugins.invalid.dsn', 'invalid://sdfdf'); $queueManager = $this->container->get(QueueManager::class); diff --git a/tests/FeatureTestCase.php b/tests/FeatureTestCase.php index 330bde9..d05f8c6 100755 --- a/tests/FeatureTestCase.php +++ b/tests/FeatureTestCase.php @@ -4,6 +4,7 @@ use AftDev\Db\Migration\PhinxApplication; use AftDev\DbEloquent\Capsule\CapsuleManager; +use Illuminate\Support\Arr; use Laminas\ServiceManager\ServiceManager; use Prophecy\Prophecy\ObjectProphecy; @@ -97,4 +98,11 @@ protected function mockService(string $name, object $mock) return $mock; } + + protected function overrideConfig($configName, $configValue) + { + $config = $this->container->get('config'); + + Arr::set($config, $configName, $configValue); + } } From f99b57585b11204b96f5fd10fae773f239471d1c Mon Sep 17 00:00:00 2001 From: Christophe G <1050197+cgaube@users.noreply.github.com> Date: Sun, 10 Jul 2022 16:04:23 -0700 Subject: [PATCH 02/20] feat(api): new api package for openapi goodness --- composer.json | 3 + composer.lock | 194 +++++++++++++++++- config/autoload/api.global.php | 9 + config/config.php | 1 + packages/api/README.md | 155 ++++++++++++++ packages/api/composer.json | 45 ++++ packages/api/src/ConfigProvider.php | 44 ++++ .../src/Exception/UnknownVersionException.php | 9 + .../Factory/CurrentOpenApiVersionFactory.php | 18 ++ .../api/src/Factory/OpenApiManagerFactory.php | 46 +++++ packages/api/src/Mutation/OpenApiMutation.php | 13 ++ packages/api/src/OpenApiManager.php | 164 +++++++++++++++ .../api/src/Route/OpenApiRouteGenerator.php | 150 ++++++++++++++ .../Factory/OpenApiManagerFactoryTest.php | 135 ++++++++++++ packages/api/tests/OpenApiManagerTest.php | 182 ++++++++++++++++ .../tests/Route/OpenApiRouteGeneratorTest.php | 100 +++++++++ packages/api/tests/specs/not-supported.php | 3 + packages/api/tests/specs/petstore.json | 166 +++++++++++++++ packages/api/tests/specs/petstore.yaml | 112 ++++++++++ packages/api/tests/specs/routes.yaml | 125 +++++++++++ packages/service-manager/README.md | 81 ++++++-- packages/service-manager/composer.json | 3 + .../service-manager/src/ConfigProvider.php | 2 + .../src/Factory/ResolverAbstractFactory.php | 4 +- .../src/Middleware/ResolveMiddleware.php | 27 +++ .../Middleware/ResolveMiddlewareFactory.php | 20 ++ .../ResolveMiddlewareFactoryFactory.php | 14 ++ .../ResolveMiddlewareFactoryTest.php | 26 +++ .../Middleware/ResolveMiddlewareTest.php | 44 ++++ tests/Feature/Api/OpenApiManagerTest.php | 73 +++++++ .../ServiceManager/ResolveMiddlewareTest.php | 26 +++ tests/data/openapi/petstore.yaml | 111 ++++++++++ 32 files changed, 2079 insertions(+), 26 deletions(-) create mode 100644 config/autoload/api.global.php create mode 100644 packages/api/README.md create mode 100755 packages/api/composer.json create mode 100644 packages/api/src/ConfigProvider.php create mode 100644 packages/api/src/Exception/UnknownVersionException.php create mode 100644 packages/api/src/Factory/CurrentOpenApiVersionFactory.php create mode 100644 packages/api/src/Factory/OpenApiManagerFactory.php create mode 100644 packages/api/src/Mutation/OpenApiMutation.php create mode 100644 packages/api/src/OpenApiManager.php create mode 100644 packages/api/src/Route/OpenApiRouteGenerator.php create mode 100644 packages/api/tests/Factory/OpenApiManagerFactoryTest.php create mode 100644 packages/api/tests/OpenApiManagerTest.php create mode 100644 packages/api/tests/Route/OpenApiRouteGeneratorTest.php create mode 100644 packages/api/tests/specs/not-supported.php create mode 100644 packages/api/tests/specs/petstore.json create mode 100644 packages/api/tests/specs/petstore.yaml create mode 100644 packages/api/tests/specs/routes.yaml create mode 100644 packages/service-manager/src/Middleware/ResolveMiddleware.php create mode 100755 packages/service-manager/src/Middleware/ResolveMiddlewareFactory.php create mode 100644 packages/service-manager/src/Middleware/ResolveMiddlewareFactoryFactory.php create mode 100755 packages/service-manager/tests/Middleware/ResolveMiddlewareFactoryTest.php create mode 100755 packages/service-manager/tests/Middleware/ResolveMiddlewareTest.php create mode 100644 tests/Feature/Api/OpenApiManagerTest.php create mode 100755 tests/Feature/ServiceManager/ResolveMiddlewareTest.php create mode 100644 tests/data/openapi/petstore.yaml diff --git a/composer.json b/composer.json index 9909da9..c8e8835 100755 --- a/composer.json +++ b/composer.json @@ -27,9 +27,12 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.3.2", + "laminas/laminas-diactoros": "^2.7", "league/flysystem-aws-s3-v3": "^3.0", "league/flysystem-ftp": "^3.0", "league/flysystem-memory": "^3.0", + "league/openapi-psr7-validator": "^0.18", + "mezzio/mezzio-router": "^3.8", "nesbot/carbon": "^2.9.1", "phpspec/prophecy-phpunit": "^2.0", "phpunit/phpunit": "^9.0", diff --git a/composer.lock b/composer.lock index 925526f..d120507 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "41c97abd2a311edf65776a3304626530", + "content-hash": "c05dd54eefb2186ce8ef647ec6ec84b9", "packages": [ { "name": "brick/varexporter", - "version": "0.3.6", + "version": "0.3.7", "source": { "type": "git", "url": "https://github.com/brick/varexporter.git", - "reference": "3361a8a30e807c0841a7ca98e5c72b6bffc73463" + "reference": "3e263cd718d242594c52963760fee2059fd5833c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/brick/varexporter/zipball/3361a8a30e807c0841a7ca98e5c72b6bffc73463", - "reference": "3361a8a30e807c0841a7ca98e5c72b6bffc73463", + "url": "https://api.github.com/repos/brick/varexporter/zipball/3e263cd718d242594c52963760fee2059fd5833c", + "reference": "3e263cd718d242594c52963760fee2059fd5833c", "shasum": "" }, "require": { @@ -45,7 +45,7 @@ ], "support": { "issues": "https://github.com/brick/varexporter/issues", - "source": "https://github.com/brick/varexporter/tree/0.3.6" + "source": "https://github.com/brick/varexporter/tree/0.3.7" }, "funding": [ { @@ -53,7 +53,7 @@ "type": "github" } ], - "time": "2022-06-15T23:51:29+00:00" + "time": "2022-06-29T23:37:57+00:00" }, { "name": "cakephp/core", @@ -5946,6 +5946,186 @@ }, "time": "2019-03-08T08:55:37+00:00" }, + { + "name": "respect/stringifier", + "version": "0.2.0", + "source": { + "type": "git", + "url": "https://github.com/Respect/Stringifier.git", + "reference": "e55af3c8aeaeaa2abb5fa47a58a8e9688cc23b59" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Respect/Stringifier/zipball/e55af3c8aeaeaa2abb5fa47a58a8e9688cc23b59", + "reference": "e55af3c8aeaeaa2abb5fa47a58a8e9688cc23b59", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.8", + "malukenho/docheader": "^0.1.7", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "autoload": { + "files": [ + "src/stringify.php" + ], + "psr-4": { + "Respect\\Stringifier\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Respect/Stringifier Contributors", + "homepage": "https://github.com/Respect/Stringifier/graphs/contributors" + } + ], + "description": "Converts any value to a string", + "homepage": "http://respect.github.io/Stringifier/", + "keywords": [ + "respect", + "stringifier", + "stringify" + ], + "support": { + "issues": "https://github.com/Respect/Stringifier/issues", + "source": "https://github.com/Respect/Stringifier/tree/0.2.0" + }, + "time": "2017-12-29T19:39:25+00:00" + }, + { + "name": "respect/validation", + "version": "2.2.3", + "source": { + "type": "git", + "url": "https://github.com/Respect/Validation.git", + "reference": "4c21a7ffc9a4915673cb2c2843963919e664e627" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Respect/Validation/zipball/4c21a7ffc9a4915673cb2c2843963919e664e627", + "reference": "4c21a7ffc9a4915673cb2c2843963919e664e627", + "shasum": "" + }, + "require": { + "php": "^7.3 || ^8.0", + "respect/stringifier": "^0.2.0", + "symfony/polyfill-mbstring": "^1.2" + }, + "require-dev": { + "egulias/email-validator": "^3.0", + "malukenho/docheader": "^0.1", + "mikey179/vfsstream": "^1.6", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-deprecation-rules": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^9.3", + "psr/http-message": "^1.0", + "respect/coding-standard": "^3.0", + "squizlabs/php_codesniffer": "^3.5", + "symfony/validator": "^3.0||^4.0", + "zendframework/zend-validator": "^2.1" + }, + "suggest": { + "egulias/email-validator": "Strict (RFC compliant) email validation", + "ext-bcmath": "Arbitrary Precision Mathematics", + "ext-fileinfo": "File Information", + "ext-mbstring": "Multibyte String Functions", + "symfony/validator": "Use Symfony validator through Respect\\Validation", + "zendframework/zend-validator": "Use Zend Framework validator through Respect\\Validation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Respect\\Validation\\": "library/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Respect/Validation Contributors", + "homepage": "https://github.com/Respect/Validation/graphs/contributors" + } + ], + "description": "The most awesome validation engine ever created for PHP", + "homepage": "http://respect.github.io/Validation/", + "keywords": [ + "respect", + "validation", + "validator" + ], + "support": { + "issues": "https://github.com/Respect/Validation/issues", + "source": "https://github.com/Respect/Validation/tree/2.2.3" + }, + "time": "2021-03-19T14:12:45+00:00" + }, + { + "name": "riverline/multipart-parser", + "version": "2.0.9", + "source": { + "type": "git", + "url": "https://github.com/Riverline/multipart-parser.git", + "reference": "ebba10245b5a6e03a673ff52c547d05029caedab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Riverline/multipart-parser/zipball/ebba10245b5a6e03a673ff52c547d05029caedab", + "reference": "ebba10245b5a6e03a673ff52c547d05029caedab", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=5.6.0" + }, + "require-dev": { + "laminas/laminas-diactoros": "^1.8.7", + "phpunit/phpunit": "^5.2 || ^6.0 || ^7.0", + "psr/http-message": "^1.0", + "symfony/psr-http-message-bridge": "^1.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Riverline\\MultiPartParser\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Romain Cambien", + "email": "romain@cambien.net" + }, + { + "name": "Riverline", + "homepage": "http://www.riverline.fr" + } + ], + "description": "One class library to parse multipart content with encoding and charset support.", + "keywords": [ + "http", + "multipart", + "parser" + ], + "support": { + "issues": "https://github.com/Riverline/multipart-parser/issues", + "source": "https://github.com/Riverline/multipart-parser/tree/2.0.9" + }, + "time": "2021-10-18T09:56:35+00:00" + }, { "name": "sebastian/cli-parser", "version": "1.0.1", diff --git a/config/autoload/api.global.php b/config/autoload/api.global.php new file mode 100644 index 0000000..86b7474 --- /dev/null +++ b/config/autoload/api.global.php @@ -0,0 +1,9 @@ + [ + 'spec' => realpath('tests/data/openapi/petstore.yaml'), + ], +]; diff --git a/config/config.php b/config/config.php index af6ff80..eb06cd7 100755 --- a/config/config.php +++ b/config/config.php @@ -17,6 +17,7 @@ \AftDev\Db\ConfigProvider::class, \AftDev\DbEloquent\ConfigProvider::class, \AftDev\Messenger\ConfigProvider::class, + \AftDev\Api\ConfigProvider::class, new PhpFileProvider(realpath(__DIR__).'/autoload/{{,*.}global,{,*.}local}.php'), ], diff --git a/packages/api/README.md b/packages/api/README.md new file mode 100644 index 0000000..396a788 --- /dev/null +++ b/packages/api/README.md @@ -0,0 +1,155 @@ +# Api Manager + +The main philosophy of this package is that your openAPI specification is the +source of truth of your application, it is the contract provided to your +consumers, and thus can be used to generate other things like routes or request +validator. + +## Configuration + +```php +[ + 'prefix': 'api', + 'spec' => '/path/to/openapi.yml', + 'namespace' => 'App/Api/Controller', + 'mutations' => [], + 'versions' => [], +] +``` + +## Versioning and Mutations + +Versioning comes in handy when you introduce breaking changes. Our +recommendation is that every time it happens you would create a new version +based on a calendar date. + +The main idea is that the spec file should always contains the most up to date +information and each version only contain mutations to make it backward +compatible. + +Because the versions are in chronological order we can apply them recursively. + +```php +[ + 'spec' => '/path/to/openapi.yml', + 'current_version' => '2022-05-10', + 'versions' => [ + '2022-05-10' => [], + '2017-01-03' => [ + MutationOne::class, + ], + '2016-11-24' => [ + MutationTwo::class, + ], + '2012-04-03' => [ + MutationThree::class, + ], + ], +]; +``` + +e.g: to generate version `2016-11-03`, we would start from the `spec` file Then +apply all version rollbacks up to that version. In our example that means be +`MutationOne::class` and `MutationTwo::class` + +Mutations can apply to any version so you could even add mutations to the +current versions This could be useful if you want to test a new feature or a +change before making it public. + +```php +[ + 'spec' => '/path/to/openapi.yml' + 'current_version' => '2022-05-10', + 'versions' => [ + '2022-05-10' => [ + ChangeSpecIfFeatureToggleIsOn::class + ], + // ... + ], +] +``` + +Each mutations should be invokables classes. The OpenApi object will be passed +as argument so you can freely edit it. + +example: + +```php +use cebe\openapi\spec\OpenApi; + +class ChangeSpecIfFeatureToggleIsOn implements OpenApiMutation +{ + public function __invoke(OpenApi $spec, FeatureToggleService $featureToggle): void + { + $toggleOn = $featureToggle->isEnabled('You Cool new feature'); + + if (false === $toggleOn) { + // Do nothing. + return; + } + + $spec->paths['/new-path'] = new PathItem([...]); + } +} +``` + +Note: If configured properly, each mutation classes will be invoked via the +Service manager resolver. [TODO ADD LINK TO RESOLVER] It means that the class +dependencies will be automatically injected. + +### Checking version in your controllers / business logic services. + +From you controllers or other services you would just need to check the current +version via the `OpenApiManager->getVersion()` method. + +```php +use cebe\openapi\spec\OpenApi; + +class PathController +{ + public function __construct( + private OpenApi $openApi, + ) + {} + + public function __invoke() + { + if ($openApi->getVersion() > `2016-11-24`) { + return ['a', 'b', 'c']; + } + + return 'a'; + } +} +``` + +## Middlewares ([psr-15](https://www.php-fig.org/psr/psr-15/)) + +### OpenApiMiddleware + +This middleware will setup the current version of the version being used for the +current request and inject the OpenApi object to the request. + +## Handler ([psr-15](https://www.php-fig.org/psr/psr-15/)) + +### OpenApiPathHandler Abstract + +This is the default handler that is injected in the router of your choice This +handler will + +- make sure the incoming request is valid (using phpleague validator) +- call the appropirate controller action (depending on the openapi operation) +- make sure the outcoming response is valid (using phpleague validator) + +#### MezzioApiHandler + +## Routing + +This package comes with a router helper that will autogenerate route +configuration from an openapi spec object. + +This configuration can then be used by your router of choice (like fastRouter or +Mezzio Application) Service that return an array of routes and controllers / +params we need a mapper for each router type. + +TODO - routes per version. (how to handle caching?) diff --git a/packages/api/composer.json b/packages/api/composer.json new file mode 100755 index 0000000..9d48d2c --- /dev/null +++ b/packages/api/composer.json @@ -0,0 +1,45 @@ +{ + "name": "aftdev/api", + "description": "Api Manager", + "license": "BSD-3-Clause", + "keywords": [ + "api", + "openapi" + ], + "require": { + "php": "^8.1", + "laminas/laminas-config-aggregator": "^1.7.0", + "cebe/php-openapi": "^1.7.0", + "illuminate/support": "^9.0" + }, + "require-dev": { + "psr/http-server-middleware": "^1.0", + "league/openapi-psr7-validator": "^0.18", + "phpspec/prophecy-phpunit": "^2.0", + "laminas/laminas-diactoros": "^2.7", + "mezzio/mezzio-router": "^3.8" + }, + "autoload": { + "psr-4": { + "AftDev\\Api\\": "src/" + }, + "classmap": [ + "src/" + ] + }, + "autoload-dev": { + "psr-4": { + "AftDevTest\\Api\\": "tests/" + } + }, + "suggest": { + "aftdev/service-manager": "To autoload spec invokable classes", + "psr/http-server-middleware": "To use the middleware", + "league/openapi-psr7-validator": "To automatically validate requests" + }, + "extra": { + "laminas": { + "config-provider": "AftDev\\Api\\ConfigProvider" + } + } +} diff --git a/packages/api/src/ConfigProvider.php b/packages/api/src/ConfigProvider.php new file mode 100644 index 0000000..8efa463 --- /dev/null +++ b/packages/api/src/ConfigProvider.php @@ -0,0 +1,44 @@ + $this->getDependencies(), + self::CONFIG_KEY => $this->getApiConfig(), + ]; + } + + public function getDependencies() + { + return [ + 'factories' => [ + OpenApi::class => Factory\CurrentOpenApiVersionFactory::class, + OpenApiManager::class => Factory\OpenApiManagerFactory::class, + HandlerMapper::class => InvokableFactory::class, + ], + ]; + } + + public function getApiConfig() + { + return [ + 'prefix' => 'api', + 'spec' => 'config/openapi/openapi.yml', + 'namespace' => 'App/Api/Controller', + 'version' => null, + 'versions' => [], + ]; + } +} diff --git a/packages/api/src/Exception/UnknownVersionException.php b/packages/api/src/Exception/UnknownVersionException.php new file mode 100644 index 0000000..4c94171 --- /dev/null +++ b/packages/api/src/Exception/UnknownVersionException.php @@ -0,0 +1,9 @@ +get(OpenApiManager::class); + + return $apiManager->getCurrentVersion(); + } +} diff --git a/packages/api/src/Factory/OpenApiManagerFactory.php b/packages/api/src/Factory/OpenApiManagerFactory.php new file mode 100644 index 0000000..f0af03f --- /dev/null +++ b/packages/api/src/Factory/OpenApiManagerFactory.php @@ -0,0 +1,46 @@ +get('config')[ConfigProvider::CONFIG_KEY]; + $resolver = $container->has(Resolver::class) ? $container->get(Resolver::class) : null; + + $version = $this->getApiVersionFromHeader($container) ?? $config['version'] ?? null; + + return new OpenApiManager( + specFile: $config['spec'], + currentVersion: $version, + versions: $config['versions'] ?? [], + resolver: $resolver, + ); + } + + private function getApiVersionFromHeader(ContainerInterface $container): ?string + { + $request = $container->has(ServerRequestInterface::class) ? $container->get(ServerRequestInterface::class) : null; + + // Mezzio for some reason use a callback for the service. + if ($request instanceof Closure) { + $request = $request(); + } + + if (!$request) { + return null; + } + + return current($request->getHeader(OpenApiManager::VERSION_HEADER_NAME, null)); + } +} diff --git a/packages/api/src/Mutation/OpenApiMutation.php b/packages/api/src/Mutation/OpenApiMutation.php new file mode 100644 index 0000000..a75e7be --- /dev/null +++ b/packages/api/src/Mutation/OpenApiMutation.php @@ -0,0 +1,13 @@ +setVersions($versions); + $this->setCurrentVersion($currentVersion ?? self::BASE_VERSION); + } + + /** + * Set the default version. + */ + public function setCurrentVersion(string $version): void + { + $this->currentVersion = $version; + } + + public function hasVersion(string $version): bool + { + return isset($this->versions[$version]); + } + + public function getVersions(): array + { + return array_keys($this->versions); + } + + /** + * @throws UnknownVersionException + */ + public function getCurrentVersion(): OpenApi + { + return $this->getVersion($this->currentVersion); + } + + /** + * @throws UnknownVersionException + */ + public function getVersion(string $version): OpenApi + { + if (isset($this->cachedVersions[$version])) { + return $this->cachedVersions[$version]; + } + + $versionMutations = $this->getVersionMutations($version); + + $versionOpenApi = $this->getBase(); + + // Override Version + if (self::BASE_VERSION != $version) { + $versionOpenApi->info->version = $version; + } + + $this->applyMutations($versionOpenApi, $versionMutations); + + return $this->cachedVersions[$version] = $versionOpenApi; + } + + /** + * Set the openapi versions. + * + * The most recent version will be set as the current version. + */ + private function setVersions(array $versions): void + { + $this->versions = $versions; + krsort($this->versions); + + $lastVersion = key($this->versions); + if ($lastVersion) { + $this->setCurrentVersion($lastVersion); + } + } + + /** + * Get the base openapi. + */ + private function getBase(): OpenApi + { + $info = new SplFileInfo($this->specFile); + if (!$info->isFile()) { + throw new \ValueError('File does not exists'); + } + + switch ($info->getExtension()) { + case 'yaml': + case 'yml': + $helper = 'readFromYamlFile'; + + break; + + case 'json': + $helper = 'readFromJsonFile'; + + break; + + default: + throw new \ValueError('Invalid file extension'); + } + + return $this->base = Reader::$helper($this->specFile); + } + + /** + * @throws UnknownVersionException + */ + private function getVersionMutations(string $version): array + { + if (self::BASE_VERSION != $version && !$this->hasVersion($version)) { + throw new UnknownVersionException(sprintf('Unknown version %s', $version)); + } + + $mutations = []; + foreach ($this->versions as $loopVersion => $versionMutations) { + $mutations = array_merge($mutations, $versionMutations); + + if ($loopVersion === $version) { + break; + } + } + + return $mutations; + } + + private function applyMutations(OpenApi $openApi, array $mutations = []) + { + foreach ($mutations as $mutation) { + if ($this->resolver) { + $this->resolver->call( + $mutation, + [ + OpenApi::class => $openApi, + '$openApi' => $openApi, + ] + ); + } elseif (is_callable($mutation)) { + $mutation($openApi); + } + } + } +} diff --git a/packages/api/src/Route/OpenApiRouteGenerator.php b/packages/api/src/Route/OpenApiRouteGenerator.php new file mode 100644 index 0000000..2782446 --- /dev/null +++ b/packages/api/src/Route/OpenApiRouteGenerator.php @@ -0,0 +1,150 @@ + 'index', // when no path params. + 'getWithParams' => 'show', // where there is a param + 'post' => 'create', + 'put' => 'update', + 'patch' => 'update', + ]; + + public function __construct( + private $prefix = '/api', + private $routeHandler = OpenApiPathHandlerInterface::class, + private $namespace = 'App\Controller', + ) { + } + + /** + * Returns routes from the openapi spec. + */ + public function generateRoutes(OpenApi $openApi): \Generator + { + foreach ($openApi->paths as $path => $pathItem) { + yield from $this->getRoutesForPath($path, $pathItem); + } + } + + private function prefixUri(string $path): string + { + return Str::of($path)->start($this->prefix)->start('/')->toString(); + } + + private function getRoutesForPath(string $uri, PathItem $path): \Generator + { + $pathCommonParams = [ + 'uri' => $this->prefixUri($uri), + ]; + + $pathParams = $this->getPathParameters($path->parameters); + + foreach ($path->getOperations() as $method => $operation) { + yield $pathCommonParams + [ + 'method' => $method, + 'name' => $operation->operationId ?? 'api.'.Str::camel("{$method}{$uri}"), + 'params' => $pathParams + $this->getPathParameters($operation->parameters), + 'handler' => $this->getHandlerNameForOperation($uri, $method), + ]; + } + } + + private function getPathParameters(array $parameters) + { + $pathParams = array_filter($parameters, fn ($param) => 'path' == $param->in); + $paramInfo = []; + foreach ($pathParams as $param) { + $paramInfo[$param->name] = [ + 'required' => $param->required, + 'schema' => [ + 'type' => $param->schema->type, + 'format' => $param->schema->format, + ], + ]; + } + + return $paramInfo; + } + + private function getHandlerNameForOperation(string $path, string $method): string + { + $pathInfo = Str::of($path)->trim('/')->explode('/'); + + $routeParams = $pathInfo->filter(fn ($str) => Str::match('/^\{.+\}$/', $str)); + $routeResources = $pathInfo->diff($routeParams); + + $controllerPosition = $routeResources->keys()->last(); + $routeParams = $routeParams->skipWhile(fn ($i, $key) => $key <= $controllerPosition); + + // Controller is always the last nonParam + $controller = $this->getControllerForPath((string) $routeResources->pop()); + $methodName = $this->getMethodName($method, $routeResources, $routeParams, $controller); + + return $controller.'@'.$methodName; + } + + private function getControllerForPath(string $controller): string + { + return $this->namespace.'\\'.Str::of($controller)->ucfirst()->pluralStudly(); + } + + private function getMethodName(string $method, Collection $routeResources, Collection $routeParams, string $controller): string + { + $hasParams = $routeParams->count(); + + // From Mapping + $verb = ($hasParams && isset($this->methodMapping[$method.'WithParams']) ? $this->methodMapping[$method.'WithParams'] : null) + ?? $this->methodMapping[$method] + ?? $method; + + $scopedBy = $routeResources->map(fn ($s) => Str::of($s)->singular()->studly()->ucfirst()); + $filterBy = $routeParams->map(fn ($s) => Str::of($s)->trim('{}')->ucfirst()); + + $methodName = $verb; + $glue = 'By'; + + if ($scopedBy->count()) { + $methodName .= $glue.$scopedBy->join(''); + $glue = 'And'; + } + + // If we have only one param do not use it if it matches the controller name + $appendFilterBy = + $hasParams + && (1 !== $hasParams || !$this->paramMatchesController($filterBy->first(), $controller)); + + if ($appendFilterBy) { + $methodName .= $glue.$filterBy->join(''); + } + + return $methodName; + } + + private function paramMatchesController($param, $controller): bool + { + $potentialMatches = [ + 'id', + 'uuid', + $controller, + $controller.'Id', + $controller.'Uuid', + ]; + + return Str::contains( + needles: $potentialMatches, + haystack: $param, + ignoreCase: true, + ); + } +} diff --git a/packages/api/tests/Factory/OpenApiManagerFactoryTest.php b/packages/api/tests/Factory/OpenApiManagerFactoryTest.php new file mode 100644 index 0000000..e68e2ee --- /dev/null +++ b/packages/api/tests/Factory/OpenApiManagerFactoryTest.php @@ -0,0 +1,135 @@ +container = $this->prophesize(ContainerInterface::class); + $this->resolver = $this->createStub(Resolver::class); + + $self = $this; + $this->container->get('config')->will(fn () => $self->config); + + $this->container->has(Resolver::class)->willReturn(false); + $this->container->has(ServerRequestInterface::class)->willReturn(false); + } + + public function testWithResolver() + { + $this->config = [ + 'api' => [ + 'spec' => 'x', + 'versions' => [], + 'version' => null, + ], + ]; + + $this->container->has(Resolver::class)->willReturn(true); + $this->container->get(Resolver::class)->shouldBeCalled()->willReturn($this->resolver); + + (new OpenApiManagerFactory())($this->container->reveal()); + } + + public function testWithVersionFromHeader() + { + $this->config = [ + 'api' => [ + 'spec' => realpath(__DIR__.'/../specs/petstore.yaml'), + 'versions' => [ + 'from-header' => [], + 'from-config' => [], + ], + 'version' => 'from-config', + ], + ]; + + $version = 'from-header'; + + $request = new ServerRequest(headers: [OpenApiManager::VERSION_HEADER_NAME => $version]); + $this->container->has(ServerRequestInterface::class)->willReturn(true); + $this->container->get(ServerRequestInterface::class)->willReturn($request); + + $openApiManager = (new OpenApiManagerFactory())($this->container->reveal()); + + $versionSpec = $openApiManager->getCurrentVersion(); + $this->assertEquals($versionSpec->info->version, $version); + } + + public function testWithVersionFromHeaderCallback() + { + $this->config = [ + 'api' => [ + 'spec' => realpath(__DIR__.'/../specs/petstore.yaml'), + 'versions' => [ + 'from-header' => [], + 'from-config' => [], + ], + 'version' => 'from-config', + ], + ]; + + $version = 'from-header'; + + $request = new ServerRequest(headers: [OpenApiManager::VERSION_HEADER_NAME => $version]); + $this->container->has(ServerRequestInterface::class)->willReturn(true); + $this->container->get(ServerRequestInterface::class)->willReturn(fn () => $request); + + $openApiManager = (new OpenApiManagerFactory())($this->container->reveal()); + + $versionSpec = $openApiManager->getCurrentVersion(); + $this->assertEquals($versionSpec->info->version, $version); + } + + public function testWithVersionFromConfig() + { + $this->config = [ + 'api' => [ + 'spec' => realpath(__DIR__.'/../specs/petstore.yaml'), + 'versions' => [ + 'from-header' => [], + 'from-config' => [], + ], + 'version' => 'from-config', + ], + ]; + + $openApiManager = (new OpenApiManagerFactory())($this->container->reveal()); + + $versionSpec = $openApiManager->getCurrentVersion(); + $this->assertEquals($versionSpec->info->version, 'from-config'); + } + + public function testWithoutVersion() + { + $this->config = [ + 'api' => [ + 'spec' => realpath(__DIR__.'/../specs/petstore.yaml'), + ], + ]; + + $openApiManager = (new OpenApiManagerFactory())($this->container->reveal()); + + $versionSpec = $openApiManager->getCurrentVersion(); + $this->assertEquals($versionSpec->info->version, '1.0.0'); + } +} diff --git a/packages/api/tests/OpenApiManagerTest.php b/packages/api/tests/OpenApiManagerTest.php new file mode 100644 index 0000000..300c73a --- /dev/null +++ b/packages/api/tests/OpenApiManagerTest.php @@ -0,0 +1,182 @@ +expectException(UnknownVersionException::class); + + $openApiManager = new OpenApiManager('specFile', [ + '2018-01-01' => [], + '2011-01-01' => [], + '2012-01-01' => [], + ]); + + $openApiManager->getVersion('v1'); + } + + public function testUnknownSpec() + { + $this->expectException(\ValueError::class); + $this->expectExceptionMessage('File does not exists'); + + $openApiManager = new OpenApiManager('invalid.file'); + + $openApiManager->getCurrentVersion(); + } + + public function testUnknownExtension() + { + $this->expectException(\ValueError::class); + $this->expectExceptionMessage('Invalid file extension'); + + $openApiManager = new OpenApiManager(realpath(__DIR__.'/specs/not-supported.php')); + + $openApiManager->getCurrentVersion(); + } + + public function testVersions() + { + $openApiManager = new OpenApiManager( + realpath(__DIR__.'/specs/petstore.yaml'), + [ + '2018-01-01' => [], + '2011-01-01' => [], + '2012-01-01' => [], + ] + ); + + $versions = $openApiManager->getVersions(); + + $this->assertEquals([ + '2018-01-01', + '2012-01-01', + '2011-01-01', + ], $versions); + } + + public function testVersionMutations() + { + $container = $this->prophesize(ContainerInterface::class); + $resolver = new Resolver($container->reveal()); + + $openApiManager = new OpenApiManager( + realpath(__DIR__.'/specs/petstore.yaml'), + [ + '2018-01-01' => [], + '2011-01-01' => [ + fn (OpenApi $openApi) => $openApi->info->description .= '|Mutation2011A', + fn (OpenApi $openApi) => $openApi->info->description .= '|Mutation2011B', + ], + '2012-01-01' => [ + fn (OpenApi $openApi) => $openApi->info->description .= '|Mutation2012', + ], + ], + resolver: $resolver + ); + + $openApi = $openApiManager->getVersion('2011-01-01'); + + $this->assertEquals('2011-01-01', $openApi->info->version); + $this->assertEquals( + 'description_value|Mutation2012|Mutation2011A|Mutation2011B', + $openApi->info->description + ); + + $openApi = $openApiManager->getVersion('2012-01-01'); + + $this->assertEquals('2012-01-01', $openApi->info->version); + $this->assertEquals( + 'description_value|Mutation2012', + $openApi->info->description + ); + } + + public function testJsonSpec() + { + $openApiManager = new OpenApiManager(realpath(__DIR__.'/specs/petstore.json')); + $openApi = $openApiManager->getCurrentVersion(); + + $this->assertEquals( + 'description_value_json', + $openApi->info->description + ); + } + + public function testVersionCache() + { + $openApiManager = new OpenApiManager( + realpath(__DIR__.'/specs/petstore.yaml'), + ['2012-01-01' => []], + ); + + $openApi = $openApiManager->getVersion('2012-01-01'); + $openApi2 = $openApiManager->getVersion('2012-01-01'); + + $this->assertSame($openApi, $openApi2); + } + + public function testMutatationsNoContainer() + { + $openApiManager = new OpenApiManager( + realpath(__DIR__.'/specs/petstore.yaml'), + [ + '2012-01-01' => [ + fn (OpenApi $openApi) => $openApi->info->description .= '|Mutation2012', + ], + ] + ); + + $openApi = $openApiManager->getVersion('2012-01-01'); + $this->assertEquals( + 'description_value|Mutation2012', + $openApi->info->description + ); + } + + public function testNoVersion() + { + $openApiManager = new OpenApiManager(realpath(__DIR__.'/specs/petstore.yaml')); + $openApi = $openApiManager->getCurrentVersion(); + + $this->assertEquals( + 'description_value', + $openApi->info->description + ); + } + + public function testGetCurrentVersion() + { + $openApiManager = new OpenApiManager( + realpath(__DIR__.'/specs/petstore.yaml'), + versions: [ + 'test-version' => [ + fn (OpenApi $openApi) => $openApi->info->version = 'test-version', + ], + ], + ); + $openApiManager->setCurrentVersion('test-version'); + + $openApi = $openApiManager->getCurrentVersion(); + $this->assertEquals( + 'test-version', + $openApi->info->version + ); + } +} diff --git a/packages/api/tests/Route/OpenApiRouteGeneratorTest.php b/packages/api/tests/Route/OpenApiRouteGeneratorTest.php new file mode 100644 index 0000000..59aea96 --- /dev/null +++ b/packages/api/tests/Route/OpenApiRouteGeneratorTest.php @@ -0,0 +1,100 @@ + $generator->generateRoutes($this->getOpenApi())); + + $found = []; + foreach ($collection as $i) { + $found[$i['uri']][$i['method']] = $i['handler']; + } + + $expected = [ + '/api/companies' => [ + 'get' => 'App\Controller\Companies@index', + 'post' => 'App\Controller\Companies@create', + 'options' => 'App\Controller\Companies@options', + 'head' => 'App\Controller\Companies@head', + 'trace' => 'App\Controller\Companies@trace', + ], + '/api/companies/{companyId}' => [ + 'get' => 'App\Controller\Companies@show', + 'put' => 'App\Controller\Companies@update', + 'delete' => 'App\Controller\Companies@delete', + ], + '/api/companies/{companyId}/employees' => [ + 'get' => 'App\Controller\Employees@indexByCompany', + ], + '/api/companies/{companyId}/employees/{employeeId}' => [ + 'get' => 'App\Controller\Employees@showByCompany', + ], + '/api/companies/{companyId}/employees/{employeeId}/salary' => [ + 'get' => 'App\Controller\Salaries@indexByCompanyEmployee', + ], + '/api/companies/{companyId}/employees/{employeeId}/salary/{category}' => [ + 'get' => 'App\Controller\Salaries@showByCompanyEmployeeAndCategory', + ], + '/api/test/param/{intParam}/{stringParam}/{optionalParam}' => [ + 'get' => 'App\Controller\Params@showByTestAndIntParamStringParamOptionalParam', + ], + ]; + + $this->assertEquals($expected, $found); + + // Test Parameters + $testParams = $collection + ->where('uri', '/api/test/param/{intParam}/{stringParam}/{optionalParam}') + ->firstWhere('method', 'get') + ; + $this->assertEquals([ + 'intParam' => [ + 'required' => true, + 'schema' => [ + 'type' => 'integer', + 'format' => 'int32', + ], + ], + 'numberParam' => [ + 'required' => true, + 'schema' => [ + 'type' => 'number', + 'format' => 'double', + ], + ], + 'dateParam' => [ + 'required' => true, + 'schema' => [ + 'type' => 'string', + 'format' => 'date', + ], + ], + 'optionalParam' => [ + 'required' => false, + 'schema' => [ + 'type' => 'string', + 'format' => null, + ], + ], + ], $testParams['params']); + } + + protected function getOpenApi(): OpenApi + { + return Reader::readFromYamlFile(realpath(__DIR__.'/../specs/routes.yaml')); + } +} diff --git a/packages/api/tests/specs/not-supported.php b/packages/api/tests/specs/not-supported.php new file mode 100644 index 0000000..0b67a5f --- /dev/null +++ b/packages/api/tests/specs/not-supported.php @@ -0,0 +1,3 @@ + + Browsers send an HTTP OPTIONS request to find out the supported HTTP + methods and other options supported for the target resource before + sending the actual request. + head: + summary: > + HEAD method requests HTTP headers from the server as if the document was + requested using the HTTP GET method. The only difference between HTTP + HEAD and GET requests is that for HTTP HEAD, the server only returns + headers without body. + operationId: deleteCompany + trace: + operationId: traceCompany + /companies/{companyId}: + parameters: + - $ref: '#/components/parameters/company' + get: + summary: Info for a specific company + operationId: showCompanyById + delete: + summary: Delete a company + operationId: deleteCompany + put: + summary: Update company + operationId: updateCompanyById + parameters: + - name: companyId + in: path + required: true + description: The id of the company to retrieve + schema: + type: string + /companies/{companyId}/employees: + parameters: + - $ref: '#/components/parameters/company' + get: + summary: List all company employees + operationId: listEmployeesByCompany + /companies/{companyId}/employees/{employeeId}: + parameters: + - $ref: '#/components/parameters/company' + get: + summary: Get one company employee by id + description: should rarely exist + operationId: getEmployeeByCompany + /companies/{companyId}/employees/{employeeId}/salary: + parameters: + - $ref: '#/components/parameters/company' + get: + summary: Get salary of a company employee + description: This is getting ridiculous + operationId: getSalaryByCompanyEmployee + /companies/{companyId}/employees/{employeeId}/salary/{category}: + parameters: + - $ref: '#/components/parameters/company' + get: + summary: Get salary of a company employee by category + description: This is just silly now + operationId: getSalaryByCompanyEmployeeAndCategory + /test/param/{intParam}/{stringParam}/{optionalParam}: + parameters: + - $ref: '#/components/parameters/intParam' + - $ref: '#/components/parameters/numberParam' + - $ref: '#/components/parameters/dateParam' + - $ref: '#/components/parameters/optionalParam' + get: + operationId: sdfsdf +components: + parameters: + company: + name: companyId + in: path + required: true + schema: + type: string + intParam: + name: intParam + in: path + required: true + schema: + type: integer + format: int32 + numberParam: + name: numberParam + in: path + required: true + schema: + type: number + format: double + dateParam: + name: dateParam + in: path + required: true + schema: + type: string + format: date + optionalParam: + name: optionalParam + in: path + required: false + schema: + type: string diff --git a/packages/service-manager/README.md b/packages/service-manager/README.md index b417baf..9295d93 100755 --- a/packages/service-manager/README.md +++ b/packages/service-manager/README.md @@ -1,13 +1,12 @@ # Service Manager -This package contains extra goodies built on top of the [laminas service -manager](https://docs.laminas.dev/laminas-servicemanager/). +This package contains extra goodies built on top of the +[laminas service manager](https://docs.laminas.dev/laminas-servicemanager/). ## Configurable Service Manager -Extends the Laminas Plugin Manager. -Allows definition of plugin configuration/settings. -To easily create configurable services/plugins. +Extends the Laminas Plugin Manager. Allows definition of plugin +configuration/settings. To easily create configurable services/plugins. ```php resolveClass(ServiceA::class); ### Resolver Abstract Factory -A Laminas abstract factory that will auto inject dependencies of your services by -using the resolver. +A Laminas abstract factory that will auto inject dependencies of your services +by using the resolver. Add it to your laminas service manager configuration in the 'abstract_factories' -section. That way any unregistered services will be automatically created with +section. That way any unregistered services will be automatically created with all of their dependencies injected. ```php @@ -116,17 +115,17 @@ $service_manager_config = [ ]; ``` -Note: This factory is automatically added if you are using this package -service ConfigProvider. +Note: This factory is automatically added if you are using this package service +ConfigProvider. ### Contextual Binding / Binding Primitives -Primitives variables cannot be auto-discovered by the service manager and thus would -require context binding. +Primitives variables cannot be auto-discovered by the service manager and thus +would require context binding. ```php -class ServiceA +class ServiceA { public function __construct( private DependencyClass $dependency, @@ -150,19 +149,69 @@ $serviceA->primitiveInt; // 1 ### Method Invocation & Injection Use the Resolver to automatically inject dependencies when calling functions. -This is based on the laravel container [functionality](https://laravel.com/docs/9.x/container#method-invocation-and-injection). - +This is based on the laravel container +[functionality](https://laravel.com/docs/9.x/container#method-invocation-and-injection). ```php $resolver->call(function(Dependency $dependency) { return $dependency->doSomething(); }); ``` + Automatically fetch a service from the container and invoke its function -(default is __invoke) but you can customize the function to use: +(default is \_\_invoke) but you can customize the function to use: ```php $resolver->call(ServiceA::class); $resolver->call([ServiceA::class, 'handle']); $resolver->call(ServiceA::class.'@handle'); ``` + +### PSR-15 Resolve Middleware + +If your application uses PSR-15 Middleware - like +[Mezzio](https://docs.mezzio.dev/mezzio/) you could potentially use the provided +Resolve Middleware to automatically inject dependencies in your handlers +constructor but also handler actions. + +Example when using the Mezzio router. + +```php +// config/routes.php + +return static function (Application $app, MiddlewareFactory $factory, ContainerInterface $container): void { + + // By Manually creating the middleware + $resolver = $container->get(Resolver::class); + $pingMiddleware = new ResolveMiddleware($container, App\Handler\PingHandler::class.'@myCustomAction'); + + $app->get('/api/ping', $pingMiddleware, 'api.ping'); + + // Or by using the factory + + $resolveMiddlewareFactory = $container->get(ResolveMiddlewareFactory::class); + + $app->get('/api/ping', $resolveMiddlewareFactory->prepare(App\Handler\PingHandler::class.'@otherAction'), 'api.ping.factory'); +} +``` + +Note: By using this middleware, your handlers will not be able to implements the +`Psr\Http\Server\RequestHandlerInterface` anymore. They should nonetheless +return a `Psr\Http\Message\ResponseInterface` + +```php +use Psr\Http\Message\ResponseInterface; + +class PingHandler +{ + public function myCustomAction(DependencyOne $dep1, DependencyTwo $dep2): ResponseInterface + { + + } + + public function myCustomAction(DependencyOne $dep1, DependencyTwo $dep2): ResponseInterface + { + + } +} +``` diff --git a/packages/service-manager/composer.json b/packages/service-manager/composer.json index 23fb7c2..c518b2c 100755 --- a/packages/service-manager/composer.json +++ b/packages/service-manager/composer.json @@ -12,6 +12,9 @@ "laminas/laminas-servicemanager": "^3.12.0", "psr/container": "^1.1 || ^2.0" }, + "require-dev": { + "laminas/laminas-diactoros": "^2.7" + }, "autoload": { "psr-4": { "AftDev\\ServiceManager\\": "src/" diff --git a/packages/service-manager/src/ConfigProvider.php b/packages/service-manager/src/ConfigProvider.php index 70ba539..88e2a61 100755 --- a/packages/service-manager/src/ConfigProvider.php +++ b/packages/service-manager/src/ConfigProvider.php @@ -3,6 +3,7 @@ namespace AftDev\ServiceManager; use AftDev\ServiceManager\Factory\ResolverAbstractFactory; +use AftDev\ServiceManager\Middleware\ResolveMiddlewareFactory; class ConfigProvider { @@ -18,6 +19,7 @@ public function getDependencies() return [ 'factories' => [ Resolver::class => Resolver\ResolverFactory::class, + ResolveMiddlewareFactory::class => Middleware\ResolveMiddlewareFactoryFactory::class, ], 'abstract_factories' => [ 'default' => ResolverAbstractFactory::class, diff --git a/packages/service-manager/src/Factory/ResolverAbstractFactory.php b/packages/service-manager/src/Factory/ResolverAbstractFactory.php index 116a16d..00e21ea 100755 --- a/packages/service-manager/src/Factory/ResolverAbstractFactory.php +++ b/packages/service-manager/src/Factory/ResolverAbstractFactory.php @@ -4,17 +4,15 @@ use AftDev\ServiceManager\Resolver; use Laminas\ServiceManager\Exception\ServiceNotFoundException; +use Laminas\ServiceManager\Factory\AbstractFactoryInterface; use Psr\Container\ContainerInterface; use ReflectionClass; use ReflectionException; -use Laminas\ServiceManager\Factory\AbstractFactoryInterface; class ResolverAbstractFactory implements AbstractFactoryInterface { public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { - $options ??= []; - /** @var Resolver $resolver */ $resolver = $container->has(Resolver::class) ? $container->get(Resolver::class) : new Resolver($container); diff --git a/packages/service-manager/src/Middleware/ResolveMiddleware.php b/packages/service-manager/src/Middleware/ResolveMiddleware.php new file mode 100644 index 0000000..0b8ee48 --- /dev/null +++ b/packages/service-manager/src/Middleware/ResolveMiddleware.php @@ -0,0 +1,27 @@ +getAttributes(); + + return $this->resolver->call($this->callable, $attributes); + } +} diff --git a/packages/service-manager/src/Middleware/ResolveMiddlewareFactory.php b/packages/service-manager/src/Middleware/ResolveMiddlewareFactory.php new file mode 100755 index 0000000..af3d164 --- /dev/null +++ b/packages/service-manager/src/Middleware/ResolveMiddlewareFactory.php @@ -0,0 +1,20 @@ +resolver, $callable); + } +} diff --git a/packages/service-manager/src/Middleware/ResolveMiddlewareFactoryFactory.php b/packages/service-manager/src/Middleware/ResolveMiddlewareFactoryFactory.php new file mode 100644 index 0000000..ace1b5b --- /dev/null +++ b/packages/service-manager/src/Middleware/ResolveMiddlewareFactoryFactory.php @@ -0,0 +1,14 @@ +get(Resolver::class)); + } +} diff --git a/packages/service-manager/tests/Middleware/ResolveMiddlewareFactoryTest.php b/packages/service-manager/tests/Middleware/ResolveMiddlewareFactoryTest.php new file mode 100755 index 0000000..d8e7b89 --- /dev/null +++ b/packages/service-manager/tests/Middleware/ResolveMiddlewareFactoryTest.php @@ -0,0 +1,26 @@ +prophesize(Resolver::class); + + $factory = new ResolveMiddlewareFactory($resolver->reveal()); + + $middleware = $factory->prepare('Test'); + + $this->assertInstanceOf(MiddlewareInterface::class, $middleware); + } +} diff --git a/packages/service-manager/tests/Middleware/ResolveMiddlewareTest.php b/packages/service-manager/tests/Middleware/ResolveMiddlewareTest.php new file mode 100755 index 0000000..7f0f6c3 --- /dev/null +++ b/packages/service-manager/tests/Middleware/ResolveMiddlewareTest.php @@ -0,0 +1,44 @@ + 'testValue', + ]; + + foreach ($attributes as $key => $value) { + $request = $request->withAttribute($key, $value); + } + + $response = $this->prophesize(ResponseInterface::class); + $requestHandler = $this->prophesize(RequestHandlerInterface::class); + + $handlerName = 'XXXX'; + $resolver = $this->prophesize(Resolver::class); + $resolver + ->call($handlerName, $attributes) + ->shouldBeCalledOnce() + ->willReturn($response->reveal()) + ; + + $resolveMiddleware = new ResolveMiddleware($resolver->reveal(), $handlerName); + $resolveMiddleware->process($request, $requestHandler->reveal()); + } +} diff --git a/tests/Feature/Api/OpenApiManagerTest.php b/tests/Feature/Api/OpenApiManagerTest.php new file mode 100644 index 0000000..8843134 --- /dev/null +++ b/tests/Feature/Api/OpenApiManagerTest.php @@ -0,0 +1,73 @@ +container->get(OpenApiManager::class); + + $this->assertInstanceOf(OpenApiManager::class, $openApiManager); + } + + /** + * @covers \AftDev\Api\Factory\CurrentOpenApiVersionFactory + */ + public function testCurrentOpenApi() + { + /** @var OpenApi $openApi */ + $openApi = $this->container->get(OpenApi::class); + + $this->assertInstanceOf(OpenApi::class, $openApi); + $this->assertEquals('Swagger Petstore', $openApi->info->title); + $this->assertEquals('1.0.0', $openApi->info->version); + } + + /** + * @covers \AftDev\Api\Factory\CurrentOpenApiVersionFactory + * @covers \AftDev\Api\Factory\OpenApiManagerFactory + */ + public function testCurrentVersion() + { + $this->overrideConfig(join('.', [ConfigProvider::CONFIG_KEY, 'versions']), ['zz' => [], 'test-version' => [ + fn (OpenApi $openApi) => $openApi->info->version = 'test-version', + ]]); + $this->overrideConfig(join('.', [ConfigProvider::CONFIG_KEY, 'version']), 'test-version'); + + $openApi = $this->container->get(OpenApi::class); + + $this->assertInstanceOf(OpenApi::class, $openApi); + $this->assertEquals('test-version', $openApi->info->version); + } + + public function testMutationDependenciesInjection() + { + $apiManagerClass = false; + $this->overrideConfig(join('.', [ConfigProvider::CONFIG_KEY, 'versions']), ['2019-01-02' => [ + function (OpenApi $openApi, OpenApiManager $apiManager) use (&$apiManagerClass) { + $apiManagerClass = get_class($apiManager); + }, + ]]); + + $openApiManager = $this->container->get(OpenApiManager::class); + + $openApi = $openApiManager->getVersion('2019-01-02'); + + $this->assertEquals(OpenApiManager::class, $apiManagerClass); + } +} diff --git a/tests/Feature/ServiceManager/ResolveMiddlewareTest.php b/tests/Feature/ServiceManager/ResolveMiddlewareTest.php new file mode 100755 index 0000000..e8d4a56 --- /dev/null +++ b/tests/Feature/ServiceManager/ResolveMiddlewareTest.php @@ -0,0 +1,26 @@ +container->get(ResolveMiddlewareFactory::class); + + $this->assertInstanceOf(ResolveMiddlewareFactory::class, $factory); + } +} diff --git a/tests/data/openapi/petstore.yaml b/tests/data/openapi/petstore.yaml new file mode 100644 index 0000000..760877b --- /dev/null +++ b/tests/data/openapi/petstore.yaml @@ -0,0 +1,111 @@ +openapi: '3.0.0' +info: + version: 1.0.0 + title: Swagger Petstore + license: + name: MIT +servers: + - url: http://petstore.swagger.io/v1 +paths: + /pets: + get: + summary: List all pets + operationId: listPets + tags: + - petsVersion1 + parameters: + - name: limit + in: query + description: How many items to return at one time (max 100) + required: false + schema: + type: integer + format: int32 + responses: + '200': + description: A paged array of pets + headers: + x-next: + description: A link to the next page of responses + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/Pets' + default: + description: unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + summary: Create a pet + operationId: createPets + tags: + - pets + responses: + '201': + description: Null response + default: + description: unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /pets/{petId}: + get: + summary: Info for a specific pet + operationId: showPetById + tags: + - pets + parameters: + - name: petId + in: path + required: true + description: The id of the pet to retrieve + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + default: + description: unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' +components: + schemas: + Pet: + type: object + required: + - id + - name + properties: + id: + type: integer + format: int64 + name: + type: string + tag: + type: string + Pets: + type: array + items: + $ref: '#/components/schemas/Pet' + Error: + type: object + required: + - code + - message + properties: + code: + type: integer + format: int32 + message: + type: string From bc4ed03f7632cac3d9a4ed4833a32777735ca1e2 Mon Sep 17 00:00:00 2001 From: Christophe G <1050197+cgaube@users.noreply.github.com> Date: Wed, 17 Aug 2022 22:37:09 -0700 Subject: [PATCH 03/20] docs(service-manager): improve resolver doc --- packages/service-manager/README.md | 42 +++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/packages/service-manager/README.md b/packages/service-manager/README.md index 9295d93..0c09e5b 100755 --- a/packages/service-manager/README.md +++ b/packages/service-manager/README.md @@ -77,18 +77,14 @@ $resolver->call(function (Dependency $dependency) { class ServiceA { protected $dependencyA; - function __construct(DependencyA $dependencyA) - { - $this->dependencyA = $dependencyA; - } - function handle(DependencyB $dependencyB) + public function __construct(DependencyA $dependencyA) { - $this->dependencyA->doSomething(); - $dependencyB->doSomething(); + $this->dependencyA = $dependencyA; } } +// Instantiate class only $serviceA = $resolver->resolveClass(ServiceA::class); ``` @@ -162,9 +158,31 @@ Automatically fetch a service from the container and invoke its function (default is \_\_invoke) but you can customize the function to use: ```php -$resolver->call(ServiceA::class); -$resolver->call([ServiceA::class, 'handle']); -$resolver->call(ServiceA::class.'@handle'); +class ServiceA +{ + protected $dependencyA; + + public function __construct(DependencyA $dependencyA) + { + $this->dependencyA = $dependencyA; + } + + public function __invoke(DependencyB $dependencyB) + { + $this->dependencyA->doSomething(); + $dependencyB->doSomething(); + } + + public function handle(DependencyC $dependencyC) + { + // ... + } +} + + +$resolver->call(ServiceA::class); // uses __invoke +$resolver->call([ServiceA::class, 'handle']); // uses handle +$resolver->call(ServiceA::class.'@handle'); // uses handle ``` ### PSR-15 Resolve Middleware @@ -206,12 +224,10 @@ class PingHandler { public function myCustomAction(DependencyOne $dep1, DependencyTwo $dep2): ResponseInterface { - } - public function myCustomAction(DependencyOne $dep1, DependencyTwo $dep2): ResponseInterface + public function otherAction(DependencyOne $dep1, DependencyTwo $dep2): ResponseInterface { - } } ``` From 7254d8ff645a0a9336d3e4fda65f8fc2e4be22ba Mon Sep 17 00:00:00 2001 From: Christophe G <1050197+cgaube@users.noreply.github.com> Date: Fri, 19 Aug 2022 16:27:05 -0700 Subject: [PATCH 04/20] fix(service-manager): change abstract factory key --- packages/service-manager/README.md | 2 +- packages/service-manager/src/ConfigProvider.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/service-manager/README.md b/packages/service-manager/README.md index 0c09e5b..5d3b5cb 100755 --- a/packages/service-manager/README.md +++ b/packages/service-manager/README.md @@ -226,7 +226,7 @@ class PingHandler { } - public function otherAction(DependencyOne $dep1, DependencyTwo $dep2): ResponseInterface + public function otherAction(DependencyThree $dep3): ResponseInterface { } } diff --git a/packages/service-manager/src/ConfigProvider.php b/packages/service-manager/src/ConfigProvider.php index 88e2a61..006b3ce 100755 --- a/packages/service-manager/src/ConfigProvider.php +++ b/packages/service-manager/src/ConfigProvider.php @@ -22,7 +22,7 @@ public function getDependencies() ResolveMiddlewareFactory::class => Middleware\ResolveMiddlewareFactoryFactory::class, ], 'abstract_factories' => [ - 'default' => ResolverAbstractFactory::class, + 'resolver' => ResolverAbstractFactory::class, ], ]; } From 2ea31656b5b25a63a3e1c711c41c8ab6dbc6fd79 Mon Sep 17 00:00:00 2001 From: Christophe G <1050197+cgaube@users.noreply.github.com> Date: Thu, 25 Aug 2022 21:15:45 -0700 Subject: [PATCH 05/20] change me fix test create mezzio route generator --- composer.lock | 1125 ++++++++++++++--- packages/api/composer.json | 2 +- .../api/src/Route/MezzionRouterAdapter.php | 7 + .../api/src/Route/OpenApiRouteGenerator.php | 38 +- .../api/src/Route/RouterAdapterAbstract.php | 7 + .../tests/Route/OpenApiRouteGeneratorTest.php | 8 + packages/cache/src/ConfigProvider.php | 4 +- packages/console/src/ConfigProvider.php | 4 +- .../service-manager/src/AbstractManager.php | 4 +- .../Feature/Api/OpenApiRouteGeneratorTest.php | 44 + 10 files changed, 1078 insertions(+), 165 deletions(-) create mode 100644 packages/api/src/Route/MezzionRouterAdapter.php create mode 100644 packages/api/src/Route/RouterAdapterAbstract.php create mode 100644 tests/Feature/Api/OpenApiRouteGeneratorTest.php diff --git a/composer.lock b/composer.lock index d120507..5f536bc 100644 --- a/composer.lock +++ b/composer.lock @@ -284,6 +284,75 @@ }, "time": "2022-07-16T21:24:52+00:00" }, + { + "name": "cebe/php-openapi", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/cebe/php-openapi.git", + "reference": "020d72b8e3a9a60bc229953e93eda25c49f46f45" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cebe/php-openapi/zipball/020d72b8e3a9a60bc229953e93eda25c49f46f45", + "reference": "020d72b8e3a9a60bc229953e93eda25c49f46f45", + "shasum": "" + }, + "require": { + "ext-json": "*", + "justinrainbow/json-schema": "^5.2", + "php": ">=7.1.0", + "symfony/yaml": "^3.4 || ^4 || ^5 || ^6" + }, + "conflict": { + "symfony/yaml": "3.4.0 - 3.4.4 || 4.0.0 - 4.4.17 || 5.0.0 - 5.1.9 || 5.2.0" + }, + "require-dev": { + "apis-guru/openapi-directory": "1.0.0", + "cebe/indent": "*", + "mermade/openapi3-examples": "1.0.0", + "nexmo/api-specification": "1.0.0", + "oai/openapi-specification": "3.0.3", + "phpstan/phpstan": "^0.12.0", + "phpunit/phpunit": "^6.5 || ^7.5 || ^8.5 || ^9.4" + }, + "bin": [ + "bin/php-openapi" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-4": { + "cebe\\openapi\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Carsten Brandt", + "email": "mail@cebe.cc", + "homepage": "https://cebe.cc/", + "role": "Creator" + } + ], + "description": "Read and write OpenAPI yaml/json files and make the content accessable in PHP objects.", + "homepage": "https://github.com/cebe/php-openapi#readme", + "keywords": [ + "openapi" + ], + "support": { + "issues": "https://github.com/cebe/php-openapi/issues", + "source": "https://github.com/cebe/php-openapi" + }, + "time": "2022-04-20T14:46:44+00:00" + }, { "name": "doctrine/inflector", "version": "2.0.4", @@ -758,25 +827,231 @@ }, "time": "2022-08-22T19:30:28+00:00" }, + { + "name": "justinrainbow/json-schema", + "version": "5.2.12", + "source": { + "type": "git", + "url": "https://github.com/justinrainbow/json-schema.git", + "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/ad87d5a5ca981228e0e205c2bc7dfb8e24559b60", + "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", + "json-schema/json-schema-test-suite": "1.2.0", + "phpunit/phpunit": "^4.8.35" + }, + "bin": [ + "bin/validate-json" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "JsonSchema\\": "src/JsonSchema/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, + { + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" + } + ], + "description": "A library to validate a json schema.", + "homepage": "https://github.com/justinrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], + "support": { + "issues": "https://github.com/justinrainbow/json-schema/issues", + "source": "https://github.com/justinrainbow/json-schema/tree/5.2.12" + }, + "time": "2022-04-13T08:02:27+00:00" + }, + { + "name": "laminas/laminas-config", + "version": "3.7.0", + "source": { + "type": "git", + "url": "https://github.com/laminas/laminas-config.git", + "reference": "e43d13dcfc273d4392812eb395ce636f73f34dfd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laminas/laminas-config/zipball/e43d13dcfc273d4392812eb395ce636f73f34dfd", + "reference": "e43d13dcfc273d4392812eb395ce636f73f34dfd", + "shasum": "" + }, + "require": { + "ext-json": "*", + "laminas/laminas-stdlib": "^3.6", + "php": "^7.3 || ~8.0.0 || ~8.1.0", + "psr/container": "^1.0" + }, + "conflict": { + "container-interop/container-interop": "<1.2.0", + "zendframework/zend-config": "*" + }, + "require-dev": { + "laminas/laminas-coding-standard": "~1.0.0", + "laminas/laminas-filter": "^2.7.2", + "laminas/laminas-i18n": "^2.10.3", + "laminas/laminas-servicemanager": "^3.7", + "phpunit/phpunit": "^9.5.5" + }, + "suggest": { + "laminas/laminas-filter": "^2.7.2; install if you want to use the Filter processor", + "laminas/laminas-i18n": "^2.7.4; install if you want to use the Translator processor", + "laminas/laminas-servicemanager": "^2.7.8 || ^3.3; if you need an extensible plugin manager for use with the Config Factory" + }, + "type": "library", + "autoload": { + "psr-4": { + "Laminas\\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://laminas.dev", + "keywords": [ + "config", + "laminas" + ], + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.laminas.dev/laminas-config/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/laminas/laminas-config/issues", + "rss": "https://github.com/laminas/laminas-config/releases.atom", + "source": "https://github.com/laminas/laminas-config" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2021-10-01T16:07:46+00:00" + }, + { + "name": "laminas/laminas-config-aggregator", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/laminas/laminas-config-aggregator.git", + "reference": "929f6714f87407b4e3f1be35485ead6044127f9d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laminas/laminas-config-aggregator/zipball/929f6714f87407b4e3f1be35485ead6044127f9d", + "reference": "929f6714f87407b4e3f1be35485ead6044127f9d", + "shasum": "" + }, + "require": { + "brick/varexporter": "^0.3.7", + "laminas/laminas-stdlib": "^3.10.1", + "php": "^7.4 || ~8.0.0 || ~8.1.0", + "webimpress/safe-writer": "^2.2.0" + }, + "conflict": { + "nikic/php-parser": "<4.12", + "zendframework/zend-config-aggregator": "*" + }, + "require-dev": { + "laminas/laminas-coding-standard": "~2.3.0", + "laminas/laminas-config": "^3.7.0", + "laminas/laminas-servicemanager": "^3.15.1", + "phpunit/phpunit": "^9.5.21", + "psalm/plugin-phpunit": "^0.17.0", + "vimeo/psalm": "^4.24.0" + }, + "suggest": { + "laminas/laminas-config": "Allows loading configuration from XML, INI, YAML, and JSON files", + "laminas/laminas-config-aggregator-modulemanager": "Allows loading configuration from laminas-mvc Module classes", + "laminas/laminas-config-aggregator-parameters": "Allows usage of templated parameters within your configuration" + }, + "type": "library", + "autoload": { + "psr-4": { + "Laminas\\ConfigAggregator\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Lightweight library for collecting and merging configuration from different sources", + "homepage": "https://laminas.dev", + "keywords": [ + "config-aggregator", + "laminas" + ], + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.laminas.dev/laminas-config-aggregator/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/laminas/laminas-config-aggregator/issues", + "rss": "https://github.com/laminas/laminas-config-aggregator/releases.atom", + "source": "https://github.com/laminas/laminas-config-aggregator" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2022-07-24T15:41:06+00:00" + }, { "name": "laminas/laminas-servicemanager", - "version": "3.15.0", + "version": "3.16.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-servicemanager.git", - "reference": "65910ef6a8066b0369fab77fbec9e030be59c866" + "reference": "863c66733740cd36ebf5e700f4258ef2c68a2a24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-servicemanager/zipball/65910ef6a8066b0369fab77fbec9e030be59c866", - "reference": "65910ef6a8066b0369fab77fbec9e030be59c866", + "url": "https://api.github.com/repos/laminas/laminas-servicemanager/zipball/863c66733740cd36ebf5e700f4258ef2c68a2a24", + "reference": "863c66733740cd36ebf5e700f4258ef2c68a2a24", "shasum": "" }, "require": { - "composer-plugin-api": "^2.0", "laminas/laminas-stdlib": "^3.2.1", "php": "~7.4.0 || ~8.0.0 || ~8.1.0", - "psr/container": "^1.1 || ^2.0.2" + "psr/container": "^1.0" }, "conflict": { "ext-psr": "*", @@ -785,14 +1060,16 @@ "zendframework/zend-servicemanager": "*" }, "provide": { - "psr/container-implementation": "^1.1 || ^2.0" + "psr/container-implementation": "^1.0" }, "replace": { "container-interop/container-interop": "^1.2.0" }, "require-dev": { + "composer/package-versions-deprecated": "^1.0", "laminas/laminas-coding-standard": "~2.3.0", - "laminas/laminas-container-config-test": "^0.6", + "laminas/laminas-container-config-test": "^0.7", + "laminas/laminas-dependency-plugin": "^2.1.2", "mikey179/vfsstream": "^1.6.10@alpha", "ocramius/proxy-manager": "^2.11", "phpbench/phpbench": "^1.1", @@ -846,20 +1123,20 @@ "type": "community_bridge" } ], - "time": "2022-07-18T21:18:56+00:00" + "time": "2022-07-27T14:58:17+00:00" }, { "name": "laminas/laminas-stdlib", - "version": "3.12.0", + "version": "3.13.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-stdlib.git", - "reference": "c5aed3c798018e31fbb7b1e421b8d96bf2cda453" + "reference": "66a6d03c381f6c9f1dd988bf8244f9afb9380d76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/c5aed3c798018e31fbb7b1e421b8d96bf2cda453", - "reference": "c5aed3c798018e31fbb7b1e421b8d96bf2cda453", + "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/66a6d03c381f6c9f1dd988bf8244f9afb9380d76", + "reference": "66a6d03c381f6c9f1dd988bf8244f9afb9380d76", "shasum": "" }, "require": { @@ -906,7 +1183,7 @@ "type": "community_bridge" } ], - "time": "2022-08-22T22:55:58+00:00" + "time": "2022-08-24T13:56:50+00:00" }, { "name": "league/flysystem", @@ -1258,80 +1535,94 @@ "time": "2022-08-06T12:41:24+00:00" }, { - "name": "psr/cache", - "version": "3.0.0", + "name": "nikic/php-parser", + "version": "v4.14.0", "source": { "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1", + "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1", "shasum": "" }, "require": { - "php": ">=8.0.0" + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" }, + "bin": [ + "bin/php-parse" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "4.9-dev" } }, "autoload": { "psr-4": { - "Psr\\Cache\\": "src/" + "PhpParser\\": "lib/PhpParser" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Nikita Popov" } ], - "description": "Common interface for caching libraries", + "description": "A PHP parser written in PHP", "keywords": [ - "cache", - "psr", - "psr-6" + "parser", + "php" ], "support": { - "source": "https://github.com/php-fig/cache/tree/3.0.0" + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.14.0" }, - "time": "2021-02-03T23:26:27+00:00" + "time": "2022-05-31T20:59:12+00:00" }, { - "name": "psr/container", - "version": "2.0.2", + "name": "ocramius/package-versions", + "version": "2.5.1", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + "url": "https://github.com/Ocramius/PackageVersions.git", + "reference": "6707caff2e84a2368f29fdf2cb28a6b5a9e3ab53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/6707caff2e84a2368f29fdf2cb28a6b5a9e3ab53", + "reference": "6707caff2e84a2368f29fdf2cb28a6b5a9e3ab53", "shasum": "" }, "require": { - "php": ">=7.4.0" + "composer-runtime-api": "^2.2.0", + "php": "~8.0.0 || ~8.1.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } + "replace": { + "composer/package-versions-deprecated": "*" + }, + "require-dev": { + "composer/composer": "^2.2.0", + "doctrine/coding-standard": "^9.0.0", + "ext-zip": "^1.15.0", + "phpunit/phpunit": "^9.5.9", + "roave/infection-static-analysis-plugin": "^1.10.0", + "vimeo/psalm": "^4.10.0" }, + "type": "library", "autoload": { "psr-4": { - "Psr\\Container\\": "src/" + "PackageVersions\\": "src/PackageVersions" } }, "notification-url": "https://packagist.org/downloads/", @@ -1340,27 +1631,126 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" } ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], + "description": "Provides efficient querying for installed package versions (no runtime IO)", "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" + "issues": "https://github.com/Ocramius/PackageVersions/issues", + "source": "https://github.com/Ocramius/PackageVersions/tree/2.5.1" }, - "time": "2021-11-05T16:47:00+00:00" + "funding": [ + { + "url": "https://github.com/Ocramius", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ocramius/package-versions", + "type": "tidelift" + } + ], + "time": "2022-03-05T18:04:57+00:00" }, { - "name": "psr/http-message", + "name": "psr/cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/3.0.0" + }, + "time": "2021-02-03T23:26:27+00:00" + }, + { + "name": "psr/container", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.2" + }, + "time": "2021-11-05T16:50:12+00:00" + }, + { + "name": "psr/http-message", "version": "1.0.1", "source": { "type": "git", @@ -2961,21 +3351,22 @@ }, { "name": "symfony/service-contracts", - "version": "v3.1.1", + "version": "v2.5.2", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "925e713fe8fcacf6bc05e936edd8dd5441a21239" + "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/925e713fe8fcacf6bc05e936edd8dd5441a21239", - "reference": "925e713fe8fcacf6bc05e936edd8dd5441a21239", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", + "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", "shasum": "" }, "require": { - "php": ">=8.1", - "psr/container": "^2.0" + "php": ">=7.2.5", + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1|^3" }, "conflict": { "ext-psr": "<1.1|>=2" @@ -2986,7 +3377,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.1-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -2996,10 +3387,7 @@ "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3026,7 +3414,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.1.1" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.2" }, "funding": [ { @@ -3042,7 +3430,7 @@ "type": "tidelift" } ], - "time": "2022-05-30T19:18:58+00:00" + "time": "2022-05-30T19:17:29+00:00" }, { "name": "symfony/string", @@ -3378,6 +3766,80 @@ ], "time": "2022-07-04T16:01:56+00:00" }, + { + "name": "symfony/yaml", + "version": "v6.1.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "cc48dd42ae1201abced04ae38284e23ce2d2d8f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/cc48dd42ae1201abced04ae38284e23ce2d2d8f3", + "reference": "cc48dd42ae1201abced04ae38284e23ce2d2d8f3", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "symfony/console": "<5.4" + }, + "require-dev": { + "symfony/console": "^5.4|^6.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "bin": [ + "Resources/bin/yaml-lint" + ], + "type": "library", + "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": "Loads and dumps YAML files", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/yaml/tree/v6.1.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-07-20T14:45:06+00:00" + }, { "name": "voku/portable-ascii", "version": "2.0.1", @@ -3565,16 +4027,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.234.1", + "version": "3.234.3", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "0057dc79b832f456ed5eb20369a51f894b99a968" + "reference": "21ee9e4181c1e676b43018bd3743dd4c9f8bafc2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/0057dc79b832f456ed5eb20369a51f894b99a968", - "reference": "0057dc79b832f456ed5eb20369a51f894b99a968", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/21ee9e4181c1e676b43018bd3743dd4c9f8bafc2", + "reference": "21ee9e4181c1e676b43018bd3743dd4c9f8bafc2", "shasum": "" }, "require": { @@ -3651,58 +4113,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.234.1" + "source": "https://github.com/aws/aws-sdk-php/tree/3.234.3" }, - "time": "2022-08-23T18:19:55+00:00" - }, - { - "name": "brick/varexporter", - "version": "0.3.7", - "source": { - "type": "git", - "url": "https://github.com/brick/varexporter.git", - "reference": "3e263cd718d242594c52963760fee2059fd5833c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/brick/varexporter/zipball/3e263cd718d242594c52963760fee2059fd5833c", - "reference": "3e263cd718d242594c52963760fee2059fd5833c", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.0", - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^8.5 || ^9.0", - "vimeo/psalm": "4.23.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Brick\\VarExporter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A powerful alternative to var_export(), which can export closures and objects without __set_state()", - "keywords": [ - "var_export" - ], - "support": { - "issues": "https://github.com/brick/varexporter/issues", - "source": "https://github.com/brick/varexporter/tree/0.3.7" - }, - "funding": [ - { - "url": "https://github.com/BenMorel", - "type": "github" - } - ], - "time": "2022-06-29T23:37:57+00:00" + "time": "2022-08-25T18:30:13+00:00" }, { "name": "composer/pcre", @@ -4141,6 +4554,62 @@ ], "time": "2022-02-28T11:07:21+00:00" }, + { + "name": "fig/http-message-util", + "version": "1.1.5", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message-util.git", + "reference": "9d94dc0154230ac39e5bf89398b324a86f63f765" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message-util/zipball/9d94dc0154230ac39e5bf89398b324a86f63f765", + "reference": "9d94dc0154230ac39e5bf89398b324a86f63f765", + "shasum": "" + }, + "require": { + "php": "^5.3 || ^7.0 || ^8.0" + }, + "suggest": { + "psr/http-message": "The package containing the PSR-7 interfaces" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Fig\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Utility classes and constants for use with PSR-7 (psr/http-message)", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "issues": "https://github.com/php-fig/http-message-util/issues", + "source": "https://github.com/php-fig/http-message-util/tree/1.1.5" + }, + "time": "2020-11-24T22:02:12+00:00" + }, { "name": "friendsofphp/php-cs-fixer", "version": "v3.10.0", @@ -4554,65 +5023,93 @@ "time": "2022-06-20T21:43:11+00:00" }, { - "name": "laminas/laminas-config-aggregator", - "version": "1.8.0", + "name": "laminas/laminas-diactoros", + "version": "2.15.0", "source": { "type": "git", - "url": "https://github.com/laminas/laminas-config-aggregator.git", - "reference": "929f6714f87407b4e3f1be35485ead6044127f9d" + "url": "https://github.com/laminas/laminas-diactoros.git", + "reference": "de9cd9cd56f51d24bd6eeaf9012ac04b2be4d587" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-config-aggregator/zipball/929f6714f87407b4e3f1be35485ead6044127f9d", - "reference": "929f6714f87407b4e3f1be35485ead6044127f9d", + "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/de9cd9cd56f51d24bd6eeaf9012ac04b2be4d587", + "reference": "de9cd9cd56f51d24bd6eeaf9012ac04b2be4d587", "shasum": "" }, "require": { - "brick/varexporter": "^0.3.7", - "laminas/laminas-stdlib": "^3.10.1", "php": "^7.4 || ~8.0.0 || ~8.1.0", - "webimpress/safe-writer": "^2.2.0" + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0" }, "conflict": { - "nikic/php-parser": "<4.12", - "zendframework/zend-config-aggregator": "*" + "zendframework/zend-diactoros": "*" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" }, "require-dev": { - "laminas/laminas-coding-standard": "~2.3.0", - "laminas/laminas-config": "^3.7.0", - "laminas/laminas-servicemanager": "^3.15.1", - "phpunit/phpunit": "^9.5.21", + "ext-curl": "*", + "ext-dom": "*", + "ext-gd": "*", + "ext-libxml": "*", + "http-interop/http-factory-tests": "^0.9.0", + "laminas/laminas-coding-standard": "^2.4.0", + "php-http/psr7-integration-tests": "^1.1.1", + "phpunit/phpunit": "^9.5.23", "psalm/plugin-phpunit": "^0.17.0", "vimeo/psalm": "^4.24.0" }, - "suggest": { - "laminas/laminas-config": "Allows loading configuration from XML, INI, YAML, and JSON files", - "laminas/laminas-config-aggregator-modulemanager": "Allows loading configuration from laminas-mvc Module classes", - "laminas/laminas-config-aggregator-parameters": "Allows usage of templated parameters within your configuration" - }, "type": "library", + "extra": { + "laminas": { + "config-provider": "Laminas\\Diactoros\\ConfigProvider", + "module": "Laminas\\Diactoros" + } + }, "autoload": { + "files": [ + "src/functions/create_uploaded_file.php", + "src/functions/marshal_headers_from_sapi.php", + "src/functions/marshal_method_from_sapi.php", + "src/functions/marshal_protocol_version_from_sapi.php", + "src/functions/marshal_uri_from_sapi.php", + "src/functions/normalize_server.php", + "src/functions/normalize_uploaded_files.php", + "src/functions/parse_cookie_header.php", + "src/functions/create_uploaded_file.legacy.php", + "src/functions/marshal_headers_from_sapi.legacy.php", + "src/functions/marshal_method_from_sapi.legacy.php", + "src/functions/marshal_protocol_version_from_sapi.legacy.php", + "src/functions/marshal_uri_from_sapi.legacy.php", + "src/functions/normalize_server.legacy.php", + "src/functions/normalize_uploaded_files.legacy.php", + "src/functions/parse_cookie_header.legacy.php" + ], "psr-4": { - "Laminas\\ConfigAggregator\\": "src/" + "Laminas\\Diactoros\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "description": "Lightweight library for collecting and merging configuration from different sources", + "description": "PSR HTTP Message implementations", "homepage": "https://laminas.dev", "keywords": [ - "config-aggregator", - "laminas" + "http", + "laminas", + "psr", + "psr-17", + "psr-7" ], "support": { "chat": "https://laminas.dev/chat", - "docs": "https://docs.laminas.dev/laminas-config-aggregator/", + "docs": "https://docs.laminas.dev/laminas-diactoros/", "forum": "https://discourse.laminas.dev", - "issues": "https://github.com/laminas/laminas-config-aggregator/issues", - "rss": "https://github.com/laminas/laminas-config-aggregator/releases.atom", - "source": "https://github.com/laminas/laminas-config-aggregator" + "issues": "https://github.com/laminas/laminas-diactoros/issues", + "rss": "https://github.com/laminas/laminas-diactoros/releases.atom", + "source": "https://github.com/laminas/laminas-diactoros" }, "funding": [ { @@ -4620,7 +5117,7 @@ "type": "community_bridge" } ], - "time": "2022-07-24T15:41:06+00:00" + "time": "2022-08-25T00:08:18+00:00" }, { "name": "league/flysystem-aws-s3-v3", @@ -4819,6 +5316,320 @@ ], "time": "2022-07-03T12:18:41+00:00" }, + { + "name": "league/openapi-psr7-validator", + "version": "0.18", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/openapi-psr7-validator.git", + "reference": "5f98f98abf37f4533473699ef2ff2b4dc9b8d52e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/openapi-psr7-validator/zipball/5f98f98abf37f4533473699ef2ff2b4dc9b8d52e", + "reference": "5f98f98abf37f4533473699ef2ff2b4dc9b8d52e", + "shasum": "" + }, + "require": { + "cebe/php-openapi": "^1.6", + "ext-json": "*", + "league/uri": "^6.3", + "php": ">=7.2", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "psr/http-message": "^1.0", + "psr/http-server-middleware": "^1.0", + "respect/validation": "^1.1.3 || ^2.0", + "riverline/multipart-parser": "^2.0.3", + "webmozart/assert": "^1.4" + }, + "require-dev": { + "doctrine/coding-standard": "^8.0", + "guzzlehttp/psr7": "^1.5", + "hansott/psr7-cookies": "^3.0.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1", + "phpstan/phpstan-phpunit": "^1", + "phpstan/phpstan-webmozart-assert": "^1", + "phpunit/phpunit": "^7 || ^8 || ^9", + "symfony/cache": "^5.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\OpenAPIValidation\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Validate PSR-7 messages against OpenAPI (3.0.2) specifications expressed in YAML or JSON", + "homepage": "https://github.com/thephpleague/openapi-psr7-validator", + "keywords": [ + "http", + "openapi", + "psr7", + "validation" + ], + "support": { + "issues": "https://github.com/thephpleague/openapi-psr7-validator/issues", + "source": "https://github.com/thephpleague/openapi-psr7-validator/tree/0.18" + }, + "time": "2022-03-01T10:34:32+00:00" + }, + { + "name": "league/uri", + "version": "6.7.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/uri.git", + "reference": "2d7c87a0860f3126a39f44a8a9bf2fed402dcfea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/uri/zipball/2d7c87a0860f3126a39f44a8a9bf2fed402dcfea", + "reference": "2d7c87a0860f3126a39f44a8a9bf2fed402dcfea", + "shasum": "" + }, + "require": { + "ext-json": "*", + "league/uri-interfaces": "^2.3", + "php": "^7.4 || ^8.0", + "psr/http-message": "^1.0" + }, + "conflict": { + "league/uri-schemes": "^1.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^v3.3.2", + "nyholm/psr7": "^1.5", + "php-http/psr7-integration-tests": "^1.1", + "phpstan/phpstan": "^1.2.0", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1.0.0", + "phpstan/phpstan-strict-rules": "^1.1.0", + "phpunit/phpunit": "^9.5.10", + "psr/http-factory": "^1.0" + }, + "suggest": { + "ext-fileinfo": "Needed to create Data URI from a filepath", + "ext-intl": "Needed to improve host validation", + "league/uri-components": "Needed to easily manipulate URI objects", + "psr/http-factory": "Needed to use the URI factory" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Uri\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://nyamsprod.com" + } + ], + "description": "URI manipulation library", + "homepage": "https://uri.thephpleague.com", + "keywords": [ + "data-uri", + "file-uri", + "ftp", + "hostname", + "http", + "https", + "middleware", + "parse_str", + "parse_url", + "psr-7", + "query-string", + "querystring", + "rfc3986", + "rfc3987", + "rfc6570", + "uri", + "uri-template", + "url", + "ws" + ], + "support": { + "docs": "https://uri.thephpleague.com", + "forum": "https://thephpleague.slack.com", + "issues": "https://github.com/thephpleague/uri/issues", + "source": "https://github.com/thephpleague/uri/tree/6.7.1" + }, + "funding": [ + { + "url": "https://github.com/sponsors/nyamsprod", + "type": "github" + } + ], + "time": "2022-06-29T09:48:18+00:00" + }, + { + "name": "league/uri-interfaces", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/uri-interfaces.git", + "reference": "00e7e2943f76d8cb50c7dfdc2f6dee356e15e383" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/00e7e2943f76d8cb50c7dfdc2f6dee356e15e383", + "reference": "00e7e2943f76d8cb50c7dfdc2f6dee356e15e383", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.19", + "phpstan/phpstan": "^0.12.90", + "phpstan/phpstan-phpunit": "^0.12.19", + "phpstan/phpstan-strict-rules": "^0.12.9", + "phpunit/phpunit": "^8.5.15 || ^9.5" + }, + "suggest": { + "ext-intl": "to use the IDNA feature", + "symfony/intl": "to use the IDNA feature via Symfony Polyfill" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Uri\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://nyamsprod.com" + } + ], + "description": "Common interface for URI representation", + "homepage": "http://github.com/thephpleague/uri-interfaces", + "keywords": [ + "rfc3986", + "rfc3987", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/thephpleague/uri-interfaces/issues", + "source": "https://github.com/thephpleague/uri-interfaces/tree/2.3.0" + }, + "funding": [ + { + "url": "https://github.com/sponsors/nyamsprod", + "type": "github" + } + ], + "time": "2021-06-28T04:27:21+00:00" + }, + { + "name": "mezzio/mezzio-router", + "version": "3.8.0", + "source": { + "type": "git", + "url": "https://github.com/mezzio/mezzio-router.git", + "reference": "27075d3e9b407791abf7ba5e62954a59be4b18df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mezzio/mezzio-router/zipball/27075d3e9b407791abf7ba5e62954a59be4b18df", + "reference": "27075d3e9b407791abf7ba5e62954a59be4b18df", + "shasum": "" + }, + "require": { + "fig/http-message-util": "^1.1.2", + "php": "^7.4 || ~8.0.0 || ~8.1.0", + "psr/container": "^1.0 || ^2.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0.1", + "psr/http-server-middleware": "^1.0", + "webmozart/assert": "^1.10" + }, + "conflict": { + "mezzio/mezzio": "<3.5", + "zendframework/zend-expressive-router": "*" + }, + "require-dev": { + "laminas/laminas-coding-standard": "~2.3.0", + "laminas/laminas-diactoros": "^2.6", + "laminas/laminas-stratigility": "^3.4", + "phpspec/prophecy": "^1.9", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5.11", + "psalm/plugin-phpunit": "^0.15.0", + "vimeo/psalm": "^4.17" + }, + "suggest": { + "mezzio/mezzio-aurarouter": "^3.0 to use the Aura.Router routing adapter", + "mezzio/mezzio-fastroute": "^3.0 to use the FastRoute routing adapter", + "mezzio/mezzio-laminasrouter": "^3.0 to use the laminas-router routing adapter" + }, + "type": "library", + "extra": { + "laminas": { + "config-provider": "Mezzio\\Router\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Mezzio\\Router\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Router subcomponent for Mezzio", + "homepage": "https://mezzio.dev", + "keywords": [ + "http", + "laminas", + "mezzio", + "middleware", + "psr", + "psr-7" + ], + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.mezzio.dev/mezzio/features/router/intro/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/mezzio/mezzio-router/issues", + "rss": "https://github.com/mezzio/mezzio-router/releases.atom", + "source": "https://github.com/mezzio/mezzio-router" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2022-01-06T16:27:49+00:00" + }, { "name": "mtdowling/jmespath.php", "version": "2.6.1", diff --git a/packages/api/composer.json b/packages/api/composer.json index 9d48d2c..c991aaf 100755 --- a/packages/api/composer.json +++ b/packages/api/composer.json @@ -8,7 +8,6 @@ ], "require": { "php": "^8.1", - "laminas/laminas-config-aggregator": "^1.7.0", "cebe/php-openapi": "^1.7.0", "illuminate/support": "^9.0" }, @@ -34,6 +33,7 @@ }, "suggest": { "aftdev/service-manager": "To autoload spec invokable classes", + "aftdev/cache": "To automatically cache generated routes", "psr/http-server-middleware": "To use the middleware", "league/openapi-psr7-validator": "To automatically validate requests" }, diff --git a/packages/api/src/Route/MezzionRouterAdapter.php b/packages/api/src/Route/MezzionRouterAdapter.php new file mode 100644 index 0000000..f47bc27 --- /dev/null +++ b/packages/api/src/Route/MezzionRouterAdapter.php @@ -0,0 +1,7 @@ + 'index', // when no path params. 'getWithParams' => 'show', // where there is a param @@ -22,11 +25,42 @@ class OpenApiRouteGenerator public function __construct( private $prefix = '/api', - private $routeHandler = OpenApiPathHandlerInterface::class, private $namespace = 'App\Controller', + private ?CacheItemPoolInterface $cache = null, ) { } + public function getCache($openApi): ?CacheItemInterface + { + $version = $openApi->info->version ?? 'default'; + $sanitized = preg_replace('/[^a-zA-Z0-9]+/', '', $version); + + return $this->cache ? $this->cache->getItem(sprintf(self::CACHE_NAME, $sanitized)) : null; + } + + /** + * Get routes form the given spec. + * + * Will fetch from cache if it exists. + */ + public function getRoutes(OpenApi $openApi): array + { + $routeCache = $this->getCache($openApi); + if ($routeCache && $routeCache->isHit()) { + return $routeCache->get(); + } + + $generator = $this->generateRoutes($openApi); + $routeArray = iterator_to_array($generator, false); + + if ($routeCache) { + $routeCache->set($routeArray); + $this->cache->save($routeCache); + } + + return $routeArray; + } + /** * Returns routes from the openapi spec. */ diff --git a/packages/api/src/Route/RouterAdapterAbstract.php b/packages/api/src/Route/RouterAdapterAbstract.php new file mode 100644 index 0000000..4ed04a0 --- /dev/null +++ b/packages/api/src/Route/RouterAdapterAbstract.php @@ -0,0 +1,7 @@ +getRoutes($this->getOpenApi()); + + $this->assertIsArray($routes); + } + public function testGenerator() { $generator = new OpenApiRouteGenerator(); diff --git a/packages/cache/src/ConfigProvider.php b/packages/cache/src/ConfigProvider.php index 1cdb9a6..4f004c4 100755 --- a/packages/cache/src/ConfigProvider.php +++ b/packages/cache/src/ConfigProvider.php @@ -2,7 +2,7 @@ namespace AftDev\Cache; -use Laminas\ServiceManager\AbstractFactory\ReflectionBasedAbstractFactory; +use AftDev\ServiceManager\Factory\ResolverAbstractFactory; use Psr\Cache\CacheItemPoolInterface; use Psr\SimpleCache\CacheInterface as SimpleCacheInterface; use Symfony\Contracts\Cache\CacheInterface; @@ -52,7 +52,7 @@ public function getCacheManagerConfig() ], ], 'abstract_factories' => [ - 'default' => ReflectionBasedAbstractFactory::class, + 'default' => ResolverAbstractFactory::class, ], ]; } diff --git a/packages/console/src/ConfigProvider.php b/packages/console/src/ConfigProvider.php index ab59195..b321ec2 100755 --- a/packages/console/src/ConfigProvider.php +++ b/packages/console/src/ConfigProvider.php @@ -2,7 +2,7 @@ namespace AftDev\Console; -use AftDev\ServiceManager\Factory\ReflectionAbstractFactory; +use AftDev\ServiceManager\Factory\ResolverAbstractFactory; class ConfigProvider { @@ -52,7 +52,7 @@ public function getManagerConfig(): array { return [ 'abstract_factories' => [ - 'default' => ReflectionAbstractFactory::class, + 'default' => ResolverAbstractFactory::class, ], ]; } diff --git a/packages/service-manager/src/AbstractManager.php b/packages/service-manager/src/AbstractManager.php index 132e54c..0676f7b 100755 --- a/packages/service-manager/src/AbstractManager.php +++ b/packages/service-manager/src/AbstractManager.php @@ -96,8 +96,10 @@ public function get($name, array $options = null) /** * Return true if the manager can create the service. + * + * {@inheritdoc} */ - public function has(string $name): bool + public function has($name): bool { return parent::has($name) || $this->hasPlugin($name); } diff --git a/tests/Feature/Api/OpenApiRouteGeneratorTest.php b/tests/Feature/Api/OpenApiRouteGeneratorTest.php new file mode 100644 index 0000000..6901a88 --- /dev/null +++ b/tests/Feature/Api/OpenApiRouteGeneratorTest.php @@ -0,0 +1,44 @@ +container->get(CacheManager::class); + $this->cache = $cacheManager->store('php'); + } + + protected function tearDown(): void + { + parent::tearDown(); + $this->cache->clear(); + } + + public function testCache() + { + $generator = new OpenApiRouteGenerator(cache: $this->cache); + $spec = Reader::readFromYamlFile(realpath(__DIR__.'/../../../packages/api/tests/specs/routes.yaml')); + + $routes = $generator->getRoutes($spec); + + $this->assertIsArray($routes); + } +} From 11bdbf0e560168c8a4663db5fabb2f35de63bdda Mon Sep 17 00:00:00 2001 From: Christophe G <1050197+cgaube@users.noreply.github.com> Date: Fri, 2 Sep 2022 10:43:36 -0700 Subject: [PATCH 06/20] test(api): add test coverage --- tests/Feature/Api/OpenApiRouteGeneratorTest.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/Feature/Api/OpenApiRouteGeneratorTest.php b/tests/Feature/Api/OpenApiRouteGeneratorTest.php index 6901a88..65f8d07 100644 --- a/tests/Feature/Api/OpenApiRouteGeneratorTest.php +++ b/tests/Feature/Api/OpenApiRouteGeneratorTest.php @@ -12,7 +12,7 @@ /** * @internal - * @covers \AftDev\Api\Factory\OpenApiRouteGenerator + * @covers \AftDev\Api\Route\OpenApiRouteGenerator */ final class OpenApiRouteGeneratorTest extends FeatureTestCase { @@ -40,5 +40,12 @@ public function testCache() $routes = $generator->getRoutes($spec); $this->assertIsArray($routes); + + $cache = $generator->getCache($spec); + $this->assertTrue($cache->isHit()); + + // When cache exists. + $routes = $generator->getRoutes($spec); + $this->assertIsArray($routes); } } From 38c0abc81ca66d3e2193b65ac602f65c31c3c9ee Mon Sep 17 00:00:00 2001 From: Christophe G <1050197+cgaube@users.noreply.github.com> Date: Sat, 3 Sep 2022 16:17:21 -0700 Subject: [PATCH 07/20] feat(api): parameter translation --- composer.lock | 664 ++++++++++++++---- packages/api/src/ConfigProvider.php | 6 + .../api/src/Factory/OpenApiManagerFactory.php | 2 +- packages/api/src/OpenApiManager.php | 2 +- .../src/Route/FastRouterParamTranslator.php | 33 + .../api/src/Route/MezzionRouterAdapter.php | 7 - .../api/src/Route/OpenApiRouteGenerator.php | 51 +- .../src/Route/ParamTranslatorInterface.php | 10 + packages/api/src/Route/Route.php | 16 + .../api/src/Route/RouterAdapterAbstract.php | 7 - packages/api/tests/OpenApiManagerTest.php | 3 +- .../Route/FastRouterParamTranslatorTest.php | 73 ++ .../tests/Route/OpenApiRouteGeneratorTest.php | 76 +- packages/api/tests/specs/routes.yaml | 23 +- .../Api/ParamTranslatorInterfaceTest.php | 28 + 15 files changed, 795 insertions(+), 206 deletions(-) create mode 100644 packages/api/src/Route/FastRouterParamTranslator.php delete mode 100644 packages/api/src/Route/MezzionRouterAdapter.php create mode 100644 packages/api/src/Route/ParamTranslatorInterface.php create mode 100644 packages/api/src/Route/Route.php delete mode 100644 packages/api/src/Route/RouterAdapterAbstract.php create mode 100644 packages/api/tests/Route/FastRouterParamTranslatorTest.php create mode 100644 tests/Feature/Api/ParamTranslatorInterfaceTest.php diff --git a/composer.lock b/composer.lock index 5f536bc..2da756d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c05dd54eefb2186ce8ef647ec6ec84b9", + "content-hash": "8e8a789d587301d19aa10c1cf9cdf60e", "packages": [ { "name": "brick/varexporter", @@ -57,16 +57,16 @@ }, { "name": "cakephp/core", - "version": "4.4.4", + "version": "4.4.5", "source": { "type": "git", "url": "https://github.com/cakephp/core.git", - "reference": "884555efcf573ea23597f9c88a12ed6d58af00f3" + "reference": "77e53e3784863c1b8006464b82ab842ee7c58e6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/core/zipball/884555efcf573ea23597f9c88a12ed6d58af00f3", - "reference": "884555efcf573ea23597f9c88a12ed6d58af00f3", + "url": "https://api.github.com/repos/cakephp/core/zipball/77e53e3784863c1b8006464b82ab842ee7c58e6b", + "reference": "77e53e3784863c1b8006464b82ab842ee7c58e6b", "shasum": "" }, "require": { @@ -110,20 +110,20 @@ "issues": "https://github.com/cakephp/cakephp/issues", "source": "https://github.com/cakephp/core" }, - "time": "2022-05-31T20:57:08+00:00" + "time": "2022-08-26T02:01:18+00:00" }, { "name": "cakephp/database", - "version": "4.4.4", + "version": "4.4.5", "source": { "type": "git", "url": "https://github.com/cakephp/database.git", - "reference": "25694dd69cbfa61a6b17674b76aa2accd1f779f9" + "reference": "eec6239b0734e2a4dfe212dc93bcd505c7d296ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/database/zipball/25694dd69cbfa61a6b17674b76aa2accd1f779f9", - "reference": "25694dd69cbfa61a6b17674b76aa2accd1f779f9", + "url": "https://api.github.com/repos/cakephp/database/zipball/eec6239b0734e2a4dfe212dc93bcd505c7d296ef", + "reference": "eec6239b0734e2a4dfe212dc93bcd505c7d296ef", "shasum": "" }, "require": { @@ -165,20 +165,20 @@ "issues": "https://github.com/cakephp/cakephp/issues", "source": "https://github.com/cakephp/database" }, - "time": "2022-07-21T13:36:55+00:00" + "time": "2022-08-18T21:01:25+00:00" }, { "name": "cakephp/datasource", - "version": "4.4.4", + "version": "4.4.5", "source": { "type": "git", "url": "https://github.com/cakephp/datasource.git", - "reference": "f0dd560edbaf6dac8045e7804c25d2e8e6ef0d3c" + "reference": "6fbd1f49833dedf3bd351e1a98b18133a6b9e86c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/datasource/zipball/f0dd560edbaf6dac8045e7804c25d2e8e6ef0d3c", - "reference": "f0dd560edbaf6dac8045e7804c25d2e8e6ef0d3c", + "url": "https://api.github.com/repos/cakephp/datasource/zipball/6fbd1f49833dedf3bd351e1a98b18133a6b9e86c", + "reference": "6fbd1f49833dedf3bd351e1a98b18133a6b9e86c", "shasum": "" }, "require": { @@ -223,20 +223,20 @@ "issues": "https://github.com/cakephp/cakephp/issues", "source": "https://github.com/cakephp/datasource" }, - "time": "2022-07-28T08:59:25+00:00" + "time": "2022-08-18T20:55:21+00:00" }, { "name": "cakephp/utility", - "version": "4.4.4", + "version": "4.4.5", "source": { "type": "git", "url": "https://github.com/cakephp/utility.git", - "reference": "32866aac3d4fef7649fb524da6c59e14e7d18a0d" + "reference": "7d28a3935f746fcbbfb38e8dddaa9c9d48b251c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/utility/zipball/32866aac3d4fef7649fb524da6c59e14e7d18a0d", - "reference": "32866aac3d4fef7649fb524da6c59e14e7d18a0d", + "url": "https://api.github.com/repos/cakephp/utility/zipball/7d28a3935f746fcbbfb38e8dddaa9c9d48b251c5", + "reference": "7d28a3935f746fcbbfb38e8dddaa9c9d48b251c5", "shasum": "" }, "require": { @@ -282,7 +282,7 @@ "issues": "https://github.com/cakephp/cakephp/issues", "source": "https://github.com/cakephp/utility" }, - "time": "2022-07-16T21:24:52+00:00" + "time": "2022-08-19T06:02:03+00:00" }, { "name": "cebe/php-openapi", @@ -446,7 +446,7 @@ }, { "name": "illuminate/collections", - "version": "v9.26.1", + "version": "v9.27.0", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", @@ -501,7 +501,7 @@ }, { "name": "illuminate/conditionable", - "version": "v9.26.1", + "version": "v9.27.0", "source": { "type": "git", "url": "https://github.com/illuminate/conditionable.git", @@ -547,7 +547,7 @@ }, { "name": "illuminate/container", - "version": "v9.26.1", + "version": "v9.27.0", "source": { "type": "git", "url": "https://github.com/illuminate/container.git", @@ -598,7 +598,7 @@ }, { "name": "illuminate/contracts", - "version": "v9.26.1", + "version": "v9.27.0", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", @@ -646,16 +646,16 @@ }, { "name": "illuminate/database", - "version": "v9.26.1", + "version": "v9.27.0", "source": { "type": "git", "url": "https://github.com/illuminate/database.git", - "reference": "2881fe5c85172602475bd9d04075ebed4f57ebc1" + "reference": "017c670244f39c42b575807f5ea52b44df772790" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/database/zipball/2881fe5c85172602475bd9d04075ebed4f57ebc1", - "reference": "2881fe5c85172602475bd9d04075ebed4f57ebc1", + "url": "https://api.github.com/repos/illuminate/database/zipball/017c670244f39c42b575807f5ea52b44df772790", + "reference": "017c670244f39c42b575807f5ea52b44df772790", "shasum": "" }, "require": { @@ -710,11 +710,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-08-23T13:29:16+00:00" + "time": "2022-08-30T13:24:51+00:00" }, { "name": "illuminate/macroable", - "version": "v9.26.1", + "version": "v9.27.0", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -760,16 +760,16 @@ }, { "name": "illuminate/support", - "version": "v9.26.1", + "version": "v9.27.0", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "aa59158424c704011acd2b3276d020c3bb4759bf" + "reference": "e40eb24d4799d82d3dab6f8f91cc2c68cb6cc798" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/aa59158424c704011acd2b3276d020c3bb4759bf", - "reference": "aa59158424c704011acd2b3276d020c3bb4759bf", + "url": "https://api.github.com/repos/illuminate/support/zipball/e40eb24d4799d82d3dab6f8f91cc2c68cb6cc798", + "reference": "e40eb24d4799d82d3dab6f8f91cc2c68cb6cc798", "shasum": "" }, "require": { @@ -825,7 +825,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-08-22T19:30:28+00:00" + "time": "2022-08-26T15:24:56+00:00" }, { "name": "justinrainbow/json-schema", @@ -1434,16 +1434,16 @@ }, { "name": "nesbot/carbon", - "version": "2.61.0", + "version": "2.62.1", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "bdf4f4fe3a3eac4de84dbec0738082a862c68ba6" + "reference": "01bc4cdefe98ef58d1f9cb31bdbbddddf2a88f7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/bdf4f4fe3a3eac4de84dbec0738082a862c68ba6", - "reference": "bdf4f4fe3a3eac4de84dbec0738082a862c68ba6", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/01bc4cdefe98ef58d1f9cb31bdbbddddf2a88f7a", + "reference": "01bc4cdefe98ef58d1f9cb31bdbbddddf2a88f7a", "shasum": "" }, "require": { @@ -1532,7 +1532,7 @@ "type": "tidelift" } ], - "time": "2022-08-06T12:41:24+00:00" + "time": "2022-09-02T07:48:13+00:00" }, { "name": "nikic/php-parser", @@ -2357,16 +2357,16 @@ }, { "name": "symfony/console", - "version": "v6.1.3", + "version": "v6.1.4", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "43fcb5c5966b43c56bcfa481368d90d748936ab8" + "reference": "7fccea8728aa2d431a6725b02b3ce759049fc84d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/43fcb5c5966b43c56bcfa481368d90d748936ab8", - "reference": "43fcb5c5966b43c56bcfa481368d90d748936ab8", + "url": "https://api.github.com/repos/symfony/console/zipball/7fccea8728aa2d431a6725b02b3ce759049fc84d", + "reference": "7fccea8728aa2d431a6725b02b3ce759049fc84d", "shasum": "" }, "require": { @@ -2433,7 +2433,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.1.3" + "source": "https://github.com/symfony/console/tree/v6.1.4" }, "funding": [ { @@ -2449,7 +2449,7 @@ "type": "tidelift" } ], - "time": "2022-07-22T14:17:57+00:00" + "time": "2022-08-26T10:32:31+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2520,16 +2520,16 @@ }, { "name": "symfony/filesystem", - "version": "v6.1.3", + "version": "v6.1.4", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "c780e677cddda78417fa5187a7c6cd2f21110db9" + "reference": "3f39c04d2630c34019907b02f85672dac99f8659" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/c780e677cddda78417fa5187a7c6cd2f21110db9", - "reference": "c780e677cddda78417fa5187a7c6cd2f21110db9", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/3f39c04d2630c34019907b02f85672dac99f8659", + "reference": "3f39c04d2630c34019907b02f85672dac99f8659", "shasum": "" }, "require": { @@ -2563,7 +2563,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.1.3" + "source": "https://github.com/symfony/filesystem/tree/v6.1.4" }, "funding": [ { @@ -2579,7 +2579,7 @@ "type": "tidelift" } ], - "time": "2022-07-20T14:45:06+00:00" + "time": "2022-08-02T16:17:38+00:00" }, { "name": "symfony/messenger", @@ -3250,16 +3250,16 @@ }, { "name": "symfony/serializer", - "version": "v6.1.3", + "version": "v6.1.4", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "2c59be38d343e2ed4d4ea3c05965c2ae41c7109f" + "reference": "03e5987dd9bb98038c60c7af3e58500c81c4aec1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/2c59be38d343e2ed4d4ea3c05965c2ae41c7109f", - "reference": "2c59be38d343e2ed4d4ea3c05965c2ae41c7109f", + "url": "https://api.github.com/repos/symfony/serializer/zipball/03e5987dd9bb98038c60c7af3e58500c81c4aec1", + "reference": "03e5987dd9bb98038c60c7af3e58500c81c4aec1", "shasum": "" }, "require": { @@ -3331,7 +3331,7 @@ "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/serializer/tree/v6.1.3" + "source": "https://github.com/symfony/serializer/tree/v6.1.4" }, "funding": [ { @@ -3347,7 +3347,7 @@ "type": "tidelift" } ], - "time": "2022-07-28T22:08:12+00:00" + "time": "2022-08-26T10:32:31+00:00" }, { "name": "symfony/service-contracts", @@ -3434,16 +3434,16 @@ }, { "name": "symfony/string", - "version": "v6.1.3", + "version": "v6.1.4", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "f35241f45c30bcd9046af2bb200a7086f70e1d6b" + "reference": "290972cad7b364e3befaa74ba0ec729800fb161c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/f35241f45c30bcd9046af2bb200a7086f70e1d6b", - "reference": "f35241f45c30bcd9046af2bb200a7086f70e1d6b", + "url": "https://api.github.com/repos/symfony/string/zipball/290972cad7b364e3befaa74ba0ec729800fb161c", + "reference": "290972cad7b364e3befaa74ba0ec729800fb161c", "shasum": "" }, "require": { @@ -3499,7 +3499,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.1.3" + "source": "https://github.com/symfony/string/tree/v6.1.4" }, "funding": [ { @@ -3515,20 +3515,20 @@ "type": "tidelift" } ], - "time": "2022-07-27T15:50:51+00:00" + "time": "2022-08-12T18:05:43+00:00" }, { "name": "symfony/translation", - "version": "v6.1.3", + "version": "v6.1.4", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "b042e16087d298d08c1f013ff505d16c12a3b1be" + "reference": "45d0f5bb8df7255651ca91c122fab604e776af03" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/b042e16087d298d08c1f013ff505d16c12a3b1be", - "reference": "b042e16087d298d08c1f013ff505d16c12a3b1be", + "url": "https://api.github.com/repos/symfony/translation/zipball/45d0f5bb8df7255651ca91c122fab604e776af03", + "reference": "45d0f5bb8df7255651ca91c122fab604e776af03", "shasum": "" }, "require": { @@ -3595,7 +3595,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.1.3" + "source": "https://github.com/symfony/translation/tree/v6.1.4" }, "funding": [ { @@ -3611,7 +3611,7 @@ "type": "tidelift" } ], - "time": "2022-07-20T13:46:29+00:00" + "time": "2022-08-02T16:17:38+00:00" }, { "name": "symfony/translation-contracts", @@ -3768,16 +3768,16 @@ }, { "name": "symfony/yaml", - "version": "v6.1.3", + "version": "v6.1.4", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "cc48dd42ae1201abced04ae38284e23ce2d2d8f3" + "reference": "86ee4d8fa594ed45e40d86eedfda1bcb66c8d919" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/cc48dd42ae1201abced04ae38284e23ce2d2d8f3", - "reference": "cc48dd42ae1201abced04ae38284e23ce2d2d8f3", + "url": "https://api.github.com/repos/symfony/yaml/zipball/86ee4d8fa594ed45e40d86eedfda1bcb66c8d919", + "reference": "86ee4d8fa594ed45e40d86eedfda1bcb66c8d919", "shasum": "" }, "require": { @@ -3822,7 +3822,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.1.3" + "source": "https://github.com/symfony/yaml/tree/v6.1.4" }, "funding": [ { @@ -3838,7 +3838,7 @@ "type": "tidelift" } ], - "time": "2022-07-20T14:45:06+00:00" + "time": "2022-08-02T16:17:38+00:00" }, { "name": "voku/portable-ascii", @@ -4027,16 +4027,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.234.3", + "version": "3.235.0", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "21ee9e4181c1e676b43018bd3743dd4c9f8bafc2" + "reference": "03294ecd13463d4ac46ac866ed918b4aad186bd4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/21ee9e4181c1e676b43018bd3743dd4c9f8bafc2", - "reference": "21ee9e4181c1e676b43018bd3743dd4c9f8bafc2", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/03294ecd13463d4ac46ac866ed918b4aad186bd4", + "reference": "03294ecd13463d4ac46ac866ed918b4aad186bd4", "shasum": "" }, "require": { @@ -4113,9 +4113,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.234.3" + "source": "https://github.com/aws/aws-sdk-php/tree/3.235.0" }, - "time": "2022-08-25T18:30:13+00:00" + "time": "2022-09-01T18:19:51+00:00" }, { "name": "composer/pcre", @@ -4612,16 +4612,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.10.0", + "version": "v3.11.0", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "76d7da666e66d83a1dc27a9d1c625c80cc4ac1fe" + "reference": "7dcdea3f2f5f473464e835be9be55283ff8cfdc3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/76d7da666e66d83a1dc27a9d1c625c80cc4ac1fe", - "reference": "76d7da666e66d83a1dc27a9d1c625c80cc4ac1fe", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/7dcdea3f2f5f473464e835be9be55283ff8cfdc3", + "reference": "7dcdea3f2f5f473464e835be9be55283ff8cfdc3", "shasum": "" }, "require": { @@ -4689,7 +4689,7 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.10.0" + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.11.0" }, "funding": [ { @@ -4697,20 +4697,20 @@ "type": "github" } ], - "time": "2022-08-17T22:13:10+00:00" + "time": "2022-09-01T18:24:51+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "7.4.5", + "version": "7.5.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82" + "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", - "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b50a2a1251152e43f6a37f0fa053e730a67d25ba", + "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba", "shasum": "" }, "require": { @@ -4725,10 +4725,10 @@ "psr/http-client-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", + "bamarni/composer-bin-plugin": "^1.8.1", "ext-curl": "*", "php-http/client-integration-tests": "^3.0", - "phpunit/phpunit": "^8.5.5 || ^9.3.5", + "phpunit/phpunit": "^8.5.29 || ^9.5.23", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { @@ -4738,8 +4738,12 @@ }, "type": "library", "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + }, "branch-alias": { - "dev-master": "7.4-dev" + "dev-master": "7.5-dev" } }, "autoload": { @@ -4805,7 +4809,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.4.5" + "source": "https://github.com/guzzle/guzzle/tree/7.5.0" }, "funding": [ { @@ -4821,20 +4825,20 @@ "type": "tidelift" } ], - "time": "2022-06-20T22:16:13+00:00" + "time": "2022-08-28T15:39:27+00:00" }, { "name": "guzzlehttp/promises", - "version": "1.5.1", + "version": "1.5.2", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" + "reference": "b94b2807d85443f9719887892882d0329d1e2598" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "url": "https://api.github.com/repos/guzzle/promises/zipball/b94b2807d85443f9719887892882d0329d1e2598", + "reference": "b94b2807d85443f9719887892882d0329d1e2598", "shasum": "" }, "require": { @@ -4889,7 +4893,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.1" + "source": "https://github.com/guzzle/promises/tree/1.5.2" }, "funding": [ { @@ -4905,20 +4909,20 @@ "type": "tidelift" } ], - "time": "2021-10-22T20:56:57+00:00" + "time": "2022-08-28T14:55:35+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.4.0", + "version": "2.4.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "13388f00956b1503577598873fffb5ae994b5737" + "reference": "69568e4293f4fa993f3b0e51c9723e1e17c41379" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/13388f00956b1503577598873fffb5ae994b5737", - "reference": "13388f00956b1503577598873fffb5ae994b5737", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/69568e4293f4fa993f3b0e51c9723e1e17c41379", + "reference": "69568e4293f4fa993f3b0e51c9723e1e17c41379", "shasum": "" }, "require": { @@ -4932,15 +4936,19 @@ "psr/http-message-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", + "bamarni/composer-bin-plugin": "^1.8.1", "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.8 || ^9.3.10" + "phpunit/phpunit": "^8.5.29 || ^9.5.23" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + }, "branch-alias": { "dev-master": "2.4-dev" } @@ -5004,7 +5012,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.4.0" + "source": "https://github.com/guzzle/psr7/tree/2.4.1" }, "funding": [ { @@ -5020,20 +5028,20 @@ "type": "tidelift" } ], - "time": "2022-06-20T21:43:11+00:00" + "time": "2022-08-28T14:45:39+00:00" }, { "name": "laminas/laminas-diactoros", - "version": "2.15.0", + "version": "2.17.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-diactoros.git", - "reference": "de9cd9cd56f51d24bd6eeaf9012ac04b2be4d587" + "reference": "5b32597aa46b83c8b85bb1cf9a6ed4fe7dd980c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/de9cd9cd56f51d24bd6eeaf9012ac04b2be4d587", - "reference": "de9cd9cd56f51d24bd6eeaf9012ac04b2be4d587", + "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/5b32597aa46b83c8b85bb1cf9a6ed4fe7dd980c5", + "reference": "5b32597aa46b83c8b85bb1cf9a6ed4fe7dd980c5", "shasum": "" }, "require": { @@ -5117,7 +5125,216 @@ "type": "community_bridge" } ], - "time": "2022-08-25T00:08:18+00:00" + "time": "2022-08-30T17:01:46+00:00" + }, + { + "name": "laminas/laminas-escaper", + "version": "2.10.0", + "source": { + "type": "git", + "url": "https://github.com/laminas/laminas-escaper.git", + "reference": "58af67282db37d24e584a837a94ee55b9c7552be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/58af67282db37d24e584a837a94ee55b9c7552be", + "reference": "58af67282db37d24e584a837a94ee55b9c7552be", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-mbstring": "*", + "php": "^7.4 || ~8.0.0 || ~8.1.0" + }, + "conflict": { + "zendframework/zend-escaper": "*" + }, + "require-dev": { + "infection/infection": "^0.26.6", + "laminas/laminas-coding-standard": "~2.3.0", + "maglnet/composer-require-checker": "^3.8.0", + "phpunit/phpunit": "^9.5.18", + "psalm/plugin-phpunit": "^0.16.1", + "vimeo/psalm": "^4.22.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Laminas\\Escaper\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Securely and safely escape HTML, HTML attributes, JavaScript, CSS, and URLs", + "homepage": "https://laminas.dev", + "keywords": [ + "escaper", + "laminas" + ], + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.laminas.dev/laminas-escaper/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/laminas/laminas-escaper/issues", + "rss": "https://github.com/laminas/laminas-escaper/releases.atom", + "source": "https://github.com/laminas/laminas-escaper" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2022-03-08T20:15:36+00:00" + }, + { + "name": "laminas/laminas-httphandlerrunner", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/laminas/laminas-httphandlerrunner.git", + "reference": "4d337cde83e6b901a4443b0ab5c3b97cbaa46413" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laminas/laminas-httphandlerrunner/zipball/4d337cde83e6b901a4443b0ab5c3b97cbaa46413", + "reference": "4d337cde83e6b901a4443b0ab5c3b97cbaa46413", + "shasum": "" + }, + "require": { + "php": "^7.3 || ~8.0.0 || ~8.1.0", + "psr/http-message": "^1.0", + "psr/http-message-implementation": "^1.0", + "psr/http-server-handler": "^1.0" + }, + "require-dev": { + "laminas/laminas-coding-standard": "~2.3.0", + "laminas/laminas-diactoros": "^2.8.0", + "phpunit/phpunit": "^9.5.9", + "psalm/plugin-phpunit": "^0.16.1", + "vimeo/psalm": "^4.10.0" + }, + "type": "library", + "extra": { + "laminas": { + "config-provider": "Laminas\\HttpHandlerRunner\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Laminas\\HttpHandlerRunner\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Execute PSR-15 RequestHandlerInterface instances and emit responses they generate.", + "homepage": "https://laminas.dev", + "keywords": [ + "components", + "laminas", + "mezzio", + "psr-15", + "psr-7" + ], + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.laminas.dev/laminas-httphandlerrunner/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/laminas/laminas-httphandlerrunner/issues", + "rss": "https://github.com/laminas/laminas-httphandlerrunner/releases.atom", + "source": "https://github.com/laminas/laminas-httphandlerrunner" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2021-09-22T09:27:36+00:00" + }, + { + "name": "laminas/laminas-stratigility", + "version": "3.8.0", + "source": { + "type": "git", + "url": "https://github.com/laminas/laminas-stratigility.git", + "reference": "aa47a70ed02cff6109bf09aa7c3e85c574033d81" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laminas/laminas-stratigility/zipball/aa47a70ed02cff6109bf09aa7c3e85c574033d81", + "reference": "aa47a70ed02cff6109bf09aa7c3e85c574033d81", + "shasum": "" + }, + "require": { + "fig/http-message-util": "^1.1", + "laminas/laminas-escaper": "^2.10.0", + "php": "^7.4 || ~8.0.0 || ~8.1.0", + "psr/http-message": "^1.0", + "psr/http-server-middleware": "^1.0" + }, + "conflict": { + "laminas/laminas-diactoros": "<1.7.1", + "zendframework/zend-stratigility": "*" + }, + "require-dev": { + "laminas/laminas-coding-standard": "~2.3.0", + "laminas/laminas-diactoros": "^2.13.0", + "phpunit/phpunit": "^9.5.21", + "psalm/plugin-phpunit": "^0.17.0", + "vimeo/psalm": "^4.24.0" + }, + "suggest": { + "psr/http-message-implementation": "Please install a psr/http-message-implementation to consume Stratigility; e.g., laminas/laminas-diactoros" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions/double-pass-middleware.php", + "src/functions/host.php", + "src/functions/middleware.php", + "src/functions/path.php", + "src/functions/double-pass-middleware.legacy.php", + "src/functions/host.legacy.php", + "src/functions/middleware.legacy.php", + "src/functions/path.legacy.php" + ], + "psr-4": { + "Laminas\\Stratigility\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "PSR-7 middleware foundation for building and dispatching middleware pipelines", + "homepage": "https://laminas.dev", + "keywords": [ + "http", + "laminas", + "middleware", + "psr-15", + "psr-7" + ], + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.laminas.dev/laminas-stratigility/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/laminas/laminas-stratigility/issues", + "rss": "https://github.com/laminas/laminas-stratigility/releases.atom", + "source": "https://github.com/laminas/laminas-stratigility" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2022-07-23T13:56:06+00:00" }, { "name": "league/flysystem-aws-s3-v3", @@ -5547,6 +5764,115 @@ ], "time": "2021-06-28T04:27:21+00:00" }, + { + "name": "mezzio/mezzio", + "version": "3.11.0", + "source": { + "type": "git", + "url": "https://github.com/mezzio/mezzio.git", + "reference": "d5bf81f0caee6cf4b682a4bf1f8d693288bf217d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mezzio/mezzio/zipball/d5bf81f0caee6cf4b682a4bf1f8d693288bf217d", + "reference": "d5bf81f0caee6cf4b682a4bf1f8d693288bf217d", + "shasum": "" + }, + "require": { + "fig/http-message-util": "^1.1.5", + "laminas/laminas-httphandlerrunner": "^2.1", + "laminas/laminas-stratigility": "^3.5", + "mezzio/mezzio-router": "^3.7", + "mezzio/mezzio-template": "^2.2", + "php": "~7.4.0||~8.0.0||~8.1.0", + "psr/container": "^1.0||^2.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0.1", + "psr/http-server-middleware": "^1.0", + "webmozart/assert": "^1.10" + }, + "conflict": { + "container-interop/container-interop": "<1.2.0", + "filp/whoops": "<2.14.4", + "laminas/laminas-diactoros": "<1.7.1", + "laminas/laminas-http": "<2.15.0", + "laminas/laminas-router": "<3.5.0", + "laminas/laminas-stdlib": "<3.6.0", + "zendframework/zend-expressive": "*" + }, + "require-dev": { + "filp/whoops": "^2.14.4", + "laminas/laminas-coding-standard": "~2.3.0", + "laminas/laminas-diactoros": "^2.11.2", + "laminas/laminas-servicemanager": "^3.10", + "malukenho/docheader": "^0.1.8", + "mezzio/mezzio-aurarouter": "^3.3.0", + "mezzio/mezzio-fastroute": "^3.3.0", + "mezzio/mezzio-laminasrouter": "^3.1.0", + "mockery/mockery": "^1.4.4", + "phpunit/phpunit": "^9.5.10", + "psalm/plugin-phpunit": "^0.13", + "vimeo/psalm": "^4.13.1" + }, + "suggest": { + "filp/whoops": "^2.1 to use the Whoops error handler", + "laminas/laminas-auradi-config": "^2.0 to use Aura.Di dependency injection container", + "laminas/laminas-pimple-config": "^1.0 to use Pimple for dependency injection container", + "laminas/laminas-servicemanager": "^3.3 to use laminas-servicemanager for dependency injection", + "mezzio/mezzio-helpers": "^3.0 for its UrlHelper, ServerUrlHelper, and BodyParseMiddleware", + "mezzio/mezzio-tooling": "^1.0 for migration and development tools; require it with the --dev flag", + "psr/http-message-implementation": "Please install a psr/http-message-implementation to consume Mezzio; e.g., laminas/laminas-diactoros" + }, + "bin": [ + "bin/mezzio-tooling" + ], + "type": "library", + "extra": { + "laminas": { + "config-provider": "Mezzio\\ConfigProvider" + } + }, + "autoload": { + "files": [ + "src/constants.php", + "src/constants.legacy.php" + ], + "psr-4": { + "Mezzio\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "PSR-15 Middleware Microframework", + "homepage": "https://mezzio.dev", + "keywords": [ + "PSR-11", + "http", + "laminas", + "mezzio", + "middleware", + "psr", + "psr-15", + "psr-7" + ], + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.mezzio.dev/mezzio/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/mezzio/mezzio/issues", + "rss": "https://github.com/mezzio/mezzio/releases.atom", + "source": "https://github.com/mezzio/mezzio" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2022-06-29T21:47:57+00:00" + }, { "name": "mezzio/mezzio-router", "version": "3.8.0", @@ -5630,6 +5956,70 @@ ], "time": "2022-01-06T16:27:49+00:00" }, + { + "name": "mezzio/mezzio-template", + "version": "2.4.0", + "source": { + "type": "git", + "url": "https://github.com/mezzio/mezzio-template.git", + "reference": "92ccf133fbe2b2f93c3e1f16de746ba96b52d67e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mezzio/mezzio-template/zipball/92ccf133fbe2b2f93c3e1f16de746ba96b52d67e", + "reference": "92ccf133fbe2b2f93c3e1f16de746ba96b52d67e", + "shasum": "" + }, + "require": { + "php": "^7.3 || ~8.0.0 || ~8.1.0" + }, + "conflict": { + "zendframework/zend-expressive-template": "*" + }, + "require-dev": { + "laminas/laminas-coding-standard": "~2.2.0", + "phpunit/phpunit": "^9.4", + "psalm/plugin-phpunit": "^0.16.1", + "vimeo/psalm": "^4.8" + }, + "suggest": { + "mezzio/mezzio-laminasviewrenderer": "^2.0 to use the laminas-view PhpRenderer template renderer", + "mezzio/mezzio-platesrenderer": "^2.0 to use the Plates template renderer", + "mezzio/mezzio-twigrenderer": "^2.0 to use the Twig template renderer" + }, + "type": "library", + "autoload": { + "psr-4": { + "Mezzio\\Template\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Template subcomponent for Mezzio", + "homepage": "https://mezzio.dev", + "keywords": [ + "laminas", + "mezzio", + "template" + ], + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.mezzio.dev/mezzio/features/template/intro/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/mezzio/mezzio-template/issues", + "rss": "https://github.com/mezzio/mezzio-template/releases.atom", + "source": "https://github.com/mezzio/mezzio-template" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2021-12-03T09:40:16+00:00" + }, { "name": "mtdowling/jmespath.php", "version": "2.6.1", @@ -6142,16 +6532,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.16", + "version": "9.2.17", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2593003befdcc10db5e213f9f28814f5aa8ac073" + "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2593003befdcc10db5e213f9f28814f5aa8ac073", - "reference": "2593003befdcc10db5e213f9f28814f5aa8ac073", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/aa94dc41e8661fe90c7316849907cba3007b10d8", + "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8", "shasum": "" }, "require": { @@ -6207,7 +6597,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.16" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.17" }, "funding": [ { @@ -6215,7 +6605,7 @@ "type": "github" } ], - "time": "2022-08-20T05:26:47+00:00" + "time": "2022-08-30T12:24:04+00:00" }, { "name": "phpunit/php-file-iterator", @@ -6460,16 +6850,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.23", + "version": "9.5.24", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "888556852e7e9bbeeedb9656afe46118765ade34" + "reference": "d0aa6097bef9fd42458a9b3c49da32c6ce6129c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/888556852e7e9bbeeedb9656afe46118765ade34", - "reference": "888556852e7e9bbeeedb9656afe46118765ade34", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d0aa6097bef9fd42458a9b3c49da32c6ce6129c5", + "reference": "d0aa6097bef9fd42458a9b3c49da32c6ce6129c5", "shasum": "" }, "require": { @@ -6498,7 +6888,7 @@ "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.0", + "sebastian/type": "^3.1", "sebastian/version": "^3.0.2" }, "suggest": { @@ -6542,7 +6932,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.23" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.24" }, "funding": [ { @@ -6554,7 +6944,7 @@ "type": "github" } ], - "time": "2022-08-22T14:01:36+00:00" + "time": "2022-08-30T07:42:16+00:00" }, { "name": "psr/event-dispatcher", @@ -7794,16 +8184,16 @@ }, { "name": "sebastian/type", - "version": "3.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad" + "reference": "fb44e1cc6e557418387ad815780360057e40753e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb44e1cc6e557418387ad815780360057e40753e", + "reference": "fb44e1cc6e557418387ad815780360057e40753e", "shasum": "" }, "require": { @@ -7815,7 +8205,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -7838,7 +8228,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.0.0" + "source": "https://github.com/sebastianbergmann/type/tree/3.1.0" }, "funding": [ { @@ -7846,7 +8236,7 @@ "type": "github" } ], - "time": "2022-03-15T09:54:48+00:00" + "time": "2022-08-29T06:55:37+00:00" }, { "name": "sebastian/version", diff --git a/packages/api/src/ConfigProvider.php b/packages/api/src/ConfigProvider.php index 8efa463..912804a 100644 --- a/packages/api/src/ConfigProvider.php +++ b/packages/api/src/ConfigProvider.php @@ -4,7 +4,9 @@ namespace AftDev\Api; +use AftDev\Api\Route\FastRouterParamTranslator; use AftDev\Api\Route\HandlerMapper; +use AftDev\Api\Route\ParamTranslatorInterface; use cebe\openapi\spec\OpenApi; use Laminas\ServiceManager\Factory\InvokableFactory; @@ -27,6 +29,10 @@ public function getDependencies() OpenApi::class => Factory\CurrentOpenApiVersionFactory::class, OpenApiManager::class => Factory\OpenApiManagerFactory::class, HandlerMapper::class => InvokableFactory::class, + FastRouterParamTranslator::class => InvokableFactory::class, + ], + 'aliases' => [ + ParamTranslatorInterface::class => FastRouterParamTranslator::class, ], ]; } diff --git a/packages/api/src/Factory/OpenApiManagerFactory.php b/packages/api/src/Factory/OpenApiManagerFactory.php index f0af03f..68daa3a 100644 --- a/packages/api/src/Factory/OpenApiManagerFactory.php +++ b/packages/api/src/Factory/OpenApiManagerFactory.php @@ -41,6 +41,6 @@ private function getApiVersionFromHeader(ContainerInterface $container): ?string return null; } - return current($request->getHeader(OpenApiManager::VERSION_HEADER_NAME, null)); + return $request->getHeader(OpenApiManager::VERSION_HEADER_NAME, null)[0] ?? null; } } diff --git a/packages/api/src/OpenApiManager.php b/packages/api/src/OpenApiManager.php index 4cc1645..c130a3a 100644 --- a/packages/api/src/OpenApiManager.php +++ b/packages/api/src/OpenApiManager.php @@ -102,7 +102,7 @@ private function getBase(): OpenApi { $info = new SplFileInfo($this->specFile); if (!$info->isFile()) { - throw new \ValueError('File does not exists'); + throw new \ValueError('Could not find the openapi spec file'); } switch ($info->getExtension()) { diff --git a/packages/api/src/Route/FastRouterParamTranslator.php b/packages/api/src/Route/FastRouterParamTranslator.php new file mode 100644 index 0000000..fff67c2 --- /dev/null +++ b/packages/api/src/Route/FastRouterParamTranslator.php @@ -0,0 +1,33 @@ + '', + 'integer' => '\d+', + 'number' => '', + 'boolean' => 'true|false', + ]; + + public function translate(string $value, bool $required, string $type, ?string $format = null): string + { + $name = trim($value, '/{}'); + + $reg = $this->mapping[$type] + // ?? $this->mapping[$type+'-'+$format] + ?? false; + if ($reg) { + $name .= ':'.$reg; + } + + if (!$required) { + return sprintf('[/{%s}]', $name); + } + + return sprintf('/{%s}', $name) ?: $value; + } +} diff --git a/packages/api/src/Route/MezzionRouterAdapter.php b/packages/api/src/Route/MezzionRouterAdapter.php deleted file mode 100644 index f47bc27..0000000 --- a/packages/api/src/Route/MezzionRouterAdapter.php +++ /dev/null @@ -1,7 +0,0 @@ - $this->prefixUri($uri), - ]; - + $prefixedUri = $this->prefixUri($uri); $pathParams = $this->getPathParameters($path->parameters); foreach ($path->getOperations() as $method => $operation) { - yield $pathCommonParams + [ + $params = [ + 'uri' => $this->swapParameters( + $prefixedUri, + array_merge( + $pathParams, + $this->getPathParameters($operation->parameters) + ), + ), 'method' => $method, 'name' => $operation->operationId ?? 'api.'.Str::camel("{$method}{$uri}"), - 'params' => $pathParams + $this->getPathParameters($operation->parameters), 'handler' => $this->getHandlerNameForOperation($uri, $method), ]; + + yield new Route(...$params); } } - private function getPathParameters(array $parameters) + private function swapParameters(string $uri, array $parameters) + { + if (!$this->paramTranslator) { + return $uri; + } + + // replacement list. + $translations = []; + foreach ($parameters as $param => $options) { + $translations["/{{$param}}"] = + $this->paramTranslator->translate( + "/{{$param}}", + ...$options, + ); + } + + return Str::swap($translations, $uri); + } + + private function getPathParameters(array $parameters): array { $pathParams = array_filter($parameters, fn ($param) => 'path' == $param->in); $paramInfo = []; foreach ($pathParams as $param) { $paramInfo[$param->name] = [ 'required' => $param->required, - 'schema' => [ - 'type' => $param->schema->type, - 'format' => $param->schema->format, - ], + 'type' => $param->schema->type, + 'format' => $param->schema->format, ]; } diff --git a/packages/api/src/Route/ParamTranslatorInterface.php b/packages/api/src/Route/ParamTranslatorInterface.php new file mode 100644 index 0000000..19b1f4b --- /dev/null +++ b/packages/api/src/Route/ParamTranslatorInterface.php @@ -0,0 +1,10 @@ +expectException(\ValueError::class); - $this->expectExceptionMessage('File does not exists'); + $this->expectExceptionMessage('Could not find the openapi spec file'); $openApiManager = new OpenApiManager('invalid.file'); diff --git a/packages/api/tests/Route/FastRouterParamTranslatorTest.php b/packages/api/tests/Route/FastRouterParamTranslatorTest.php new file mode 100644 index 0000000..7dd72e6 --- /dev/null +++ b/packages/api/tests/Route/FastRouterParamTranslatorTest.php @@ -0,0 +1,73 @@ +translate('/{id}', ...$options); + $this->assertEquals($expected, $transformed); + } + + public function dataProvider() + { + return [ + 'string' => [ + 'options' => [ + 'required' => true, + 'type' => 'string', + 'format' => '', + ], + 'expected' => '/{id}', + ], + 'string-optional' => [ + 'options' => [ + 'required' => false, + 'type' => 'string', + 'format' => '', + ], + 'expected' => '[/{id}]', + ], + 'integer' => [ + 'options' => [ + 'required' => true, + 'type' => 'integer', + 'format' => '', + ], + 'expected' => '/{id:\d+}', + ], + 'number' => [ + 'options' => [ + 'required' => true, + 'type' => 'number', + 'format' => '', + ], + 'expected' => '/{id}', + ], + 'boolean' => [ + 'options' => [ + 'required' => true, + 'type' => 'boolean', + 'format' => '', + ], + 'expected' => '/{id:true|false}', + ], + ]; + } +} diff --git a/packages/api/tests/Route/OpenApiRouteGeneratorTest.php b/packages/api/tests/Route/OpenApiRouteGeneratorTest.php index 8a831c6..899028c 100644 --- a/packages/api/tests/Route/OpenApiRouteGeneratorTest.php +++ b/packages/api/tests/Route/OpenApiRouteGeneratorTest.php @@ -1,16 +1,22 @@ uri][$i->method] = $i->handler; } $expected = [ @@ -57,48 +63,42 @@ public function testGenerator() '/api/companies/{companyId}/employees/{employeeId}/salary/{category}' => [ 'get' => 'App\Controller\Salaries@showByCompanyEmployeeAndCategory', ], - '/api/test/param/{intParam}/{stringParam}/{optionalParam}' => [ - 'get' => 'App\Controller\Params@showByTestAndIntParamStringParamOptionalParam', + '/api/test/param/{intParam}/{stringParam}/{dateParam}/{optionalParam}' => [ + 'get' => 'App\Controller\Params@showByTestAndIntParamStringParamDateParamOptionalParam', ], ]; $this->assertEquals($expected, $found); + } - // Test Parameters - $testParams = $collection - ->where('uri', '/api/test/param/{intParam}/{stringParam}/{optionalParam}') - ->firstWhere('method', 'get') - ; - $this->assertEquals([ - 'intParam' => [ - 'required' => true, - 'schema' => [ - 'type' => 'integer', - 'format' => 'int32', - ], - ], - 'numberParam' => [ - 'required' => true, - 'schema' => [ - 'type' => 'number', - 'format' => 'double', - ], - ], - 'dateParam' => [ - 'required' => true, - 'schema' => [ - 'type' => 'string', - 'format' => 'date', - ], - ], - 'optionalParam' => [ - 'required' => false, - 'schema' => [ - 'type' => 'string', - 'format' => null, - ], - ], - ], $testParams['params']); + public function testRouteParamTranslation() + { + $paramTranslator = $this->prophesize(ParamTranslatorInterface::class); + $paramTranslator->translate(Argument::cetera())->willReturn('/{:translated}'); + + $generator = new OpenApiRouteGenerator( + paramTranslator: $paramTranslator->reveal(), + ); + + $collection = $generator->generateRoutes($this->getOpenApi()); + $found = []; + foreach ($collection as $i) { + if (!in_array($i->uri, $found)) { + $found[] = $i->uri; + } + } + + $expected = [ + '/api/companies', + '/api/companies/{:translated}', + '/api/companies/{:translated}/employees', + '/api/companies/{:translated}/employees/{:translated}', + '/api/companies/{:translated}/employees/{:translated}/salary', + '/api/companies/{:translated}/employees/{:translated}/salary/{:translated}', + '/api/test/param/{:translated}/{:translated}/{:translated}/{:translated}', + ]; + + $this->assertEquals($expected, $found); } protected function getOpenApi(): OpenApi diff --git a/packages/api/tests/specs/routes.yaml b/packages/api/tests/specs/routes.yaml index 3763054..7f06867 100644 --- a/packages/api/tests/specs/routes.yaml +++ b/packages/api/tests/specs/routes.yaml @@ -62,6 +62,7 @@ paths: /companies/{companyId}/employees/{employeeId}: parameters: - $ref: '#/components/parameters/company' + - $ref: '#/components/parameters/employee' get: summary: Get one company employee by id description: should rarely exist @@ -69,6 +70,7 @@ paths: /companies/{companyId}/employees/{employeeId}/salary: parameters: - $ref: '#/components/parameters/company' + - $ref: '#/components/parameters/employee' get: summary: Get salary of a company employee description: This is getting ridiculous @@ -76,13 +78,20 @@ paths: /companies/{companyId}/employees/{employeeId}/salary/{category}: parameters: - $ref: '#/components/parameters/company' + - $ref: '#/components/parameters/employee' + - name: category + in: path + required: true + schema: + type: string get: summary: Get salary of a company employee by category description: This is just silly now operationId: getSalaryByCompanyEmployeeAndCategory - /test/param/{intParam}/{stringParam}/{optionalParam}: + /test/param/{intParam}/{stringParam}/{dateParam}/{optionalParam}: parameters: - $ref: '#/components/parameters/intParam' + - $ref: '#/components/parameters/stringParam' - $ref: '#/components/parameters/numberParam' - $ref: '#/components/parameters/dateParam' - $ref: '#/components/parameters/optionalParam' @@ -96,6 +105,18 @@ components: required: true schema: type: string + employee: + name: employeeId + in: path + required: true + schema: + type: string + stringParam: + name: stringParam + in: path + required: true + schema: + type: string intParam: name: intParam in: path diff --git a/tests/Feature/Api/ParamTranslatorInterfaceTest.php b/tests/Feature/Api/ParamTranslatorInterfaceTest.php new file mode 100644 index 0000000..72b5581 --- /dev/null +++ b/tests/Feature/Api/ParamTranslatorInterfaceTest.php @@ -0,0 +1,28 @@ +container->get(ParamTranslatorInterface::class); + + $this->assertInstanceOf(ParamTranslatorInterface::class, $translator); + $this->assertInstanceOf(FastRouterParamTranslator::class, $translator); + } +} From 95b85111c4f1cdefb9f6bbd59dd17fc6c857b525 Mon Sep 17 00:00:00 2001 From: Christophe G <1050197+cgaube@users.noreply.github.com> Date: Sat, 3 Sep 2022 22:48:11 -0700 Subject: [PATCH 08/20] feat(api): request validator middleware --- packages/api/src/ConfigProvider.php | 1 + .../RequestValidationMiddlewareFactory.php | 24 +++++++++++++++++++ packages/api/src/OpenApiManager.php | 2 ++ .../Factory/OpenApiManagerFactoryTest.php | 1 + tests/Feature/Api/OpenApiManagerTest.php | 2 ++ .../Feature/Api/OpenApiRouteGeneratorTest.php | 1 + .../Api/RequestValidationMiddlewareTest.php | 23 ++++++++++++++++++ 7 files changed, 54 insertions(+) create mode 100644 packages/api/src/Factory/RequestValidationMiddlewareFactory.php create mode 100644 tests/Feature/Api/RequestValidationMiddlewareTest.php diff --git a/packages/api/src/ConfigProvider.php b/packages/api/src/ConfigProvider.php index 912804a..016ff00 100644 --- a/packages/api/src/ConfigProvider.php +++ b/packages/api/src/ConfigProvider.php @@ -30,6 +30,7 @@ public function getDependencies() OpenApiManager::class => Factory\OpenApiManagerFactory::class, HandlerMapper::class => InvokableFactory::class, FastRouterParamTranslator::class => InvokableFactory::class, + \League\OpenAPIValidation\PSR15\ValidationMiddleware::class => Factory\RequestValidationMiddlewareFactory::class, ], 'aliases' => [ ParamTranslatorInterface::class => FastRouterParamTranslator::class, diff --git a/packages/api/src/Factory/RequestValidationMiddlewareFactory.php b/packages/api/src/Factory/RequestValidationMiddlewareFactory.php new file mode 100644 index 0000000..5a8d045 --- /dev/null +++ b/packages/api/src/Factory/RequestValidationMiddlewareFactory.php @@ -0,0 +1,24 @@ +get(OpenApiManager::class); + + $currentVersion = $apiManager->getCurrentVersion(); + + return (new ValidationMiddlewareBuilder()) + ->fromSchema($currentVersion) + ->getValidationMiddleware() + ; + } +} diff --git a/packages/api/src/OpenApiManager.php b/packages/api/src/OpenApiManager.php index c130a3a..86f98c6 100644 --- a/packages/api/src/OpenApiManager.php +++ b/packages/api/src/OpenApiManager.php @@ -8,6 +8,7 @@ use AftDev\ServiceManager\Resolver; use cebe\openapi\Reader; use cebe\openapi\spec\OpenApi; +use Psr\Cache\CacheItemPoolInterface; use SplFileInfo; class OpenApiManager @@ -25,6 +26,7 @@ public function __construct( array $versions = [], ?string $currentVersion = null, private ?Resolver $resolver = null, + private ?CacheItemPoolInterface $cache = null, ) { $this->setVersions($versions); $this->setCurrentVersion($currentVersion ?? self::BASE_VERSION); diff --git a/packages/api/tests/Factory/OpenApiManagerFactoryTest.php b/packages/api/tests/Factory/OpenApiManagerFactoryTest.php index e68e2ee..a124573 100644 --- a/packages/api/tests/Factory/OpenApiManagerFactoryTest.php +++ b/packages/api/tests/Factory/OpenApiManagerFactoryTest.php @@ -14,6 +14,7 @@ /** * @internal + * * @covers \AftDev\Api\Factory\OpenApiManagerFactory */ final class OpenApiManagerFactoryTest extends TestCase diff --git a/tests/Feature/Api/OpenApiManagerTest.php b/tests/Feature/Api/OpenApiManagerTest.php index 8843134..0d0b262 100644 --- a/tests/Feature/Api/OpenApiManagerTest.php +++ b/tests/Feature/Api/OpenApiManagerTest.php @@ -9,7 +9,9 @@ /** * @internal + * * @coversDefaultClass \AftDev\Api\OpenApiManager + * * @covers \AftDev\Api\ConfigProvider * @covers \AftDev\Api\OpenApiManager */ diff --git a/tests/Feature/Api/OpenApiRouteGeneratorTest.php b/tests/Feature/Api/OpenApiRouteGeneratorTest.php index 65f8d07..d5a3585 100644 --- a/tests/Feature/Api/OpenApiRouteGeneratorTest.php +++ b/tests/Feature/Api/OpenApiRouteGeneratorTest.php @@ -12,6 +12,7 @@ /** * @internal + * * @covers \AftDev\Api\Route\OpenApiRouteGenerator */ final class OpenApiRouteGeneratorTest extends FeatureTestCase diff --git a/tests/Feature/Api/RequestValidationMiddlewareTest.php b/tests/Feature/Api/RequestValidationMiddlewareTest.php new file mode 100644 index 0000000..1d26272 --- /dev/null +++ b/tests/Feature/Api/RequestValidationMiddlewareTest.php @@ -0,0 +1,23 @@ +container->get(ValidationMiddleware::class); + + $this->assertInstanceOf(ValidationMiddleware::class, $middleware); + } +} From 0991befb7a901e833ad85f59b7bc11fc9d3f8e97 Mon Sep 17 00:00:00 2001 From: Christophe G <1050197+cgaube@users.noreply.github.com> Date: Sat, 3 Sep 2022 22:48:20 -0700 Subject: [PATCH 09/20] chore(all): apply php linter new rules --- packages/cache/tests/CacheManagerTest.php | 1 + packages/cache/tests/ConfigProviderTest.php | 1 + packages/cache/tests/Factory/ChainAdapterFactoryTest.php | 1 + packages/cache/tests/Factory/DefaultCacheFactoryTest.php | 1 + .../cache/tests/Factory/MemcachedAdapterFactoryTest.php | 1 + packages/cache/tests/Factory/RedisAdapterFactoryTest.php | 1 + .../cache/tests/Factory/TagAwareAdapterFactoryTest.php | 1 + packages/console/tests/ApplicationTest.php | 1 + packages/console/tests/ConfigProviderTest.php | 1 + packages/console/tests/Factory/ApplicationFactoryTest.php | 1 + .../console/tests/Factory/CommandManagerFactoryTest.php | 1 + .../tests/Capsule/CapsuleManagerFactoryTest.php | 1 + packages/db-eloquent/tests/Capsule/CapsuleManagerTest.php | 1 + packages/db/tests/ConfigProviderTest.php | 1 + packages/db/tests/ConnectionManagerTest.php | 1 + packages/db/tests/ConnectionTest.php | 1 + .../db/tests/Factory/ConnectionAbstractFactoryTest.php | 1 + .../db/tests/Factory/ConnectionManagerFactoryTest.php | 1 + .../db/tests/Migration/PhinxApplicationFactoryTest.php | 1 + packages/db/tests/Migration/PhinxApplicationTest.php | 1 + packages/db/tests/Migration/PhinxConfigFactoryTest.php | 1 + packages/filesystem/tests/ConfigProviderTest.php | 1 + packages/filesystem/tests/DiskManagerTest.php | 1 + .../filesystem/tests/Factory/DiskAbstractFactoryTest.php | 1 + .../filesystem/tests/Factory/DiskManagerFactoryTest.php | 1 + .../filesystem/tests/Factory/FileManagerFactoryTest.php | 1 + .../filesystem/tests/Factory/S3AdapterFactoryTest.php | 1 + packages/log/tests/ConfigProviderTest.php | 1 + packages/log/tests/Factory/ChannelAbstractFactoryTest.php | 1 + packages/log/tests/Factory/DefaultLoggerFactoryTest.php | 1 + packages/log/tests/LogManagerTest.php | 1 + packages/log/tests/StackFactoryTest.php | 1 + packages/service-manager/src/AbstractManager.php | 8 ++++---- .../tests/Factory/AbstractManagerFactoryTest.php | 1 + .../tests/Factory/ResolverAbstractFactoryTest.php | 1 + packages/service-manager/tests/ManagerTest.php | 1 + .../tests/Middleware/ResolveMiddlewareFactoryTest.php | 1 + .../tests/Middleware/ResolveMiddlewareTest.php | 1 + .../service-manager/tests/Resolver/RuleBuilderTest.php | 1 + packages/service-manager/tests/ResolverTest.php | 1 + tests/Feature/Cache/CacheAdapterTest.php | 1 + tests/Feature/Console/ConsoleTest.php | 1 + tests/Feature/DbEloquent/DbBuilderTest.php | 1 + tests/Feature/DbEloquent/DbEloquentTest.php | 1 + tests/Feature/DbEloquent/DefaultConnectionTest.php | 1 + tests/Feature/DbEloquent/MessengerSerializationTest.php | 1 + tests/Feature/Messenger/MessengerTest.php | 1 + tests/Feature/Messenger/Queues/TransportsTest.php | 1 + tests/Feature/ServiceManager/ResolveMiddlewareTest.php | 1 + tests/Feature/ServiceManager/ResolverTest.php | 1 + tests/FeatureTestCase.php | 1 + tests/TestCase.php | 1 + 52 files changed, 55 insertions(+), 4 deletions(-) diff --git a/packages/cache/tests/CacheManagerTest.php b/packages/cache/tests/CacheManagerTest.php index 4b0f1c6..bd1a60c 100755 --- a/packages/cache/tests/CacheManagerTest.php +++ b/packages/cache/tests/CacheManagerTest.php @@ -12,6 +12,7 @@ /** * @internal + * * @covers \AftDev\Cache\CacheManager */ class CacheManagerTest extends TestCase diff --git a/packages/cache/tests/ConfigProviderTest.php b/packages/cache/tests/ConfigProviderTest.php index bc71929..57cb7ac 100755 --- a/packages/cache/tests/ConfigProviderTest.php +++ b/packages/cache/tests/ConfigProviderTest.php @@ -7,6 +7,7 @@ /** * @internal + * * @covers \AftDev\Cache\ConfigProvider */ class ConfigProviderTest extends TestCase diff --git a/packages/cache/tests/Factory/ChainAdapterFactoryTest.php b/packages/cache/tests/Factory/ChainAdapterFactoryTest.php index c173770..84e9f91 100755 --- a/packages/cache/tests/Factory/ChainAdapterFactoryTest.php +++ b/packages/cache/tests/Factory/ChainAdapterFactoryTest.php @@ -12,6 +12,7 @@ /** * @internal + * * @covers \AftDev\Cache\Factory\ChainAdapterFactory */ class ChainAdapterFactoryTest extends TestCase diff --git a/packages/cache/tests/Factory/DefaultCacheFactoryTest.php b/packages/cache/tests/Factory/DefaultCacheFactoryTest.php index c1e299a..7de6572 100755 --- a/packages/cache/tests/Factory/DefaultCacheFactoryTest.php +++ b/packages/cache/tests/Factory/DefaultCacheFactoryTest.php @@ -10,6 +10,7 @@ /** * @internal + * * @coversNothing */ class DefaultCacheFactoryTest extends TestCase diff --git a/packages/cache/tests/Factory/MemcachedAdapterFactoryTest.php b/packages/cache/tests/Factory/MemcachedAdapterFactoryTest.php index f0b5ccf..44ca9aa 100755 --- a/packages/cache/tests/Factory/MemcachedAdapterFactoryTest.php +++ b/packages/cache/tests/Factory/MemcachedAdapterFactoryTest.php @@ -7,6 +7,7 @@ /** * @internal + * * @covers \AftDev\Cache\Factory\MemcachedAdapterFactory */ class MemcachedAdapterFactoryTest extends TestCase diff --git a/packages/cache/tests/Factory/RedisAdapterFactoryTest.php b/packages/cache/tests/Factory/RedisAdapterFactoryTest.php index 1952189..dda606f 100755 --- a/packages/cache/tests/Factory/RedisAdapterFactoryTest.php +++ b/packages/cache/tests/Factory/RedisAdapterFactoryTest.php @@ -7,6 +7,7 @@ /** * @internal + * * @covers \AftDev\Cache\Factory\RedisAdapterFactory */ class RedisAdapterFactoryTest extends TestCase diff --git a/packages/cache/tests/Factory/TagAwareAdapterFactoryTest.php b/packages/cache/tests/Factory/TagAwareAdapterFactoryTest.php index f4b50b3..820431f 100755 --- a/packages/cache/tests/Factory/TagAwareAdapterFactoryTest.php +++ b/packages/cache/tests/Factory/TagAwareAdapterFactoryTest.php @@ -11,6 +11,7 @@ /** * @internal + * * @covers \AftDev\Cache\Factory\TagAwareAdapterFactory */ class TagAwareAdapterFactoryTest extends TestCase diff --git a/packages/console/tests/ApplicationTest.php b/packages/console/tests/ApplicationTest.php index e22c30b..5058563 100755 --- a/packages/console/tests/ApplicationTest.php +++ b/packages/console/tests/ApplicationTest.php @@ -9,6 +9,7 @@ * Class ApplicationTest. * * @internal + * * @covers \AftDev\Console\Application */ class ApplicationTest extends TestCase diff --git a/packages/console/tests/ConfigProviderTest.php b/packages/console/tests/ConfigProviderTest.php index 5962ad1..53ccb73 100755 --- a/packages/console/tests/ConfigProviderTest.php +++ b/packages/console/tests/ConfigProviderTest.php @@ -9,6 +9,7 @@ * Class ConfigProviderTest. * * @internal + * * @covers \AftDev\Console\ConfigProvider */ class ConfigProviderTest extends TestCase diff --git a/packages/console/tests/Factory/ApplicationFactoryTest.php b/packages/console/tests/Factory/ApplicationFactoryTest.php index 9837a9d..09bb69a 100755 --- a/packages/console/tests/Factory/ApplicationFactoryTest.php +++ b/packages/console/tests/Factory/ApplicationFactoryTest.php @@ -14,6 +14,7 @@ * Class CommandManagerFactoryTest. * * @internal + * * @covers \AftDev\Console\Factory\ApplicationFactory */ class ApplicationFactoryTest extends TestCase diff --git a/packages/console/tests/Factory/CommandManagerFactoryTest.php b/packages/console/tests/Factory/CommandManagerFactoryTest.php index efb8113..d457b76 100755 --- a/packages/console/tests/Factory/CommandManagerFactoryTest.php +++ b/packages/console/tests/Factory/CommandManagerFactoryTest.php @@ -12,6 +12,7 @@ * Class CommandManagerFactoryTest. * * @internal + * * @covers \AftDev\Console\Factory\CommandManagerFactory */ class CommandManagerFactoryTest extends TestCase diff --git a/packages/db-eloquent/tests/Capsule/CapsuleManagerFactoryTest.php b/packages/db-eloquent/tests/Capsule/CapsuleManagerFactoryTest.php index c19cb25..6628cba 100755 --- a/packages/db-eloquent/tests/Capsule/CapsuleManagerFactoryTest.php +++ b/packages/db-eloquent/tests/Capsule/CapsuleManagerFactoryTest.php @@ -11,6 +11,7 @@ /** * @internal + * * @covers \AftDev\DbEloquent\Capsule\CapsuleManagerFactory */ class CapsuleManagerFactoryTest extends TestCase diff --git a/packages/db-eloquent/tests/Capsule/CapsuleManagerTest.php b/packages/db-eloquent/tests/Capsule/CapsuleManagerTest.php index 568fa5a..59f4346 100755 --- a/packages/db-eloquent/tests/Capsule/CapsuleManagerTest.php +++ b/packages/db-eloquent/tests/Capsule/CapsuleManagerTest.php @@ -9,6 +9,7 @@ /** * @internal + * * @covers \AftDev\DbEloquent\Capsule\CapsuleManager */ class CapsuleManagerTest extends TestCase diff --git a/packages/db/tests/ConfigProviderTest.php b/packages/db/tests/ConfigProviderTest.php index acad8e9..f6949fc 100755 --- a/packages/db/tests/ConfigProviderTest.php +++ b/packages/db/tests/ConfigProviderTest.php @@ -7,6 +7,7 @@ /** * @internal + * * @covers \AftDev\Db\ConfigProvider */ class ConfigProviderTest extends TestCase diff --git a/packages/db/tests/ConnectionManagerTest.php b/packages/db/tests/ConnectionManagerTest.php index c34f953..e861d7f 100755 --- a/packages/db/tests/ConnectionManagerTest.php +++ b/packages/db/tests/ConnectionManagerTest.php @@ -8,6 +8,7 @@ /** * @internal + * * @covers \AftDev\Db\ConnectionManager */ class ConnectionManagerTest extends TestCase diff --git a/packages/db/tests/ConnectionTest.php b/packages/db/tests/ConnectionTest.php index 53214ac..0c9539f 100755 --- a/packages/db/tests/ConnectionTest.php +++ b/packages/db/tests/ConnectionTest.php @@ -7,6 +7,7 @@ /** * @internal + * * @covers \AftDev\Db\Connection */ class ConnectionTest extends TestCase diff --git a/packages/db/tests/Factory/ConnectionAbstractFactoryTest.php b/packages/db/tests/Factory/ConnectionAbstractFactoryTest.php index 00acc90..13ca119 100755 --- a/packages/db/tests/Factory/ConnectionAbstractFactoryTest.php +++ b/packages/db/tests/Factory/ConnectionAbstractFactoryTest.php @@ -9,6 +9,7 @@ /** * @internal + * * @covers \AftDev\Db\Factory\ConnectionAbstractFactory */ class ConnectionAbstractFactoryTest extends TestCase diff --git a/packages/db/tests/Factory/ConnectionManagerFactoryTest.php b/packages/db/tests/Factory/ConnectionManagerFactoryTest.php index 6b741ea..c5dba6c 100755 --- a/packages/db/tests/Factory/ConnectionManagerFactoryTest.php +++ b/packages/db/tests/Factory/ConnectionManagerFactoryTest.php @@ -9,6 +9,7 @@ /** * @internal + * * @covers \AftDev\Db\Factory\ConnectionManagerFactory */ class ConnectionManagerFactoryTest extends TestCase diff --git a/packages/db/tests/Migration/PhinxApplicationFactoryTest.php b/packages/db/tests/Migration/PhinxApplicationFactoryTest.php index d6da728..8e97645 100755 --- a/packages/db/tests/Migration/PhinxApplicationFactoryTest.php +++ b/packages/db/tests/Migration/PhinxApplicationFactoryTest.php @@ -11,6 +11,7 @@ /** * @internal + * * @covers \AftDev\Db\Migration\PhinxApplicationFactory */ class PhinxApplicationFactoryTest extends TestCase diff --git a/packages/db/tests/Migration/PhinxApplicationTest.php b/packages/db/tests/Migration/PhinxApplicationTest.php index 60e63d5..4a11e58 100755 --- a/packages/db/tests/Migration/PhinxApplicationTest.php +++ b/packages/db/tests/Migration/PhinxApplicationTest.php @@ -8,6 +8,7 @@ /** * @internal + * * @covers \AftDev\Db\Migration\PhinxApplication */ class PhinxApplicationTest extends TestCase diff --git a/packages/db/tests/Migration/PhinxConfigFactoryTest.php b/packages/db/tests/Migration/PhinxConfigFactoryTest.php index 47abe57..dea8d5a 100755 --- a/packages/db/tests/Migration/PhinxConfigFactoryTest.php +++ b/packages/db/tests/Migration/PhinxConfigFactoryTest.php @@ -11,6 +11,7 @@ /** * @internal + * * @covers \AftDev\Db\Migration\PhinxConfigFactory */ class PhinxConfigFactoryTest extends TestCase diff --git a/packages/filesystem/tests/ConfigProviderTest.php b/packages/filesystem/tests/ConfigProviderTest.php index 216368d..a441857 100755 --- a/packages/filesystem/tests/ConfigProviderTest.php +++ b/packages/filesystem/tests/ConfigProviderTest.php @@ -7,6 +7,7 @@ /** * @internal + * * @covers \AftDev\Filesystem\ConfigProvider */ class ConfigProviderTest extends TestCase diff --git a/packages/filesystem/tests/DiskManagerTest.php b/packages/filesystem/tests/DiskManagerTest.php index 69631dd..1473b78 100755 --- a/packages/filesystem/tests/DiskManagerTest.php +++ b/packages/filesystem/tests/DiskManagerTest.php @@ -13,6 +13,7 @@ /** * @internal + * * @covers \AftDev\Filesystem\DiskManager * @covers \AftDev\Filesystem\Factory\DiskAbstractFactory */ diff --git a/packages/filesystem/tests/Factory/DiskAbstractFactoryTest.php b/packages/filesystem/tests/Factory/DiskAbstractFactoryTest.php index 9cab500..6d2637a 100755 --- a/packages/filesystem/tests/Factory/DiskAbstractFactoryTest.php +++ b/packages/filesystem/tests/Factory/DiskAbstractFactoryTest.php @@ -13,6 +13,7 @@ /** * @internal + * * @covers \AftDev\Filesystem\Factory\DiskAbstractFactory * @covers \AftDev\Filesystem\Factory\GetConfigTrait */ diff --git a/packages/filesystem/tests/Factory/DiskManagerFactoryTest.php b/packages/filesystem/tests/Factory/DiskManagerFactoryTest.php index 615be82..8d67aee 100755 --- a/packages/filesystem/tests/Factory/DiskManagerFactoryTest.php +++ b/packages/filesystem/tests/Factory/DiskManagerFactoryTest.php @@ -9,6 +9,7 @@ /** * @internal + * * @covers \AftDev\Filesystem\Factory\DiskManagerFactory */ class DiskManagerFactoryTest extends TestCase diff --git a/packages/filesystem/tests/Factory/FileManagerFactoryTest.php b/packages/filesystem/tests/Factory/FileManagerFactoryTest.php index c8c593f..37f4148 100755 --- a/packages/filesystem/tests/Factory/FileManagerFactoryTest.php +++ b/packages/filesystem/tests/Factory/FileManagerFactoryTest.php @@ -10,6 +10,7 @@ /** * @internal + * * @covers \AftDev\Filesystem\Factory\FileManagerFactory */ class FileManagerFactoryTest extends TestCase diff --git a/packages/filesystem/tests/Factory/S3AdapterFactoryTest.php b/packages/filesystem/tests/Factory/S3AdapterFactoryTest.php index 1555949..59291af 100644 --- a/packages/filesystem/tests/Factory/S3AdapterFactoryTest.php +++ b/packages/filesystem/tests/Factory/S3AdapterFactoryTest.php @@ -12,6 +12,7 @@ /** * @internal + * * @covers \AftDev\Filesystem\Factory\S3AdapterFactory */ class S3AdapterFactoryTest extends TestCase diff --git a/packages/log/tests/ConfigProviderTest.php b/packages/log/tests/ConfigProviderTest.php index 19f9ed4..ef900ba 100755 --- a/packages/log/tests/ConfigProviderTest.php +++ b/packages/log/tests/ConfigProviderTest.php @@ -7,6 +7,7 @@ /** * @internal + * * @covers \AftDev\Log\ConfigProvider */ class ConfigProviderTest extends TestCase diff --git a/packages/log/tests/Factory/ChannelAbstractFactoryTest.php b/packages/log/tests/Factory/ChannelAbstractFactoryTest.php index 2071d66..de9f9a6 100755 --- a/packages/log/tests/Factory/ChannelAbstractFactoryTest.php +++ b/packages/log/tests/Factory/ChannelAbstractFactoryTest.php @@ -18,6 +18,7 @@ /** * @internal + * * @covers \AftDev\Log\Factory\ChannelAbstractFactory */ class ChannelAbstractFactoryTest extends TestCase diff --git a/packages/log/tests/Factory/DefaultLoggerFactoryTest.php b/packages/log/tests/Factory/DefaultLoggerFactoryTest.php index ae53de6..f4d534e 100755 --- a/packages/log/tests/Factory/DefaultLoggerFactoryTest.php +++ b/packages/log/tests/Factory/DefaultLoggerFactoryTest.php @@ -10,6 +10,7 @@ /** * @internal + * * @coversNothing */ class DefaultLoggerFactoryTest extends TestCase diff --git a/packages/log/tests/LogManagerTest.php b/packages/log/tests/LogManagerTest.php index 1308f67..f6e9b9d 100755 --- a/packages/log/tests/LogManagerTest.php +++ b/packages/log/tests/LogManagerTest.php @@ -12,6 +12,7 @@ /** * @internal + * * @covers \AftDev\Log\LoggerManager */ class LogManagerTest extends TestCase diff --git a/packages/log/tests/StackFactoryTest.php b/packages/log/tests/StackFactoryTest.php index b5fc346..3fc084d 100755 --- a/packages/log/tests/StackFactoryTest.php +++ b/packages/log/tests/StackFactoryTest.php @@ -13,6 +13,7 @@ /** * @internal + * * @covers \AftDev\Log\Factory\StackFactory */ class StackFactoryTest extends TestCase diff --git a/packages/service-manager/src/AbstractManager.php b/packages/service-manager/src/AbstractManager.php index 0676f7b..3ae3f59 100755 --- a/packages/service-manager/src/AbstractManager.php +++ b/packages/service-manager/src/AbstractManager.php @@ -117,12 +117,12 @@ public function hasPlugin(string $name): bool * * Configuration option will be fetched from the plugins options. * + * @return mixed + * * @throws ServiceManagerException\ServiceNotFoundException if the manager does not have a service definition for * the instance, and the service is not auto-invokable. * @throws ServiceManagerException\InvalidServiceException if the plugin created is invalid * for the plugin context. - * - * @return mixed */ public function getPlugin(string $name) { @@ -152,13 +152,13 @@ public function getPlugin(string $name) /** * Return default. * + * @return mixed + * * @throws ServiceManagerException\ServiceNotFoundException if the manager does not have * a service definition for the instance, and the service is not * auto-invokable. * @throws ServiceManagerException\InvalidServiceException if the plugin created is invalid for the * plugin context. - * - * @return mixed */ public function getDefault() { diff --git a/packages/service-manager/tests/Factory/AbstractManagerFactoryTest.php b/packages/service-manager/tests/Factory/AbstractManagerFactoryTest.php index 17c4a84..a04ea51 100755 --- a/packages/service-manager/tests/Factory/AbstractManagerFactoryTest.php +++ b/packages/service-manager/tests/Factory/AbstractManagerFactoryTest.php @@ -9,6 +9,7 @@ /** * @internal + * * @covers \AftDev\ServiceManager\Factory\AbstractManagerFactory */ class AbstractManagerFactoryTest extends TestCase diff --git a/packages/service-manager/tests/Factory/ResolverAbstractFactoryTest.php b/packages/service-manager/tests/Factory/ResolverAbstractFactoryTest.php index fddd79b..67da89d 100755 --- a/packages/service-manager/tests/Factory/ResolverAbstractFactoryTest.php +++ b/packages/service-manager/tests/Factory/ResolverAbstractFactoryTest.php @@ -10,6 +10,7 @@ /** * @internal + * * @covers \AftDev\ServiceManager\Factory\ResolverAbstractFactory * @covers \AftDev\ServiceManager\Resolver */ diff --git a/packages/service-manager/tests/ManagerTest.php b/packages/service-manager/tests/ManagerTest.php index c676a0d..39ac6fc 100755 --- a/packages/service-manager/tests/ManagerTest.php +++ b/packages/service-manager/tests/ManagerTest.php @@ -10,6 +10,7 @@ /** * @internal + * * @covers \AftDev\ServiceManager\AbstractManager */ class ManagerTest extends TestCase diff --git a/packages/service-manager/tests/Middleware/ResolveMiddlewareFactoryTest.php b/packages/service-manager/tests/Middleware/ResolveMiddlewareFactoryTest.php index d8e7b89..f9fa071 100755 --- a/packages/service-manager/tests/Middleware/ResolveMiddlewareFactoryTest.php +++ b/packages/service-manager/tests/Middleware/ResolveMiddlewareFactoryTest.php @@ -9,6 +9,7 @@ /** * @internal + * * @covers \AftDev\ServiceManager\Middleware\ResolveMiddlewareFactory */ final class ResolveMiddlewareFactoryTest extends TestCase diff --git a/packages/service-manager/tests/Middleware/ResolveMiddlewareTest.php b/packages/service-manager/tests/Middleware/ResolveMiddlewareTest.php index 7f0f6c3..8089cda 100755 --- a/packages/service-manager/tests/Middleware/ResolveMiddlewareTest.php +++ b/packages/service-manager/tests/Middleware/ResolveMiddlewareTest.php @@ -11,6 +11,7 @@ /** * @internal + * * @covers \AftDev\ServiceManager\Middleware\ResolveMiddleware */ final class ResolveMiddlewareTest extends TestCase diff --git a/packages/service-manager/tests/Resolver/RuleBuilderTest.php b/packages/service-manager/tests/Resolver/RuleBuilderTest.php index 541be78..d57a441 100755 --- a/packages/service-manager/tests/Resolver/RuleBuilderTest.php +++ b/packages/service-manager/tests/Resolver/RuleBuilderTest.php @@ -8,6 +8,7 @@ /** * @internal + * * @covers \AftDev\ServiceManager\Resolver\RuleBuilder */ class RuleBuilderTest extends TestCase diff --git a/packages/service-manager/tests/ResolverTest.php b/packages/service-manager/tests/ResolverTest.php index eb8e961..ff7987e 100755 --- a/packages/service-manager/tests/ResolverTest.php +++ b/packages/service-manager/tests/ResolverTest.php @@ -9,6 +9,7 @@ /** * @internal + * * @covers \AftDev\ServiceManager\Resolver */ class ResolverTest extends TestCase diff --git a/tests/Feature/Cache/CacheAdapterTest.php b/tests/Feature/Cache/CacheAdapterTest.php index c1346aa..81602aa 100755 --- a/tests/Feature/Cache/CacheAdapterTest.php +++ b/tests/Feature/Cache/CacheAdapterTest.php @@ -15,6 +15,7 @@ /** * @internal + * * @coversNothing */ class CacheAdapterTest extends FeatureTestCase diff --git a/tests/Feature/Console/ConsoleTest.php b/tests/Feature/Console/ConsoleTest.php index f072721..fd3b63e 100755 --- a/tests/Feature/Console/ConsoleTest.php +++ b/tests/Feature/Console/ConsoleTest.php @@ -10,6 +10,7 @@ /** * @internal + * * @covers \AftDev\Console\Application */ class ConsoleTest extends FeatureTestCase diff --git a/tests/Feature/DbEloquent/DbBuilderTest.php b/tests/Feature/DbEloquent/DbBuilderTest.php index 14ac38f..104cc26 100755 --- a/tests/Feature/DbEloquent/DbBuilderTest.php +++ b/tests/Feature/DbEloquent/DbBuilderTest.php @@ -7,6 +7,7 @@ /** * @internal + * * @covers \AftDev\DbEloquent\Capsule\CapsuleManager */ class DbBuilderTest extends FeatureTestCase diff --git a/tests/Feature/DbEloquent/DbEloquentTest.php b/tests/Feature/DbEloquent/DbEloquentTest.php index 926d5b8..1f3a179 100755 --- a/tests/Feature/DbEloquent/DbEloquentTest.php +++ b/tests/Feature/DbEloquent/DbEloquentTest.php @@ -8,6 +8,7 @@ /** * @internal + * * @covers \AftDev\DbEloquent\Capsule\CapsuleManager */ class DbEloquentTest extends FeatureTestCase diff --git a/tests/Feature/DbEloquent/DefaultConnectionTest.php b/tests/Feature/DbEloquent/DefaultConnectionTest.php index cc2ae58..fc427c1 100755 --- a/tests/Feature/DbEloquent/DefaultConnectionTest.php +++ b/tests/Feature/DbEloquent/DefaultConnectionTest.php @@ -8,6 +8,7 @@ /** * @internal + * * @covers \AftDev\DbEloquent\Factory\DefaultConnectionFactory */ class DefaultConnectionTest extends FeatureTestCase diff --git a/tests/Feature/DbEloquent/MessengerSerializationTest.php b/tests/Feature/DbEloquent/MessengerSerializationTest.php index 493c2e9..1d4b37f 100755 --- a/tests/Feature/DbEloquent/MessengerSerializationTest.php +++ b/tests/Feature/DbEloquent/MessengerSerializationTest.php @@ -9,6 +9,7 @@ /** * @internal + * * @covers \AftDev\DbEloquent\ConfigProvider * @covers \AftDev\DbEloquent\Serializer\ModelNormalizer */ diff --git a/tests/Feature/Messenger/MessengerTest.php b/tests/Feature/Messenger/MessengerTest.php index 1f86336..0c74c66 100755 --- a/tests/Feature/Messenger/MessengerTest.php +++ b/tests/Feature/Messenger/MessengerTest.php @@ -16,6 +16,7 @@ /** * @internal + * * @covers \AftDev\Messenger\Factory\MessageBusFactory * @covers \AftDev\Messenger\Factory\MessengerFactory * @covers \AftDev\Messenger\Handler\MessageHandler diff --git a/tests/Feature/Messenger/Queues/TransportsTest.php b/tests/Feature/Messenger/Queues/TransportsTest.php index 8cd2506..d6485a0 100755 --- a/tests/Feature/Messenger/Queues/TransportsTest.php +++ b/tests/Feature/Messenger/Queues/TransportsTest.php @@ -11,6 +11,7 @@ /** * @internal + * * @covers \AftDev\Messenger\Queue\Factory\SymfonyTransportAbstractFactory */ final class TransportsTest extends FeatureTestCase diff --git a/tests/Feature/ServiceManager/ResolveMiddlewareTest.php b/tests/Feature/ServiceManager/ResolveMiddlewareTest.php index e8d4a56..a6f59ce 100755 --- a/tests/Feature/ServiceManager/ResolveMiddlewareTest.php +++ b/tests/Feature/ServiceManager/ResolveMiddlewareTest.php @@ -7,6 +7,7 @@ /** * @internal + * * @covers \AftDev\ServiceManager\ConfigProvider * @covers \AftDev\ServiceManager\Middleware\ResolveMiddleware * @covers \AftDev\ServiceManager\Middleware\ResolveMiddlewareFactory diff --git a/tests/Feature/ServiceManager/ResolverTest.php b/tests/Feature/ServiceManager/ResolverTest.php index 1597932..185d5fc 100755 --- a/tests/Feature/ServiceManager/ResolverTest.php +++ b/tests/Feature/ServiceManager/ResolverTest.php @@ -7,6 +7,7 @@ /** * @internal + * * @covers \AftDev\ServiceManager\ConfigProvider * @covers \AftDev\ServiceManager\Resolver\ResolverFactory */ diff --git a/tests/FeatureTestCase.php b/tests/FeatureTestCase.php index d05f8c6..ac6b24b 100755 --- a/tests/FeatureTestCase.php +++ b/tests/FeatureTestCase.php @@ -10,6 +10,7 @@ /** * @internal + * * @coversNothing */ class FeatureTestCase extends TestCase diff --git a/tests/TestCase.php b/tests/TestCase.php index 62a5559..57fa4c1 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -7,6 +7,7 @@ /** * @internal + * * @coversNothing */ class TestCase extends PhpUnitTestCase From e9abdbfab9f57a909a0fe70cfe51e1a32ba32daa Mon Sep 17 00:00:00 2001 From: Christophe G <1050197+cgaube@users.noreply.github.com> Date: Mon, 5 Sep 2022 14:10:10 -0700 Subject: [PATCH 10/20] feat(api): add caching support --- composer.json | 2 +- packages/api/composer.json | 2 +- packages/api/src/ConfigProvider.php | 2 + .../src/Factory/InteractsWithCacheTrait.php | 22 ++++++++ .../api/src/Factory/OpenApiManagerFactory.php | 5 ++ packages/api/src/OpenApiManager.php | 46 ++++++++++++++--- .../api/src/Route/OpenApiRouteGenerator.php | 16 ++++-- phpunit.xml.dist | 1 + tests/Feature/Api/OpenApiManagerTest.php | 51 ++++++++++++++++++- tests/FeatureTestCase.php | 6 ++- 10 files changed, 137 insertions(+), 16 deletions(-) create mode 100644 packages/api/src/Factory/InteractsWithCacheTrait.php diff --git a/composer.json b/composer.json index c8e8835..fa2f730 100755 --- a/composer.json +++ b/composer.json @@ -93,7 +93,7 @@ "monorepo": "monorepo-builder", "repo-merge": "monorepo-builder merge --ansi", "repo-validate": "monorepo-builder validate --ansi", - "test": "phpunit --no-coverage --order-by=random", + "test": "phpunit --no-coverage", "test:unit": "@test --testsuite UnitTests", "test:feature": "@test --testsuite Features", "coverage": "@php -dpcov.enabled=1 ./vendor/bin/phpunit", diff --git a/packages/api/composer.json b/packages/api/composer.json index c991aaf..d010ecf 100755 --- a/packages/api/composer.json +++ b/packages/api/composer.json @@ -33,7 +33,7 @@ }, "suggest": { "aftdev/service-manager": "To autoload spec invokable classes", - "aftdev/cache": "To automatically cache generated routes", + "aftdev/cache": "To automatically cache generated specs and routes", "psr/http-server-middleware": "To use the middleware", "league/openapi-psr7-validator": "To automatically validate requests" }, diff --git a/packages/api/src/ConfigProvider.php b/packages/api/src/ConfigProvider.php index 016ff00..b27b55a 100644 --- a/packages/api/src/ConfigProvider.php +++ b/packages/api/src/ConfigProvider.php @@ -46,6 +46,8 @@ public function getApiConfig() 'namespace' => 'App/Api/Controller', 'version' => null, 'versions' => [], + // Cache store to use (requires aftdev/cache-manager) + 'cache' => null, ]; } } diff --git a/packages/api/src/Factory/InteractsWithCacheTrait.php b/packages/api/src/Factory/InteractsWithCacheTrait.php new file mode 100644 index 0000000..c63380c --- /dev/null +++ b/packages/api/src/Factory/InteractsWithCacheTrait.php @@ -0,0 +1,22 @@ +has(CacheManager::class)) { + return $container->get(CacheManager::class)->store($store); + } + + return null; + } +} diff --git a/packages/api/src/Factory/OpenApiManagerFactory.php b/packages/api/src/Factory/OpenApiManagerFactory.php index 68daa3a..a6a726d 100644 --- a/packages/api/src/Factory/OpenApiManagerFactory.php +++ b/packages/api/src/Factory/OpenApiManagerFactory.php @@ -13,6 +13,8 @@ class OpenApiManagerFactory { + use InteractsWithCacheTrait; + public function __invoke(ContainerInterface $container) { $config = $container->get('config')[ConfigProvider::CONFIG_KEY]; @@ -20,11 +22,14 @@ public function __invoke(ContainerInterface $container) $version = $this->getApiVersionFromHeader($container) ?? $config['version'] ?? null; + $cache = $this->getCache($container, $config); + return new OpenApiManager( specFile: $config['spec'], currentVersion: $version, versions: $config['versions'] ?? [], resolver: $resolver, + cache: $cache ?? null, ); } diff --git a/packages/api/src/OpenApiManager.php b/packages/api/src/OpenApiManager.php index 86f98c6..b03413c 100644 --- a/packages/api/src/OpenApiManager.php +++ b/packages/api/src/OpenApiManager.php @@ -8,13 +8,15 @@ use AftDev\ServiceManager\Resolver; use cebe\openapi\Reader; use cebe\openapi\spec\OpenApi; +use Illuminate\Support\Str; +use Psr\Cache\CacheItemInterface; use Psr\Cache\CacheItemPoolInterface; use SplFileInfo; class OpenApiManager { public const VERSION_HEADER_NAME = 'X-Api-Version'; - + public const CACHE_NAME = 'api.specs.{:version}'; private const BASE_VERSION = '_base'; private array $cachedVersions = []; @@ -67,20 +69,48 @@ public function getVersion(string $version): OpenApi return $this->cachedVersions[$version]; } - $versionMutations = $this->getVersionMutations($version); + $cache = $this->getCache($version); + if ($cache && $cache->isHit()) { + $versionOpenApi = $cache->get(); + } - $versionOpenApi = $this->getBase(); + if (!isset($versionOpenApi)) { + $versionMutations = $this->getVersionMutations($version); - // Override Version - if (self::BASE_VERSION != $version) { - $versionOpenApi->info->version = $version; - } + $versionOpenApi = $this->getBase(); - $this->applyMutations($versionOpenApi, $versionMutations); + // Override Version + if (self::BASE_VERSION != $version) { + $versionOpenApi->info->version = $version; + } + + $this->applyMutations($versionOpenApi, $versionMutations); + + if ($this->cache) { + $cache->set($versionOpenApi); + $this->cache->save($cache); + } + } return $this->cachedVersions[$version] = $versionOpenApi; } + public function getCache(string $version = 'default'): ?CacheItemInterface + { + if (null === $this->cache) { + return null; + } + + return $this->cache->getItem( + Str::swap( + [ + '{:version}' => preg_replace('/[^a-zA-Z0-9\.-_]+/', '', $version), + ], + self::CACHE_NAME, + ) + ); + } + /** * Set the openapi versions. * diff --git a/packages/api/src/Route/OpenApiRouteGenerator.php b/packages/api/src/Route/OpenApiRouteGenerator.php index cbf116c..07c5b19 100644 --- a/packages/api/src/Route/OpenApiRouteGenerator.php +++ b/packages/api/src/Route/OpenApiRouteGenerator.php @@ -13,7 +13,7 @@ class OpenApiRouteGenerator { - public const CACHE_NAME = 'api.routes.%s'; + public const CACHE_NAME = 'api.routes.{:version}'; private $methodMapping = [ 'get' => 'index', // when no path params. @@ -33,10 +33,20 @@ public function __construct( public function getCache($openApi): ?CacheItemInterface { + if (null === $this->cache) { + return null; + } + $version = $openApi->info->version ?? 'default'; - $sanitized = preg_replace('/[^a-zA-Z0-9]+/', '', $version); - return $this->cache ? $this->cache->getItem(sprintf(self::CACHE_NAME, $sanitized)) : null; + return $this->cache->getItem( + Str::swap( + [ + '{:version}' => preg_replace('/[^a-zA-Z0-9]+/', '', $version), + ], + self::CACHE_NAME, + ) + ); } /** diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 2759056..27c1f2a 100755 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -4,6 +4,7 @@ xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true" + executionOrder="random" > diff --git a/tests/Feature/Api/OpenApiManagerTest.php b/tests/Feature/Api/OpenApiManagerTest.php index 0d0b262..6e81205 100644 --- a/tests/Feature/Api/OpenApiManagerTest.php +++ b/tests/Feature/Api/OpenApiManagerTest.php @@ -4,8 +4,10 @@ use AftDev\Api\ConfigProvider; use AftDev\Api\OpenApiManager; +use AftDev\Cache\CacheManager; use AftDev\Test\FeatureTestCase; use cebe\openapi\spec\OpenApi; +use Psr\Cache\CacheItemPoolInterface; /** * @internal @@ -46,7 +48,7 @@ public function testCurrentOpenApi() */ public function testCurrentVersion() { - $this->overrideConfig(join('.', [ConfigProvider::CONFIG_KEY, 'versions']), ['zz' => [], 'test-version' => [ + $this->overrideConfig([ConfigProvider::CONFIG_KEY, 'versions'], ['zz' => [], 'test-version' => [ fn (OpenApi $openApi) => $openApi->info->version = 'test-version', ]]); $this->overrideConfig(join('.', [ConfigProvider::CONFIG_KEY, 'version']), 'test-version'); @@ -60,7 +62,7 @@ public function testCurrentVersion() public function testMutationDependenciesInjection() { $apiManagerClass = false; - $this->overrideConfig(join('.', [ConfigProvider::CONFIG_KEY, 'versions']), ['2019-01-02' => [ + $this->overrideConfig([ConfigProvider::CONFIG_KEY, 'versions'], ['2019-01-02' => [ function (OpenApi $openApi, OpenApiManager $apiManager) use (&$apiManagerClass) { $apiManagerClass = get_class($apiManager); }, @@ -72,4 +74,49 @@ function (OpenApi $openApi, OpenApiManager $apiManager) use (&$apiManagerClass) $this->assertEquals(OpenApiManager::class, $apiManagerClass); } + + /** + * @covers \AftDev\Api\Factory\OpenApiManagerFactory + */ + public function testCache() + { + $this->overrideConfig([ConfigProvider::CONFIG_KEY, 'cache'], 'php'); + $this->overrideConfig([ConfigProvider::CONFIG_KEY, 'versions'], ['2019-01-02' => []]); + + $cacheManager = $this->container->get(CacheManager::class); + + /** @var CacheItemPoolInterface|\Symfony\Component\Cache\Adapter\PhpFilesAdapter $phpStore */ + $phpStore = $cacheManager->get('php'); + $phpStore->clear(); + + $openApiManager = $this->container->get(OpenApiManager::class); + $openApiManager->getCurrentVersion(); + + $this->assertTrue($phpStore->hasItem('api.specs._base')); + + return $phpStore; + } + + /** + * Make sure the cache is being reused. + * + * @depends testCache + * + * @param mixed $phpStore + */ + public function testCacheFound($phpStore) + { + $this->overrideConfig([ConfigProvider::CONFIG_KEY, 'cache'], 'php'); + $this->overrideConfig([ConfigProvider::CONFIG_KEY, 'versions'], ['2019-01-02' => []]); + + $cacheManager = $this->container->get(CacheManager::class); + $phpStore = $cacheManager->get('php'); + $this->assertTrue($phpStore->hasItem('api.specs._base')); + + $openApiManager = $this->container->get(OpenApiManager::class); + $spec = $openApiManager->getCurrentVersion(); + + $phpStore->clear(); + $this->assertInstanceOf(OpenApi::class, $spec); + } } diff --git a/tests/FeatureTestCase.php b/tests/FeatureTestCase.php index ac6b24b..f7c1207 100755 --- a/tests/FeatureTestCase.php +++ b/tests/FeatureTestCase.php @@ -100,8 +100,12 @@ protected function mockService(string $name, object $mock) return $mock; } - protected function overrideConfig($configName, $configValue) + protected function overrideConfig(string|array $configName, $configValue) { + if (is_array($configName)) { + $configName = join('.', $configName); + } + $config = $this->container->get('config'); Arr::set($config, $configName, $configValue); From 10d636b20f916aeb0911125fbe5fb8f34d3e825b Mon Sep 17 00:00:00 2001 From: Christophe G <1050197+cgaube@users.noreply.github.com> Date: Mon, 5 Sep 2022 14:49:15 -0700 Subject: [PATCH 11/20] feat(api): add factory for route generator --- packages/api/src/ConfigProvider.php | 2 ++ .../Factory/OpenApiRouteGeneratorFactory.php | 32 +++++++++++++++++++ .../Feature/Api/OpenApiRouteGeneratorTest.php | 10 ++++++ 3 files changed, 44 insertions(+) create mode 100644 packages/api/src/Factory/OpenApiRouteGeneratorFactory.php diff --git a/packages/api/src/ConfigProvider.php b/packages/api/src/ConfigProvider.php index b27b55a..d5db8ed 100644 --- a/packages/api/src/ConfigProvider.php +++ b/packages/api/src/ConfigProvider.php @@ -6,6 +6,7 @@ use AftDev\Api\Route\FastRouterParamTranslator; use AftDev\Api\Route\HandlerMapper; +use AftDev\Api\Route\OpenApiRouteGenerator; use AftDev\Api\Route\ParamTranslatorInterface; use cebe\openapi\spec\OpenApi; use Laminas\ServiceManager\Factory\InvokableFactory; @@ -28,6 +29,7 @@ public function getDependencies() 'factories' => [ OpenApi::class => Factory\CurrentOpenApiVersionFactory::class, OpenApiManager::class => Factory\OpenApiManagerFactory::class, + OpenApiRouteGenerator::class => Factory\OpenApiRouteGeneratorFactory::class, HandlerMapper::class => InvokableFactory::class, FastRouterParamTranslator::class => InvokableFactory::class, \League\OpenAPIValidation\PSR15\ValidationMiddleware::class => Factory\RequestValidationMiddlewareFactory::class, diff --git a/packages/api/src/Factory/OpenApiRouteGeneratorFactory.php b/packages/api/src/Factory/OpenApiRouteGeneratorFactory.php new file mode 100644 index 0000000..fb28fd8 --- /dev/null +++ b/packages/api/src/Factory/OpenApiRouteGeneratorFactory.php @@ -0,0 +1,32 @@ +get(ParamTranslatorInterface::class); + + $config = $container->get('config')[ConfigProvider::CONFIG_KEY]; + $prefix = $config['prefix'] ?? null; + $namespace = $config['prefix'] ?? 'App/Controller'; + $cache = $this->getCache($container, $config); + + return new OpenApiRouteGenerator( + prefix: $prefix, + namespace: $namespace, + paramTranslator: $paramTranslator, + cache: $cache, + ); + } +} diff --git a/tests/Feature/Api/OpenApiRouteGeneratorTest.php b/tests/Feature/Api/OpenApiRouteGeneratorTest.php index d5a3585..d8a3183 100644 --- a/tests/Feature/Api/OpenApiRouteGeneratorTest.php +++ b/tests/Feature/Api/OpenApiRouteGeneratorTest.php @@ -33,6 +33,16 @@ protected function tearDown(): void $this->cache->clear(); } + /** + * @covers \AftDev\Api\Factory\OpenApiRouteGeneratorFactory + */ + public function testFactory() + { + $generator = $this->container->get(OpenApiRouteGenerator::class); + + $this->assertInstanceOf(OpenApiRouteGenerator::class, $generator); + } + public function testCache() { $generator = new OpenApiRouteGenerator(cache: $this->cache); From 43b1afb466c60d32ac0bd7c6ea065eea811de721 Mon Sep 17 00:00:00 2001 From: Christophe G <1050197+cgaube@users.noreply.github.com> Date: Thu, 15 Sep 2022 21:27:36 -0700 Subject: [PATCH 12/20] chore(all): change config folder structure --- config/autoload/.gitignore | 2 -- config/autoload/api.global.php | 8 ++++++++ config/autoload/development/.gitignore | 3 +++ config/autoload/local/.gitignore | 3 +++ config/config.php | 5 ++++- docker-compose.yml | 7 ++++--- env/php/Dockerfile | 2 ++ 7 files changed, 24 insertions(+), 6 deletions(-) delete mode 100755 config/autoload/.gitignore create mode 100755 config/autoload/development/.gitignore create mode 100755 config/autoload/local/.gitignore diff --git a/config/autoload/.gitignore b/config/autoload/.gitignore deleted file mode 100755 index 1a83fda..0000000 --- a/config/autoload/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -local.php -*.local.php diff --git a/config/autoload/api.global.php b/config/autoload/api.global.php index 86b7474..9db3b20 100644 --- a/config/autoload/api.global.php +++ b/config/autoload/api.global.php @@ -1,9 +1,17 @@ [ 'spec' => realpath('tests/data/openapi/petstore.yaml'), + 'servers' => [ + 'default' => MergeRemoveKey::class, + 'development' => [ + 'url' => '', + 'description' => 'Development server', + ], + ], ], ]; diff --git a/config/autoload/development/.gitignore b/config/autoload/development/.gitignore new file mode 100755 index 0000000..94548af --- /dev/null +++ b/config/autoload/development/.gitignore @@ -0,0 +1,3 @@ +* +*/ +!.gitignore diff --git a/config/autoload/local/.gitignore b/config/autoload/local/.gitignore new file mode 100755 index 0000000..94548af --- /dev/null +++ b/config/autoload/local/.gitignore @@ -0,0 +1,3 @@ +* +*/ +!.gitignore diff --git a/config/config.php b/config/config.php index eb06cd7..94e236c 100755 --- a/config/config.php +++ b/config/config.php @@ -7,6 +7,9 @@ $processors = []; +$env = getenv('APP_ENV') ?: 'production'; +$envFolders = [$env, 'local']; + $aggregator = new ConfigAggregator( [ \AftDev\ServiceManager\ConfigProvider::class, @@ -19,7 +22,7 @@ \AftDev\Messenger\ConfigProvider::class, \AftDev\Api\ConfigProvider::class, - new PhpFileProvider(realpath(__DIR__).'/autoload/{{,*.}global,{,*.}local}.php'), + new PhpFileProvider(realpath(__DIR__).'/autoload/{{,*.}global,{'.join(',', $envFolders).'}/{,*}}.php'), ], null, $processors diff --git a/docker-compose.yml b/docker-compose.yml index fdb472b..12fbdf6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: "3.9" +version: '3.9' services: # Php Image @@ -10,8 +10,9 @@ services: stdin_open: true tty: true # Map local user to container user for file permissions. - user: "${UID:-1000}:${GID:-1000}" + user: '${UID:-1000}:${GID:-1000}' environment: + APP_ENV: ${APP_ENV:-production} PHP_VERSION: ${PHP_VERSION:-80} volumes: - './:/data' @@ -23,7 +24,7 @@ services: MYSQL_DATABASE: 'db' MYSQL_ROOT_PASSWORD: 'root' volumes: - - "./env/mysql:/docker-entrypoint-initdb.d" + - './env/mysql:/docker-entrypoint-initdb.d' ports: - '${LOCALDEV_MYSQL_PORT:-3306}:3306' # AWS services diff --git a/env/php/Dockerfile b/env/php/Dockerfile index 00fc5b6..efb48e3 100755 --- a/env/php/Dockerfile +++ b/env/php/Dockerfile @@ -24,4 +24,6 @@ COPY ["env/php/config.ini", "/etc/php.d/zzzzz_docker.ini"] WORKDIR /data +ENV APP_ENV production + CMD ["php", "-a"] From 27fee179c4da0a2bf949995ac925ce4e66d6925c Mon Sep 17 00:00:00 2001 From: Christophe G <1050197+cgaube@users.noreply.github.com> Date: Mon, 16 Jan 2023 10:13:40 -0800 Subject: [PATCH 13/20] feat(api): api server, api router improvement --- config/autoload/api.global.php | 8 --- docker-compose.yml | 2 +- packages/api/README.md | 59 ++++++++++++------- packages/api/src/ConfigProvider.php | 8 ++- .../api/src/Factory/OpenApiManagerFactory.php | 2 + .../Factory/OpenApiRouteGeneratorFactory.php | 4 +- packages/api/src/OpenApiManager.php | 14 ++++- .../src/Route/FastRouterParamTranslator.php | 4 +- .../api/src/Route/OpenApiRouteGenerator.php | 11 +--- packages/api/tests/OpenApiManagerTest.php | 30 ++++++++++ .../tests/Route/OpenApiRouteGeneratorTest.php | 28 ++++----- packages/service-manager/README.md | 2 +- .../src/Middleware/ResolveMiddleware.php | 1 + .../Middleware/ResolveMiddlewareTest.php | 3 +- tests/Feature/Api/OpenApiManagerTest.php | 33 ++++++++++- 15 files changed, 142 insertions(+), 67 deletions(-) diff --git a/config/autoload/api.global.php b/config/autoload/api.global.php index 9db3b20..86b7474 100644 --- a/config/autoload/api.global.php +++ b/config/autoload/api.global.php @@ -1,17 +1,9 @@ [ 'spec' => realpath('tests/data/openapi/petstore.yaml'), - 'servers' => [ - 'default' => MergeRemoveKey::class, - 'development' => [ - 'url' => '', - 'description' => 'Development server', - ], - ], ], ]; diff --git a/docker-compose.yml b/docker-compose.yml index 12fbdf6..e6c06cb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,7 +19,7 @@ services: # Mysql Database mysql: container_name: framework-mysql - image: mysql:5.7 + image: mysql:8 environment: MYSQL_DATABASE: 'db' MYSQL_ROOT_PASSWORD: 'root' diff --git a/packages/api/README.md b/packages/api/README.md index 396a788..4fc6dc9 100644 --- a/packages/api/README.md +++ b/packages/api/README.md @@ -9,11 +9,13 @@ validator. ```php [ - 'prefix': 'api', 'spec' => '/path/to/openapi.yml', - 'namespace' => 'App/Api/Controller', + 'namespace' => 'App\Api\Controller', 'mutations' => [], 'versions' => [], + 'servers' => [ + 'url' => 'https://api.server.com', + ], ] ``` @@ -123,33 +125,48 @@ class PathController } ``` -## Middlewares ([psr-15](https://www.php-fig.org/psr/psr-15/)) +## Routing -### OpenApiMiddleware +This package comes with a router helper that will autogenerate route +configuration from an openapi spec object. -This middleware will setup the current version of the version being used for the -current request and inject the OpenApi object to the request. +This configuration can then be used by your router of choice (like FastRouter or +Mezzio Application) -## Handler ([psr-15](https://www.php-fig.org/psr/psr-15/)) +```php -### OpenApiPathHandler Abstract -This is the default handler that is injected in the router of your choice This -handler will +``` -- make sure the incoming request is valid (using phpleague validator) -- call the appropirate controller action (depending on the openapi operation) -- make sure the outcoming response is valid (using phpleague validator) +### Route parameters -#### MezzioApiHandler +Each router have a different parameter format, by default our +OpenApiRouteGenerator is setup to use the FastRouter format. -## Routing +To override this, simply create a new translator and inject it to the Route +Generator (via container dependency injection or manually) -This package comes with a router helper that will autogenerate route -configuration from an openapi spec object. +```php + 'aliases' => [ + ParamTranslatorInterface::class => YourTranslator::class + ], +``` + +## OpenAPI request validator via middleware (PSR-15 Middleware Factory) + +This package provides a middleware factory that returns a PSR-15 compatible +middleware that will validate that all incoming requests matches the format +defined by your openapi spec. -This configuration can then be used by your router of choice (like fastRouter or -Mezzio Application) Service that return an array of routes and controllers / -params we need a mapper for each router type. +This middleware also validate that whatever data is sent back from your +controllers match the schemas defined in the spec -TODO - routes per version. (how to handle caching?) +The middleware uses the openapi validator from +https://github.com/thephpleague/openapi-psr7-validator + +```php +$openApiRequestValidatorMiddleware = $container->get(\League\OpenAPIValidation\PSR15\ValidationMiddleware::class); + +// Use middleware when defining your openapi routes +// Actual implementation will depending on your router. +``` diff --git a/packages/api/src/ConfigProvider.php b/packages/api/src/ConfigProvider.php index d5db8ed..6cbe528 100644 --- a/packages/api/src/ConfigProvider.php +++ b/packages/api/src/ConfigProvider.php @@ -43,9 +43,13 @@ public function getDependencies() public function getApiConfig() { return [ - 'prefix' => 'api', + 'servers' => [ + 'default' => [ + 'url' => 'https://api.your-site.com', + ], + ], 'spec' => 'config/openapi/openapi.yml', - 'namespace' => 'App/Api/Controller', + 'namespace' => 'App\Api\Controller', 'version' => null, 'versions' => [], // Cache store to use (requires aftdev/cache-manager) diff --git a/packages/api/src/Factory/OpenApiManagerFactory.php b/packages/api/src/Factory/OpenApiManagerFactory.php index a6a726d..1715000 100644 --- a/packages/api/src/Factory/OpenApiManagerFactory.php +++ b/packages/api/src/Factory/OpenApiManagerFactory.php @@ -21,11 +21,13 @@ public function __invoke(ContainerInterface $container) $resolver = $container->has(Resolver::class) ? $container->get(Resolver::class) : null; $version = $this->getApiVersionFromHeader($container) ?? $config['version'] ?? null; + $servers = $config['servers'] ?? []; $cache = $this->getCache($container, $config); return new OpenApiManager( specFile: $config['spec'], + servers: $servers, currentVersion: $version, versions: $config['versions'] ?? [], resolver: $resolver, diff --git a/packages/api/src/Factory/OpenApiRouteGeneratorFactory.php b/packages/api/src/Factory/OpenApiRouteGeneratorFactory.php index fb28fd8..e89f85e 100644 --- a/packages/api/src/Factory/OpenApiRouteGeneratorFactory.php +++ b/packages/api/src/Factory/OpenApiRouteGeneratorFactory.php @@ -18,12 +18,10 @@ public function __invoke(ContainerInterface $container) $paramTranslator = $container->get(ParamTranslatorInterface::class); $config = $container->get('config')[ConfigProvider::CONFIG_KEY]; - $prefix = $config['prefix'] ?? null; - $namespace = $config['prefix'] ?? 'App/Controller'; + $namespace = $config['namespace'] ?? 'App\Controller'; $cache = $this->getCache($container, $config); return new OpenApiRouteGenerator( - prefix: $prefix, namespace: $namespace, paramTranslator: $paramTranslator, cache: $cache, diff --git a/packages/api/src/OpenApiManager.php b/packages/api/src/OpenApiManager.php index b03413c..ecad2de 100644 --- a/packages/api/src/OpenApiManager.php +++ b/packages/api/src/OpenApiManager.php @@ -8,6 +8,7 @@ use AftDev\ServiceManager\Resolver; use cebe\openapi\Reader; use cebe\openapi\spec\OpenApi; +use cebe\openapi\spec\Server; use Illuminate\Support\Str; use Psr\Cache\CacheItemInterface; use Psr\Cache\CacheItemPoolInterface; @@ -26,6 +27,7 @@ class OpenApiManager public function __construct( private string $specFile, array $versions = [], + private array $servers = [], ?string $currentVersion = null, private ?Resolver $resolver = null, private ?CacheItemPoolInterface $cache = null, @@ -79,11 +81,21 @@ public function getVersion(string $version): OpenApi $versionOpenApi = $this->getBase(); - // Override Version + // Override Version. if (self::BASE_VERSION != $version) { $versionOpenApi->info->version = $version; } + // Add Servers. + $servers = array_map( + fn ($s) => new Server($s), + $this->servers, + ); + + if ($servers) { + $versionOpenApi->servers = $servers; + } + $this->applyMutations($versionOpenApi, $versionMutations); if ($this->cache) { diff --git a/packages/api/src/Route/FastRouterParamTranslator.php b/packages/api/src/Route/FastRouterParamTranslator.php index fff67c2..578d637 100644 --- a/packages/api/src/Route/FastRouterParamTranslator.php +++ b/packages/api/src/Route/FastRouterParamTranslator.php @@ -17,9 +17,7 @@ public function translate(string $value, bool $required, string $type, ?string $ { $name = trim($value, '/{}'); - $reg = $this->mapping[$type] - // ?? $this->mapping[$type+'-'+$format] - ?? false; + $reg = $this->mapping[$type] ?? false; if ($reg) { $name .= ':'.$reg; } diff --git a/packages/api/src/Route/OpenApiRouteGenerator.php b/packages/api/src/Route/OpenApiRouteGenerator.php index 07c5b19..8092f65 100644 --- a/packages/api/src/Route/OpenApiRouteGenerator.php +++ b/packages/api/src/Route/OpenApiRouteGenerator.php @@ -24,7 +24,6 @@ class OpenApiRouteGenerator ]; public function __construct( - private string $prefix = '/api', private string $namespace = 'App\Controller', private ?ParamTranslatorInterface $paramTranslator = null, private ?CacheItemPoolInterface $cache = null, @@ -84,27 +83,21 @@ public function generateRoutes(OpenApi $openApi): \Generator } } - private function prefixUri(string $path): string - { - return Str::of($path)->start($this->prefix)->start('/')->toString(); - } - private function getRoutesForPath(string $uri, PathItem $path): \Generator { - $prefixedUri = $this->prefixUri($uri); $pathParams = $this->getPathParameters($path->parameters); foreach ($path->getOperations() as $method => $operation) { $params = [ 'uri' => $this->swapParameters( - $prefixedUri, + $uri, array_merge( $pathParams, $this->getPathParameters($operation->parameters) ), ), 'method' => $method, - 'name' => $operation->operationId ?? 'api.'.Str::camel("{$method}{$uri}"), + 'name' => 'api.'.($operation->operationId ?? Str::camel("{$method}{$uri}")), 'handler' => $this->getHandlerNameForOperation($uri, $method), ]; diff --git a/packages/api/tests/OpenApiManagerTest.php b/packages/api/tests/OpenApiManagerTest.php index 6426749..d0df255 100644 --- a/packages/api/tests/OpenApiManagerTest.php +++ b/packages/api/tests/OpenApiManagerTest.php @@ -7,6 +7,7 @@ use AftDev\ServiceManager\Resolver; use AftDev\Test\TestCase; use cebe\openapi\spec\OpenApi; +use cebe\openapi\spec\Server; use Prophecy; use Psr\Container\ContainerInterface; @@ -180,4 +181,33 @@ public function testGetCurrentVersion() $openApi->info->version ); } + + public function testServers() + { + $openApiManager = new OpenApiManager( + realpath(__DIR__.'/specs/petstore.yaml'), + servers: [ + 'server_a' => [ + 'url' => 'https://serverA.com', + ], + 'server_b' => [ + 'url' => 'https://serverB.com', + ], + ], + ); + + $openApi = $openApiManager->getCurrentVersion(); + + $this->assertCount(2, $openApi->servers); + $serverA = current($openApi->servers); + $serverB = last($openApi->servers); + + $this->assertInstanceOf(Server::class, $serverA); + $this->assertInstanceOf(Server::class, $serverB); + + $this->assertSame('https://serverA.com', $serverA->url); + $this->assertSame('https://serverB.com', $serverB->url); + + $this->assertTrue($openApi->validate()); + } } diff --git a/packages/api/tests/Route/OpenApiRouteGeneratorTest.php b/packages/api/tests/Route/OpenApiRouteGeneratorTest.php index 899028c..6b1226a 100644 --- a/packages/api/tests/Route/OpenApiRouteGeneratorTest.php +++ b/packages/api/tests/Route/OpenApiRouteGeneratorTest.php @@ -39,31 +39,31 @@ public function testGenerator() } $expected = [ - '/api/companies' => [ + '/companies' => [ 'get' => 'App\Controller\Companies@index', 'post' => 'App\Controller\Companies@create', 'options' => 'App\Controller\Companies@options', 'head' => 'App\Controller\Companies@head', 'trace' => 'App\Controller\Companies@trace', ], - '/api/companies/{companyId}' => [ + '/companies/{companyId}' => [ 'get' => 'App\Controller\Companies@show', 'put' => 'App\Controller\Companies@update', 'delete' => 'App\Controller\Companies@delete', ], - '/api/companies/{companyId}/employees' => [ + '/companies/{companyId}/employees' => [ 'get' => 'App\Controller\Employees@indexByCompany', ], - '/api/companies/{companyId}/employees/{employeeId}' => [ + '/companies/{companyId}/employees/{employeeId}' => [ 'get' => 'App\Controller\Employees@showByCompany', ], - '/api/companies/{companyId}/employees/{employeeId}/salary' => [ + '/companies/{companyId}/employees/{employeeId}/salary' => [ 'get' => 'App\Controller\Salaries@indexByCompanyEmployee', ], - '/api/companies/{companyId}/employees/{employeeId}/salary/{category}' => [ + '/companies/{companyId}/employees/{employeeId}/salary/{category}' => [ 'get' => 'App\Controller\Salaries@showByCompanyEmployeeAndCategory', ], - '/api/test/param/{intParam}/{stringParam}/{dateParam}/{optionalParam}' => [ + '/test/param/{intParam}/{stringParam}/{dateParam}/{optionalParam}' => [ 'get' => 'App\Controller\Params@showByTestAndIntParamStringParamDateParamOptionalParam', ], ]; @@ -89,13 +89,13 @@ public function testRouteParamTranslation() } $expected = [ - '/api/companies', - '/api/companies/{:translated}', - '/api/companies/{:translated}/employees', - '/api/companies/{:translated}/employees/{:translated}', - '/api/companies/{:translated}/employees/{:translated}/salary', - '/api/companies/{:translated}/employees/{:translated}/salary/{:translated}', - '/api/test/param/{:translated}/{:translated}/{:translated}/{:translated}', + '/companies', + '/companies/{:translated}', + '/companies/{:translated}/employees', + '/companies/{:translated}/employees/{:translated}', + '/companies/{:translated}/employees/{:translated}/salary', + '/companies/{:translated}/employees/{:translated}/salary/{:translated}', + '/test/param/{:translated}/{:translated}/{:translated}/{:translated}', ]; $this->assertEquals($expected, $found); diff --git a/packages/service-manager/README.md b/packages/service-manager/README.md index 5d3b5cb..0aac96a 100755 --- a/packages/service-manager/README.md +++ b/packages/service-manager/README.md @@ -209,7 +209,7 @@ return static function (Application $app, MiddlewareFactory $factory, ContainerI $resolveMiddlewareFactory = $container->get(ResolveMiddlewareFactory::class); - $app->get('/api/ping', $resolveMiddlewareFactory->prepare(App\Handler\PingHandler::class.'@otherAction'), 'api.ping.factory'); + $app->get('/api/ping', $resolveMiddlewareFactory->prepare(App\Handler\PingHandler::class.'@otherAction')); } ``` diff --git a/packages/service-manager/src/Middleware/ResolveMiddleware.php b/packages/service-manager/src/Middleware/ResolveMiddleware.php index 0b8ee48..06536d1 100644 --- a/packages/service-manager/src/Middleware/ResolveMiddleware.php +++ b/packages/service-manager/src/Middleware/ResolveMiddleware.php @@ -21,6 +21,7 @@ public function __construct( public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $attributes = $request->getAttributes(); + $attributes[ServerRequestInterface::class] = $request; return $this->resolver->call($this->callable, $attributes); } diff --git a/packages/service-manager/tests/Middleware/ResolveMiddlewareTest.php b/packages/service-manager/tests/Middleware/ResolveMiddlewareTest.php index 8089cda..8efec0b 100755 --- a/packages/service-manager/tests/Middleware/ResolveMiddlewareTest.php +++ b/packages/service-manager/tests/Middleware/ResolveMiddlewareTest.php @@ -7,6 +7,7 @@ use AftDev\Test\TestCase; use Laminas\Diactoros\ServerRequest; use Psr\Http\Message\ResponseInterface; +use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; /** @@ -34,7 +35,7 @@ public function testMiddleware() $handlerName = 'XXXX'; $resolver = $this->prophesize(Resolver::class); $resolver - ->call($handlerName, $attributes) + ->call($handlerName, $attributes + [ServerRequestInterface::class => $request]) ->shouldBeCalledOnce() ->willReturn($response->reveal()) ; diff --git a/tests/Feature/Api/OpenApiManagerTest.php b/tests/Feature/Api/OpenApiManagerTest.php index 6e81205..2e4a016 100644 --- a/tests/Feature/Api/OpenApiManagerTest.php +++ b/tests/Feature/Api/OpenApiManagerTest.php @@ -7,6 +7,7 @@ use AftDev\Cache\CacheManager; use AftDev\Test\FeatureTestCase; use cebe\openapi\spec\OpenApi; +use cebe\openapi\spec\Server; use Psr\Cache\CacheItemPoolInterface; /** @@ -70,7 +71,7 @@ function (OpenApi $openApi, OpenApiManager $apiManager) use (&$apiManagerClass) $openApiManager = $this->container->get(OpenApiManager::class); - $openApi = $openApiManager->getVersion('2019-01-02'); + $openApiManager->getVersion('2019-01-02'); $this->assertEquals(OpenApiManager::class, $apiManagerClass); } @@ -91,16 +92,18 @@ public function testCache() $openApiManager = $this->container->get(OpenApiManager::class); $openApiManager->getCurrentVersion(); + $openApiManager->getVersion('2019-01-02'); $this->assertTrue($phpStore->hasItem('api.specs._base')); - - return $phpStore; + $this->assertTrue($phpStore->hasItem('api.specs.20190102')); } /** * Make sure the cache is being reused. * * @depends testCache + * Previous function will add items into the cache. This test make sure they + * are used * * @param mixed $phpStore */ @@ -119,4 +122,28 @@ public function testCacheFound($phpStore) $phpStore->clear(); $this->assertInstanceOf(OpenApi::class, $spec); } + + /** + * @covers \AftDev\Api\Factory\OpenApiManagerFactory + */ + public function testServers() + { + $this->overrideConfig( + [ConfigProvider::CONFIG_KEY, 'servers'], + [ + 'serverA' => [ + 'url' => 'https://test.com', + 'description' => 'xyz', + ], + ], + ); + + $openApiManager = $this->container->get(OpenApiManager::class); + + $servers = $openApiManager->getCurrentVersion()->servers; + + $this->assertInstanceOf(Server::class, current($servers)); + $this->assertEquals('https://test.com', current($servers)->url); + $this->assertEquals('xyz', current($servers)->description); + } } From aaf4a4aec3627d8a1f07ff05651430bca01c5eba Mon Sep 17 00:00:00 2001 From: Christophe G <1050197+cgaube@users.noreply.github.com> Date: Mon, 16 Jan 2023 10:16:28 -0800 Subject: [PATCH 14/20] chore(all): add random order to php tests --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index fa2f730..c8e8835 100755 --- a/composer.json +++ b/composer.json @@ -93,7 +93,7 @@ "monorepo": "monorepo-builder", "repo-merge": "monorepo-builder merge --ansi", "repo-validate": "monorepo-builder validate --ansi", - "test": "phpunit --no-coverage", + "test": "phpunit --no-coverage --order-by=random", "test:unit": "@test --testsuite UnitTests", "test:feature": "@test --testsuite Features", "coverage": "@php -dpcov.enabled=1 ./vendor/bin/phpunit", From 21a35a506a8acc6ae304e1ac7402c66b15c5d36a Mon Sep 17 00:00:00 2001 From: Christophe G <1050197+cgaube@users.noreply.github.com> Date: Mon, 16 Jan 2023 10:23:47 -0800 Subject: [PATCH 15/20] chore(all): update php dependencies --- composer.lock | 1484 +++++++++++++++++++------------------------------ 1 file changed, 584 insertions(+), 900 deletions(-) diff --git a/composer.lock b/composer.lock index 2da756d..1e5327f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8e8a789d587301d19aa10c1cf9cdf60e", + "content-hash": "c05dd54eefb2186ce8ef647ec6ec84b9", "packages": [ { "name": "brick/varexporter", @@ -57,16 +57,16 @@ }, { "name": "cakephp/core", - "version": "4.4.5", + "version": "4.4.10", "source": { "type": "git", "url": "https://github.com/cakephp/core.git", - "reference": "77e53e3784863c1b8006464b82ab842ee7c58e6b" + "reference": "20e50de2f461b5983a1a1296fe5c3762857b9edd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/core/zipball/77e53e3784863c1b8006464b82ab842ee7c58e6b", - "reference": "77e53e3784863c1b8006464b82ab842ee7c58e6b", + "url": "https://api.github.com/repos/cakephp/core/zipball/20e50de2f461b5983a1a1296fe5c3762857b9edd", + "reference": "20e50de2f461b5983a1a1296fe5c3762857b9edd", "shasum": "" }, "require": { @@ -110,20 +110,20 @@ "issues": "https://github.com/cakephp/cakephp/issues", "source": "https://github.com/cakephp/core" }, - "time": "2022-08-26T02:01:18+00:00" + "time": "2022-10-07T16:40:13+00:00" }, { "name": "cakephp/database", - "version": "4.4.5", + "version": "4.4.10", "source": { "type": "git", "url": "https://github.com/cakephp/database.git", - "reference": "eec6239b0734e2a4dfe212dc93bcd505c7d296ef" + "reference": "c12a8f30f802968a885774e2ac3c099f470bf07c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/database/zipball/eec6239b0734e2a4dfe212dc93bcd505c7d296ef", - "reference": "eec6239b0734e2a4dfe212dc93bcd505c7d296ef", + "url": "https://api.github.com/repos/cakephp/database/zipball/c12a8f30f802968a885774e2ac3c099f470bf07c", + "reference": "c12a8f30f802968a885774e2ac3c099f470bf07c", "shasum": "" }, "require": { @@ -132,7 +132,8 @@ "php": ">=7.4.0" }, "suggest": { - "cakephp/i18n": "If you are using locale-aware datetime formats or Chronos types." + "cakephp/i18n": "If you are using locale-aware datetime formats or Chronos types.", + "cakephp/log": "If you want to use query logging without providing a logger yourself." }, "type": "library", "autoload": { @@ -165,20 +166,20 @@ "issues": "https://github.com/cakephp/cakephp/issues", "source": "https://github.com/cakephp/database" }, - "time": "2022-08-18T21:01:25+00:00" + "time": "2023-01-03T20:29:38+00:00" }, { "name": "cakephp/datasource", - "version": "4.4.5", + "version": "4.4.10", "source": { "type": "git", "url": "https://github.com/cakephp/datasource.git", - "reference": "6fbd1f49833dedf3bd351e1a98b18133a6b9e86c" + "reference": "cb58adb0e6f52f26fa61d03776b07c157e328c1e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/datasource/zipball/6fbd1f49833dedf3bd351e1a98b18133a6b9e86c", - "reference": "6fbd1f49833dedf3bd351e1a98b18133a6b9e86c", + "url": "https://api.github.com/repos/cakephp/datasource/zipball/cb58adb0e6f52f26fa61d03776b07c157e328c1e", + "reference": "cb58adb0e6f52f26fa61d03776b07c157e328c1e", "shasum": "" }, "require": { @@ -223,20 +224,20 @@ "issues": "https://github.com/cakephp/cakephp/issues", "source": "https://github.com/cakephp/datasource" }, - "time": "2022-08-18T20:55:21+00:00" + "time": "2022-11-26T11:46:41+00:00" }, { "name": "cakephp/utility", - "version": "4.4.5", + "version": "4.4.10", "source": { "type": "git", "url": "https://github.com/cakephp/utility.git", - "reference": "7d28a3935f746fcbbfb38e8dddaa9c9d48b251c5" + "reference": "aa7bba6c39b56751f5c917464f113c924d4ba10f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/utility/zipball/7d28a3935f746fcbbfb38e8dddaa9c9d48b251c5", - "reference": "7d28a3935f746fcbbfb38e8dddaa9c9d48b251c5", + "url": "https://api.github.com/repos/cakephp/utility/zipball/aa7bba6c39b56751f5c917464f113c924d4ba10f", + "reference": "aa7bba6c39b56751f5c917464f113c924d4ba10f", "shasum": "" }, "require": { @@ -282,7 +283,7 @@ "issues": "https://github.com/cakephp/cakephp/issues", "source": "https://github.com/cakephp/utility" }, - "time": "2022-08-19T06:02:03+00:00" + "time": "2022-11-06T06:40:44+00:00" }, { "name": "cebe/php-openapi", @@ -355,28 +356,28 @@ }, { "name": "doctrine/inflector", - "version": "2.0.4", + "version": "2.0.6", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89" + "reference": "d9d313a36c872fd6ee06d9a6cbcf713eaa40f024" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", - "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/d9d313a36c872fd6ee06d9a6cbcf713eaa40f024", + "reference": "d9d313a36c872fd6ee06d9a6cbcf713eaa40f024", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^8.2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpstan/phpstan-strict-rules": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", - "vimeo/psalm": "^4.10" + "doctrine/coding-standard": "^10", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.3", + "phpunit/phpunit": "^8.5 || ^9.5", + "vimeo/psalm": "^4.25" }, "type": "library", "autoload": { @@ -426,7 +427,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.4" + "source": "https://github.com/doctrine/inflector/tree/2.0.6" }, "funding": [ { @@ -442,20 +443,20 @@ "type": "tidelift" } ], - "time": "2021-10-22T20:16:43+00:00" + "time": "2022-10-20T09:10:12+00:00" }, { "name": "illuminate/collections", - "version": "v9.27.0", + "version": "v9.47.0", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", - "reference": "3bda212d2c245b3261cd9af690dfd47d9878cebf" + "reference": "9668ef5b1cc13cbc0a57a5208417dce2be66a3d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/3bda212d2c245b3261cd9af690dfd47d9878cebf", - "reference": "3bda212d2c245b3261cd9af690dfd47d9878cebf", + "url": "https://api.github.com/repos/illuminate/collections/zipball/9668ef5b1cc13cbc0a57a5208417dce2be66a3d4", + "reference": "9668ef5b1cc13cbc0a57a5208417dce2be66a3d4", "shasum": "" }, "require": { @@ -497,11 +498,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-08-22T14:29:59+00:00" + "time": "2023-01-06T14:14:06+00:00" }, { "name": "illuminate/conditionable", - "version": "v9.27.0", + "version": "v9.47.0", "source": { "type": "git", "url": "https://github.com/illuminate/conditionable.git", @@ -547,16 +548,16 @@ }, { "name": "illuminate/container", - "version": "v9.27.0", + "version": "v9.47.0", "source": { "type": "git", "url": "https://github.com/illuminate/container.git", - "reference": "d86b073cae04713cf28def54417fa771621bc4f1" + "reference": "62d43e04ce5c9660344f174e62e7da4053ddcb89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/container/zipball/d86b073cae04713cf28def54417fa771621bc4f1", - "reference": "d86b073cae04713cf28def54417fa771621bc4f1", + "url": "https://api.github.com/repos/illuminate/container/zipball/62d43e04ce5c9660344f174e62e7da4053ddcb89", + "reference": "62d43e04ce5c9660344f174e62e7da4053ddcb89", "shasum": "" }, "require": { @@ -594,20 +595,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-05-16T15:53:09+00:00" + "time": "2023-01-05T17:08:40+00:00" }, { "name": "illuminate/contracts", - "version": "v9.27.0", + "version": "v9.47.0", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", - "reference": "0d1dd1a7e947072319f2e641cc50081219606502" + "reference": "856ad15be8d80a2f217d30cfe2df3fc3a5c886fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/0d1dd1a7e947072319f2e641cc50081219606502", - "reference": "0d1dd1a7e947072319f2e641cc50081219606502", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/856ad15be8d80a2f217d30cfe2df3fc3a5c886fd", + "reference": "856ad15be8d80a2f217d30cfe2df3fc3a5c886fd", "shasum": "" }, "require": { @@ -642,20 +643,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-08-18T14:18:13+00:00" + "time": "2022-12-31T20:34:28+00:00" }, { "name": "illuminate/database", - "version": "v9.27.0", + "version": "v9.47.0", "source": { "type": "git", "url": "https://github.com/illuminate/database.git", - "reference": "017c670244f39c42b575807f5ea52b44df772790" + "reference": "f2d7f145b2a25dff82bcf89f64468a1f083ce613" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/database/zipball/017c670244f39c42b575807f5ea52b44df772790", - "reference": "017c670244f39c42b575807f5ea52b44df772790", + "url": "https://api.github.com/repos/illuminate/database/zipball/f2d7f145b2a25dff82bcf89f64468a1f083ce613", + "reference": "f2d7f145b2a25dff82bcf89f64468a1f083ce613", "shasum": "" }, "require": { @@ -666,11 +667,11 @@ "illuminate/macroable": "^9.0", "illuminate/support": "^9.0", "php": "^8.0.2", - "symfony/console": "^6.0" + "symfony/console": "^6.0.9" }, "suggest": { "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.4).", - "fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).", + "fakerphp/faker": "Required to use the eloquent factory builder (^1.21).", "illuminate/console": "Required to use the database commands (^9.0).", "illuminate/events": "Required to use the observers with Eloquent (^9.0).", "illuminate/filesystem": "Required to use the migrations (^9.0).", @@ -710,11 +711,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-08-30T13:24:51+00:00" + "time": "2023-01-10T16:08:45+00:00" }, { "name": "illuminate/macroable", - "version": "v9.27.0", + "version": "v9.47.0", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -760,16 +761,16 @@ }, { "name": "illuminate/support", - "version": "v9.27.0", + "version": "v9.47.0", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "e40eb24d4799d82d3dab6f8f91cc2c68cb6cc798" + "reference": "96472803636dc813986410b805a1db382f9a9138" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/e40eb24d4799d82d3dab6f8f91cc2c68cb6cc798", - "reference": "e40eb24d4799d82d3dab6f8f91cc2c68cb6cc798", + "url": "https://api.github.com/repos/illuminate/support/zipball/96472803636dc813986410b805a1db382f9a9138", + "reference": "96472803636dc813986410b805a1db382f9a9138", "shasum": "" }, "require": { @@ -780,7 +781,7 @@ "illuminate/conditionable": "^9.0", "illuminate/contracts": "^9.0", "illuminate/macroable": "^9.0", - "nesbot/carbon": "^2.53.1", + "nesbot/carbon": "^2.62.1", "php": "^8.0.2", "voku/portable-ascii": "^2.0" }, @@ -790,8 +791,9 @@ "suggest": { "illuminate/filesystem": "Required to use the composer class (^9.0).", "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^2.0.2).", - "ramsey/uuid": "Required to use Str::uuid() (^4.2.2).", + "ramsey/uuid": "Required to use Str::uuid() (^4.7).", "symfony/process": "Required to use the composer class (^6.0).", + "symfony/uid": "Required to use Str::ulid() (^6.0).", "symfony/var-dumper": "Required to use the dd function (^6.0).", "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.4.1)." }, @@ -825,7 +827,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-08-26T15:24:56+00:00" + "time": "2023-01-06T18:59:10+00:00" }, { "name": "justinrainbow/json-schema", @@ -899,22 +901,22 @@ }, { "name": "laminas/laminas-config", - "version": "3.7.0", + "version": "3.8.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-config.git", - "reference": "e43d13dcfc273d4392812eb395ce636f73f34dfd" + "reference": "46baad58d0b12cf98539e04334eff40a1fdfb9a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-config/zipball/e43d13dcfc273d4392812eb395ce636f73f34dfd", - "reference": "e43d13dcfc273d4392812eb395ce636f73f34dfd", + "url": "https://api.github.com/repos/laminas/laminas-config/zipball/46baad58d0b12cf98539e04334eff40a1fdfb9a0", + "reference": "46baad58d0b12cf98539e04334eff40a1fdfb9a0", "shasum": "" }, "require": { "ext-json": "*", "laminas/laminas-stdlib": "^3.6", - "php": "^7.3 || ~8.0.0 || ~8.1.0", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0", "psr/container": "^1.0" }, "conflict": { @@ -922,11 +924,11 @@ "zendframework/zend-config": "*" }, "require-dev": { - "laminas/laminas-coding-standard": "~1.0.0", - "laminas/laminas-filter": "^2.7.2", - "laminas/laminas-i18n": "^2.10.3", - "laminas/laminas-servicemanager": "^3.7", - "phpunit/phpunit": "^9.5.5" + "laminas/laminas-coding-standard": "~2.4.0", + "laminas/laminas-filter": "~2.23.0", + "laminas/laminas-i18n": "~2.19.0", + "laminas/laminas-servicemanager": "~3.19.0", + "phpunit/phpunit": "~9.5.25" }, "suggest": { "laminas/laminas-filter": "^2.7.2; install if you want to use the Filter processor", @@ -963,26 +965,26 @@ "type": "community_bridge" } ], - "time": "2021-10-01T16:07:46+00:00" + "time": "2022-10-16T14:21:22+00:00" }, { "name": "laminas/laminas-config-aggregator", - "version": "1.8.0", + "version": "1.13.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-config-aggregator.git", - "reference": "929f6714f87407b4e3f1be35485ead6044127f9d" + "reference": "5c445bbe9afabb7fd7c38382f27930f11632dd90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-config-aggregator/zipball/929f6714f87407b4e3f1be35485ead6044127f9d", - "reference": "929f6714f87407b4e3f1be35485ead6044127f9d", + "url": "https://api.github.com/repos/laminas/laminas-config-aggregator/zipball/5c445bbe9afabb7fd7c38382f27930f11632dd90", + "reference": "5c445bbe9afabb7fd7c38382f27930f11632dd90", "shasum": "" }, "require": { "brick/varexporter": "^0.3.7", "laminas/laminas-stdlib": "^3.10.1", - "php": "^7.4 || ~8.0.0 || ~8.1.0", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0", "webimpress/safe-writer": "^2.2.0" }, "conflict": { @@ -990,12 +992,12 @@ "zendframework/zend-config-aggregator": "*" }, "require-dev": { - "laminas/laminas-coding-standard": "~2.3.0", - "laminas/laminas-config": "^3.7.0", - "laminas/laminas-servicemanager": "^3.15.1", - "phpunit/phpunit": "^9.5.21", - "psalm/plugin-phpunit": "^0.17.0", - "vimeo/psalm": "^4.24.0" + "laminas/laminas-coding-standard": "~2.4.0", + "laminas/laminas-config": "^3.8.0", + "laminas/laminas-servicemanager": "^3.19", + "phpunit/phpunit": "^9.5.26", + "psalm/plugin-phpunit": "^0.18.0", + "vimeo/psalm": "^5.0" }, "suggest": { "laminas/laminas-config": "Allows loading configuration from XML, INI, YAML, and JSON files", @@ -1032,25 +1034,25 @@ "type": "community_bridge" } ], - "time": "2022-07-24T15:41:06+00:00" + "time": "2022-12-03T21:22:49+00:00" }, { "name": "laminas/laminas-servicemanager", - "version": "3.16.0", + "version": "3.20.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-servicemanager.git", - "reference": "863c66733740cd36ebf5e700f4258ef2c68a2a24" + "reference": "bc2c2cbe2dd90db8b9d16b0618f542692b76ab59" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-servicemanager/zipball/863c66733740cd36ebf5e700f4258ef2c68a2a24", - "reference": "863c66733740cd36ebf5e700f4258ef2c68a2a24", + "url": "https://api.github.com/repos/laminas/laminas-servicemanager/zipball/bc2c2cbe2dd90db8b9d16b0618f542692b76ab59", + "reference": "bc2c2cbe2dd90db8b9d16b0618f542692b76ab59", "shasum": "" }, "require": { "laminas/laminas-stdlib": "^3.2.1", - "php": "~7.4.0 || ~8.0.0 || ~8.1.0", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0", "psr/container": "^1.0" }, "conflict": { @@ -1066,17 +1068,16 @@ "container-interop/container-interop": "^1.2.0" }, "require-dev": { - "composer/package-versions-deprecated": "^1.0", - "laminas/laminas-coding-standard": "~2.3.0", - "laminas/laminas-container-config-test": "^0.7", - "laminas/laminas-dependency-plugin": "^2.1.2", - "mikey179/vfsstream": "^1.6.10@alpha", - "ocramius/proxy-manager": "^2.11", - "phpbench/phpbench": "^1.1", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5.5", - "psalm/plugin-phpunit": "^0.17.0", - "vimeo/psalm": "^4.8" + "composer/package-versions-deprecated": "^1.11.99.5", + "laminas/laminas-coding-standard": "~2.4.0", + "laminas/laminas-container-config-test": "^0.8", + "laminas/laminas-dependency-plugin": "^2.2", + "mikey179/vfsstream": "^1.6.11@alpha", + "ocramius/proxy-manager": "^2.14.1", + "phpbench/phpbench": "^1.2.7", + "phpunit/phpunit": "^9.5.26", + "psalm/plugin-phpunit": "^0.18.0", + "vimeo/psalm": "^5.0.0" }, "suggest": { "ocramius/proxy-manager": "ProxyManager ^2.1.1 to handle lazy initialization of services" @@ -1123,35 +1124,34 @@ "type": "community_bridge" } ], - "time": "2022-07-27T14:58:17+00:00" + "time": "2022-12-01T17:03:38+00:00" }, { "name": "laminas/laminas-stdlib", - "version": "3.13.0", + "version": "3.16.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-stdlib.git", - "reference": "66a6d03c381f6c9f1dd988bf8244f9afb9380d76" + "reference": "f4f773641807c7ccee59b758bfe4ac4ba33ecb17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/66a6d03c381f6c9f1dd988bf8244f9afb9380d76", - "reference": "66a6d03c381f6c9f1dd988bf8244f9afb9380d76", + "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/f4f773641807c7ccee59b758bfe4ac4ba33ecb17", + "reference": "f4f773641807c7ccee59b758bfe4ac4ba33ecb17", "shasum": "" }, "require": { - "php": "^7.4 || ~8.0.0 || ~8.1.0" + "php": "~8.0.0 || ~8.1.0 || ~8.2.0" }, "conflict": { "zendframework/zend-stdlib": "*" }, "require-dev": { - "laminas/laminas-coding-standard": "~2.3.0", - "phpbench/phpbench": "^1.2.6", - "phpstan/phpdoc-parser": "^0.5.4", - "phpunit/phpunit": "^9.5.23", - "psalm/plugin-phpunit": "^0.17.0", - "vimeo/psalm": "^4.26" + "laminas/laminas-coding-standard": "^2.4.0", + "phpbench/phpbench": "^1.2.7", + "phpunit/phpunit": "^9.5.26", + "psalm/plugin-phpunit": "^0.18.0", + "vimeo/psalm": "^5.0.0" }, "type": "library", "autoload": { @@ -1183,20 +1183,20 @@ "type": "community_bridge" } ], - "time": "2022-08-24T13:56:50+00:00" + "time": "2022-12-03T18:48:01+00:00" }, { "name": "league/flysystem", - "version": "3.2.1", + "version": "3.12.1", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "81aea9e5217084c7850cd36e1587ee4aad721c6b" + "reference": "b934123c1f11ada6363d057d691e3065fa6d6d49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/81aea9e5217084c7850cd36e1587ee4aad721c6b", - "reference": "81aea9e5217084c7850cd36e1587ee4aad721c6b", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/b934123c1f11ada6363d057d691e3065fa6d6d49", + "reference": "b934123c1f11ada6363d057d691e3065fa6d6d49", "shasum": "" }, "require": { @@ -1207,12 +1207,13 @@ "aws/aws-sdk-php": "3.209.31 || 3.210.0", "guzzlehttp/guzzle": "<7.0", "guzzlehttp/ringphp": "<1.1.1", + "phpseclib/phpseclib": "3.0.15", "symfony/http-client": "<5.2" }, "require-dev": { "async-aws/s3": "^1.5", - "async-aws/simple-s3": "^1.0", - "aws/aws-sdk-php": "^3.198.1", + "async-aws/simple-s3": "^1.1", + "aws/aws-sdk-php": "^3.220.0", "composer/semver": "^3.0", "ext-fileinfo": "*", "ext-ftp": "*", @@ -1220,7 +1221,7 @@ "friendsofphp/php-cs-fixer": "^3.5", "google/cloud-storage": "^1.23", "microsoft/azure-storage-blob": "^1.1", - "phpseclib/phpseclib": "^2.0", + "phpseclib/phpseclib": "^3.0.14", "phpstan/phpstan": "^0.12.26", "phpunit/phpunit": "^9.5.11", "sabre/dav": "^4.3.1" @@ -1257,11 +1258,11 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.2.1" + "source": "https://github.com/thephpleague/flysystem/tree/3.12.1" }, "funding": [ { - "url": "https://offset.earth/frankdejonge", + "url": "https://ecologi.com/frankdejonge", "type": "custom" }, { @@ -1273,7 +1274,7 @@ "type": "tidelift" } ], - "time": "2022-08-14T20:48:34+00:00" + "time": "2023-01-06T16:34:48+00:00" }, { "name": "league/mime-type-detection", @@ -1434,16 +1435,16 @@ }, { "name": "nesbot/carbon", - "version": "2.62.1", + "version": "2.65.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "01bc4cdefe98ef58d1f9cb31bdbbddddf2a88f7a" + "reference": "09acf64155c16dc6f580f36569ae89344e9734a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/01bc4cdefe98ef58d1f9cb31bdbbddddf2a88f7a", - "reference": "01bc4cdefe98ef58d1f9cb31bdbbddddf2a88f7a", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/09acf64155c16dc6f580f36569ae89344e9734a3", + "reference": "09acf64155c16dc6f580f36569ae89344e9734a3", "shasum": "" }, "require": { @@ -1454,7 +1455,7 @@ "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { - "doctrine/dbal": "^2.0 || ^3.0", + "doctrine/dbal": "^2.0 || ^3.1.4", "doctrine/orm": "^2.7", "friendsofphp/php-cs-fixer": "^3.0", "kylekatarnls/multi-tester": "^2.0", @@ -1532,20 +1533,20 @@ "type": "tidelift" } ], - "time": "2022-09-02T07:48:13+00:00" + "time": "2023-01-06T15:55:01+00:00" }, { "name": "nikic/php-parser", - "version": "v4.14.0", + "version": "v4.15.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1" + "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", + "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", "shasum": "" }, "require": { @@ -1586,38 +1587,38 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.14.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.2" }, - "time": "2022-05-31T20:59:12+00:00" + "time": "2022-11-12T15:38:23+00:00" }, { "name": "ocramius/package-versions", - "version": "2.5.1", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/Ocramius/PackageVersions.git", - "reference": "6707caff2e84a2368f29fdf2cb28a6b5a9e3ab53" + "reference": "065921ed7cb2a6861443d91138d0a4378316af8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/6707caff2e84a2368f29fdf2cb28a6b5a9e3ab53", - "reference": "6707caff2e84a2368f29fdf2cb28a6b5a9e3ab53", + "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/065921ed7cb2a6861443d91138d0a4378316af8d", + "reference": "065921ed7cb2a6861443d91138d0a4378316af8d", "shasum": "" }, "require": { "composer-runtime-api": "^2.2.0", - "php": "~8.0.0 || ~8.1.0" + "php": "~8.1.0 || ~8.2.0" }, "replace": { "composer/package-versions-deprecated": "*" }, "require-dev": { - "composer/composer": "^2.2.0", - "doctrine/coding-standard": "^9.0.0", + "composer/composer": "^2.4.4", + "doctrine/coding-standard": "^10.0.0", "ext-zip": "^1.15.0", - "phpunit/phpunit": "^9.5.9", - "roave/infection-static-analysis-plugin": "^1.10.0", - "vimeo/psalm": "^4.10.0" + "phpunit/phpunit": "^9.5.26", + "roave/infection-static-analysis-plugin": "^1.25.0", + "vimeo/psalm": "^4.29.0" }, "type": "library", "autoload": { @@ -1638,7 +1639,7 @@ "description": "Provides efficient querying for installed package versions (no runtime IO)", "support": { "issues": "https://github.com/Ocramius/PackageVersions/issues", - "source": "https://github.com/Ocramius/PackageVersions/tree/2.5.1" + "source": "https://github.com/Ocramius/PackageVersions/tree/2.7.0" }, "funding": [ { @@ -1650,7 +1651,7 @@ "type": "tidelift" } ], - "time": "2022-03-05T18:04:57+00:00" + "time": "2022-10-31T12:51:46+00:00" }, { "name": "psr/cache", @@ -2019,16 +2020,16 @@ }, { "name": "robmorgan/phinx", - "version": "0.12.12", + "version": "0.12.13", "source": { "type": "git", "url": "https://github.com/cakephp/phinx.git", - "reference": "9a6ce1e7fdf0fa4e602ba5875b5bc9442ccaa115" + "reference": "6eb0f295e140ed2804d93396755f0ce9ada4ec07" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/phinx/zipball/9a6ce1e7fdf0fa4e602ba5875b5bc9442ccaa115", - "reference": "9a6ce1e7fdf0fa4e602ba5875b5bc9442ccaa115", + "url": "https://api.github.com/repos/cakephp/phinx/zipball/6eb0f295e140ed2804d93396755f0ce9ada4ec07", + "reference": "6eb0f295e140ed2804d93396755f0ce9ada4ec07", "shasum": "" }, "require": { @@ -2099,22 +2100,22 @@ ], "support": { "issues": "https://github.com/cakephp/phinx/issues", - "source": "https://github.com/cakephp/phinx/tree/0.12.12" + "source": "https://github.com/cakephp/phinx/tree/0.12.13" }, - "time": "2022-07-09T18:53:51+00:00" + "time": "2022-10-03T04:57:40+00:00" }, { "name": "symfony/cache", - "version": "v6.1.3", + "version": "v6.2.4", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "5cf8e75f02932818889e0609380b8d5427a6c86c" + "reference": "ddd1a70bfdf4ed19facad0db689c7bca979d322e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/5cf8e75f02932818889e0609380b8d5427a6c86c", - "reference": "5cf8e75f02932818889e0609380b8d5427a6c86c", + "url": "https://api.github.com/repos/symfony/cache/zipball/ddd1a70bfdf4ed19facad0db689c7bca979d322e", + "reference": "ddd1a70bfdf4ed19facad0db689c7bca979d322e", "shasum": "" }, "require": { @@ -2123,7 +2124,7 @@ "psr/log": "^1.1|^2|^3", "symfony/cache-contracts": "^1.1.7|^2|^3", "symfony/service-contracts": "^1.1|^2|^3", - "symfony/var-exporter": "^5.4|^6.0" + "symfony/var-exporter": "^6.2" }, "conflict": { "doctrine/dbal": "<2.13.1", @@ -2174,14 +2175,14 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Provides an extended PSR-6, PSR-16 (and tags) implementation", + "description": "Provides extended PSR-6, PSR-16 (and tags) implementations", "homepage": "https://symfony.com", "keywords": [ "caching", "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v6.1.3" + "source": "https://github.com/symfony/cache/tree/v6.2.4" }, "funding": [ { @@ -2197,20 +2198,20 @@ "type": "tidelift" } ], - "time": "2022-07-29T07:42:06+00:00" + "time": "2022-12-29T16:29:13+00:00" }, { "name": "symfony/cache-contracts", - "version": "v3.1.1", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/symfony/cache-contracts.git", - "reference": "2eab7fa459af6d75c6463e63e633b667a9b761d3" + "reference": "e8d1a5fc43534063204b74c080ebe36307d12271" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/2eab7fa459af6d75c6463e63e633b667a9b761d3", - "reference": "2eab7fa459af6d75c6463e63e633b667a9b761d3", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/e8d1a5fc43534063204b74c080ebe36307d12271", + "reference": "e8d1a5fc43534063204b74c080ebe36307d12271", "shasum": "" }, "require": { @@ -2223,7 +2224,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.1-dev" + "dev-main": "3.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -2260,7 +2261,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/cache-contracts/tree/v3.1.1" + "source": "https://github.com/symfony/cache-contracts/tree/v3.2.0" }, "funding": [ { @@ -2276,20 +2277,20 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2022-11-25T10:21:52+00:00" }, { "name": "symfony/config", - "version": "v6.1.3", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "a0645dc585d378b73c01115dd7ab9348f7d40c85" + "reference": "ebf27792246165a2a0b6b69ec9c620cac8c5a2f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/a0645dc585d378b73c01115dd7ab9348f7d40c85", - "reference": "a0645dc585d378b73c01115dd7ab9348f7d40c85", + "url": "https://api.github.com/repos/symfony/config/zipball/ebf27792246165a2a0b6b69ec9c620cac8c5a2f0", + "reference": "ebf27792246165a2a0b6b69ec9c620cac8c5a2f0", "shasum": "" }, "require": { @@ -2337,7 +2338,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v6.1.3" + "source": "https://github.com/symfony/config/tree/v6.2.0" }, "funding": [ { @@ -2353,20 +2354,20 @@ "type": "tidelift" } ], - "time": "2022-07-20T15:00:40+00:00" + "time": "2022-11-02T09:08:04+00:00" }, { "name": "symfony/console", - "version": "v6.1.4", + "version": "v6.2.3", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "7fccea8728aa2d431a6725b02b3ce759049fc84d" + "reference": "0f579613e771dba2dbb8211c382342a641f5da06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/7fccea8728aa2d431a6725b02b3ce759049fc84d", - "reference": "7fccea8728aa2d431a6725b02b3ce759049fc84d", + "url": "https://api.github.com/repos/symfony/console/zipball/0f579613e771dba2dbb8211c382342a641f5da06", + "reference": "0f579613e771dba2dbb8211c382342a641f5da06", "shasum": "" }, "require": { @@ -2433,7 +2434,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.1.4" + "source": "https://github.com/symfony/console/tree/v6.2.3" }, "funding": [ { @@ -2449,20 +2450,20 @@ "type": "tidelift" } ], - "time": "2022-08-26T10:32:31+00:00" + "time": "2022-12-28T14:26:22+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.1.1", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918" + "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", - "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/1ee04c65529dea5d8744774d474e7cbd2f1206d3", + "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3", "shasum": "" }, "require": { @@ -2471,7 +2472,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.1-dev" + "dev-main": "3.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -2500,7 +2501,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.1.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.0" }, "funding": [ { @@ -2516,20 +2517,20 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2022-11-25T10:21:52+00:00" }, { "name": "symfony/filesystem", - "version": "v6.1.4", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "3f39c04d2630c34019907b02f85672dac99f8659" + "reference": "50b2523c874605cf3d4acf7a9e2b30b6a440a016" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/3f39c04d2630c34019907b02f85672dac99f8659", - "reference": "3f39c04d2630c34019907b02f85672dac99f8659", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/50b2523c874605cf3d4acf7a9e2b30b6a440a016", + "reference": "50b2523c874605cf3d4acf7a9e2b30b6a440a016", "shasum": "" }, "require": { @@ -2563,7 +2564,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.1.4" + "source": "https://github.com/symfony/filesystem/tree/v6.2.0" }, "funding": [ { @@ -2579,20 +2580,20 @@ "type": "tidelift" } ], - "time": "2022-08-02T16:17:38+00:00" + "time": "2022-11-20T13:01:27+00:00" }, { "name": "symfony/messenger", - "version": "v6.1.3", + "version": "v6.2.2", "source": { "type": "git", "url": "https://github.com/symfony/messenger.git", - "reference": "8d36b2447ed50a92a21f031bc6d3a3fefbe73bf3" + "reference": "b8621076ecbef9ef7d53e1a92b1da3fdad3cc3f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/messenger/zipball/8d36b2447ed50a92a21f031bc6d3a3fefbe73bf3", - "reference": "8d36b2447ed50a92a21f031bc6d3a3fefbe73bf3", + "url": "https://api.github.com/repos/symfony/messenger/zipball/b8621076ecbef9ef7d53e1a92b1da3fdad3cc3f8", + "reference": "b8621076ecbef9ef7d53e1a92b1da3fdad3cc3f8", "shasum": "" }, "require": { @@ -2614,6 +2615,7 @@ "symfony/http-kernel": "^5.4|^6.0", "symfony/process": "^5.4|^6.0", "symfony/property-access": "^5.4|^6.0", + "symfony/rate-limiter": "^5.4|^6.0", "symfony/routing": "^5.4|^6.0", "symfony/serializer": "^5.4|^6.0", "symfony/service-contracts": "^1.1|^2|^3", @@ -2649,7 +2651,7 @@ "description": "Helps applications send and receive messages to/from other applications or via message queues", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/messenger/tree/v6.1.3" + "source": "https://github.com/symfony/messenger/tree/v6.2.2" }, "funding": [ { @@ -2665,20 +2667,20 @@ "type": "tidelift" } ], - "time": "2022-07-20T13:46:29+00:00" + "time": "2022-12-14T16:11:27+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", "shasum": "" }, "require": { @@ -2693,7 +2695,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2731,7 +2733,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" }, "funding": [ { @@ -2747,20 +2749,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "433d05519ce6990bf3530fba6957499d327395c2" + "reference": "511a08c03c1960e08a883f4cffcacd219b758354" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2", - "reference": "433d05519ce6990bf3530fba6957499d327395c2", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", + "reference": "511a08c03c1960e08a883f4cffcacd219b758354", "shasum": "" }, "require": { @@ -2772,7 +2774,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2812,7 +2814,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" }, "funding": [ { @@ -2828,20 +2830,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd" + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", "shasum": "" }, "require": { @@ -2853,7 +2855,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2896,7 +2898,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" }, "funding": [ { @@ -2912,20 +2914,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", "shasum": "" }, "require": { @@ -2940,7 +2942,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2979,7 +2981,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" }, "funding": [ { @@ -2995,20 +2997,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", "shasum": "" }, "require": { @@ -3017,7 +3019,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3062,7 +3064,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" }, "funding": [ { @@ -3078,24 +3080,25 @@ "type": "tidelift" } ], - "time": "2022-05-10T07:21:04+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/property-access", - "version": "v6.1.3", + "version": "v6.2.3", "source": { "type": "git", "url": "https://github.com/symfony/property-access.git", - "reference": "25108ee9b62d6ef0815007d9c7cf6a7ba40bb7c5" + "reference": "9c267d87dd665d5d33e897290bbb9f64ae905b94" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-access/zipball/25108ee9b62d6ef0815007d9c7cf6a7ba40bb7c5", - "reference": "25108ee9b62d6ef0815007d9c7cf6a7ba40bb7c5", + "url": "https://api.github.com/repos/symfony/property-access/zipball/9c267d87dd665d5d33e897290bbb9f64ae905b94", + "reference": "9c267d87dd665d5d33e897290bbb9f64ae905b94", "shasum": "" }, "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/property-info": "^5.4|^6.0" }, "require-dev": { @@ -3141,7 +3144,7 @@ "reflection" ], "support": { - "source": "https://github.com/symfony/property-access/tree/v6.1.3" + "source": "https://github.com/symfony/property-access/tree/v6.2.3" }, "funding": [ { @@ -3157,20 +3160,20 @@ "type": "tidelift" } ], - "time": "2022-06-27T17:24:16+00:00" + "time": "2022-12-23T08:18:26+00:00" }, { "name": "symfony/property-info", - "version": "v6.1.3", + "version": "v6.2.3", "source": { "type": "git", "url": "https://github.com/symfony/property-info.git", - "reference": "2fc363ed2f2b5d3b231ed0824e066d140d3fd1d8" + "reference": "b4cbbbcc8679460cfeb1d5bdcb8127a2e85c376c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-info/zipball/2fc363ed2f2b5d3b231ed0824e066d140d3fd1d8", - "reference": "2fc363ed2f2b5d3b231ed0824e066d140d3fd1d8", + "url": "https://api.github.com/repos/symfony/property-info/zipball/b4cbbbcc8679460cfeb1d5bdcb8127a2e85c376c", + "reference": "b4cbbbcc8679460cfeb1d5bdcb8127a2e85c376c", "shasum": "" }, "require": { @@ -3183,7 +3186,7 @@ "symfony/dependency-injection": "<5.4" }, "require-dev": { - "doctrine/annotations": "^1.10.4", + "doctrine/annotations": "^1.10.4|^2", "phpdocumentor/reflection-docblock": "^5.2", "phpstan/phpdoc-parser": "^1.0", "symfony/cache": "^5.4|^6.0", @@ -3230,7 +3233,7 @@ "validator" ], "support": { - "source": "https://github.com/symfony/property-info/tree/v6.1.3" + "source": "https://github.com/symfony/property-info/tree/v6.2.3" }, "funding": [ { @@ -3246,20 +3249,20 @@ "type": "tidelift" } ], - "time": "2022-07-19T08:34:05+00:00" + "time": "2022-12-20T16:41:15+00:00" }, { "name": "symfony/serializer", - "version": "v6.1.4", + "version": "v6.2.3", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "03e5987dd9bb98038c60c7af3e58500c81c4aec1" + "reference": "9cb1e8fd22f9ff40b9580ae822f44c13317ddb20" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/03e5987dd9bb98038c60c7af3e58500c81c4aec1", - "reference": "03e5987dd9bb98038c60c7af3e58500c81c4aec1", + "url": "https://api.github.com/repos/symfony/serializer/zipball/9cb1e8fd22f9ff40b9580ae822f44c13317ddb20", + "reference": "9cb1e8fd22f9ff40b9580ae822f44c13317ddb20", "shasum": "" }, "require": { @@ -3269,7 +3272,7 @@ "conflict": { "doctrine/annotations": "<1.12", "phpdocumentor/reflection-docblock": "<3.2.2", - "phpdocumentor/type-resolver": "<1.4.0", + "phpdocumentor/type-resolver": "<1.4.0|>=1.7.0", "symfony/dependency-injection": "<5.4", "symfony/property-access": "<5.4", "symfony/property-info": "<5.4", @@ -3277,7 +3280,7 @@ "symfony/yaml": "<5.4" }, "require-dev": { - "doctrine/annotations": "^1.12", + "doctrine/annotations": "^1.12|^2", "phpdocumentor/reflection-docblock": "^3.2|^4.0|^5.0", "symfony/cache": "^5.4|^6.0", "symfony/config": "^5.4|^6.0", @@ -3331,7 +3334,7 @@ "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/serializer/tree/v6.1.4" + "source": "https://github.com/symfony/serializer/tree/v6.2.3" }, "funding": [ { @@ -3347,7 +3350,7 @@ "type": "tidelift" } ], - "time": "2022-08-26T10:32:31+00:00" + "time": "2022-12-20T16:41:15+00:00" }, { "name": "symfony/service-contracts", @@ -3434,16 +3437,16 @@ }, { "name": "symfony/string", - "version": "v6.1.4", + "version": "v6.2.2", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "290972cad7b364e3befaa74ba0ec729800fb161c" + "reference": "863219fd713fa41cbcd285a79723f94672faff4d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/290972cad7b364e3befaa74ba0ec729800fb161c", - "reference": "290972cad7b364e3befaa74ba0ec729800fb161c", + "url": "https://api.github.com/repos/symfony/string/zipball/863219fd713fa41cbcd285a79723f94672faff4d", + "reference": "863219fd713fa41cbcd285a79723f94672faff4d", "shasum": "" }, "require": { @@ -3459,6 +3462,7 @@ "require-dev": { "symfony/error-handler": "^5.4|^6.0", "symfony/http-client": "^5.4|^6.0", + "symfony/intl": "^6.2", "symfony/translation-contracts": "^2.0|^3.0", "symfony/var-exporter": "^5.4|^6.0" }, @@ -3499,7 +3503,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.1.4" + "source": "https://github.com/symfony/string/tree/v6.2.2" }, "funding": [ { @@ -3515,20 +3519,20 @@ "type": "tidelift" } ], - "time": "2022-08-12T18:05:43+00:00" + "time": "2022-12-14T16:11:27+00:00" }, { "name": "symfony/translation", - "version": "v6.1.4", + "version": "v6.2.3", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "45d0f5bb8df7255651ca91c122fab604e776af03" + "reference": "a2a15404ef4c15d92c205718eb828b225a144379" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/45d0f5bb8df7255651ca91c122fab604e776af03", - "reference": "45d0f5bb8df7255651ca91c122fab604e776af03", + "url": "https://api.github.com/repos/symfony/translation/zipball/a2a15404ef4c15d92c205718eb828b225a144379", + "reference": "a2a15404ef4c15d92c205718eb828b225a144379", "shasum": "" }, "require": { @@ -3548,6 +3552,7 @@ "symfony/translation-implementation": "2.3|3.0" }, "require-dev": { + "nikic/php-parser": "^4.13", "psr/log": "^1|^2|^3", "symfony/config": "^5.4|^6.0", "symfony/console": "^5.4|^6.0", @@ -3562,6 +3567,7 @@ "symfony/yaml": "^5.4|^6.0" }, "suggest": { + "nikic/php-parser": "To use PhpAstExtractor", "psr/log-implementation": "To use logging capability in translator", "symfony/config": "", "symfony/yaml": "" @@ -3595,7 +3601,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.1.4" + "source": "https://github.com/symfony/translation/tree/v6.2.3" }, "funding": [ { @@ -3611,20 +3617,20 @@ "type": "tidelift" } ], - "time": "2022-08-02T16:17:38+00:00" + "time": "2022-12-23T14:11:11+00:00" }, { "name": "symfony/translation-contracts", - "version": "v3.1.1", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "606be0f48e05116baef052f7f3abdb345c8e02cc" + "reference": "68cce71402305a015f8c1589bfada1280dc64fe7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/606be0f48e05116baef052f7f3abdb345c8e02cc", - "reference": "606be0f48e05116baef052f7f3abdb345c8e02cc", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/68cce71402305a015f8c1589bfada1280dc64fe7", + "reference": "68cce71402305a015f8c1589bfada1280dc64fe7", "shasum": "" }, "require": { @@ -3636,7 +3642,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.1-dev" + "dev-main": "3.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -3676,7 +3682,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v3.1.1" + "source": "https://github.com/symfony/translation-contracts/tree/v3.2.0" }, "funding": [ { @@ -3692,20 +3698,20 @@ "type": "tidelift" } ], - "time": "2022-06-27T17:24:16+00:00" + "time": "2022-11-25T10:21:52+00:00" }, { "name": "symfony/var-exporter", - "version": "v6.1.3", + "version": "v6.2.3", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "b49350f45cebbba6e5286485264b912f2bcfc9ef" + "reference": "d055d12b20b42e407e607460e7552a1fe6d27f08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/b49350f45cebbba6e5286485264b912f2bcfc9ef", - "reference": "b49350f45cebbba6e5286485264b912f2bcfc9ef", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/d055d12b20b42e407e607460e7552a1fe6d27f08", + "reference": "d055d12b20b42e407e607460e7552a1fe6d27f08", "shasum": "" }, "require": { @@ -3745,10 +3751,12 @@ "export", "hydrate", "instantiate", + "lazy loading", + "proxy", "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v6.1.3" + "source": "https://github.com/symfony/var-exporter/tree/v6.2.3" }, "funding": [ { @@ -3764,20 +3772,20 @@ "type": "tidelift" } ], - "time": "2022-07-04T16:01:56+00:00" + "time": "2022-12-22T17:55:15+00:00" }, { "name": "symfony/yaml", - "version": "v6.1.4", + "version": "v6.2.2", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "86ee4d8fa594ed45e40d86eedfda1bcb66c8d919" + "reference": "6ed8243aa5f2cb5a57009f826b5e7fb3c4200cf3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/86ee4d8fa594ed45e40d86eedfda1bcb66c8d919", - "reference": "86ee4d8fa594ed45e40d86eedfda1bcb66c8d919", + "url": "https://api.github.com/repos/symfony/yaml/zipball/6ed8243aa5f2cb5a57009f826b5e7fb3c4200cf3", + "reference": "6ed8243aa5f2cb5a57009f826b5e7fb3c4200cf3", "shasum": "" }, "require": { @@ -3822,7 +3830,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.1.4" + "source": "https://github.com/symfony/yaml/tree/v6.2.2" }, "funding": [ { @@ -3838,7 +3846,7 @@ "type": "tidelift" } ], - "time": "2022-08-02T16:17:38+00:00" + "time": "2022-12-14T16:11:27+00:00" }, { "name": "voku/portable-ascii", @@ -4027,16 +4035,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.235.0", + "version": "3.257.1", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "03294ecd13463d4ac46ac866ed918b4aad186bd4" + "reference": "a46e5cd59a411a5c929f030736738e4d81d52c62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/03294ecd13463d4ac46ac866ed918b4aad186bd4", - "reference": "03294ecd13463d4ac46ac866ed918b4aad186bd4", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/a46e5cd59a411a5c929f030736738e4d81d52c62", + "reference": "a46e5cd59a411a5c929f030736738e4d81d52c62", "shasum": "" }, "require": { @@ -4055,6 +4063,7 @@ "aws/aws-php-sns-message-validator": "~1.0", "behat/behat": "~3.0", "composer/composer": "^1.10.22", + "dms/phpunit-arraysubset-asserts": "^0.4.0", "doctrine/cache": "~1.4", "ext-dom": "*", "ext-openssl": "*", @@ -4062,10 +4071,11 @@ "ext-sockets": "*", "nette/neon": "^2.3", "paragonie/random_compat": ">= 2", - "phpunit/phpunit": "^4.8.35 || ^5.6.3", + "phpunit/phpunit": "^4.8.35 || ^5.6.3 || ^9.5", "psr/cache": "^1.0", "psr/simple-cache": "^1.0", - "sebastian/comparator": "^1.2.3" + "sebastian/comparator": "^1.2.3 || ^4.0", + "yoast/phpunit-polyfills": "^1.0" }, "suggest": { "aws/aws-php-sns-message-validator": "To validate incoming SNS notifications", @@ -4113,22 +4123,22 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.235.0" + "source": "https://github.com/aws/aws-sdk-php/tree/3.257.1" }, - "time": "2022-09-01T18:19:51+00:00" + "time": "2023-01-13T19:29:27+00:00" }, { "name": "composer/pcre", - "version": "3.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd" + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/e300eb6c535192decd27a85bc72a9290f0d6b3bd", - "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd", + "url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", "shasum": "" }, "require": { @@ -4170,7 +4180,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.0.0" + "source": "https://github.com/composer/pcre/tree/3.1.0" }, "funding": [ { @@ -4186,7 +4196,7 @@ "type": "tidelift" } ], - "time": "2022-02-25T20:21:48+00:00" + "time": "2022-11-17T09:50:14+00:00" }, { "name": "composer/semver", @@ -4337,32 +4347,35 @@ }, { "name": "doctrine/annotations", - "version": "1.13.3", + "version": "1.14.2", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "648b0343343565c4a056bfc8392201385e8d89f0" + "reference": "ad785217c1e9555a7d6c6c8c9f406395a5e2882b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/648b0343343565c4a056bfc8392201385e8d89f0", - "reference": "648b0343343565c4a056bfc8392201385e8d89f0", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/ad785217c1e9555a7d6c6c8c9f406395a5e2882b", + "reference": "ad785217c1e9555a7d6c6c8c9f406395a5e2882b", "shasum": "" }, "require": { - "doctrine/lexer": "1.*", + "doctrine/lexer": "^1 || ^2", "ext-tokenizer": "*", "php": "^7.1 || ^8.0", "psr/cache": "^1 || ^2 || ^3" }, "require-dev": { "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^1.4.10 || ^1.8.0", - "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", - "symfony/cache": "^4.4 || ^5.2", + "doctrine/coding-standard": "^9 || ^10", + "phpstan/phpstan": "~1.4.10 || ^1.8.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "symfony/cache": "^4.4 || ^5.4 || ^6", "vimeo/psalm": "^4.10" }, + "suggest": { + "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" + }, "type": "library", "autoload": { "psr-4": { @@ -4404,36 +4417,79 @@ ], "support": { "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.13.3" + "source": "https://github.com/doctrine/annotations/tree/1.14.2" }, - "time": "2022-07-02T10:48:51+00:00" + "time": "2022-12-15T06:48:22+00:00" + }, + { + "name": "doctrine/deprecations", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "shasum": "" + }, + "require": { + "php": "^7.1|^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "phpunit/phpunit": "^7.5|^8.5|^9.5", + "psr/log": "^1|^2|^3" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/v1.0.0" + }, + "time": "2022-05-02T15:47:09+00:00" }, { "name": "doctrine/instantiator", - "version": "1.4.1", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", + "doctrine/coding-standard": "^9 || ^11", "ext-pdo": "*", "ext-phar": "*", "phpbench/phpbench": "^0.16 || ^1", "phpstan/phpstan": "^1.4", "phpstan/phpstan-phpunit": "^1", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" + "vimeo/psalm": "^4.30 || ^5.4" }, "type": "library", "autoload": { @@ -4460,7 +4516,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" }, "funding": [ { @@ -4476,35 +4532,37 @@ "type": "tidelift" } ], - "time": "2022-03-03T08:28:38+00:00" + "time": "2022-12-30T00:15:36+00:00" }, { "name": "doctrine/lexer", - "version": "1.2.3", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229" + "reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/39ab8fcf5a51ce4b85ca97c7a7d033eb12831124", + "reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124", "shasum": "" }, "require": { + "doctrine/deprecations": "^1.0", "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9.0", + "doctrine/coding-standard": "^9 || ^10", "phpstan/phpstan": "^1.3", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.11" + "psalm/plugin-phpunit": "^0.18.3", + "vimeo/psalm": "^4.11 || ^5.0" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + "Doctrine\\Common\\Lexer\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -4536,7 +4594,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.2.3" + "source": "https://github.com/doctrine/lexer/tree/2.1.0" }, "funding": [ { @@ -4552,7 +4610,7 @@ "type": "tidelift" } ], - "time": "2022-02-28T11:07:21+00:00" + "time": "2022-12-14T08:49:07+00:00" }, { "name": "fig/http-message-util", @@ -4612,16 +4670,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.11.0", + "version": "v3.13.2", "source": { "type": "git", - "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "7dcdea3f2f5f473464e835be9be55283ff8cfdc3" + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "3952f08a81bd3b1b15e11c3de0b6bf037faa8496" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/7dcdea3f2f5f473464e835be9be55283ff8cfdc3", - "reference": "7dcdea3f2f5f473464e835be9be55283ff8cfdc3", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/3952f08a81bd3b1b15e11c3de0b6bf037faa8496", + "reference": "3952f08a81bd3b1b15e11c3de0b6bf037faa8496", "shasum": "" }, "require": { @@ -4645,7 +4703,7 @@ }, "require-dev": { "justinrainbow/json-schema": "^5.2", - "keradus/cli-executor": "^1.5", + "keradus/cli-executor": "^2.0", "mikey179/vfsstream": "^1.6.10", "php-coveralls/php-coveralls": "^2.5.2", "php-cs-fixer/accessible-object": "^1.1", @@ -4654,8 +4712,8 @@ "phpspec/prophecy": "^1.15", "phpspec/prophecy-phpunit": "^2.0", "phpunit/phpunit": "^9.5", - "phpunitgoodpractices/polyfill": "^1.5", - "phpunitgoodpractices/traits": "^1.9.1", + "phpunitgoodpractices/polyfill": "^1.6", + "phpunitgoodpractices/traits": "^1.9.2", "symfony/phpunit-bridge": "^6.0", "symfony/yaml": "^5.4 || ^6.0" }, @@ -4688,8 +4746,8 @@ ], "description": "A tool to automatically fix PHP code style", "support": { - "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.11.0" + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.13.2" }, "funding": [ { @@ -4697,7 +4755,7 @@ "type": "github" } ], - "time": "2022-09-01T18:24:51+00:00" + "time": "2023-01-02T23:53:50+00:00" }, { "name": "guzzlehttp/guzzle", @@ -4913,16 +4971,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.4.1", + "version": "2.4.3", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "69568e4293f4fa993f3b0e51c9723e1e17c41379" + "reference": "67c26b443f348a51926030c83481b85718457d3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/69568e4293f4fa993f3b0e51c9723e1e17c41379", - "reference": "69568e4293f4fa993f3b0e51c9723e1e17c41379", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/67c26b443f348a51926030c83481b85718457d3d", + "reference": "67c26b443f348a51926030c83481b85718457d3d", "shasum": "" }, "require": { @@ -5012,7 +5070,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.4.1" + "source": "https://github.com/guzzle/psr7/tree/2.4.3" }, "funding": [ { @@ -5028,24 +5086,24 @@ "type": "tidelift" } ], - "time": "2022-08-28T14:45:39+00:00" + "time": "2022-10-26T14:07:24+00:00" }, { "name": "laminas/laminas-diactoros", - "version": "2.17.0", + "version": "2.24.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-diactoros.git", - "reference": "5b32597aa46b83c8b85bb1cf9a6ed4fe7dd980c5" + "reference": "6028af6c3b5ced4d063a680d2483cce67578b902" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/5b32597aa46b83c8b85bb1cf9a6ed4fe7dd980c5", - "reference": "5b32597aa46b83c8b85bb1cf9a6ed4fe7dd980c5", + "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/6028af6c3b5ced4d063a680d2483cce67578b902", + "reference": "6028af6c3b5ced4d063a680d2483cce67578b902", "shasum": "" }, "require": { - "php": "^7.4 || ~8.0.0 || ~8.1.0", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0", "psr/http-factory": "^1.0", "psr/http-message": "^1.0" }, @@ -5063,10 +5121,10 @@ "ext-libxml": "*", "http-interop/http-factory-tests": "^0.9.0", "laminas/laminas-coding-standard": "^2.4.0", - "php-http/psr7-integration-tests": "^1.1.1", - "phpunit/phpunit": "^9.5.23", - "psalm/plugin-phpunit": "^0.17.0", - "vimeo/psalm": "^4.24.0" + "php-http/psr7-integration-tests": "^1.2", + "phpunit/phpunit": "^9.5.27", + "psalm/plugin-phpunit": "^0.18.4", + "vimeo/psalm": "^5.4" }, "type": "library", "extra": { @@ -5125,234 +5183,25 @@ "type": "community_bridge" } ], - "time": "2022-08-30T17:01:46+00:00" - }, - { - "name": "laminas/laminas-escaper", - "version": "2.10.0", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-escaper.git", - "reference": "58af67282db37d24e584a837a94ee55b9c7552be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/58af67282db37d24e584a837a94ee55b9c7552be", - "reference": "58af67282db37d24e584a837a94ee55b9c7552be", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "ext-mbstring": "*", - "php": "^7.4 || ~8.0.0 || ~8.1.0" - }, - "conflict": { - "zendframework/zend-escaper": "*" - }, - "require-dev": { - "infection/infection": "^0.26.6", - "laminas/laminas-coding-standard": "~2.3.0", - "maglnet/composer-require-checker": "^3.8.0", - "phpunit/phpunit": "^9.5.18", - "psalm/plugin-phpunit": "^0.16.1", - "vimeo/psalm": "^4.22.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Laminas\\Escaper\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Securely and safely escape HTML, HTML attributes, JavaScript, CSS, and URLs", - "homepage": "https://laminas.dev", - "keywords": [ - "escaper", - "laminas" - ], - "support": { - "chat": "https://laminas.dev/chat", - "docs": "https://docs.laminas.dev/laminas-escaper/", - "forum": "https://discourse.laminas.dev", - "issues": "https://github.com/laminas/laminas-escaper/issues", - "rss": "https://github.com/laminas/laminas-escaper/releases.atom", - "source": "https://github.com/laminas/laminas-escaper" - }, - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], - "time": "2022-03-08T20:15:36+00:00" - }, - { - "name": "laminas/laminas-httphandlerrunner", - "version": "2.1.0", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-httphandlerrunner.git", - "reference": "4d337cde83e6b901a4443b0ab5c3b97cbaa46413" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-httphandlerrunner/zipball/4d337cde83e6b901a4443b0ab5c3b97cbaa46413", - "reference": "4d337cde83e6b901a4443b0ab5c3b97cbaa46413", - "shasum": "" - }, - "require": { - "php": "^7.3 || ~8.0.0 || ~8.1.0", - "psr/http-message": "^1.0", - "psr/http-message-implementation": "^1.0", - "psr/http-server-handler": "^1.0" - }, - "require-dev": { - "laminas/laminas-coding-standard": "~2.3.0", - "laminas/laminas-diactoros": "^2.8.0", - "phpunit/phpunit": "^9.5.9", - "psalm/plugin-phpunit": "^0.16.1", - "vimeo/psalm": "^4.10.0" - }, - "type": "library", - "extra": { - "laminas": { - "config-provider": "Laminas\\HttpHandlerRunner\\ConfigProvider" - } - }, - "autoload": { - "psr-4": { - "Laminas\\HttpHandlerRunner\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Execute PSR-15 RequestHandlerInterface instances and emit responses they generate.", - "homepage": "https://laminas.dev", - "keywords": [ - "components", - "laminas", - "mezzio", - "psr-15", - "psr-7" - ], - "support": { - "chat": "https://laminas.dev/chat", - "docs": "https://docs.laminas.dev/laminas-httphandlerrunner/", - "forum": "https://discourse.laminas.dev", - "issues": "https://github.com/laminas/laminas-httphandlerrunner/issues", - "rss": "https://github.com/laminas/laminas-httphandlerrunner/releases.atom", - "source": "https://github.com/laminas/laminas-httphandlerrunner" - }, - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], - "time": "2021-09-22T09:27:36+00:00" - }, - { - "name": "laminas/laminas-stratigility", - "version": "3.8.0", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-stratigility.git", - "reference": "aa47a70ed02cff6109bf09aa7c3e85c574033d81" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-stratigility/zipball/aa47a70ed02cff6109bf09aa7c3e85c574033d81", - "reference": "aa47a70ed02cff6109bf09aa7c3e85c574033d81", - "shasum": "" - }, - "require": { - "fig/http-message-util": "^1.1", - "laminas/laminas-escaper": "^2.10.0", - "php": "^7.4 || ~8.0.0 || ~8.1.0", - "psr/http-message": "^1.0", - "psr/http-server-middleware": "^1.0" - }, - "conflict": { - "laminas/laminas-diactoros": "<1.7.1", - "zendframework/zend-stratigility": "*" - }, - "require-dev": { - "laminas/laminas-coding-standard": "~2.3.0", - "laminas/laminas-diactoros": "^2.13.0", - "phpunit/phpunit": "^9.5.21", - "psalm/plugin-phpunit": "^0.17.0", - "vimeo/psalm": "^4.24.0" - }, - "suggest": { - "psr/http-message-implementation": "Please install a psr/http-message-implementation to consume Stratigility; e.g., laminas/laminas-diactoros" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions/double-pass-middleware.php", - "src/functions/host.php", - "src/functions/middleware.php", - "src/functions/path.php", - "src/functions/double-pass-middleware.legacy.php", - "src/functions/host.legacy.php", - "src/functions/middleware.legacy.php", - "src/functions/path.legacy.php" - ], - "psr-4": { - "Laminas\\Stratigility\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "PSR-7 middleware foundation for building and dispatching middleware pipelines", - "homepage": "https://laminas.dev", - "keywords": [ - "http", - "laminas", - "middleware", - "psr-15", - "psr-7" - ], - "support": { - "chat": "https://laminas.dev/chat", - "docs": "https://docs.laminas.dev/laminas-stratigility/", - "forum": "https://discourse.laminas.dev", - "issues": "https://github.com/laminas/laminas-stratigility/issues", - "rss": "https://github.com/laminas/laminas-stratigility/releases.atom", - "source": "https://github.com/laminas/laminas-stratigility" - }, - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], - "time": "2022-07-23T13:56:06+00:00" + "time": "2022-12-20T12:22:40+00:00" }, { "name": "league/flysystem-aws-s3-v3", - "version": "3.2.0", + "version": "3.12.1", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem-aws-s3-v3.git", - "reference": "257893ef7398b3c9255b26dff8b0118bb93fc5ff" + "reference": "ea100348d497585687e4ad487bf150b0d766b46d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/257893ef7398b3c9255b26dff8b0118bb93fc5ff", - "reference": "257893ef7398b3c9255b26dff8b0118bb93fc5ff", + "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/ea100348d497585687e4ad487bf150b0d766b46d", + "reference": "ea100348d497585687e4ad487bf150b0d766b46d", "shasum": "" }, "require": { - "aws/aws-sdk-php": "^3.132.4", - "league/flysystem": "^3.0.0", + "aws/aws-sdk-php": "^3.220.0", + "league/flysystem": "^3.10.0", "league/mime-type-detection": "^1.0.0", "php": "^8.0.2" }, @@ -5388,11 +5237,11 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem-aws-s3-v3/issues", - "source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/3.2.0" + "source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/3.12.1" }, "funding": [ { - "url": "https://offset.earth/frankdejonge", + "url": "https://ecologi.com/frankdejonge", "type": "custom" }, { @@ -5404,20 +5253,20 @@ "type": "tidelift" } ], - "time": "2022-07-26T07:22:40+00:00" + "time": "2023-01-06T15:19:01+00:00" }, { "name": "league/flysystem-ftp", - "version": "3.1.1", + "version": "3.10.3", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem-ftp.git", - "reference": "e59ae1b1370503a7925a75cc44f6f99cced1b2f0" + "reference": "475d526de342b4a166e64c11ccabbda027c9e716" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-ftp/zipball/e59ae1b1370503a7925a75cc44f6f99cced1b2f0", - "reference": "e59ae1b1370503a7925a75cc44f6f99cced1b2f0", + "url": "https://api.github.com/repos/thephpleague/flysystem-ftp/zipball/475d526de342b4a166e64c11ccabbda027c9e716", + "reference": "475d526de342b4a166e64c11ccabbda027c9e716", "shasum": "" }, "require": { @@ -5452,11 +5301,11 @@ "ftpd" ], "support": { - "source": "https://github.com/thephpleague/flysystem-ftp/tree/3.1.1" + "source": "https://github.com/thephpleague/flysystem-ftp/tree/3.10.3" }, "funding": [ { - "url": "https://offset.earth/frankdejonge", + "url": "https://ecologi.com/frankdejonge", "type": "custom" }, { @@ -5468,20 +5317,20 @@ "type": "tidelift" } ], - "time": "2022-07-13T10:31:43+00:00" + "time": "2022-10-26T18:15:09+00:00" }, { "name": "league/flysystem-memory", - "version": "3.1.1", + "version": "3.10.3", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem-memory.git", - "reference": "e3702cf8ac6bd3db868e5edca6e9ef58bb17d57f" + "reference": "5405162ac81f4de5aa5fa01aae7d07382b7c797b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-memory/zipball/e3702cf8ac6bd3db868e5edca6e9ef58bb17d57f", - "reference": "e3702cf8ac6bd3db868e5edca6e9ef58bb17d57f", + "url": "https://api.github.com/repos/thephpleague/flysystem-memory/zipball/5405162ac81f4de5aa5fa01aae7d07382b7c797b", + "reference": "5405162ac81f4de5aa5fa01aae7d07382b7c797b", "shasum": "" }, "require": { @@ -5515,11 +5364,11 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem-memory/issues", - "source": "https://github.com/thephpleague/flysystem-memory/tree/3.1.1" + "source": "https://github.com/thephpleague/flysystem-memory/tree/3.10.3" }, "funding": [ { - "url": "https://offset.earth/frankdejonge", + "url": "https://ecologi.com/frankdejonge", "type": "custom" }, { @@ -5531,7 +5380,7 @@ "type": "tidelift" } ], - "time": "2022-07-03T12:18:41+00:00" + "time": "2022-10-26T18:30:26+00:00" }, { "name": "league/openapi-psr7-validator", @@ -5596,37 +5445,38 @@ }, { "name": "league/uri", - "version": "6.7.1", + "version": "6.8.0", "source": { "type": "git", "url": "https://github.com/thephpleague/uri.git", - "reference": "2d7c87a0860f3126a39f44a8a9bf2fed402dcfea" + "reference": "a700b4656e4c54371b799ac61e300ab25a2d1d39" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/uri/zipball/2d7c87a0860f3126a39f44a8a9bf2fed402dcfea", - "reference": "2d7c87a0860f3126a39f44a8a9bf2fed402dcfea", + "url": "https://api.github.com/repos/thephpleague/uri/zipball/a700b4656e4c54371b799ac61e300ab25a2d1d39", + "reference": "a700b4656e4c54371b799ac61e300ab25a2d1d39", "shasum": "" }, "require": { "ext-json": "*", "league/uri-interfaces": "^2.3", - "php": "^7.4 || ^8.0", - "psr/http-message": "^1.0" + "php": "^8.1", + "psr/http-message": "^1.0.1" }, "conflict": { "league/uri-schemes": "^1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^v3.3.2", - "nyholm/psr7": "^1.5", - "php-http/psr7-integration-tests": "^1.1", - "phpstan/phpstan": "^1.2.0", + "friendsofphp/php-cs-fixer": "^v3.9.5", + "nyholm/psr7": "^1.5.1", + "php-http/psr7-integration-tests": "^1.1.1", + "phpbench/phpbench": "^1.2.6", + "phpstan/phpstan": "^1.8.5", "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1.0.0", - "phpstan/phpstan-strict-rules": "^1.1.0", - "phpunit/phpunit": "^9.5.10", - "psr/http-factory": "^1.0" + "phpstan/phpstan-phpunit": "^1.1.1", + "phpstan/phpstan-strict-rules": "^1.4.3", + "phpunit/phpunit": "^9.5.24", + "psr/http-factory": "^1.0.1" }, "suggest": { "ext-fileinfo": "Needed to create Data URI from a filepath", @@ -5683,7 +5533,7 @@ "docs": "https://uri.thephpleague.com", "forum": "https://thephpleague.slack.com", "issues": "https://github.com/thephpleague/uri/issues", - "source": "https://github.com/thephpleague/uri/tree/6.7.1" + "source": "https://github.com/thephpleague/uri/tree/6.8.0" }, "funding": [ { @@ -5691,7 +5541,7 @@ "type": "github" } ], - "time": "2022-06-29T09:48:18+00:00" + "time": "2022-09-13T19:58:47+00:00" }, { "name": "league/uri-interfaces", @@ -5764,132 +5614,23 @@ ], "time": "2021-06-28T04:27:21+00:00" }, - { - "name": "mezzio/mezzio", - "version": "3.11.0", - "source": { - "type": "git", - "url": "https://github.com/mezzio/mezzio.git", - "reference": "d5bf81f0caee6cf4b682a4bf1f8d693288bf217d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mezzio/mezzio/zipball/d5bf81f0caee6cf4b682a4bf1f8d693288bf217d", - "reference": "d5bf81f0caee6cf4b682a4bf1f8d693288bf217d", - "shasum": "" - }, - "require": { - "fig/http-message-util": "^1.1.5", - "laminas/laminas-httphandlerrunner": "^2.1", - "laminas/laminas-stratigility": "^3.5", - "mezzio/mezzio-router": "^3.7", - "mezzio/mezzio-template": "^2.2", - "php": "~7.4.0||~8.0.0||~8.1.0", - "psr/container": "^1.0||^2.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0.1", - "psr/http-server-middleware": "^1.0", - "webmozart/assert": "^1.10" - }, - "conflict": { - "container-interop/container-interop": "<1.2.0", - "filp/whoops": "<2.14.4", - "laminas/laminas-diactoros": "<1.7.1", - "laminas/laminas-http": "<2.15.0", - "laminas/laminas-router": "<3.5.0", - "laminas/laminas-stdlib": "<3.6.0", - "zendframework/zend-expressive": "*" - }, - "require-dev": { - "filp/whoops": "^2.14.4", - "laminas/laminas-coding-standard": "~2.3.0", - "laminas/laminas-diactoros": "^2.11.2", - "laminas/laminas-servicemanager": "^3.10", - "malukenho/docheader": "^0.1.8", - "mezzio/mezzio-aurarouter": "^3.3.0", - "mezzio/mezzio-fastroute": "^3.3.0", - "mezzio/mezzio-laminasrouter": "^3.1.0", - "mockery/mockery": "^1.4.4", - "phpunit/phpunit": "^9.5.10", - "psalm/plugin-phpunit": "^0.13", - "vimeo/psalm": "^4.13.1" - }, - "suggest": { - "filp/whoops": "^2.1 to use the Whoops error handler", - "laminas/laminas-auradi-config": "^2.0 to use Aura.Di dependency injection container", - "laminas/laminas-pimple-config": "^1.0 to use Pimple for dependency injection container", - "laminas/laminas-servicemanager": "^3.3 to use laminas-servicemanager for dependency injection", - "mezzio/mezzio-helpers": "^3.0 for its UrlHelper, ServerUrlHelper, and BodyParseMiddleware", - "mezzio/mezzio-tooling": "^1.0 for migration and development tools; require it with the --dev flag", - "psr/http-message-implementation": "Please install a psr/http-message-implementation to consume Mezzio; e.g., laminas/laminas-diactoros" - }, - "bin": [ - "bin/mezzio-tooling" - ], - "type": "library", - "extra": { - "laminas": { - "config-provider": "Mezzio\\ConfigProvider" - } - }, - "autoload": { - "files": [ - "src/constants.php", - "src/constants.legacy.php" - ], - "psr-4": { - "Mezzio\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "PSR-15 Middleware Microframework", - "homepage": "https://mezzio.dev", - "keywords": [ - "PSR-11", - "http", - "laminas", - "mezzio", - "middleware", - "psr", - "psr-15", - "psr-7" - ], - "support": { - "chat": "https://laminas.dev/chat", - "docs": "https://docs.mezzio.dev/mezzio/", - "forum": "https://discourse.laminas.dev", - "issues": "https://github.com/mezzio/mezzio/issues", - "rss": "https://github.com/mezzio/mezzio/releases.atom", - "source": "https://github.com/mezzio/mezzio" - }, - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], - "time": "2022-06-29T21:47:57+00:00" - }, { "name": "mezzio/mezzio-router", - "version": "3.8.0", + "version": "3.13.0", "source": { "type": "git", "url": "https://github.com/mezzio/mezzio-router.git", - "reference": "27075d3e9b407791abf7ba5e62954a59be4b18df" + "reference": "cb9e2476844074587e1ed849f53ef466a7e8d893" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mezzio/mezzio-router/zipball/27075d3e9b407791abf7ba5e62954a59be4b18df", - "reference": "27075d3e9b407791abf7ba5e62954a59be4b18df", + "url": "https://api.github.com/repos/mezzio/mezzio-router/zipball/cb9e2476844074587e1ed849f53ef466a7e8d893", + "reference": "cb9e2476844074587e1ed849f53ef466a7e8d893", "shasum": "" }, "require": { "fig/http-message-util": "^1.1.2", - "php": "^7.4 || ~8.0.0 || ~8.1.0", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0", "psr/container": "^1.0 || ^2.0", "psr/http-factory": "^1.0", "psr/http-message": "^1.0.1", @@ -5901,14 +5642,12 @@ "zendframework/zend-expressive-router": "*" }, "require-dev": { - "laminas/laminas-coding-standard": "~2.3.0", - "laminas/laminas-diactoros": "^2.6", - "laminas/laminas-stratigility": "^3.4", - "phpspec/prophecy": "^1.9", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5.11", - "psalm/plugin-phpunit": "^0.15.0", - "vimeo/psalm": "^4.17" + "laminas/laminas-coding-standard": "~2.5.0", + "laminas/laminas-diactoros": "^2.24", + "laminas/laminas-stratigility": "^3.9.0", + "phpunit/phpunit": "^9.5.27", + "psalm/plugin-phpunit": "^0.18.4", + "vimeo/psalm": "^5.4" }, "suggest": { "mezzio/mezzio-aurarouter": "^3.0 to use the Aura.Router routing adapter", @@ -5954,71 +5693,7 @@ "type": "community_bridge" } ], - "time": "2022-01-06T16:27:49+00:00" - }, - { - "name": "mezzio/mezzio-template", - "version": "2.4.0", - "source": { - "type": "git", - "url": "https://github.com/mezzio/mezzio-template.git", - "reference": "92ccf133fbe2b2f93c3e1f16de746ba96b52d67e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mezzio/mezzio-template/zipball/92ccf133fbe2b2f93c3e1f16de746ba96b52d67e", - "reference": "92ccf133fbe2b2f93c3e1f16de746ba96b52d67e", - "shasum": "" - }, - "require": { - "php": "^7.3 || ~8.0.0 || ~8.1.0" - }, - "conflict": { - "zendframework/zend-expressive-template": "*" - }, - "require-dev": { - "laminas/laminas-coding-standard": "~2.2.0", - "phpunit/phpunit": "^9.4", - "psalm/plugin-phpunit": "^0.16.1", - "vimeo/psalm": "^4.8" - }, - "suggest": { - "mezzio/mezzio-laminasviewrenderer": "^2.0 to use the laminas-view PhpRenderer template renderer", - "mezzio/mezzio-platesrenderer": "^2.0 to use the Plates template renderer", - "mezzio/mezzio-twigrenderer": "^2.0 to use the Twig template renderer" - }, - "type": "library", - "autoload": { - "psr-4": { - "Mezzio\\Template\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Template subcomponent for Mezzio", - "homepage": "https://mezzio.dev", - "keywords": [ - "laminas", - "mezzio", - "template" - ], - "support": { - "chat": "https://laminas.dev/chat", - "docs": "https://docs.mezzio.dev/mezzio/features/template/intro/", - "forum": "https://discourse.laminas.dev", - "issues": "https://github.com/mezzio/mezzio-template/issues", - "rss": "https://github.com/mezzio/mezzio-template/releases.atom", - "source": "https://github.com/mezzio/mezzio-template" - }, - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], - "time": "2021-12-03T09:40:16+00:00" + "time": "2023-01-15T08:25:11+00:00" }, { "name": "mtdowling/jmespath.php", @@ -6363,25 +6038,30 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.6.1", + "version": "1.6.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "77a32518733312af16a44300404e945338981de3" + "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", - "reference": "77a32518733312af16a44300404e945338981de3", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/48f445a408c131e38cab1c235aa6d2bb7a0bb20d", + "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", + "php": "^7.4 || ^8.0", "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { "ext-tokenizer": "*", - "psalm/phar": "^4.8" + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.13.9", + "vimeo/psalm": "^4.25" }, "type": "library", "extra": { @@ -6407,27 +6087,27 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.2" }, - "time": "2022-03-15T21:29:03+00:00" + "time": "2022-10-14T12:47:21+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.15.0", + "version": "v1.16.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" + "reference": "be8cac52a0827776ff9ccda8c381ac5b71aeb359" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be8cac52a0827776ff9ccda8c381ac5b71aeb359", + "reference": "be8cac52a0827776ff9ccda8c381ac5b71aeb359", "shasum": "" }, "require": { "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", + "php": "^7.2 || 8.0.* || 8.1.* || 8.2.*", "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0", "sebastian/recursion-context": "^3.0 || ^4.0" @@ -6474,9 +6154,9 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" + "source": "https://github.com/phpspec/prophecy/tree/v1.16.0" }, - "time": "2021-12-08T12:19:24+00:00" + "time": "2022-11-29T15:06:56+00:00" }, { "name": "phpspec/prophecy-phpunit", @@ -6532,16 +6212,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.17", + "version": "9.2.23", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8" + "reference": "9f1f0f9a2fbb680b26d1cf9b61b6eac43a6e4e9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/aa94dc41e8661fe90c7316849907cba3007b10d8", - "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/9f1f0f9a2fbb680b26d1cf9b61b6eac43a6e4e9c", + "reference": "9f1f0f9a2fbb680b26d1cf9b61b6eac43a6e4e9c", "shasum": "" }, "require": { @@ -6597,7 +6277,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.17" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.23" }, "funding": [ { @@ -6605,7 +6285,7 @@ "type": "github" } ], - "time": "2022-08-30T12:24:04+00:00" + "time": "2022-12-28T12:41:10+00:00" }, { "name": "phpunit/php-file-iterator", @@ -6850,20 +6530,20 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.24", + "version": "9.5.28", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "d0aa6097bef9fd42458a9b3c49da32c6ce6129c5" + "reference": "954ca3113a03bf780d22f07bf055d883ee04b65e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d0aa6097bef9fd42458a9b3c49da32c6ce6129c5", - "reference": "d0aa6097bef9fd42458a9b3c49da32c6ce6129c5", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/954ca3113a03bf780d22f07bf055d883ee04b65e", + "reference": "954ca3113a03bf780d22f07bf055d883ee04b65e", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1", + "doctrine/instantiator": "^1.3.1 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -6881,14 +6561,14 @@ "phpunit/php-timer": "^5.0.2", "sebastian/cli-parser": "^1.0.1", "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.5", + "sebastian/comparator": "^4.0.8", "sebastian/diff": "^4.0.3", "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.3", + "sebastian/exporter": "^4.0.5", "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.1", + "sebastian/type": "^3.2", "sebastian/version": "^3.0.2" }, "suggest": { @@ -6932,7 +6612,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.24" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.28" }, "funding": [ { @@ -6942,9 +6622,13 @@ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" } ], - "time": "2022-08-30T07:42:16+00:00" + "time": "2023-01-14T12:32:24+00:00" }, { "name": "psr/event-dispatcher", @@ -7496,16 +7180,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.6", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", "shasum": "" }, "require": { @@ -7558,7 +7242,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" }, "funding": [ { @@ -7566,7 +7250,7 @@ "type": "github" } ], - "time": "2020-10-26T15:49:45+00:00" + "time": "2022-09-14T12:41:17+00:00" }, { "name": "sebastian/complexity", @@ -7756,16 +7440,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", "shasum": "" }, "require": { @@ -7821,7 +7505,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" }, "funding": [ { @@ -7829,7 +7513,7 @@ "type": "github" } ], - "time": "2021-11-11T14:18:36+00:00" + "time": "2022-09-14T06:03:37+00:00" }, { "name": "sebastian/global-state", @@ -8184,16 +7868,16 @@ }, { "name": "sebastian/type", - "version": "3.1.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "fb44e1cc6e557418387ad815780360057e40753e" + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb44e1cc6e557418387ad815780360057e40753e", - "reference": "fb44e1cc6e557418387ad815780360057e40753e", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", "shasum": "" }, "require": { @@ -8205,7 +7889,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -8228,7 +7912,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.1.0" + "source": "https://github.com/sebastianbergmann/type/tree/3.2.0" }, "funding": [ { @@ -8236,7 +7920,7 @@ "type": "github" } ], - "time": "2022-08-29T06:55:37+00:00" + "time": "2022-09-12T14:47:03+00:00" }, { "name": "sebastian/version", @@ -8293,16 +7977,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v6.1.0", + "version": "v6.2.2", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "a0449a7ad7daa0f7c0acd508259f80544ab5a347" + "reference": "3ffeb31139b49bf6ef0bc09d1db95eac053388d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a0449a7ad7daa0f7c0acd508259f80544ab5a347", - "reference": "a0449a7ad7daa0f7c0acd508259f80544ab5a347", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/3ffeb31139b49bf6ef0bc09d1db95eac053388d1", + "reference": "3ffeb31139b49bf6ef0bc09d1db95eac053388d1", "shasum": "" }, "require": { @@ -8356,7 +8040,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.1.0" + "source": "https://github.com/symfony/event-dispatcher/tree/v6.2.2" }, "funding": [ { @@ -8372,20 +8056,20 @@ "type": "tidelift" } ], - "time": "2022-05-05T16:51:07+00:00" + "time": "2022-12-14T16:11:27+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.1.1", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "02ff5eea2f453731cfbc6bc215e456b781480448" + "reference": "0782b0b52a737a05b4383d0df35a474303cabdae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/02ff5eea2f453731cfbc6bc215e456b781480448", - "reference": "02ff5eea2f453731cfbc6bc215e456b781480448", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0782b0b52a737a05b4383d0df35a474303cabdae", + "reference": "0782b0b52a737a05b4383d0df35a474303cabdae", "shasum": "" }, "require": { @@ -8398,7 +8082,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.1-dev" + "dev-main": "3.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -8435,7 +8119,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.1.1" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.2.0" }, "funding": [ { @@ -8451,20 +8135,20 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2022-11-25T10:21:52+00:00" }, { "name": "symfony/finder", - "version": "v6.1.3", + "version": "v6.2.3", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "39696bff2c2970b3779a5cac7bf9f0b88fc2b709" + "reference": "81eefbddfde282ee33b437ba5e13d7753211ae8e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/39696bff2c2970b3779a5cac7bf9f0b88fc2b709", - "reference": "39696bff2c2970b3779a5cac7bf9f0b88fc2b709", + "url": "https://api.github.com/repos/symfony/finder/zipball/81eefbddfde282ee33b437ba5e13d7753211ae8e", + "reference": "81eefbddfde282ee33b437ba5e13d7753211ae8e", "shasum": "" }, "require": { @@ -8499,7 +8183,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.1.3" + "source": "https://github.com/symfony/finder/tree/v6.2.3" }, "funding": [ { @@ -8515,20 +8199,20 @@ "type": "tidelift" } ], - "time": "2022-07-29T07:42:06+00:00" + "time": "2022-12-22T17:55:15+00:00" }, { "name": "symfony/options-resolver", - "version": "v6.1.0", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "a3016f5442e28386ded73c43a32a5b68586dd1c4" + "reference": "d28f02acde71ff75e957082cd36e973df395f626" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/a3016f5442e28386ded73c43a32a5b68586dd1c4", - "reference": "a3016f5442e28386ded73c43a32a5b68586dd1c4", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/d28f02acde71ff75e957082cd36e973df395f626", + "reference": "d28f02acde71ff75e957082cd36e973df395f626", "shasum": "" }, "require": { @@ -8566,7 +8250,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.1.0" + "source": "https://github.com/symfony/options-resolver/tree/v6.2.0" }, "funding": [ { @@ -8582,20 +8266,20 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2022-11-02T09:08:04+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1" + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/13f6d1271c663dc5ae9fb843a8f16521db7687a1", - "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", "shasum": "" }, "require": { @@ -8604,7 +8288,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -8645,7 +8329,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.27.0" }, "funding": [ { @@ -8661,20 +8345,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/process", - "version": "v6.1.3", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "a6506e99cfad7059b1ab5cab395854a0a0c21292" + "reference": "ba6e55359f8f755fe996c58a81e00eaa67a35877" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/a6506e99cfad7059b1ab5cab395854a0a0c21292", - "reference": "a6506e99cfad7059b1ab5cab395854a0a0c21292", + "url": "https://api.github.com/repos/symfony/process/zipball/ba6e55359f8f755fe996c58a81e00eaa67a35877", + "reference": "ba6e55359f8f755fe996c58a81e00eaa67a35877", "shasum": "" }, "require": { @@ -8706,7 +8390,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.1.3" + "source": "https://github.com/symfony/process/tree/v6.2.0" }, "funding": [ { @@ -8722,20 +8406,20 @@ "type": "tidelift" } ], - "time": "2022-06-27T17:24:16+00:00" + "time": "2022-11-02T09:08:04+00:00" }, { "name": "symfony/redis-messenger", - "version": "v6.1.3", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/redis-messenger.git", - "reference": "4959dca3b135ce92224c415871966b22d164a1e1" + "reference": "59d2015719637e6cc52f38b757728697d7f42744" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/redis-messenger/zipball/4959dca3b135ce92224c415871966b22d164a1e1", - "reference": "4959dca3b135ce92224c415871966b22d164a1e1", + "url": "https://api.github.com/repos/symfony/redis-messenger/zipball/59d2015719637e6cc52f38b757728697d7f42744", + "reference": "59d2015719637e6cc52f38b757728697d7f42744", "shasum": "" }, "require": { @@ -8773,7 +8457,7 @@ "description": "Symfony Redis extension Messenger Bridge", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/redis-messenger/tree/v6.1.3" + "source": "https://github.com/symfony/redis-messenger/tree/v6.2.0" }, "funding": [ { @@ -8789,20 +8473,20 @@ "type": "tidelift" } ], - "time": "2022-07-20T15:00:40+00:00" + "time": "2022-10-28T16:24:13+00:00" }, { "name": "symfony/stopwatch", - "version": "v6.1.0", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "77dedae82ce2a26e2e9b481855473fc3b3e4e54d" + "reference": "266636bb8f3fbdccc302491df7b3a1b9a8c238a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/77dedae82ce2a26e2e9b481855473fc3b3e4e54d", - "reference": "77dedae82ce2a26e2e9b481855473fc3b3e4e54d", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/266636bb8f3fbdccc302491df7b3a1b9a8c238a7", + "reference": "266636bb8f3fbdccc302491df7b3a1b9a8c238a7", "shasum": "" }, "require": { @@ -8835,7 +8519,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.1.0" + "source": "https://github.com/symfony/stopwatch/tree/v6.2.0" }, "funding": [ { @@ -8851,20 +8535,20 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2022-09-28T16:00:52+00:00" }, { "name": "symfony/var-dumper", - "version": "v6.1.3", + "version": "v6.2.3", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "d5a5e44a2260c5eb5e746bf4f1fbd12ee6ceb427" + "reference": "fdbadd4803bc3c96ef89238c9c9e2ebe424ec2e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/d5a5e44a2260c5eb5e746bf4f1fbd12ee6ceb427", - "reference": "d5a5e44a2260c5eb5e746bf4f1fbd12ee6ceb427", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/fdbadd4803bc3c96ef89238c9c9e2ebe424ec2e0", + "reference": "fdbadd4803bc3c96ef89238c9c9e2ebe424ec2e0", "shasum": "" }, "require": { @@ -8923,7 +8607,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.1.3" + "source": "https://github.com/symfony/var-dumper/tree/v6.2.3" }, "funding": [ { @@ -8939,7 +8623,7 @@ "type": "tidelift" } ], - "time": "2022-07-20T13:46:29+00:00" + "time": "2022-12-22T17:55:15+00:00" }, { "name": "symplify/monorepo-builder", From 809e6fd279abc7fa31707cfaeccbdcea36bd22af Mon Sep 17 00:00:00 2001 From: Christophe G <1050197+cgaube@users.noreply.github.com> Date: Mon, 16 Jan 2023 10:57:18 -0800 Subject: [PATCH 16/20] chore(lint): disable global_namespece_import --- .php-cs-fixer.dist.php | 1 + 1 file changed, 1 insertion(+) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index dbe1613..341f2d5 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -17,6 +17,7 @@ 'phpdoc_align' => false, 'phpdoc_annotation_without_dot' => false, 'single_import_per_statement' => false, + 'global_namespace_import' => false, ]) ; From 199fb07dd8a975c2c32f970bcb923b7156f1c7a9 Mon Sep 17 00:00:00 2001 From: Christophe G <1050197+cgaube@users.noreply.github.com> Date: Mon, 16 Jan 2023 10:57:52 -0800 Subject: [PATCH 17/20] chore(lint): lint files --- packages/db/src/ConnectionManager.php | 2 -- packages/log/src/LoggerManager.php | 3 --- 2 files changed, 5 deletions(-) diff --git a/packages/db/src/ConnectionManager.php b/packages/db/src/ConnectionManager.php index 3ccf113..63c00a6 100755 --- a/packages/db/src/ConnectionManager.php +++ b/packages/db/src/ConnectionManager.php @@ -18,8 +18,6 @@ class ConnectionManager /** * ConnectionManager constructor. - * - * @param $connections */ public function __construct(array $connections) { diff --git a/packages/log/src/LoggerManager.php b/packages/log/src/LoggerManager.php index b8d23ba..53a55da 100755 --- a/packages/log/src/LoggerManager.php +++ b/packages/log/src/LoggerManager.php @@ -44,9 +44,6 @@ class LoggerManager extends AbstractManager /** * Shortcuts to the default logger functions. * - * @param $name - * @param $args - * * @return false|LoggerInterface */ public function __call($name, $args) From 59659c4e36429fad513530f83a6bf32684ad518c Mon Sep 17 00:00:00 2001 From: Christophe G <1050197+cgaube@users.noreply.github.com> Date: Mon, 16 Jan 2023 11:07:26 -0800 Subject: [PATCH 18/20] chore(lint): lint files --- packages/log/src/LoggerManager.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/log/src/LoggerManager.php b/packages/log/src/LoggerManager.php index 53a55da..1b470fc 100755 --- a/packages/log/src/LoggerManager.php +++ b/packages/log/src/LoggerManager.php @@ -44,6 +44,9 @@ class LoggerManager extends AbstractManager /** * Shortcuts to the default logger functions. * + * @param mixed $name + * @param mixed $args + * * @return false|LoggerInterface */ public function __call($name, $args) From ded289aadb2daa4473ad415e7413109cc35ab442 Mon Sep 17 00:00:00 2001 From: Christophe G <1050197+cgaube@users.noreply.github.com> Date: Mon, 3 Jul 2023 10:41:51 -0700 Subject: [PATCH 19/20] lint files --- .../cache/src/Factory/MemcachedAdapterFactory.php | 3 --- packages/cache/src/Factory/RedisAdapterFactory.php | 3 --- packages/console/tests/Command.php | 3 --- .../db-eloquent/src/Serializer/ModelNormalizer.php | 11 ----------- packages/db/src/Migration/PhinxApplication.php | 3 --- packages/filesystem/src/DiskManager.php | 3 --- .../filesystem/src/Factory/DiskAbstractFactory.php | 3 --- .../filesystem/src/Factory/DiskManagerFactory.php | 3 --- .../filesystem/src/Factory/FileManagerFactory.php | 3 --- packages/filesystem/src/Factory/S3AdapterFactory.php | 3 --- packages/messenger/src/Message/QueueableTrait.php | 6 ------ .../Queue/Factory/SymfonyTransportAbstractFactory.php | 3 --- packages/messenger/src/Queue/QueueManagerFactory.php | 3 --- .../src/Serializer/Normalizer/CarbonDenormalizer.php | 8 -------- packages/service-manager/src/AbstractManager.php | 3 --- .../src/Factory/ResolverAbstractFactory.php | 2 -- packages/service-manager/src/Resolver.php | 4 ++-- tests/Feature/Console/TestCommand.php | 3 --- 18 files changed, 2 insertions(+), 68 deletions(-) diff --git a/packages/cache/src/Factory/MemcachedAdapterFactory.php b/packages/cache/src/Factory/MemcachedAdapterFactory.php index 4733ee3..20fe5d4 100755 --- a/packages/cache/src/Factory/MemcachedAdapterFactory.php +++ b/packages/cache/src/Factory/MemcachedAdapterFactory.php @@ -8,9 +8,6 @@ class MemcachedAdapterFactory extends ResolverAbstractFactory { - /** - * {@inheritdoc} - */ public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { [$servers, $memCachedOptions] = $this->getConnectionOptions($options); diff --git a/packages/cache/src/Factory/RedisAdapterFactory.php b/packages/cache/src/Factory/RedisAdapterFactory.php index 8ee63eb..0aff101 100755 --- a/packages/cache/src/Factory/RedisAdapterFactory.php +++ b/packages/cache/src/Factory/RedisAdapterFactory.php @@ -8,9 +8,6 @@ class RedisAdapterFactory extends ResolverAbstractFactory { - /** - * {@inheritdoc} - */ public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { // Create RedisClient Client. diff --git a/packages/console/tests/Command.php b/packages/console/tests/Command.php index 0a6653c..144532a 100755 --- a/packages/console/tests/Command.php +++ b/packages/console/tests/Command.php @@ -10,9 +10,6 @@ class Command extends SymfonyCommand { protected static $defaultName = 'testCommand'; - /** - * {@inheritdoc} - */ public function execute(InputInterface $input, OutputInterface $output) { return 0; diff --git a/packages/db-eloquent/src/Serializer/ModelNormalizer.php b/packages/db-eloquent/src/Serializer/ModelNormalizer.php index 6a6fd4a..e713188 100755 --- a/packages/db-eloquent/src/Serializer/ModelNormalizer.php +++ b/packages/db-eloquent/src/Serializer/ModelNormalizer.php @@ -12,25 +12,16 @@ class ModelNormalizer implements NormalizerInterface, DenormalizerInterface, CacheableSupportsMethodInterface { - /** - * {@inheritdoc} - */ public function hasCacheableSupportsMethod(): bool { return __CLASS__ === static::class; } - /** - * {@inheritdoc} - */ public function supportsNormalization($data, string $format = null) { return $data instanceof Model; } - /** - * {@inheritdoc} - */ public function supportsDenormalization($data, string $type, string $format = null) { return is_a($type, Model::class, true); @@ -62,8 +53,6 @@ public function denormalize($data, string $type, string $format = null, array $c } /** - * {@inheritdoc} - * * @throws InvalidArgumentException */ public function normalize($object, string $format = null, array $context = []) diff --git a/packages/db/src/Migration/PhinxApplication.php b/packages/db/src/Migration/PhinxApplication.php index 8d993b5..6150f24 100755 --- a/packages/db/src/Migration/PhinxApplication.php +++ b/packages/db/src/Migration/PhinxApplication.php @@ -25,9 +25,6 @@ public function __construct(Config $config) $this->find('test')->setHidden(true); } - /** - * {@inheritdoc} - */ public function find($name) { $command = parent::find($name); diff --git a/packages/filesystem/src/DiskManager.php b/packages/filesystem/src/DiskManager.php index 39965f2..d150724 100755 --- a/packages/filesystem/src/DiskManager.php +++ b/packages/filesystem/src/DiskManager.php @@ -52,9 +52,6 @@ public function cloud(): FilesystemOperator return $this->cloudDisk ? $this->disk($this->cloudDisk) : $this->disk(); } - /** - * {@inheritdoc} - */ public function configure(array $config) { parent::configure($config); diff --git a/packages/filesystem/src/Factory/DiskAbstractFactory.php b/packages/filesystem/src/Factory/DiskAbstractFactory.php index 2b57704..5541eeb 100755 --- a/packages/filesystem/src/Factory/DiskAbstractFactory.php +++ b/packages/filesystem/src/Factory/DiskAbstractFactory.php @@ -10,9 +10,6 @@ class DiskAbstractFactory extends ResolverAbstractFactory { use GetConfigTrait; - /** - * {@inheritdoc} - */ public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { // Fetch config of the filesystem. diff --git a/packages/filesystem/src/Factory/DiskManagerFactory.php b/packages/filesystem/src/Factory/DiskManagerFactory.php index b2fa9d1..8bddef0 100755 --- a/packages/filesystem/src/Factory/DiskManagerFactory.php +++ b/packages/filesystem/src/Factory/DiskManagerFactory.php @@ -11,9 +11,6 @@ class DiskManagerFactory extends AbstractManagerFactory { protected $managerClass = DiskManager::class; - /** - * {@inheritdoc} - */ public function getManagerConfiguration(ContainerInterface $container): array { return $container->get('config')[ConfigProvider::CONFIG_KEY]['disks']; diff --git a/packages/filesystem/src/Factory/FileManagerFactory.php b/packages/filesystem/src/Factory/FileManagerFactory.php index ae44d74..75567d5 100755 --- a/packages/filesystem/src/Factory/FileManagerFactory.php +++ b/packages/filesystem/src/Factory/FileManagerFactory.php @@ -9,9 +9,6 @@ class FileManagerFactory implements FactoryInterface { - /** - * {@inheritdoc} - */ public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null) { $diskManager = $container->get(DiskManager::class); diff --git a/packages/filesystem/src/Factory/S3AdapterFactory.php b/packages/filesystem/src/Factory/S3AdapterFactory.php index aee9b9d..70a2f20 100644 --- a/packages/filesystem/src/Factory/S3AdapterFactory.php +++ b/packages/filesystem/src/Factory/S3AdapterFactory.php @@ -20,9 +20,6 @@ class S3AdapterFactory extends ResolverAbstractFactory 'use_path_style_endpoint', ]; - /** - * {@inheritdoc} - */ public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { // Fetch config of the filesystem. diff --git a/packages/messenger/src/Message/QueueableTrait.php b/packages/messenger/src/Message/QueueableTrait.php index 6c0ce08..6b5b241 100755 --- a/packages/messenger/src/Message/QueueableTrait.php +++ b/packages/messenger/src/Message/QueueableTrait.php @@ -9,9 +9,6 @@ trait QueueableTrait */ protected $queues; - /** - * {@inheritdoc} - */ public function getQueues(): ?array { return null !== $this->queues @@ -19,9 +16,6 @@ public function getQueues(): ?array : (array) ($this->queue ?? null); } - /** - * {@inheritdoc} - */ public function onQueue(...$queues): QueueableInterface { $queues = is_array($queues[0]) ? $queues[0] : $queues; diff --git a/packages/messenger/src/Queue/Factory/SymfonyTransportAbstractFactory.php b/packages/messenger/src/Queue/Factory/SymfonyTransportAbstractFactory.php index f2d1edc..7eac6ad 100644 --- a/packages/messenger/src/Queue/Factory/SymfonyTransportAbstractFactory.php +++ b/packages/messenger/src/Queue/Factory/SymfonyTransportAbstractFactory.php @@ -51,9 +51,6 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o return $factory->createTransport($dsn, $options, $serializer); } - /** - * {@inheritdoc} - */ public function canCreate(ContainerInterface $container, $requestedName) { // Always return true - we will use the options or name above to check if we can handle it. diff --git a/packages/messenger/src/Queue/QueueManagerFactory.php b/packages/messenger/src/Queue/QueueManagerFactory.php index 62569c3..4a61192 100755 --- a/packages/messenger/src/Queue/QueueManagerFactory.php +++ b/packages/messenger/src/Queue/QueueManagerFactory.php @@ -10,9 +10,6 @@ class QueueManagerFactory extends AbstractManagerFactory { protected $managerClass = QueueManager::class; - /** - * {@inheritdoc} - */ public function getManagerConfiguration(ContainerInterface $container): array { return $container->get('config')[ConfigProvider::KEY_MESSENGER][ConfigProvider::KEY_QUEUES]; diff --git a/packages/messenger/src/Serializer/Normalizer/CarbonDenormalizer.php b/packages/messenger/src/Serializer/Normalizer/CarbonDenormalizer.php index 16773eb..f22c917 100755 --- a/packages/messenger/src/Serializer/Normalizer/CarbonDenormalizer.php +++ b/packages/messenger/src/Serializer/Normalizer/CarbonDenormalizer.php @@ -15,8 +15,6 @@ class CarbonDenormalizer implements DenormalizerInterface, CacheableSupportsMeth ]; /** - * {@inheritdoc} - * * @throws NotNormalizableValueException */ public function denormalize($data, string $type, string $format = null, array $context = []) @@ -28,17 +26,11 @@ public function denormalize($data, string $type, string $format = null, array $c } } - /** - * {@inheritdoc} - */ public function supportsDenormalization($data, string $type, string $format = null) { return isset(self::$supportedTypes[$type]); } - /** - * {@inheritdoc} - */ public function hasCacheableSupportsMethod(): bool { return __CLASS__ === static::class; diff --git a/packages/service-manager/src/AbstractManager.php b/packages/service-manager/src/AbstractManager.php index 41af052..2b6eac1 100755 --- a/packages/service-manager/src/AbstractManager.php +++ b/packages/service-manager/src/AbstractManager.php @@ -38,9 +38,6 @@ abstract class AbstractManager extends LaminasPluginManager */ protected $pluginsOptions = []; - /** - * {@inheritdoc} - */ public function configure(array $config) { parent::configure($config); diff --git a/packages/service-manager/src/Factory/ResolverAbstractFactory.php b/packages/service-manager/src/Factory/ResolverAbstractFactory.php index 566bdde..23bb5d1 100755 --- a/packages/service-manager/src/Factory/ResolverAbstractFactory.php +++ b/packages/service-manager/src/Factory/ResolverAbstractFactory.php @@ -29,8 +29,6 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o } /** - * {@inheritdoc} - * * @return bool */ public function canCreate(ContainerInterface $container, $requestedName) diff --git a/packages/service-manager/src/Resolver.php b/packages/service-manager/src/Resolver.php index de2a160..3949a77 100755 --- a/packages/service-manager/src/Resolver.php +++ b/packages/service-manager/src/Resolver.php @@ -5,6 +5,7 @@ use AftDev\ServiceManager\Resolver\RuleBuilder; use Psr\Container\ContainerInterface; use ReflectionClass; +use ReflectionMethod; use ReflectionParameter; class Resolver @@ -118,8 +119,7 @@ protected function mapParameter(ReflectionParameter $parameter, array $parameter $types = $type ? ($type instanceof (\ReflectionUnionType::class) ? $type->getTypes() : [$type]) - : [] - ; + : []; foreach ($types as $type) { if ($type->isBuiltin()) { diff --git a/tests/Feature/Console/TestCommand.php b/tests/Feature/Console/TestCommand.php index f2ce32b..fa976e8 100755 --- a/tests/Feature/Console/TestCommand.php +++ b/tests/Feature/Console/TestCommand.php @@ -12,9 +12,6 @@ class TestCommand extends SymfonyCommand { protected static $defaultName = 'test:command'; - /** - * {@inheritdoc} - */ public function execute(InputInterface $input, OutputInterface $output) { $output->writeln('Test Command Output'); From ed3a9536ab9b0fe92fc907100c88f7db9735e9d1 Mon Sep 17 00:00:00 2001 From: Christophe G <1050197+cgaube@users.noreply.github.com> Date: Mon, 3 Jul 2023 10:57:49 -0700 Subject: [PATCH 20/20] fix tests --- packages/api/tests/Route/FastRouterParamTranslatorTest.php | 2 +- packages/service-manager/src/Resolver.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/api/tests/Route/FastRouterParamTranslatorTest.php b/packages/api/tests/Route/FastRouterParamTranslatorTest.php index 7dd72e6..f849369 100644 --- a/packages/api/tests/Route/FastRouterParamTranslatorTest.php +++ b/packages/api/tests/Route/FastRouterParamTranslatorTest.php @@ -25,7 +25,7 @@ public function testTranslation(array $options, string $expected) $this->assertEquals($expected, $transformed); } - public function dataProvider() + static public function dataProvider() { return [ 'string' => [ diff --git a/packages/service-manager/src/Resolver.php b/packages/service-manager/src/Resolver.php index 3949a77..b5270f7 100755 --- a/packages/service-manager/src/Resolver.php +++ b/packages/service-manager/src/Resolver.php @@ -7,6 +7,7 @@ use ReflectionClass; use ReflectionMethod; use ReflectionParameter; +use ReflectionException; class Resolver {