Skip to content

Commit

Permalink
Merge pull request #9 from chimeraphp/fix-routing-configuration
Browse files Browse the repository at this point in the history
Fix routing configuration
  • Loading branch information
lcobucci authored Jul 26, 2018
2 parents 9c59fef + 3277593 commit 05e2fea
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 15 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ script:
jobs:
allow_failures:
- php: nightly
- env: STATIC_ANALYSIS=1
- env: MUTATION_TESTS=1

include:
- stage: Code Quality
Expand Down Expand Up @@ -53,4 +51,4 @@ jobs:
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{.disabled,}
- if [[ ! $(php -m | grep -si xdebug) ]]; then echo "xdebug required for mutation tests"; exit 1; fi
script:
- ./vendor/bin/infection --test-framework-options='--testsuite unit' --threads=4 --min-msi=9 --min-covered-msi=100
- ./vendor/bin/infection --test-framework-options='--testsuite unit' --threads=4 --min-msi=8 --min-covered-msi=100
13 changes: 6 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@
"chimera/serialization-jms": "^0.1",
"chimera/routing-expressive": "^0.1",
"doctrine/coding-standard": "^4.0",
"infection/infection": "dev-master@dev",
"phpstan/phpdoc-parser": "^0.3@dev",
"phpstan/phpstan": "^0.10@dev",
"phpstan/phpstan-phpunit": "^0.10@dev",
"phpstan/phpstan-strict-rules": "^0.10@dev",
"phpunit/phpunit": "^7.1",
"squizlabs/php_codesniffer": "^3.2"
"infection/infection": "^0.9",
"phpstan/phpstan": "^0.10",
"phpstan/phpstan-phpunit": "^0.10",
"phpstan/phpstan-strict-rules": "^0.10",
"phpunit/phpunit": "^7.2",
"squizlabs/php_codesniffer": "^3.3"
},
"suggest": {
"chimera/bus-tactician": "To use league/tactician as service bus",
Expand Down
14 changes: 13 additions & 1 deletion config/routing-expressive.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,19 @@
</service>

<service id="Chimera\Routing\RouteParamsExtractor" class="Chimera\Routing\Expressive\RouteParamsExtractor" />
<service id="Zend\HttpHandlerRunner\Emitter\EmitterInterface" class="Zend\HttpHandlerRunner\Emitter\SapiEmitter" />

<service id="Zend\HttpHandlerRunner\Emitter\SapiEmitter" />
<service id="Zend\HttpHandlerRunner\Emitter\SapiStreamEmitter" />
<service id="Zend\HttpHandlerRunner\Emitter\EmitterStack">
<call method="push">
<argument type="service" id="Zend\HttpHandlerRunner\Emitter\SapiStreamEmitter" />
</call>
<call method="push">
<argument type="service" id="Zend\HttpHandlerRunner\Emitter\SapiEmitter" />
</call>
</service>

<service id="Zend\HttpHandlerRunner\Emitter\EmitterInterface" alias="Zend\HttpHandlerRunner\Emitter\EmitterStack" />

<service id="Zend\Expressive\Router\Middleware\ImplicitOptionsMiddleware" class="Zend\Expressive\Router\Middleware\ImplicitOptionsMiddleware">
<argument type="service" id="Psr\Http\Message\ResponseInterface" />
Expand Down
8 changes: 4 additions & 4 deletions src/Routing/Expressive/RegisterServices.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private function extractRoutes(ContainerBuilder $container): array
}

/**
* @return string[][][]
* @return mixed[]
*
* @throws InvalidArgumentException
*/
Expand All @@ -162,7 +162,7 @@ private function extractMiddlewareList(ContainerBuilder $container): array
}

/**
* @param string[][][] $middlewareList
* @param mixed[] $middlewareList
*
* @return string[][]
*/
Expand Down Expand Up @@ -488,7 +488,7 @@ public function createOnly(string $routeServiceId, array $route, ContainerBuilde
$route['redirect_to'],
new Reference($this->applicationName . '.http.uri_generator'),
new Reference(IdentifierGenerator::class),
$route['async'] === true ? StatusCode::STATUS_CREATED : StatusCode::STATUS_ACCEPTED,
$route['async'] === true ? StatusCode::STATUS_ACCEPTED : StatusCode::STATUS_CREATED,
]
);

Expand Down Expand Up @@ -529,7 +529,7 @@ public function executeOnly(string $routeServiceId, array $route, ContainerBuild
[
$this->generateWriteAction($routeServiceId . '.action', $route['command'], $container),
new Reference(ResponseInterface::class),
$route['async'] === true ? StatusCode::STATUS_NO_CONTENT : StatusCode::STATUS_ACCEPTED,
$route['async'] === true ? StatusCode::STATUS_ACCEPTED : StatusCode::STATUS_NO_CONTENT,
]
);

Expand Down

0 comments on commit 05e2fea

Please sign in to comment.