Fixed some more inspection issues

This commit is contained in:
Jan Böhmer 2023-04-15 22:05:29 +02:00
parent de96aae9a5
commit 29d1d49aca
83 changed files with 153 additions and 172 deletions

View file

@ -74,9 +74,9 @@ class GroupController extends BaseAdminController
//We need to stop the execution here, or our permissions changes will be overwritten by the form values
return $this->redirectToRoute('group_edit', ['id' => $entity->getID()]);
} else {
$this->addFlash('danger', 'csfr_invalid');
}
$this->addFlash('danger', 'csfr_invalid');
}
return $this->_edit($entity, $request, $em, $timestamp);

View file

@ -52,7 +52,7 @@ class LogController extends AbstractController
{
protected EntityManagerInterface $entityManager;
protected TimeTravel $timeTravel;
protected DBElementRepository $dbRepository;
protected EntityRepository $dbRepository;
public function __construct(EntityManagerInterface $entityManager, TimeTravel $timeTravel)
{

View file

@ -114,9 +114,9 @@ class ProjectController extends AbstractController
$request->get('_redirect',
$this->generateUrl('project_info', ['id' => $project->getID()]
)));
} else {
$this->addFlash('error', 'project.build.flash.invalid_input');
}
$this->addFlash('error', 'project.build.flash.invalid_input');
}
return $this->renderForm('projects/build/build.html.twig', [

View file

@ -106,7 +106,7 @@ class SelectAPIController extends AbstractController
3 => $this->translator->trans('export.level.full'),
];
return $this->json(array_map(function ($key, $value) {
return $this->json(array_map(static function ($key, $value) {
return [
'text' => $value,
'value' => $key,
@ -198,7 +198,7 @@ class SelectAPIController extends AbstractController
]);
//Remove the data-* prefix for each key
$data = array_combine(
array_map(function ($key) {
array_map(static function ($key) {
if (strpos($key, 'data-') === 0) {
return substr($key, 5);
}

View file

@ -129,9 +129,9 @@ class UserController extends AdminPages\BaseAdminController
//We need to stop the execution here, or our permissions changes will be overwritten by the form values
return $this->redirectToRoute('user_edit', ['id' => $entity->getID()]);
} else {
$this->addFlash('danger', 'csfr_invalid');
}
$this->addFlash('danger', 'csfr_invalid');
}
return $this->_edit($entity, $request, $em, $timestamp);