Skip to content

Commit 20a5f99

Browse files
chore: introduce phpstan level 6 (#7269)
1 parent 6590649 commit 20a5f99

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Controller/ApiPlatformController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ private function getUriVariables(Request $request, HttpOperation $operation): ar
103103
{
104104
$uriVariables = [];
105105
foreach ($operation->getUriVariables() ?? [] as $parameterName => $_) {
106-
$parameter = $request->route($parameterName);
106+
$parameter = $request->route((string) $parameterName);
107107
if (\is_string($parameter) && ($format = $request->attributes->get('_format')) && str_contains($parameter, $format)) {
108108
$parameter = substr($parameter, 0, \strlen($parameter) - (\strlen($format) + 1));
109109
}

Exception/ErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function render($request, \Throwable $exception)
7777
$operation = null;
7878
foreach ($resourceCollection as $resource) {
7979
foreach ($resource->getOperations() as $op) {
80-
foreach ($op->getOutputFormats() as $key => $value) {
80+
foreach ($op->getOutputFormats() ?? [] as $key => $value) {
8181
if ($key === $format) {
8282
$operation = $op;
8383
break 3;

0 commit comments

Comments
 (0)