Remove no longer used annotation use statements and replace with attribute use statements

This commit is contained in:
2025-10-01 18:38:41 +02:00
parent d8528dceab
commit 32d2bb002b
486 changed files with 495 additions and 1063 deletions

View File

@@ -75,7 +75,7 @@ final class ActivityController extends AbstractController
* Deletes a Activity entity.
*/
#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/activity/{id}/delete', name: 'chill_activity_activity_delete', methods: ['GET', 'POST', 'DELETE'])]
public function deleteAction(Request $request, mixed $id): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
public function deleteAction(Request $request, mixed $id): \Symfony\Component\HttpFoundation\RedirectResponse|Response
{
$view = null;

View File

@@ -22,7 +22,7 @@ use function is_int;
*/
class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder(): \Symfony\Component\Config\Definition\Builder\TreeBuilder
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('chill_activity');
$rootNode = $treeBuilder->getRootNode();

View File

@@ -34,9 +34,9 @@ use Chill\ThirdPartyBundle\Entity\ThirdParty;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Annotation\SerializedName;
use Symfony\Component\Serializer\Attribute\DiscriminatorMap;
use Symfony\Component\Serializer\Attribute\Groups;
use Symfony\Component\Serializer\Attribute\SerializedName;
use Symfony\Component\Validator\Constraints as Assert;
/**

View File

@@ -12,7 +12,7 @@ declare(strict_types=1);
namespace Chill\ActivityBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Serializer\Attribute as Serializer;
/**
* Class ActivityPresence.

View File

@@ -37,8 +37,6 @@ class ActivityReason
/**
* Get active.
*
* @return bool
*/
public function getActive(): bool
{
@@ -55,8 +53,6 @@ class ActivityReason
/**
* Get id.
*
* @return int
*/
public function getId(): ?int
{

View File

@@ -58,8 +58,6 @@ class ActivityReasonCategory implements \Stringable
/**
* Get active.
*
* @return bool
*/
public function getActive(): bool
{
@@ -68,8 +66,6 @@ class ActivityReasonCategory implements \Stringable
/**
* Get id.
*
* @return int
*/
public function getId(): ?int
{

View File

@@ -12,8 +12,8 @@ declare(strict_types=1);
namespace Chill\ActivityBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Attribute as Serializer;
use Symfony\Component\Serializer\Attribute\Groups;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Context\ExecutionContextInterface;

View File

@@ -36,9 +36,6 @@ class ActivityReasonCategoryType extends AbstractType
]);
}
/**
* @return string
*/
public function getBlockPrefix(): string
{
return 'chill_activitybundle_activityreasoncategory';

View File

@@ -36,9 +36,6 @@ class ActivityReasonType extends AbstractType
]);
}
/**
* @return string
*/
public function getBlockPrefix(): string
{
return 'chill_activitybundle_activityreason';

View File

@@ -22,10 +22,8 @@ trait PrepareActivityTrait
{
/**
* Return an activity with a scope and a person inside.
*
* @return Activity
*/
public function prepareActivity(Scope $scope, Person $person): \Chill\ActivityBundle\Entity\Activity
public function prepareActivity(Scope $scope, Person $person): Activity
{
return (new Activity())
->setScope($scope)

View File

@@ -41,7 +41,7 @@ class ByActivityTypeAggregatorTest extends AbstractAggregatorTest
$this->translatableStringHelper = self::getContainer()->get(TranslatableStringHelperInterface::class);
}
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\ACPAggregators\ByActivityTypeAggregator
public function getAggregator(): ByActivityTypeAggregator
{
return new ByActivityTypeAggregator(
$this->rollingDateConverter,

View File

@@ -32,7 +32,7 @@ final class BySocialActionAggregatorTest extends AbstractAggregatorTest
$this->aggregator = self::getContainer()->get('chill.activity.export.bysocialaction_aggregator');
}
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\ACPAggregators\BySocialActionAggregator
public function getAggregator(): BySocialActionAggregator
{
return $this->aggregator;
}

View File

@@ -32,7 +32,7 @@ final class BySocialIssueAggregatorTest extends AbstractAggregatorTest
$this->aggregator = self::getContainer()->get('chill.activity.export.bysocialissue_aggregator');
}
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\ACPAggregators\BySocialIssueAggregator
public function getAggregator(): BySocialIssueAggregator
{
return $this->aggregator;
}

View File

@@ -35,7 +35,7 @@ class ActivityPresenceAggregatorTest extends AbstractAggregatorTest
$this->activityPresenceRepository = self::getContainer()->get(ActivityPresenceRepositoryInterface::class);
}
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\ActivityPresenceAggregator
public function getAggregator(): ActivityPresenceAggregator
{
return new ActivityPresenceAggregator($this->activityPresenceRepository, $this->translatableStringHelper);
}

View File

@@ -44,7 +44,7 @@ final class ActivityReasonAggregatorTest extends AbstractAggregatorTest
->push($request->reveal());*/
}
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\ActivityReasonAggregator
public function getAggregator(): ActivityReasonAggregator
{
return $this->aggregator;
}

View File

@@ -45,7 +45,7 @@ final class ActivityTypeAggregatorTest extends AbstractAggregatorTest
->push($request->reveal());
}
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\ActivityTypeAggregator
public function getAggregator(): ActivityTypeAggregator
{
return $this->aggregator;
}

View File

@@ -45,7 +45,7 @@ final class ActivityUserAggregatorTest extends AbstractAggregatorTest
->push($request->reveal());
}
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\ActivityUserAggregator
public function getAggregator(): ActivityUserAggregator
{
return $this->aggregator;
}

View File

@@ -32,7 +32,7 @@ final class ByThirdpartyAggregatorTest extends AbstractAggregatorTest
$this->aggregator = self::getContainer()->get(ByThirdpartyAggregator::class);
}
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\ByThirdpartyAggregator
public function getAggregator(): ByThirdpartyAggregator
{
return $this->aggregator;
}

View File

@@ -32,7 +32,7 @@ final class ByUserAggregatorTest extends AbstractAggregatorTest
$this->aggregator = self::getContainer()->get(ByCreatorAggregator::class);
}
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\ByCreatorAggregator
public function getAggregator(): ByCreatorAggregator
{
return $this->aggregator;
}

View File

@@ -32,7 +32,7 @@ final class CreatorJobAggregatorTest extends AbstractAggregatorTest
$this->aggregator = self::getContainer()->get(CreatorJobAggregator::class);
}
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\CreatorJobAggregator
public function getAggregator(): CreatorJobAggregator
{
return $this->aggregator;
}

View File

@@ -32,7 +32,7 @@ final class CreatorScopeAggregatorTest extends AbstractAggregatorTest
$this->aggregator = self::getContainer()->get(CreatorScopeAggregator::class);
}
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\CreatorScopeAggregator
public function getAggregator(): CreatorScopeAggregator
{
return $this->aggregator;
}

View File

@@ -32,7 +32,7 @@ final class DateAggregatorTest extends AbstractAggregatorTest
$this->aggregator = self::getContainer()->get(DateAggregator::class);
}
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\DateAggregator
public function getAggregator(): DateAggregator
{
return $this->aggregator;
}

View File

@@ -32,7 +32,7 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest
$this->aggregator = self::getContainer()->get(LocationTypeAggregator::class);
}
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\LocationTypeAggregator
public function getAggregator(): LocationTypeAggregator
{
return $this->aggregator;
}

View File

@@ -32,7 +32,7 @@ class PersonAggregatorTest extends AbstractAggregatorTest
$this->labelPersonHelper = self::getContainer()->get(LabelPersonHelper::class);
}
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\PersonAggregators\PersonAggregator
public function getAggregator(): PersonAggregator
{
return new PersonAggregator($this->labelPersonHelper);
}

View File

@@ -33,7 +33,7 @@ class PersonsAggregatorTest extends AbstractAggregatorTest
$this->labelPersonHelper = self::getContainer()->get(LabelPersonHelper::class);
}
public function getAggregator(): \Chill\ActivityBundle\Export\Aggregator\PersonsAggregator
public function getAggregator(): PersonsAggregator
{
return new PersonsAggregator($this->labelPersonHelper);
}

View File

@@ -33,7 +33,7 @@ final class ByCreatorFilterTest extends AbstractFilterTest
$this->filter = self::getContainer()->get(ByCreatorFilter::class);
}
public function getFilter(): \Chill\ActivityBundle\Export\Filter\ByCreatorFilter
public function getFilter(): ByCreatorFilter
{
return $this->filter;
}

View File

@@ -34,7 +34,7 @@ final class BySocialIssueFilterTest extends AbstractFilterTest
$this->filter = self::getContainer()->get(BySocialIssueFilter::class);
}
public function getFilter(): \Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialIssueFilter
public function getFilter(): BySocialIssueFilter
{
return $this->filter;
}

View File

@@ -33,7 +33,7 @@ final class ActivityDateFilterTest extends AbstractFilterTest
$this->filter = self::getContainer()->get(ActivityDateFilter::class);
}
public function getFilter(): \Chill\ActivityBundle\Export\Filter\ActivityDateFilter
public function getFilter(): ActivityDateFilter
{
return $this->filter;
}

View File

@@ -39,7 +39,7 @@ class ActivityPresenceFilterTest extends AbstractFilterTest
$this->translatableStringHelper = self::getContainer()->get(TranslatableStringHelperInterface::class);
}
public function getFilter(): \Chill\ActivityBundle\Export\Filter\ActivityPresenceFilter
public function getFilter(): ActivityPresenceFilter
{
return new ActivityPresenceFilter($this->translatableStringHelper, $this->translator);
}

View File

@@ -44,7 +44,7 @@ final class ActivityReasonFilterTest extends AbstractFilterTest
->push($request->reveal());
}
public function getFilter(): \Chill\ActivityBundle\Export\Filter\PersonFilters\ActivityReasonFilter
public function getFilter(): ActivityReasonFilter
{
return $this->filter;
}

View File

@@ -34,7 +34,7 @@ final class ActivityTypeFilterTest extends AbstractFilterTest
$this->filter = self::getContainer()->get('chill.activity.export.type_filter');
}
public function getFilter(): \Chill\ActivityBundle\Export\Filter\ActivityTypeFilter
public function getFilter(): ActivityTypeFilter
{
return $this->filter;
}

View File

@@ -33,7 +33,7 @@ final class ByCreatorFilterTest extends AbstractFilterTest
$this->filter = self::getContainer()->get(ByCreatorFilter::class);
}
public function getFilter(): \Chill\ActivityBundle\Export\Filter\ByCreatorFilter
public function getFilter(): ByCreatorFilter
{
return $this->filter;
}

View File

@@ -42,7 +42,7 @@ class CreatorJobFilterTest extends AbstractFilterTest
$this->userJobRepository = self::getContainer()->get(UserJobRepositoryInterface::class);
}
public function getFilter(): \Chill\ActivityBundle\Export\Filter\CreatorJobFilter
public function getFilter(): CreatorJobFilter
{
return new CreatorJobFilter(
$this->translatableStringHelper,

View File

@@ -33,7 +33,7 @@ final class CreatorScopeFilterTest extends AbstractFilterTest
$this->filter = self::getContainer()->get(CreatorScopeFilter::class);
}
public function getFilter(): \Chill\ActivityBundle\Export\Filter\CreatorScopeFilter
public function getFilter(): CreatorScopeFilter
{
return $this->filter;
}

View File

@@ -32,7 +32,7 @@ final class EmergencyFilterTest extends AbstractFilterTest
$this->filter = self::getContainer()->get(EmergencyFilter::class);
}
public function getFilter(): \Chill\ActivityBundle\Export\Filter\EmergencyFilter
public function getFilter(): EmergencyFilter
{
return $this->filter;
}

View File

@@ -33,7 +33,7 @@ final class LocationTypeFilterTest extends AbstractFilterTest
$this->filter = self::getContainer()->get(LocationTypeFilter::class);
}
public function getFilter(): \Chill\ActivityBundle\Export\Filter\LocationTypeFilter
public function getFilter(): LocationTypeFilter
{
return $this->filter;
}

View File

@@ -34,7 +34,7 @@ final class ActivityReasonFilterTest extends AbstractFilterTest
$this->filter = self::getContainer()->get('chill.activity.export.reason_filter');
}
public function getFilter(): \Chill\ActivityBundle\Export\Filter\PersonFilters\ActivityReasonFilter
public function getFilter(): ActivityReasonFilter
{
return $this->filter;
}

View File

@@ -33,7 +33,7 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest
$this->filter = self::getContainer()->get('chill.activity.export.person_having_an_activity_between_date_filter');
}
public function getFilter(): \Chill\ActivityBundle\Export\Filter\PersonFilters\PersonHavingActivityBetweenDateFilter
public function getFilter(): PersonHavingActivityBetweenDateFilter
{
return $this->filter;
}

View File

@@ -43,7 +43,7 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest
->push($request->reveal());
}
public function getFilter(): \Chill\ActivityBundle\Export\Filter\PersonFilters\PersonHavingActivityBetweenDateFilter
public function getFilter(): PersonHavingActivityBetweenDateFilter
{
return $this->filter;
}

View File

@@ -34,7 +34,7 @@ class PersonsFilterTest extends AbstractFilterTest
$this->personRender = self::getContainer()->get(PersonRenderInterface::class);
}
public function getFilter(): \Chill\ActivityBundle\Export\Filter\PersonsFilter
public function getFilter(): PersonsFilter
{
return new PersonsFilter($this->personRender);
}

View File

@@ -32,7 +32,7 @@ final class SentReceivedFilterTest extends AbstractFilterTest
$this->filter = self::getContainer()->get(SentReceivedFilter::class);
}
public function getFilter(): \Chill\ActivityBundle\Export\Filter\SentReceivedFilter
public function getFilter(): SentReceivedFilter
{
return $this->filter;
}

View File

@@ -33,7 +33,7 @@ final class UserFilterTest extends AbstractFilterTest
$this->filter = self::getContainer()->get(UserFilter::class);
}
public function getFilter(): \Chill\ActivityBundle\Export\Filter\UserFilter
public function getFilter(): UserFilter
{
return $this->filter;
}

View File

@@ -47,9 +47,6 @@ final class TranslatableActivityReasonTest extends TypeTestCase
$this->markTestSkipped('See issue 651');
}
/**
* @return \Symfony\Bridge\Doctrine\Form\Type\EntityType
*/
protected function getEntityType(): \Symfony\Bridge\Doctrine\Form\Type\EntityType
{
$managerRegistry = (new \Prophecy\Prophet())->prophesize();
@@ -71,13 +68,11 @@ final class TranslatableActivityReasonTest extends TypeTestCase
/**
* @param string $locale
* @param string $fallbackLocale
*
* @return TranslatableStringHelper
*/
protected function getTranslatableStringHelper(
$locale = 'en',
$fallbackLocale = 'en',
): \Chill\MainBundle\Templating\TranslatableStringHelper {
): TranslatableStringHelper {
$prophet = new \Prophecy\Prophet();
$requestStack = $prophet->prophesize();
$request = $prophet->prophesize();

View File

@@ -19,7 +19,6 @@ use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Test\PrepareCenterTrait;
use Chill\MainBundle\Test\PrepareScopeTrait;
use Chill\MainBundle\Test\PrepareUserTrait;
use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Chill\PersonBundle\Test\PreparePersonTrait;
use Prophecy\Prophet;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;

View File

@@ -41,7 +41,7 @@ class TimelineActivityProvider implements TimelineProviderInterface
$this->user = $storage->getToken()->getUser();
}
public function fetchQuery($context, array $args): \Chill\MainBundle\Timeline\TimelineSingleQuery
public function fetchQuery($context, array $args): TimelineSingleQuery
{
if ('center' === $context) {
return TimelineSingleQuery::fromArray($this->aclAwareRepository

View File

@@ -12,7 +12,6 @@ declare(strict_types=1);
namespace Chill\AsideActivityBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
/**
* Class AdminController.

View File

@@ -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_aside_activity');

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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();

View File

@@ -75,8 +75,6 @@ class Charge extends AbstractElement implements HasCentersInterface
/**
* Get id.
*
* @return int
*/
public function getId(): ?int
{

View File

@@ -47,8 +47,6 @@ class Resource extends AbstractElement implements HasCentersInterface
/**
* Get id.
*
* @return int
*/
public function getId(): ?int
{

View File

@@ -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;

View File

@@ -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]
);
}*/
}
}

View File

@@ -12,7 +12,6 @@ declare(strict_types=1);
namespace Chill\CalendarBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
class AdminController extends AbstractController
{

View File

@@ -19,7 +19,6 @@ use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Routing\Annotation\Route;
class CalendarAPIController extends ApiController
{

View File

@@ -40,7 +40,6 @@ use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Serializer\SerializerInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

View File

@@ -23,7 +23,6 @@ use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Bundle\SecurityBundle\Security;

View File

@@ -19,7 +19,6 @@ use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Routing\Annotation\Route;
class CalendarRangeAPIController extends ApiController
{

View File

@@ -29,7 +29,6 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Bundle\SecurityBundle\Security;
class InviteApiController

View File

@@ -24,7 +24,6 @@ use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use TheNetworg\OAuth2\Client\Provider\Azure;
use TheNetworg\OAuth2\Client\Token\AccessToken;

View File

@@ -23,7 +23,6 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Routing\Annotation\Route;
class RemoteCalendarMSGraphSyncController
{

View File

@@ -26,7 +26,6 @@ use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Serializer\SerializerInterface;
/**

View File

@@ -21,7 +21,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_calendar');
$rootNode = $treeBuilder->getRootNode();

View File

@@ -30,7 +30,7 @@ use Doctrine\Common\Collections\Criteria;
use Doctrine\Common\Collections\ReadableCollection;
use Doctrine\Common\Collections\Selectable;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Serializer\Attribute as Serializer;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\Range;

View File

@@ -18,7 +18,7 @@ use Chill\MainBundle\Doctrine\Model\TrackUpdateTrait;
use Chill\MainBundle\Entity\Location;
use Chill\MainBundle\Entity\User;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Attribute\Groups;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity]

View File

@@ -17,7 +17,7 @@ use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
use Chill\MainBundle\Doctrine\Model\TrackUpdateTrait;
use Chill\MainBundle\Entity\User;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Serializer\Attribute as Serializer;
/**
* An invitation for another user to a Calendar.

View File

@@ -22,17 +22,17 @@ use Chill\CalendarBundle\Messenger\Message\CalendarRangeRemovedMessage;
use Chill\CalendarBundle\RemoteCalendar\Connector\RemoteCalendarConnectorInterface;
use Chill\MainBundle\Repository\UserRepository;
use Symfony\Component\Messenger\Attribute\AsMessageHandler;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
/**
* Remove a calendar range when it is removed from local calendar.
*
* @AsMessageHandler
*/
#[\Symfony\Component\Messenger\Attribute\AsMessageHandler]
#[AsMessageHandler]
class CalendarRangeRemoveToRemoteHandler
{
public function __construct(private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly UserRepository $userRepository) {}
public function __invoke(CalendarRangeRemovedMessage $calendarRangeRemovedMessage): void
{
$this->remoteCalendarConnector->removeCalendarRange(

View File

@@ -23,17 +23,17 @@ use Chill\CalendarBundle\RemoteCalendar\Connector\RemoteCalendarConnectorInterfa
use Chill\CalendarBundle\Repository\CalendarRangeRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Messenger\Attribute\AsMessageHandler;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
/**
* Write calendar range creation / update to the remote calendar.
*
* @AsMessageHandler
*/
#[\Symfony\Component\Messenger\Attribute\AsMessageHandler]
#[AsMessageHandler]
class CalendarRangeToRemoteHandler
{
public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository, private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly EntityManagerInterface $entityManager) {}
public function __invoke(CalendarRangeMessage $calendarRangeMessage): void
{
$range = $this->calendarRangeRepository->find($calendarRangeMessage->getCalendarRangeId());

View File

@@ -22,7 +22,6 @@ use Chill\CalendarBundle\Messenger\Message\CalendarRemovedMessage;
use Chill\CalendarBundle\RemoteCalendar\Connector\RemoteCalendarConnectorInterface;
use Chill\CalendarBundle\Repository\CalendarRangeRepository;
use Chill\MainBundle\Repository\UserRepositoryInterface;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
/**
* Handle the deletion of calendar.
@@ -33,6 +32,7 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
class CalendarRemoveHandler
{
public function __construct(private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly CalendarRangeRepository $calendarRangeRepository, private readonly UserRepositoryInterface $userRepository) {}
public function __invoke(CalendarRemovedMessage $message): void
{
if (null !== $message->getAssociatedCalendarRangeId()) {

View File

@@ -28,17 +28,17 @@ use Chill\CalendarBundle\Repository\InviteRepository;
use Chill\MainBundle\Repository\UserRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Messenger\Attribute\AsMessageHandler;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
/**
* Write calendar creation / update to the remote calendar.
*
* @AsMessageHandler
*/
#[\Symfony\Component\Messenger\Attribute\AsMessageHandler]
#[AsMessageHandler]
class CalendarToRemoteHandler
{
public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository, private readonly CalendarRepository $calendarRepository, private readonly EntityManagerInterface $entityManager, private readonly InviteRepository $inviteRepository, private readonly RemoteCalendarConnectorInterface $calendarConnector, private readonly UserRepository $userRepository) {}
public function __invoke(CalendarMessage $calendarMessage): void
{
$calendar = $this->calendarRepository->find($calendarMessage->getCalendarId());

View File

@@ -22,7 +22,6 @@ use Chill\CalendarBundle\Messenger\Message\InviteUpdateMessage;
use Chill\CalendarBundle\RemoteCalendar\Connector\RemoteCalendarConnectorInterface;
use Chill\CalendarBundle\Repository\InviteRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
/**
* Sync the local invitation to the remote calendar.
@@ -33,6 +32,7 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
class InviteUpdateHandler
{
public function __construct(private readonly EntityManagerInterface $em, private readonly InviteRepository $inviteRepository, private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector) {}
public function __invoke(InviteUpdateMessage $inviteUpdateMessage): void
{
if (null === $invite = $this->inviteRepository->find($inviteUpdateMessage->getInviteId())) {

View File

@@ -27,7 +27,6 @@ use Chill\CalendarBundle\Repository\CalendarRepository;
use Chill\MainBundle\Repository\UserRepository;
use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
/**
* Handle notification of changes made by users directly on Outlook calendar.
@@ -38,6 +37,7 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
class MSGraphChangeNotificationHandler
{
public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository, private readonly CalendarRangeSyncer $calendarRangeSyncer, private readonly CalendarRepository $calendarRepository, private readonly CalendarSyncer $calendarSyncer, private readonly EntityManagerInterface $em, private readonly LoggerInterface $logger, private readonly MapCalendarToUser $mapCalendarToUser, private readonly UserRepository $userRepository) {}
public function __invoke(MSGraphChangeNotificationMessage $changeNotificationMessage): void
{
$user = $this->userRepository->find($changeNotificationMessage->getUserId());

View File

@@ -18,7 +18,7 @@ declare(strict_types=1);
namespace Chill\CalendarBundle\RemoteCalendar\Model;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Serializer\Attribute as Serializer;
class RemoteEvent
{

View File

@@ -16,7 +16,6 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\HttpFoundation\Request;
/**
* @internal

View File

@@ -19,7 +19,6 @@ declare(strict_types=1);
namespace Chill\CalendarBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\Messenger\Transport\InMemoryTransport;
/**
* @internal

View File

@@ -39,7 +39,7 @@ final class AgentAggregatorTest extends AbstractAggregatorTest
$this->aggregator = self::getContainer()->get('chill.calendar.export.agent_aggregator');
}
public function getAggregator(): \Chill\CalendarBundle\Export\Aggregator\AgentAggregator
public function getAggregator(): AgentAggregator
{
return $this->aggregator;
}

View File

@@ -39,7 +39,7 @@ final class CancelReasonAggregatorTest extends AbstractAggregatorTest
$this->aggregator = self::getContainer()->get('chill.calendar.export.cancel_reason_aggregator');
}
public function getAggregator(): \Chill\CalendarBundle\Export\Aggregator\CancelReasonAggregator
public function getAggregator(): CancelReasonAggregator
{
return $this->aggregator;
}

View File

@@ -39,7 +39,7 @@ final class JobAggregatorTest extends AbstractAggregatorTest
$this->aggregator = self::getContainer()->get('chill.calendar.export.job_aggregator');
}
public function getAggregator(): \Chill\CalendarBundle\Export\Aggregator\JobAggregator
public function getAggregator(): JobAggregator
{
return $this->aggregator;
}

View File

@@ -39,7 +39,7 @@ final class LocationAggregatorTest extends AbstractAggregatorTest
$this->aggregator = self::getContainer()->get('chill.calendar.export.location_aggregator');
}
public function getAggregator(): \Chill\CalendarBundle\Export\Aggregator\LocationAggregator
public function getAggregator(): LocationAggregator
{
return $this->aggregator;
}

View File

@@ -39,7 +39,7 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest
$this->aggregator = self::getContainer()->get('chill.calendar.export.location_type_aggregator');
}
public function getAggregator(): \Chill\CalendarBundle\Export\Aggregator\LocationTypeAggregator
public function getAggregator(): LocationTypeAggregator
{
return $this->aggregator;
}

View File

@@ -39,7 +39,7 @@ final class MonthYearAggregatorTest extends AbstractAggregatorTest
$this->aggregator = self::getContainer()->get('chill.calendar.export.month_aggregator');
}
public function getAggregator(): \Chill\CalendarBundle\Export\Aggregator\MonthYearAggregator
public function getAggregator(): MonthYearAggregator
{
return $this->aggregator;
}

View File

@@ -39,7 +39,7 @@ final class ScopeAggregatorTest extends AbstractAggregatorTest
$this->aggregator = self::getContainer()->get('chill.calendar.export.scope_aggregator');
}
public function getAggregator(): \Chill\CalendarBundle\Export\Aggregator\ScopeAggregator
public function getAggregator(): ScopeAggregator
{
return $this->aggregator;
}

View File

@@ -46,7 +46,7 @@ final class AgentFilterTest extends AbstractFilterTest
$this->filter = self::getContainer()->get('chill.calendar.export.agent_filter');
}
public function getFilter(): \Chill\CalendarBundle\Export\Filter\AgentFilter
public function getFilter(): AgentFilter
{
return $this->filter;
}

View File

@@ -46,7 +46,7 @@ final class BetweenDatesFilterTest extends AbstractFilterTest
$this->filter = self::getContainer()->get('chill.calendar.export.between_dates_filter');
}
public function getFilter(): \Chill\CalendarBundle\Export\Filter\BetweenDatesFilter
public function getFilter(): BetweenDatesFilter
{
return $this->filter;
}

View File

@@ -47,7 +47,7 @@ final class JobFilterTest extends AbstractFilterTest
$this->filter = self::getContainer()->get('chill.calendar.export.job_filter');
}
public function getFilter(): \Chill\CalendarBundle\Export\Filter\JobFilter
public function getFilter(): JobFilter
{
return $this->filter;
}

View File

@@ -47,7 +47,7 @@ final class ScopeFilterTest extends AbstractFilterTest
$this->filter = self::getContainer()->get('chill.calendar.export.scope_filter');
}
public function getFilter(): \Chill\CalendarBundle\Export\Filter\ScopeFilter
public function getFilter(): ScopeFilter
{
return $this->filter;
}

View File

@@ -13,7 +13,6 @@ namespace Chill\CustomFieldsBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
/**
* Class AdminController

View File

@@ -18,7 +18,6 @@ use Doctrine\Persistence\ManagerRegistry;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\Translation\TranslatorInterface;
/**

View File

@@ -25,7 +25,6 @@ use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\Translation\TranslatorInterface;
/**

View File

@@ -64,7 +64,7 @@ class CustomFieldDate extends AbstractCustomField
);
}
public function buildOptionsForm(FormBuilderInterface $builder): \Symfony\Component\Form\FormBuilderInterface
public function buildOptionsForm(FormBuilderInterface $builder): FormBuilderInterface
{
$validatorFunction = static function ($value, ExecutionContextInterface $context) {
try {

View File

@@ -63,7 +63,7 @@ class CustomFieldLongChoice extends AbstractCustomField
->addModelTransformer(new CustomFieldDataTransformer($this, $customField));
}
public function buildOptionsForm(FormBuilderInterface $builder): \Symfony\Component\Form\FormBuilderInterface
public function buildOptionsForm(FormBuilderInterface $builder): FormBuilderInterface
{
// create a selector between different keys
$keys = $this->optionRepository->getKeys();

View File

@@ -58,7 +58,7 @@ class CustomFieldNumber extends AbstractCustomField
$builder->add($customField->getSlug(), $type, $fieldOptions);
}
public function buildOptionsForm(FormBuilderInterface $builder): \Symfony\Component\Form\FormBuilderInterface
public function buildOptionsForm(FormBuilderInterface $builder): FormBuilderInterface
{
return $builder
->add(self::MIN, NumberType::class, [

View File

@@ -60,7 +60,7 @@ class CustomFieldText extends AbstractCustomField
]);
}
public function buildOptionsForm(FormBuilderInterface $builder): \Symfony\Component\Form\FormBuilderInterface
public function buildOptionsForm(FormBuilderInterface $builder): FormBuilderInterface
{
return $builder
->add(self::MAX_LENGTH, IntegerType::class, ['empty_data' => 256])

View File

@@ -46,7 +46,7 @@ class CustomFieldTitle extends AbstractCustomField
]);
}
public function buildOptionsForm(FormBuilderInterface $builder): \Symfony\Component\Form\FormBuilderInterface
public function buildOptionsForm(FormBuilderInterface $builder): FormBuilderInterface
{
return $builder->add(
self::TYPE,

View File

@@ -22,7 +22,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_custom_fields');
$rootNode = $treeBuilder->getRootNode();

View File

@@ -59,18 +59,14 @@ class CustomField
/**
* Get customFieldGroup.
*
* @return CustomFieldsGroup
*/
public function getCustomFieldsGroup(): ?\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup
public function getCustomFieldsGroup(): ?CustomFieldsGroup
{
return $this->customFieldGroup;
}
/**
* Get id.
*
* @return int
*/
public function getId(): ?int
{
@@ -103,9 +99,6 @@ class CustomField
return $this->name;
}
/**
* @return array
*/
public function getOptions(): array
{
return $this->options;
@@ -113,8 +106,6 @@ class CustomField
/**
* Get order.
*
* @return float
*/
public function getOrdering(): ?float
{
@@ -123,17 +114,12 @@ class CustomField
/**
* alias for isRequired.
*
* @return bool
*/
public function getRequired(): bool
{
return $this->isRequired();
}
/**
* @return string
*/
public function getSlug(): ?string
{
return $this->slug;
@@ -141,8 +127,6 @@ class CustomField
/**
* Get type.
*
* @return string
*/
public function getType(): ?string
{
@@ -151,8 +135,6 @@ class CustomField
/**
* Returns true if the custom field is active.
*
* @return bool
*/
public function isActive(): bool
{
@@ -161,8 +143,6 @@ class CustomField
/**
* return true if the field required.
*
* @return bool
*/
public function isRequired(): bool
{

View File

@@ -54,57 +54,36 @@ class Option
$this->children = new ArrayCollection();
}
/**
* @return bool
*/
public function getActive(): bool
{
return $this->isActive();
}
/**
* @return Collection
*/
public function getChildren(): \Doctrine\Common\Collections\Collection
public function getChildren(): Collection
{
return $this->children;
}
/**
* @return int
*/
public function getId(): ?int
{
return $this->id;
}
/**
* @return string
*/
public function getInternalKey(): string
{
return $this->internalKey;
}
/**
* @return string
*/
public function getKey(): ?string
{
return $this->key;
}
/**
* @return Option
*/
public function getParent(): ?\Chill\CustomFieldsBundle\Entity\CustomFieldLongChoice\Option
public function getParent(): ?Option
{
return $this->parent;
}
/**
* @return array
*/
public function getText(): ?array
{
return $this->text;
@@ -118,9 +97,6 @@ class Option
return null === $this->parent ? false : true;
}
/**
* @return bool
*/
public function isActive(): bool
{
return $this->active;

Some files were not shown because too many files have changed in this diff Show More