mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 18:58:46 +02:00
Fixed phpstan issues
This commit is contained in:
parent
afcbbe0f43
commit
3a8c5a788f
11 changed files with 25 additions and 124 deletions
|
@ -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')]
|
||||
|
|
|
@ -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') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue