Skip to content

Commit

Permalink
Merge branch '4.x' into refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
l0gicgate authored Jul 7, 2022
2 parents da61426 + 484a32a commit 1ce17b7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Slim/CallableResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function resolve($toResolve): callable
$resolved = $toResolve;
if (is_string($toResolve)) {
$resolved = $this->resolveSlimNotation($toResolve);
$resolved[1] = $resolved[1] ?? '__invoke';
$resolved[1] ??= '__invoke';
}
$callable = $this->assertCallable($resolved, $toResolve);
return $this->bindToContainer($callable);
Expand Down
2 changes: 1 addition & 1 deletion Slim/Middleware/BodyParsingMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ protected function parseBody(ServerRequestInterface $request)
$body = (string)$request->getBody();
$parsed = $this->bodyParsers[$mediaType]($body);

if (!is_null($parsed) && !is_object($parsed) && !is_array($parsed)) {
if ($parsed !== null && !is_object($parsed) && !is_array($parsed)) {
throw new RuntimeException(
'Request body media type parser return value must be an array, an object, or null'
);
Expand Down
4 changes: 1 addition & 3 deletions tests/AppTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1862,9 +1862,7 @@ public function testCanBeReExecutedRecursivelyDuringDispatch(): void

/** @var ResponseInterface $response */
$response = $app->handle($request->withAddedHeader('X-NESTED', '1'));
$response = $response->withAddedHeader('X-TRACE', 'outer');

return $response;
return $response->withAddedHeader('X-TRACE', 'outer');
});

$middlewareProphecy2 = $this->prophesize(MiddlewareInterface::class);
Expand Down
10 changes: 2 additions & 8 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,10 @@
],
RouteCollector::class => [
'is_readable' => function (string $file): bool {
if (stripos($file, 'non-readable.cache') !== false) {
return false;
}
return true;
return stripos($file, 'non-readable.cache') === false;
},
'is_writable' => function (string $path): bool {
if (stripos($path, 'non-writable-directory') !== false) {
return false;
}
return true;
return stripos($path, 'non-writable-directory') === false;
}
]
]);

0 comments on commit 1ce17b7

Please # to comment.