Fix phpstan issues

This commit is contained in:
2023-12-12 22:34:26 +01:00
parent af663cf27c
commit da997badd9
26 changed files with 275 additions and 261 deletions

View File

@@ -11,6 +11,7 @@ declare(strict_types=1);
namespace Chill\TaskBundle\Controller;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Pagination\PaginatorFactory;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface;
use Chill\MainBundle\Serializer\Model\Collection;
@@ -38,8 +39,10 @@ use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Security;
use Symfony\Contracts\Translation\TranslatorInterface;
final class SingleTaskController extends AbstractController
@@ -55,6 +58,7 @@ final class SingleTaskController extends AbstractController
private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory,
private readonly SingleTaskStateRepository $singleTaskStateRepository,
private readonly SingleTaskRepository $singleTaskRepository,
private readonly Security $security,
) {}
/**
@@ -487,8 +491,14 @@ final class SingleTaskController extends AbstractController
*/
public function newAction(Request $request)
{
$user = $this->security->getUser();
if (!$user instanceof User) {
throw new AccessDeniedHttpException();
}
$task = (new SingleTask())
->setAssignee($this->getUser())
->setAssignee($user)
->setType('task_default');
$entityType = $this->getEntityContext($request);

View File

@@ -66,7 +66,7 @@ class TaskController extends AbstractController
'chill_task_single_task_show',
[
'id' => $task->getId(),
'list_params' => $request->query->get('list_params', []),
'list_params' => $request->query->all('list_params'),
]
);
null === $task->getCourse() ? $defaultTemplate = '@ChillTask/SingleTask/Person/transition.html.twig' : $defaultTemplate = '@ChillTask/SingleTask/AccompanyingCourse/transition.html.twig';
@@ -134,8 +134,6 @@ class TaskController extends AbstractController
}
/**
* @param \Chill\TaskBundle\Controller\AbstractTask $task
*
* @return \Symfony\Component\Form\FormInterface
*/
protected function createTransitionForm(AbstractTask $task)

View File

@@ -26,8 +26,7 @@ final readonly class UserMenuBuilder implements LocalMenuBuilderInterface
private TokenStorageInterface $tokenStorage,
private TranslatorInterface $translator,
private AuthorizationCheckerInterface $authorizationChecker
) {
}
) {}
public function buildMenu($menuId, MenuItem $menu, array $parameters)
{