Apply rector rules: symfony up to 54

This commit is contained in:
2024-04-04 23:30:25 +02:00
parent 1ee3b9e2f0
commit 579bd829f8
204 changed files with 974 additions and 2346 deletions

View File

@@ -16,9 +16,7 @@ use Symfony\Component\Routing\Annotation\Route;
class AdminController extends AbstractController
{
/**
* @Route("/{_locale}/admin/budget", name="chill_admin_budget")
*/
#[Route(path: '/{_locale}/admin/budget', name: 'chill_admin_budget')]
public function indexAdminAction()
{
return $this->render('@ChillBudget/Admin/index.html.twig');

View File

@@ -21,9 +21,8 @@ class ChargeController extends AbstractElementController
{
/**
* @return \Symfony\Component\HttpFoundation\Response
*
* @\Symfony\Component\Routing\Annotation\Route("{_locale}/budget/charge/{id}/delete", name="chill_budget_charge_delete")
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '{_locale}/budget/charge/{id}/delete', name: 'chill_budget_charge_delete')]
public function deleteAction(Request $request, Charge $charge)
{
return $this->_delete(
@@ -36,9 +35,8 @@ class ChargeController extends AbstractElementController
/**
* @return \Symfony\Component\HttpFoundation\Response
*
* @\Symfony\Component\Routing\Annotation\Route("{_locale}/budget/charge/{id}/edit", name="chill_budget_charge_edit")
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '{_locale}/budget/charge/{id}/edit', name: 'chill_budget_charge_edit')]
public function editAction(Request $request, Charge $charge)
{
return $this->_edit(
@@ -51,9 +49,8 @@ class ChargeController extends AbstractElementController
/**
* @return \Symfony\Component\HttpFoundation\Response
*
* @\Symfony\Component\Routing\Annotation\Route("{_locale}/budget/charge/by-person/{id}/new", name="chill_budget_charge_new")
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '{_locale}/budget/charge/by-person/{id}/new', name: 'chill_budget_charge_new')]
public function newAction(Request $request, Person $person)
{
return $this->_new(
@@ -66,9 +63,8 @@ class ChargeController extends AbstractElementController
/**
* @return \Symfony\Component\HttpFoundation\Response
*
* @\Symfony\Component\Routing\Annotation\Route("{_locale}/budget/charge/by-household/{id}/new", name="chill_budget_charge_household_new")
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '{_locale}/budget/charge/by-household/{id}/new', name: 'chill_budget_charge_household_new')]
public function newHouseholdAction(Request $request, Household $household)
{
return $this->_new(
@@ -81,9 +77,8 @@ class ChargeController extends AbstractElementController
/**
* @return \Symfony\Component\HttpFoundation\Response
*
* @\Symfony\Component\Routing\Annotation\Route("{_locale}/budget/charge/{id}/view", name="chill_budget_charge_view")
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '{_locale}/budget/charge/{id}/view', name: 'chill_budget_charge_view')]
public function viewAction(Charge $charge)
{
return $this->_view($charge, '@ChillBudget/Charge/view.html.twig');

View File

@@ -23,9 +23,7 @@ class ElementController extends AbstractController
{
public function __construct(private readonly CalculatorManager $calculator, private readonly ResourceRepository $resourceRepository, private readonly ChargeRepository $chargeRepository) {}
/**
* @\Symfony\Component\Routing\Annotation\Route("{_locale}/budget/elements/by-person/{id}", name="chill_budget_elements_index")
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '{_locale}/budget/elements/by-person/{id}', name: 'chill_budget_elements_index')]
public function indexAction(Person $person)
{
$this->denyAccessUnlessGranted(BudgetElementVoter::SEE, $person);
@@ -47,9 +45,7 @@ class ElementController extends AbstractController
]);
}
/**
* @\Symfony\Component\Routing\Annotation\Route("{_locale}/budget/elements/by-household/{id}", name="chill_budget_elements_household_index")
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '{_locale}/budget/elements/by-household/{id}', name: 'chill_budget_elements_household_index')]
public function indexHouseholdAction(Household $household)
{
$this->denyAccessUnlessGranted(BudgetElementVoter::SEE, $household);

View File

@@ -20,9 +20,7 @@ use Symfony\Component\HttpFoundation\Response;
class ResourceController extends AbstractElementController
{
/**
* @\Symfony\Component\Routing\Annotation\Route("{_locale}/budget/resource/{id}/delete", name="chill_budget_resource_delete")
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '{_locale}/budget/resource/{id}/delete', name: 'chill_budget_resource_delete')]
public function deleteAction(Request $request, Resource $resource)
{
return $this->_delete(
@@ -33,9 +31,7 @@ class ResourceController extends AbstractElementController
);
}
/**
* @\Symfony\Component\Routing\Annotation\Route("{_locale}/budget/resource/{id}/edit", name="chill_budget_resource_edit")
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '{_locale}/budget/resource/{id}/edit', name: 'chill_budget_resource_edit')]
public function editAction(Request $request, Resource $resource): Response
{
return $this->_edit(
@@ -48,9 +44,8 @@ class ResourceController extends AbstractElementController
/**
* Create a new budget element for a person.
*
* @\Symfony\Component\Routing\Annotation\Route("{_locale}/budget/resource/by-person/{id}/new", name="chill_budget_resource_new")
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '{_locale}/budget/resource/by-person/{id}/new', name: 'chill_budget_resource_new')]
public function newAction(Request $request, Person $person): Response
{
return $this->_new(
@@ -63,9 +58,8 @@ class ResourceController extends AbstractElementController
/**
* Create new budget element for a household.
*
* @\Symfony\Component\Routing\Annotation\Route("{_locale}/budget/resource/by-household/{id}/new", name="chill_budget_resource_household_new")
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '{_locale}/budget/resource/by-household/{id}/new', name: 'chill_budget_resource_household_new')]
public function newHouseholdAction(Request $request, Household $household): Response
{
return $this->_new(
@@ -76,9 +70,7 @@ class ResourceController extends AbstractElementController
);
}
/**
* @\Symfony\Component\Routing\Annotation\Route("{_locale}/budget/resource/{id}/view", name="chill_budget_resource_view")
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '{_locale}/budget/resource/{id}/view', name: 'chill_budget_resource_view')]
public function viewAction(Resource $resource): Response
{
return $this->_view($resource, '@ChillBudget/Resource/view.html.twig');