Fixed phpstan issues

This commit is contained in:
Jan Böhmer 2023-07-17 00:43:35 +02:00
parent afcbbe0f43
commit 3a8c5a788f
11 changed files with 25 additions and 124 deletions

View file

@ -47,7 +47,7 @@ class OAuthClientController extends AbstractController
return $this->clientRegistry
->getClient($name) // key used in config/packages/knpu_oauth2_client.yaml
->redirect();
->redirect([], []);
}
#[Route('/{name}/check', name: 'oauth_client_check')]

View file

@ -236,14 +236,14 @@ class PartController extends AbstractController
/**
* This function provides a common implementation for methods, which use the part form.
* @param Request $request
* @param Part $new_part
* @param Part $data
* @param array $form_options
* @return Response
*/
private function renderPartForm(string $mode, Request $request, Part $data, array $form_options = []): Response
{
//Ensure that mode is either 'new' or 'edit
if (!in_array($mode, ['new', 'edit'])) {
if (!in_array($mode, ['new', 'edit'], true)) {
throw new \InvalidArgumentException('Invalid mode given');
}
@ -305,6 +305,7 @@ class PartController extends AbstractController
$this->addFlash('error', 'part.created_flash.invalid');
}
$template = '';
if ($mode === 'new') {
$template = 'parts/edit/new_part.html.twig';
} else if ($mode === 'edit') {