Skip to content

Commit 1ed721f

Browse files
authored
Merge pull request #19 from chimeraphp/upgrade-dependencies
Upgrade dependencies
2 parents d54ff0b + 99773fb commit 1ed721f

File tree

7 files changed

+77
-83
lines changed

7 files changed

+77
-83
lines changed

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@
1515
},
1616
"require": {
1717
"php": "^7.3 || 8.0",
18-
"lcobucci/di-builder": "^5.5"
18+
"lcobucci/di-builder": "^5.6"
1919
},
2020
"require-dev": {
21-
"chimera/bus-tactician": "^0.2",
22-
"chimera/mapping": "^0.2",
23-
"chimera/routing-expressive": "^0.2",
24-
"chimera/serialization-jms": "^0.2",
21+
"chimera/bus-tactician": "^0.3",
22+
"chimera/mapping": "^0.3",
23+
"chimera/routing-expressive": "^0.3",
24+
"chimera/serialization-jms": "^0.3",
2525
"infection/infection": "^0.13",
2626
"lcobucci/coding-standard": "^3.0",
2727
"phpstan/phpstan": "^0.11",
2828
"phpstan/phpstan-deprecation-rules": "^0.11",
2929
"phpstan/phpstan-phpunit": "^0.11",
3030
"phpstan/phpstan-strict-rules": "^0.11",
31-
"phpunit/phpunit": "^8.0"
31+
"phpunit/phpunit": "^8.2"
3232
},
3333
"suggest": {
3434
"chimera/bus-tactician": "To use league/tactician as service bus",

config/bus-tactician.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
<services>
66
<defaults public="false" />
77

8-
<service id="League\Tactician\Handler\CommandNameExtractor\ClassNameExtractor" class="League\Tactician\Handler\CommandNameExtractor\ClassNameExtractor" />
8+
<service id="League\Tactician\Handler\CommandNameExtractor\ClassNameExtractor" />
99

10-
<service id="League\Tactician\Handler\MethodNameInflector\ClassNameInflector" class="League\Tactician\Handler\MethodNameInflector\ClassNameInflector" />
11-
<service id="League\Tactician\Handler\MethodNameInflector\HandleClassNameInflector" class="League\Tactician\Handler\MethodNameInflector\HandleClassNameInflector" />
12-
<service id="League\Tactician\Handler\MethodNameInflector\HandleClassNameWithoutSuffixInflector" class="League\Tactician\Handler\MethodNameInflector\HandleClassNameWithoutSuffixInflector" />
13-
<service id="League\Tactician\Handler\MethodNameInflector\HandleInflector" class="League\Tactician\Handler\MethodNameInflector\HandleInflector" />
14-
<service id="League\Tactician\Handler\MethodNameInflector\InvokeInflector" class="League\Tactician\Handler\MethodNameInflector\InvokeInflector" />
10+
<service id="League\Tactician\Handler\MethodNameInflector\ClassNameInflector" />
11+
<service id="League\Tactician\Handler\MethodNameInflector\HandleClassNameInflector" />
12+
<service id="League\Tactician\Handler\MethodNameInflector\HandleClassNameWithoutSuffixInflector" />
13+
<service id="League\Tactician\Handler\MethodNameInflector\HandleInflector" />
14+
<service id="League\Tactician\Handler\MethodNameInflector\InvokeInflector" />
1515

16-
<service id="Chimera\ServiceBus\Tactician\ReadModelConversionMiddleware" class="Chimera\ServiceBus\Tactician\ReadModelConversionMiddleware">
16+
<service id="Chimera\ServiceBus\Tactician\ReadModelConversionMiddleware">
1717
<argument type="service" id="Chimera\ServiceBus\ReadModelConverter" />
1818
</service>
1919
</services>

config/foundation.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
<services>
66
<defaults public="false" />
77

8-
<service id="Chimera\MessageCreator\NamedConstructor" class="Chimera\MessageCreator\NamedConstructor" />
9-
<service id="Chimera\ServiceBus\ReadModelConverter\Callback" class="Chimera\ServiceBus\ReadModelConverter\Callback" />
10-
<service id="Chimera\IdentifierGenerator\RamseyUuid" class="Chimera\IdentifierGenerator\RamseyUuid" />
8+
<service id="Chimera\MessageCreator\NamedConstructor" />
9+
<service id="Chimera\ServiceBus\ReadModelConverter\Callback" />
10+
<service id="Chimera\IdentifierGenerator\RamseyUuid" />
1111

12-
<service id="Lcobucci\ContentNegotiation\Formatter\Json" class="Lcobucci\ContentNegotiation\Formatter\Json" />
12+
<service id="Lcobucci\ContentNegotiation\Formatter\Json" />
1313
</services>
1414
</container>

config/routing-expressive.xml

Lines changed: 26 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -23,57 +23,45 @@
2323
<services>
2424
<defaults public="false" />
2525

26-
<service id="Psr\Http\Message\StreamInterface">
27-
<factory service="chimera.routing.expressive.stream_factory" method="__invoke" />
28-
29-
<argument type="service" id="service_container" />
30-
</service>
31-
32-
<service id="Psr\Http\Message\ServerRequestInterface">
33-
<factory service="chimera.routing.expressive.request_factory" method="__invoke" />
34-
35-
<argument type="service" id="service_container" />
36-
</service>
37-
38-
<service id="Psr\Http\Message\ResponseInterface">
39-
<factory service="chimera.routing.expressive.response_factory" method="__invoke" />
40-
41-
<argument type="service" id="service_container" />
42-
</service>
43-
44-
<service id="Chimera\Routing\RouteParamsExtractor" class="Chimera\Routing\Expressive\RouteParamsExtractor" />
26+
<service id="Chimera\Routing\Expressive\RouteParamsExtractor" />
27+
<service id="Chimera\Routing\RouteParamsExtractor" alias="Chimera\Routing\Expressive\RouteParamsExtractor" />
4528

4629
<service id="Zend\HttpHandlerRunner\Emitter\SapiEmitter" />
4730
<service id="Zend\HttpHandlerRunner\Emitter\SapiStreamEmitter" />
48-
4931
<service id="Zend\HttpHandlerRunner\Emitter\EmitterInterface" alias="Zend\HttpHandlerRunner\Emitter\SapiEmitter" />
5032

51-
<service id="Zend\Expressive\Router\Middleware\ImplicitOptionsMiddleware" class="Zend\Expressive\Router\Middleware\ImplicitOptionsMiddleware">
52-
<argument type="service" id="Psr\Http\Message\ResponseInterface" />
33+
<service id="Zend\Expressive\Router\Middleware\ImplicitOptionsMiddleware">
34+
<argument type="collection">
35+
<argument type="service" id="Psr\Http\Message\ResponseFactoryInterface" />
36+
<argument>createResponse</argument>
37+
</argument>
5338
</service>
5439

55-
<service id="Zend\Expressive\Router\Middleware\MethodNotAllowedMiddleware" class="Zend\Expressive\Router\Middleware\MethodNotAllowedMiddleware">
56-
<argument type="service" id="Psr\Http\Message\ResponseInterface" />
40+
<service id="Zend\Expressive\Router\Middleware\MethodNotAllowedMiddleware">
41+
<argument type="collection">
42+
<argument type="service" id="Psr\Http\Message\ResponseFactoryInterface" />
43+
<argument>createResponse</argument>
44+
</argument>
5745
</service>
5846

59-
<service id="Zend\Expressive\Router\Middleware\DispatchMiddleware" class="Zend\Expressive\Router\Middleware\DispatchMiddleware" />
47+
<service id="Zend\Expressive\Router\Middleware\DispatchMiddleware" />
6048

61-
<service id="Zend\Expressive\Handler\NotFoundHandler" class="Zend\Stratigility\Middleware\RequestHandlerMiddleware">
62-
<argument type="service" id="Zend\Expressive\Handler\NotFoundHandler\Inner" />
63-
</service>
64-
<service id="Zend\Expressive\Handler\NotFoundHandler\Inner" class="Zend\Expressive\Handler\NotFoundHandler">
65-
<argument type="service" id="Psr\Http\Message\ResponseInterface" />
66-
</service>
67-
68-
<service id="Zend\Expressive\Response\ServerRequestErrorResponseGenerator" class="Zend\Expressive\Response\ServerRequestErrorResponseGenerator">
69-
<argument type="service" id="Psr\Http\Message\ResponseInterface" />
49+
<service id="Zend\Expressive\Response\ServerRequestErrorResponseGenerator">
50+
<argument type="collection">
51+
<argument type="service" id="Psr\Http\Message\ResponseFactoryInterface" />
52+
<argument>createResponse</argument>
53+
</argument>
7054
<argument>%zend_expressive.debug%</argument>
7155
</service>
7256

73-
<service id="Zend\Expressive\Helper\BodyParams\BodyParamsMiddleware" class="Zend\Expressive\Helper\BodyParams\BodyParamsMiddleware" />
57+
<service id="Zend\Expressive\Helper\BodyParams\BodyParamsMiddleware" />
58+
59+
<service id="Zend\Diactoros\StreamFactory" />
60+
<service id="Zend\Diactoros\ServerRequestFactory" />
61+
<service id="Zend\Diactoros\ResponseFactory" />
7462

75-
<service id="chimera.routing.expressive.stream_factory" class="Zend\Expressive\Container\StreamFactoryFactory" />
76-
<service id="chimera.routing.expressive.request_factory" class="Zend\Expressive\Container\ServerRequestFactoryFactory" />
77-
<service id="chimera.routing.expressive.response_factory" class="Zend\Expressive\Container\ResponseFactoryFactory" />
63+
<service id="Psr\Http\Message\StreamFactoryInterface" alias="Zend\Diactoros\StreamFactory" />
64+
<service id="Psr\Http\Message\ServerRequestFactoryInterface" alias="Zend\Diactoros\ServerRequestFactory" />
65+
<service id="Psr\Http\Message\ResponseFactoryInterface" alias="Zend\Diactoros\ResponseFactory" />
7866
</services>
7967
</container>

config/routing.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
<services>
66
<defaults public="false" />
77

8-
<service id="Chimera\Routing\RouteParamsExtraction" class="Chimera\Routing\RouteParamsExtraction">
8+
<service id="Chimera\Routing\RouteParamsExtraction">
99
<argument type="service" id="Chimera\Routing\RouteParamsExtractor" />
1010
</service>
11+
12+
<service id="Chimera\Routing\MissingRouteDispatching" />
1113
</services>
1214
</container>

config/serialization-jms.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77

88
<service id="Chimera\MessageCreator" alias="Chimera\MessageCreator\JmsSerializer\ArrayTransformer" />
99

10-
<service id="Chimera\MessageCreator\JmsSerializer\ArrayTransformer" class="Chimera\MessageCreator\JmsSerializer\ArrayTransformer">
10+
<service id="Chimera\MessageCreator\JmsSerializer\ArrayTransformer">
1111
<argument type="service" id="JMS\Serializer\SerializerInterface" />
1212
</service>
1313

14-
<service id="Chimera\MessageCreator\JmsSerializer\InputDataInjector" class="Chimera\MessageCreator\JmsSerializer\InputDataInjector">
15-
14+
<service id="Chimera\MessageCreator\JmsSerializer\InputDataInjector">
1615
<!-- This tag is very specific to the compiler passes in jms/serializer-bundle -->
1716
<tag name="jms_serializer.event_listener" event="serializer.pre_deserialize" method="injectData" priority="-99" />
1817
</service>

src/Routing/Expressive/RegisterServices.php

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,28 @@
88
use Chimera\ExecuteQuery;
99
use Chimera\IdentifierGenerator;
1010
use Chimera\MessageCreator;
11+
use Chimera\Routing\Expressive\Application;
1112
use Chimera\Routing\Expressive\UriGenerator;
1213
use Chimera\Routing\Handler\CreateAndFetch;
1314
use Chimera\Routing\Handler\CreateOnly;
1415
use Chimera\Routing\Handler\ExecuteAndFetch;
1516
use Chimera\Routing\Handler\ExecuteOnly;
1617
use Chimera\Routing\Handler\FetchOnly;
18+
use Chimera\Routing\MissingRouteDispatching;
1719
use Chimera\Routing\RouteParamsExtraction;
1820
use Fig\Http\Message\StatusCodeInterface as StatusCode;
1921
use Lcobucci\ContentNegotiation\ContentTypeMiddleware;
2022
use Lcobucci\ContentNegotiation\Formatter\Json;
21-
use Psr\Http\Message\ResponseInterface;
22-
use Psr\Http\Message\ServerRequestInterface;
23-
use Psr\Http\Message\StreamInterface;
23+
use Psr\Http\Message\ResponseFactoryInterface;
24+
use Psr\Http\Message\StreamFactoryInterface;
2425
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
2526
use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass;
2627
use Symfony\Component\DependencyInjection\ContainerBuilder;
2728
use Symfony\Component\DependencyInjection\Definition;
2829
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
2930
use Symfony\Component\DependencyInjection\Reference;
30-
use Zend\Expressive\Application;
31-
use Zend\Expressive\Handler\NotFoundHandler;
31+
use Zend\Diactoros\ServerRequestFactory;
32+
use Zend\Expressive\Application as Expressive;
3233
use Zend\Expressive\Helper\BodyParams\BodyParamsMiddleware;
3334
use Zend\Expressive\Middleware\LazyLoadingMiddleware;
3435
use Zend\Expressive\MiddlewareContainer;
@@ -289,7 +290,7 @@ private function registerApplication(
289290
$middlewarePipeline->addMethodCall('pipe', [new Reference(MethodNotAllowedMiddleware::class)]);
290291
$middlewarePipeline->addMethodCall('pipe', [new Reference(RouteParamsExtraction::class)]);
291292
$middlewarePipeline->addMethodCall('pipe', [new Reference(DispatchMiddleware::class)]);
292-
$middlewarePipeline->addMethodCall('pipe', [new Reference(NotFoundHandler::class)]);
293+
$middlewarePipeline->addMethodCall('pipe', [new Reference(MissingRouteDispatching::class)]);
293294

294295
$container->setDefinition($this->applicationName . '.http.middleware_pipeline', $middlewarePipeline);
295296

@@ -345,7 +346,7 @@ private function registerApplication(
345346
ImplicitHeadMiddleware::class,
346347
[
347348
new Reference($this->applicationName . '.http.router'),
348-
new Reference(StreamInterface::class),
349+
[new Reference(StreamFactoryInterface::class), 'createStream'],
349350
]
350351
);
351352

@@ -375,7 +376,7 @@ private function registerApplication(
375376
$container->hasParameter($applicationAllowedFormats) ? '%' . $applicationAllowedFormats . '%'
376377
: '%chimera.default_allowed_formats%',
377378
$formatters,
378-
new Reference(StreamInterface::class),
379+
new Reference(StreamFactoryInterface::class),
379380
]
380381
);
381382

@@ -390,26 +391,30 @@ private function registerApplication(
390391
[
391392
new Reference($this->applicationName . '.http.middleware_pipeline'),
392393
new Reference(EmitterInterface::class),
393-
new Reference(ServerRequestInterface::class),
394+
[ServerRequestFactory::class, 'fromGlobals'],
394395
new Reference(ServerRequestErrorResponseGenerator::class),
395396
]
396397
);
397398

398399
$container->setDefinition($this->applicationName . '.http.request_handler_runner', $requestHandlerRunner);
399400

400-
$application = new Definition(
401-
Application::class,
402-
[
403-
new Reference($this->applicationName . '.http.middleware_factory'),
404-
new Reference($this->applicationName . '.http.middleware_pipeline'),
405-
new Reference($this->applicationName . '.http.route_collector'),
406-
new Reference($this->applicationName . '.http.request_handler_runner'),
407-
]
401+
$container->setDefinition(
402+
$this->applicationName . '.http_expressive',
403+
new Definition(
404+
Expressive::class,
405+
[
406+
new Reference($this->applicationName . '.http.middleware_factory'),
407+
new Reference($this->applicationName . '.http.middleware_pipeline'),
408+
new Reference($this->applicationName . '.http.route_collector'),
409+
new Reference($this->applicationName . '.http.request_handler_runner'),
410+
]
411+
)
408412
);
409413

410-
$application->setPublic(true);
414+
$app = new Definition(Application::class, [new Reference($this->applicationName . '.http_expressive')]);
415+
$app->setPublic(true);
411416

412-
$container->setDefinition($this->applicationName . '.http', $application);
417+
$container->setDefinition($this->applicationName . '.http', $app);
413418
}
414419

415420
private function generateReadAction(string $name, string $query, ContainerBuilder $container): Reference
@@ -468,7 +473,7 @@ public function fetchOnly(string $routeServiceId, array $route, ContainerBuilder
468473
FetchOnly::class,
469474
[
470475
$this->generateReadAction($routeServiceId . '.action', $route['query'], $container),
471-
new Reference(ResponseInterface::class),
476+
new Reference(ResponseFactoryInterface::class),
472477
]
473478
);
474479

@@ -486,7 +491,7 @@ public function createOnly(string $routeServiceId, array $route, ContainerBuilde
486491
CreateOnly::class,
487492
[
488493
$this->generateWriteAction($routeServiceId . '.action', $route['command'], $container),
489-
new Reference(ResponseInterface::class),
494+
new Reference(ResponseFactoryInterface::class),
490495
$route['redirect_to'],
491496
new Reference($this->applicationName . '.http.uri_generator'),
492497
new Reference(IdentifierGenerator::class),
@@ -509,7 +514,7 @@ public function createAndFetch(string $routeServiceId, array $route, ContainerBu
509514
[
510515
$this->generateWriteAction($routeServiceId . '.write_action', $route['command'], $container),
511516
$this->generateReadAction($routeServiceId . '.read_action', $route['query'], $container),
512-
new Reference(ResponseInterface::class),
517+
new Reference(ResponseFactoryInterface::class),
513518
$route['redirect_to'],
514519
new Reference($this->applicationName . '.http.uri_generator'),
515520
new Reference(IdentifierGenerator::class),
@@ -530,7 +535,7 @@ public function executeOnly(string $routeServiceId, array $route, ContainerBuild
530535
ExecuteOnly::class,
531536
[
532537
$this->generateWriteAction($routeServiceId . '.action', $route['command'], $container),
533-
new Reference(ResponseInterface::class),
538+
new Reference(ResponseFactoryInterface::class),
534539
$route['async'] === true ? StatusCode::STATUS_ACCEPTED : StatusCode::STATUS_NO_CONTENT,
535540
]
536541
);
@@ -550,7 +555,7 @@ public function executeAndFetch(string $routeServiceId, array $route, ContainerB
550555
[
551556
$this->generateWriteAction($routeServiceId . '.action', $route['command'], $container),
552557
$this->generateReadAction($routeServiceId . '.read_action', $route['query'], $container),
553-
new Reference(ResponseInterface::class),
558+
new Reference(ResponseFactoryInterface::class),
554559
]
555560
);
556561

0 commit comments

Comments
 (0)