mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-03-15 18:37:45 +00:00
Remove no longer used annotation use statements and replace with attribute use statements
This commit is contained in:
@@ -12,7 +12,6 @@ declare(strict_types=1);
|
||||
namespace Chill\BudgetBundle\Controller\Admin;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class AdminController extends AbstractController
|
||||
{
|
||||
|
||||
@@ -17,7 +17,6 @@ use Chill\PersonBundle\Entity\Household\Household;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Symfony\Bridge\Doctrine\Attribute\MapEntity;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class ChargeController extends AbstractElementController
|
||||
{
|
||||
@@ -71,9 +70,6 @@ class ChargeController extends AbstractElementController
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
#[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/budget/charge/{id}/view', name: 'chill_budget_charge_view')]
|
||||
public function viewAction(#[MapEntity(id: 'id')] Charge $charge): \Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
|
||||
@@ -19,7 +19,6 @@ use Chill\PersonBundle\Entity\Household\Household;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Symfony\Bridge\Doctrine\Attribute\MapEntity;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class ElementController extends AbstractController
|
||||
{
|
||||
|
||||
@@ -18,7 +18,6 @@ use Chill\PersonBundle\Entity\Person;
|
||||
use Symfony\Bridge\Doctrine\Attribute\MapEntity;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class ResourceController extends AbstractElementController
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
|
||||
class Configuration implements ConfigurationInterface
|
||||
{
|
||||
public function getConfigTreeBuilder(): \Symfony\Component\Config\Definition\Builder\TreeBuilder
|
||||
public function getConfigTreeBuilder(): TreeBuilder
|
||||
{
|
||||
$treeBuilder = new TreeBuilder('chill_budget');
|
||||
$rootNode = $treeBuilder->getRootNode();
|
||||
|
||||
@@ -75,8 +75,6 @@ class Charge extends AbstractElement implements HasCentersInterface
|
||||
|
||||
/**
|
||||
* Get id.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getId(): ?int
|
||||
{
|
||||
|
||||
@@ -47,8 +47,6 @@ class Resource extends AbstractElement implements HasCentersInterface
|
||||
|
||||
/**
|
||||
* Get id.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getId(): ?int
|
||||
{
|
||||
|
||||
@@ -20,7 +20,6 @@ use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||
use Chill\PersonBundle\Entity\Household\Household;
|
||||
use Chill\PersonBundle\Entity\Household\HouseholdMember;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Doctrine\ORM\AbstractQuery;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\NativeQuery;
|
||||
use Doctrine\ORM\Query;
|
||||
|
||||
@@ -30,43 +30,43 @@ final class Version20221207105407 extends AbstractMigration
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
/* $resources = $this->container->getParameter('chill_budget.resources');
|
||||
$charges = $this->container->getParameter('chill_budget.charges');
|
||||
/* $resources = $this->container->getParameter('chill_budget.resources');
|
||||
$charges = $this->container->getParameter('chill_budget.charges');
|
||||
|
||||
foreach ($resources as $value) {
|
||||
$lang = $value['labels'][0]['lang'];
|
||||
$label = $value['labels'][0]['label'];
|
||||
$kind = $value['key'];
|
||||
$this->addSql(
|
||||
'INSERT INTO chill_budget.resource_type (id, isActive, name, ordering, kind) VALUES (
|
||||
nextval(\'chill_budget.resource_type_id_seq\'), true, jsonb_build_object(:lang::text, :label::text), 0, :kind::text)',
|
||||
['lang' => $lang, 'label' => $label, 'kind' => $kind],
|
||||
['lang' => Types::STRING, 'label' => Types::STRING, 'kind' => Types::STRING]
|
||||
);
|
||||
$this->addSql(
|
||||
'UPDATE chill_budget.resource SET resource_id = resource_type.id
|
||||
FROM chill_budget.resource_type WHERE resource.type = :kind AND resource_type.kind = resource.type;',
|
||||
['kind' => $kind],
|
||||
['kind' => Types::STRING]
|
||||
);
|
||||
}
|
||||
foreach ($resources as $value) {
|
||||
$lang = $value['labels'][0]['lang'];
|
||||
$label = $value['labels'][0]['label'];
|
||||
$kind = $value['key'];
|
||||
$this->addSql(
|
||||
'INSERT INTO chill_budget.resource_type (id, isActive, name, ordering, kind) VALUES (
|
||||
nextval(\'chill_budget.resource_type_id_seq\'), true, jsonb_build_object(:lang::text, :label::text), 0, :kind::text)',
|
||||
['lang' => $lang, 'label' => $label, 'kind' => $kind],
|
||||
['lang' => Types::STRING, 'label' => Types::STRING, 'kind' => Types::STRING]
|
||||
);
|
||||
$this->addSql(
|
||||
'UPDATE chill_budget.resource SET resource_id = resource_type.id
|
||||
FROM chill_budget.resource_type WHERE resource.type = :kind AND resource_type.kind = resource.type;',
|
||||
['kind' => $kind],
|
||||
['kind' => Types::STRING]
|
||||
);
|
||||
}
|
||||
|
||||
foreach ($charges as $value) {
|
||||
$lang = $value['labels'][0]['lang'];
|
||||
$label = $value['labels'][0]['label'];
|
||||
$kind = $value['key'];
|
||||
$this->addSql(
|
||||
'INSERT INTO chill_budget.charge_type VALUES (nextval(\'chill_budget.charge_type_id_seq\'), true,
|
||||
jsonb_build_object(:lang::text, :label::text), 0, :kind::text);',
|
||||
['lang' => $lang, 'label' => $label, 'kind' => $kind],
|
||||
['lang' => Types::STRING, 'label' => Types::STRING, 'kind' => Types::STRING]
|
||||
);
|
||||
$this->addSql(
|
||||
'UPDATE chill_budget.charge SET charge_id = charge_type.id
|
||||
FROM chill_budget.charge_type WHERE charge.type = :kind AND charge_type.kind = charge.type;',
|
||||
['kind' => $kind],
|
||||
['kind' => Types::STRING]
|
||||
);
|
||||
}*/
|
||||
foreach ($charges as $value) {
|
||||
$lang = $value['labels'][0]['lang'];
|
||||
$label = $value['labels'][0]['label'];
|
||||
$kind = $value['key'];
|
||||
$this->addSql(
|
||||
'INSERT INTO chill_budget.charge_type VALUES (nextval(\'chill_budget.charge_type_id_seq\'), true,
|
||||
jsonb_build_object(:lang::text, :label::text), 0, :kind::text);',
|
||||
['lang' => $lang, 'label' => $label, 'kind' => $kind],
|
||||
['lang' => Types::STRING, 'label' => Types::STRING, 'kind' => Types::STRING]
|
||||
);
|
||||
$this->addSql(
|
||||
'UPDATE chill_budget.charge SET charge_id = charge_type.id
|
||||
FROM chill_budget.charge_type WHERE charge.type = :kind AND charge_type.kind = charge.type;',
|
||||
['kind' => $kind],
|
||||
['kind' => Types::STRING]
|
||||
);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user