DX: apply rector rules up to php8.0

This commit is contained in:
2023-04-15 01:05:37 +02:00
parent d8870e906f
commit dde3002100
714 changed files with 2348 additions and 9263 deletions

View File

@@ -36,11 +36,8 @@ abstract class AbstractCRUDController extends AbstractController
/**
* get the role given from the config.
*
* @param mixed $entity
* @param mixed $_format
*/
protected function getRoleFor(string $action, Request $request, $entity, $_format): string
protected function getRoleFor(string $action, Request $request, mixed $entity, mixed $_format): string
{
$actionConfig = $this->getActionConfig($action);
@@ -135,7 +132,7 @@ abstract class AbstractCRUDController extends AbstractController
*
* @param mixed $_format
*/
protected function countEntities(string $action, Request $request, $_format): int
protected function countEntities(string $action, Request $request, mixed $_format): int
{
return $this->buildQueryEntities($action, $request)
->select('COUNT(e)')
@@ -171,10 +168,8 @@ abstract class AbstractCRUDController extends AbstractController
* get the instance of the entity with the given id.
*
* @throw Symfony\Component\HttpKernel\Exception\NotFoundHttpException if the object is not found
*
* @param mixed $action
*/
protected function getEntity($action, string $id, Request $request): object
protected function getEntity(mixed $action, string $id, Request $request): object
{
$e = $this
->getDoctrine()
@@ -205,10 +200,8 @@ abstract class AbstractCRUDController extends AbstractController
/**
* Get the result of the query.
*
* @param mixed $query
*/
protected function getQueryResult(string $action, Request $request, string $_format, int $totalItems, PaginatorInterface $paginator, $query)
protected function getQueryResult(string $action, Request $request, string $_format, int $totalItems, PaginatorInterface $paginator, mixed $query)
{
return $query->getQuery()->getResult();
}
@@ -220,41 +213,32 @@ abstract class AbstractCRUDController extends AbstractController
/**
* Called on post check ACL.
*
* @param mixed $entity
*/
protected function onPostCheckACL(string $action, Request $request, string $_format, $entity): ?Response
protected function onPostCheckACL(string $action, Request $request, string $_format, mixed $entity): ?Response
{
return null;
}
/**
* Called on post fetch entity.
*
* @param mixed $entity
* @param mixed $_format
*/
protected function onPostFetchEntity(string $action, Request $request, $entity, $_format): ?Response
protected function onPostFetchEntity(string $action, Request $request, mixed $entity, mixed $_format): ?Response
{
return null;
}
/**
* Method used by indexAction.
*
* @param mixed $query
*/
protected function onPostIndexBuildQuery(string $action, Request $request, string $_format, int $totalItems, PaginatorInterface $paginator, $query): ?Response
protected function onPostIndexBuildQuery(string $action, Request $request, string $_format, int $totalItems, PaginatorInterface $paginator, mixed $query): ?Response
{
return null;
}
/**
* Method used by indexAction.
*
* @param mixed $entities
*/
protected function onPostIndexFetchQuery(string $action, Request $request, string $_format, int $totalItems, PaginatorInterface $paginator, $entities): ?Response
protected function onPostIndexFetchQuery(string $action, Request $request, string $_format, int $totalItems, PaginatorInterface $paginator, mixed $entities): ?Response
{
return null;
}
@@ -274,11 +258,8 @@ abstract class AbstractCRUDController extends AbstractController
/**
* Add ordering fields in the query build by self::queryEntities.
*
* @param mixed $query
* @param mixed $_format
*/
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator, $_format)
protected function orderQuery(string $action, mixed $query, Request $request, PaginatorInterface $paginator, mixed $_format)
{
return $query;
}