From 2a6ecb7b3b012a2643c6965ec080c2f07053ed69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ture=20Gj=C3=B8rup?= Date: Fri, 24 Nov 2023 12:29:31 +0100 Subject: [PATCH] DISPLAY-1030: Switch from doctrine annotations to attributes --- CHANGELOG.md | 7 +- composer.json | 1 - composer.lock | 78 +------------------ config/packages/doctrine.yaml | 2 +- rector.php | 2 +- src/Entity/AbstractBaseEntity.php | 47 ++++------- src/Entity/RefreshToken.php | 8 +- src/Entity/ScreenLayout.php | 23 ++---- src/Entity/ScreenLayoutRegions.php | 24 ++---- src/Entity/ScreenUser.php | 16 +--- src/Entity/Template.php | 19 ++--- src/Entity/Tenant.php | 19 ++--- .../Tenant/AbstractTenantScopedEntity.php | 14 +--- src/Entity/Tenant/Feed.php | 22 ++---- src/Entity/Tenant/FeedSource.php | 23 ++---- src/Entity/Tenant/Media.php | 39 +++------- src/Entity/Tenant/Playlist.php | 31 ++------ src/Entity/Tenant/PlaylistScreenRegion.php | 38 +++------ src/Entity/Tenant/PlaylistSlide.php | 22 ++---- src/Entity/Tenant/Schedule.php | 19 ++--- src/Entity/Tenant/Screen.php | 50 ++++-------- src/Entity/Tenant/ScreenCampaign.php | 18 ++--- src/Entity/Tenant/ScreenGroup.php | 12 +-- src/Entity/Tenant/ScreenGroupCampaign.php | 18 ++--- src/Entity/Tenant/Slide.php | 42 +++------- src/Entity/Tenant/Theme.php | 19 ++--- src/Entity/Traits/EntityPublishedTrait.php | 8 +- .../Traits/EntityTitleDescriptionTrait.php | 8 +- src/Entity/Traits/MultiTenantTrait.php | 5 +- src/Entity/User.php | 23 ++---- src/Entity/UserRoleTenant.php | 32 ++------ symfony.lock | 12 --- 32 files changed, 169 insertions(+), 532 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07e6750a..07669572 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,12 @@ All notable changes to this project will be documented in this file. ## [Unreleased] - [#174](https://github.com/os2display/display-api-service/pull/174) - Update composer dependencies, Enforce strict types + - Update composer dependencies + - Update `symfony/flex` 1.x -> 2.x + - Update `vich/uploader-bundle` 1.x -> 2.x + - Update `debril/feed-io 5.x -> 6.x + - Enforce strict types + - Switch from doctrine annotations to attributes - [#173](https://github.com/os2display/display-api-service/pull/173) Upgraded to API Platform 3 - [#172](https://github.com/os2display/display-api-service/pull/172) diff --git a/composer.json b/composer.json index afb725fc..00cc15a1 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,6 @@ "api-platform/core": "^3.1", "composer/package-versions-deprecated": "^1.11", "debril/feed-io": "^6.0", - "doctrine/annotations": "^1.0", "doctrine/doctrine-bundle": "^2.4", "doctrine/doctrine-migrations-bundle": "^3.1", "doctrine/orm": "^2.9", diff --git a/composer.lock b/composer.lock index 04eb2a00..d9d82477 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "28a28d5d79186145c701026df6cc0cb6", + "content-hash": "76b64fafb576030a100cd17a9ecaa4e5", "packages": [ { "name": "api-platform/core", @@ -533,82 +533,6 @@ }, "time": "2023-10-16T14:12:49+00:00" }, - { - "name": "doctrine/annotations", - "version": "1.14.3", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", - "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", - "shasum": "" - }, - "require": { - "doctrine/lexer": "^1 || ^2", - "ext-tokenizer": "*", - "php": "^7.1 || ^8.0", - "psr/cache": "^1 || ^2 || ^3" - }, - "require-dev": { - "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^9 || ^10", - "phpstan/phpstan": "~1.4.10 || ^1.8.0", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "symfony/cache": "^4.4 || ^5.4 || ^6", - "vimeo/psalm": "^4.10" - }, - "suggest": { - "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.14.3" - }, - "time": "2023-02-01T09:20:38+00:00" - }, { "name": "doctrine/cache", "version": "2.2.0", diff --git a/config/packages/doctrine.yaml b/config/packages/doctrine.yaml index 16c96fa9..5b6ecd98 100644 --- a/config/packages/doctrine.yaml +++ b/config/packages/doctrine.yaml @@ -16,7 +16,7 @@ doctrine: mappings: App: is_bundle: false - type: annotation + type: attribute dir: '%kernel.project_dir%/src/Entity' prefix: 'App\Entity' alias: App diff --git a/rector.php b/rector.php index e084025f..f78f3733 100644 --- a/rector.php +++ b/rector.php @@ -22,7 +22,7 @@ // define sets of rules $rectorConfig->sets([ LevelSetList::UP_TO_PHP_81, -// DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES, + DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES, // DoctrineSetList::DOCTRINE_DBAL_30, // DoctrineSetList::DOCTRINE_ORM_214, // DoctrineSetList::DOCTRINE_CODE_QUALITY, diff --git a/src/Entity/AbstractBaseEntity.php b/src/Entity/AbstractBaseEntity.php index 5997b09e..3a956ada 100644 --- a/src/Entity/AbstractBaseEntity.php +++ b/src/Entity/AbstractBaseEntity.php @@ -10,43 +10,27 @@ use Symfony\Bridge\Doctrine\IdGenerator\UlidGenerator; use Symfony\Component\Uid\Ulid; -/** - * @ORM\MappedSuperclass - * - * @ORM\HasLifecycleCallbacks - */ +#[ORM\MappedSuperclass] +#[ORM\HasLifecycleCallbacks] abstract class AbstractBaseEntity implements BlameableInterface { - /** - * @ORM\Id - * - * @ORM\Column(type="ulid", unique=true) - * - * @ORM\GeneratedValue(strategy="CUSTOM") - * - * @ORM\CustomIdGenerator(class=UlidGenerator::class) - */ #[ApiProperty(identifier: true)] + #[ORM\Id] + #[ORM\Column(type: 'ulid', unique: true)] + #[ORM\GeneratedValue(strategy: 'CUSTOM')] + #[ORM\CustomIdGenerator(class: UlidGenerator::class)] private ?Ulid $id = null; - /** - * @ORM\Column(type="datetime_immutable", nullable=false) - */ + #[ORM\Column(type: 'datetime_immutable', nullable: false)] private \DateTimeImmutable $createdAt; - /** - * @ORM\Column(type="datetime_immutable", nullable=false) - */ + #[ORM\Column(type: 'datetime_immutable', nullable: false)] private \DateTimeImmutable $modifiedAt; - /** - * @ORM\Column(type="string", nullable=false, options={"default":""}) - */ + #[ORM\Column(type: 'string', nullable: false, options: ['default' => ''])] private string $createdBy = ''; - /** - * @ORM\Column(type="string", nullable=false, options={"default":""}) - */ + #[ORM\Column(type: 'string', nullable: false, options: ['default' => ''])] private string $modifiedBy = ''; /** @@ -74,10 +58,8 @@ public function getCreatedAt(): \DateTimeInterface return $this->createdAt; } - /** - * @ORM\PrePersist() - */ #[Ignore] + #[ORM\PrePersist] public function setCreatedAt(): self { $this->createdAt = isset($this->id) ? $this->id->getDateTime() : new \DateTimeImmutable(); @@ -90,12 +72,9 @@ public function getModifiedAt(): \DateTimeInterface return $this->modifiedAt; } - /** - * @ORM\PrePersist() - * - * @ORM\PreUpdate() - */ #[Ignore] + #[ORM\PrePersist] + #[ORM\PreUpdate] public function setModifiedAt(): self { $this->modifiedAt = new \DateTimeImmutable(); diff --git a/src/Entity/RefreshToken.php b/src/Entity/RefreshToken.php index d619e995..8eebb814 100644 --- a/src/Entity/RefreshToken.php +++ b/src/Entity/RefreshToken.php @@ -7,11 +7,9 @@ use Doctrine\ORM\Mapping as ORM; use Gesdinet\JWTRefreshTokenBundle\Entity\RefreshToken as BaseRefreshToken; -/** - * @ORM\Entity - * - * @ORM\Table("refresh_tokens") - */ + +#[ORM\Table('refresh_tokens')] +#[ORM\Entity] class RefreshToken extends BaseRefreshToken { } diff --git a/src/Entity/ScreenLayout.php b/src/Entity/ScreenLayout.php index 7c9241a2..298385fe 100644 --- a/src/Entity/ScreenLayout.php +++ b/src/Entity/ScreenLayout.php @@ -13,35 +13,24 @@ use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; -/** - * @ORM\Entity(repositoryClass=ScreenLayoutRepository::class) - * - * @ORM\EntityListeners({"App\EventListener\ScreenLayoutDoctrineEventListener"}) - */ +#[ORM\Entity(repositoryClass: ScreenLayoutRepository::class)] +#[ORM\EntityListeners([\App\EventListener\ScreenLayoutDoctrineEventListener::class])] class ScreenLayout extends AbstractBaseEntity implements MultiTenantInterface { use MultiTenantTrait; use EntityTitleDescriptionTrait; - /** - * @ORM\Column(type="integer", nullable=false, options={"default": 0}) - */ + #[ORM\Column(type: 'integer', nullable: false, options: ['default' => 0])] private int $gridRows = 0; - /** - * @ORM\Column(type="integer", nullable=false, options={"default": 0}) - */ + #[ORM\Column(type: 'integer', nullable: false, options: ['default' => 0])] private int $gridColumns = 0; - /** - * @ORM\OneToMany(targetEntity=Screen::class, mappedBy="screenLayout") - */ + #[ORM\OneToMany(targetEntity: Screen::class, mappedBy: 'screenLayout')] private Collection $screens; - /** - * @ORM\OneToMany(targetEntity=ScreenLayoutRegions::class, mappedBy="screenLayout") - */ + #[ORM\OneToMany(targetEntity: ScreenLayoutRegions::class, mappedBy: 'screenLayout')] private Collection $regions; public function __construct() diff --git a/src/Entity/ScreenLayoutRegions.php b/src/Entity/ScreenLayoutRegions.php index 0fa334f0..8fc0ca0b 100644 --- a/src/Entity/ScreenLayoutRegions.php +++ b/src/Entity/ScreenLayoutRegions.php @@ -13,44 +13,34 @@ use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Annotation\Groups; -/** - * @ORM\Entity(repositoryClass=ScreenLayoutRegionsRepository::class) - * - * @ORM\EntityListeners({"App\EventListener\ScreenLayoutRegionsDoctrineEventListener"}) - */ +#[ORM\Entity(repositoryClass: ScreenLayoutRegionsRepository::class)] +#[ORM\EntityListeners([\App\EventListener\ScreenLayoutRegionsDoctrineEventListener::class])] class ScreenLayoutRegions extends AbstractBaseEntity implements MultiTenantInterface { use MultiTenantTrait; /** - * @ORM\Column(type="string", length=255, nullable=false, options={"default" : ""}) - * * @Groups({"read"}) */ + #[ORM\Column(type: 'string', length: 255, nullable: false, options: ['default' => ''])] private string $title = ''; /** - * @ORM\Column(type="array", nullable=false) - * * @Groups({"read"}) */ + #[ORM\Column(type: 'array', nullable: false)] private array $gridArea = []; - /** - * @ORM\OneToMany(targetEntity=PlaylistScreenRegion::class, mappedBy="region", orphanRemoval=true) - */ + #[ORM\OneToMany(targetEntity: PlaylistScreenRegion::class, mappedBy: 'region', orphanRemoval: true)] private Collection $playlistScreenRegions; - /** - * @ORM\ManyToOne(targetEntity=ScreenLayout::class, inversedBy="regions") - */ + #[ORM\ManyToOne(targetEntity: ScreenLayout::class, inversedBy: 'regions')] private ?ScreenLayout $screenLayout = null; /** - * @ORM\Column(type="string", length=255, nullable=true) - * * @Groups({"read"}) */ + #[ORM\Column(type: 'string', length: 255, nullable: true)] private ?string $type = null; public function __construct() diff --git a/src/Entity/ScreenUser.php b/src/Entity/ScreenUser.php index 9fd86bd3..8bc69743 100644 --- a/src/Entity/ScreenUser.php +++ b/src/Entity/ScreenUser.php @@ -14,26 +14,18 @@ use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface; use Symfony\Component\Security\Core\User\UserInterface; -/** - * @ORM\Entity(repositoryClass=ScreenUserRepository::class) - */ +#[ORM\Entity(repositoryClass: ScreenUserRepository::class)] class ScreenUser extends AbstractTenantScopedEntity implements UserInterface, TenantScopedUserInterface { final public const ROLE_SCREEN = 'ROLE_SCREEN'; - /** - * @ORM\Column(type="string", length=180, unique=true) - */ + #[ORM\Column(type: 'string', length: 180, unique: true)] private string $username; - /** - * @ORM\Column(type="json") - */ + #[ORM\Column(type: 'json')] private array $roles = []; - /** - * @ORM\OneToOne(targetEntity=Screen::class, inversedBy="screenUser") - */ + #[ORM\OneToOne(targetEntity: Screen::class, inversedBy: 'screenUser')] private Screen $screen; /** diff --git a/src/Entity/Template.php b/src/Entity/Template.php index 04c0c3ab..cb9f7987 100644 --- a/src/Entity/Template.php +++ b/src/Entity/Template.php @@ -13,30 +13,21 @@ use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; -/** - * @ORM\Entity(repositoryClass=TemplateRepository::class) - * - * @ORM\EntityListeners({"App\EventListener\TemplateDoctrineEventListener"}) - */ +#[ORM\Entity(repositoryClass: TemplateRepository::class)] +#[ORM\EntityListeners([\App\EventListener\TemplateDoctrineEventListener::class])] class Template extends AbstractBaseEntity implements MultiTenantInterface { use MultiTenantTrait; use EntityTitleDescriptionTrait; - /** - * @ORM\Column(type="string", length=255, nullable=false, options={"default" : ""}) - */ + #[ORM\Column(type: 'string', length: 255, nullable: false, options: ['default' => ''])] private string $icon = ''; - /** - * @ORM\Column(type="array") - */ + #[ORM\Column(type: 'array')] private array $resources = []; - /** - * @ORM\OneToMany(targetEntity=Slide::class, mappedBy="template") - */ + #[ORM\OneToMany(targetEntity: Slide::class, mappedBy: 'template')] private Collection $slides; public function __construct() diff --git a/src/Entity/Tenant.php b/src/Entity/Tenant.php index 411871fc..7f0a4b06 100644 --- a/src/Entity/Tenant.php +++ b/src/Entity/Tenant.php @@ -10,28 +10,19 @@ use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; -/** - * @ORM\Entity(repositoryClass=TenantRepository::class) - * - * @ORM\EntityListeners({"App\EventListener\TenantDoctrineEventListener"}) - */ +#[ORM\Entity(repositoryClass: TenantRepository::class)] +#[ORM\EntityListeners([\App\EventListener\TenantDoctrineEventListener::class])] class Tenant extends AbstractBaseEntity implements \JsonSerializable { use EntityTitleDescriptionTrait; - /** - * @ORM\Column(type="string", length=25, unique=true) - */ + #[ORM\Column(type: 'string', length: 25, unique: true)] private string $tenantKey = ''; - /** - * @ORM\OneToMany(targetEntity=UserRoleTenant::class, mappedBy="tenant", orphanRemoval=true) - */ + #[ORM\OneToMany(targetEntity: UserRoleTenant::class, mappedBy: 'tenant', orphanRemoval: true)] private Collection $userRoleTenants; - /** - * @ORM\Column(type="string", nullable="true") - */ + #[ORM\Column(type: 'string', nullable: true)] private ?string $fallbackImageUrl = null; public function __construct() diff --git a/src/Entity/Tenant/AbstractTenantScopedEntity.php b/src/Entity/Tenant/AbstractTenantScopedEntity.php index 5207f72e..03edc1f1 100644 --- a/src/Entity/Tenant/AbstractTenantScopedEntity.php +++ b/src/Entity/Tenant/AbstractTenantScopedEntity.php @@ -9,18 +9,12 @@ use App\Entity\Tenant; use Doctrine\ORM\Mapping as ORM; -/** - * @ORM\MappedSuperclass - * - * @ORM\HasLifecycleCallbacks - */ +#[ORM\MappedSuperclass] +#[ORM\HasLifecycleCallbacks] abstract class AbstractTenantScopedEntity extends AbstractBaseEntity implements TenantScopedEntityInterface { - /** - * @ORM\ManyToOne(targetEntity=Tenant::class) - * - * @ORM\JoinColumn(nullable=false) - */ + #[ORM\ManyToOne(targetEntity: Tenant::class)] + #[ORM\JoinColumn(nullable: false)] private Tenant $tenant; public function getTenant(): Tenant diff --git a/src/Entity/Tenant/Feed.php b/src/Entity/Tenant/Feed.php index fac0c257..f8c81c07 100644 --- a/src/Entity/Tenant/Feed.php +++ b/src/Entity/Tenant/Feed.php @@ -7,28 +7,18 @@ use App\Repository\FeedRepository; use Doctrine\ORM\Mapping as ORM; -/** - * @ORM\Entity(repositoryClass=FeedRepository::class) - * - * @ORM\EntityListeners({"App\EventListener\FeedDoctrineEventListener"}) - */ +#[ORM\Entity(repositoryClass: FeedRepository::class)] +#[ORM\EntityListeners([\App\EventListener\FeedDoctrineEventListener::class])] class Feed extends AbstractTenantScopedEntity { - /** - * @ORM\ManyToOne(targetEntity=FeedSource::class, inversedBy="feeds") - * - * @ORM\JoinColumn(nullable=false) - */ + #[ORM\ManyToOne(targetEntity: FeedSource::class, inversedBy: 'feeds')] + #[ORM\JoinColumn(nullable: false)] private ?FeedSource $feedSource = null; - /** - * @ORM\Column(type="json", nullable=true) - */ + #[ORM\Column(type: 'json', nullable: true)] private ?array $configuration = []; - /** - * @ORM\OneToOne(targetEntity=Slide::class, mappedBy="feed")) - */ + #[ORM\OneToOne(targetEntity: Slide::class, mappedBy: 'feed')] private ?Slide $slide = null; public function getFeedSource(): ?FeedSource diff --git a/src/Entity/Tenant/FeedSource.php b/src/Entity/Tenant/FeedSource.php index 5dc154ff..38a9d4d3 100644 --- a/src/Entity/Tenant/FeedSource.php +++ b/src/Entity/Tenant/FeedSource.php @@ -10,33 +10,22 @@ use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; -/** - * @ORM\Entity(repositoryClass=FeedSourceRepository::class) - * - * @ORM\EntityListeners({"App\EventListener\FeedSourceDoctrineEventListener"}) - */ +#[ORM\Entity(repositoryClass: FeedSourceRepository::class)] +#[ORM\EntityListeners([\App\EventListener\FeedSourceDoctrineEventListener::class])] class FeedSource extends AbstractTenantScopedEntity { use EntityTitleDescriptionTrait; - /** - * @ORM\Column(type="string", length=255) - */ + #[ORM\Column(type: 'string', length: 255)] private string $feedType = ''; - /** - * @ORM\Column(type="json", nullable=true) - */ + #[ORM\Column(type: 'json', nullable: true)] private ?array $secrets = []; - /** - * @ORM\OneToMany(targetEntity=Feed::class, mappedBy="feedSource", orphanRemoval=true) - */ + #[ORM\OneToMany(targetEntity: Feed::class, mappedBy: 'feedSource', orphanRemoval: true)] private Collection $feeds; - /** - * @ORM\Column(type="string", length=255) - */ + #[ORM\Column(type: 'string', length: 255)] private string $supportedFeedOutputType = ''; public function __construct() diff --git a/src/Entity/Tenant/Media.php b/src/Entity/Tenant/Media.php index de7c3688..b7a55e83 100644 --- a/src/Entity/Tenant/Media.php +++ b/src/Entity/Tenant/Media.php @@ -13,12 +13,9 @@ use Symfony\Component\Validator\Constraints as Assert; use Vich\UploaderBundle\Mapping\Annotation as Vich; -/** - * @ORM\Entity(repositoryClass=MediaRepository::class) - * - * @ORM\EntityListeners({"App\EventListener\MediaDoctrineEventListener"}) - */ #[Vich\Uploadable] +#[ORM\Entity(repositoryClass: MediaRepository::class)] +#[ORM\EntityListeners([\App\EventListener\MediaDoctrineEventListener::class])] class Media extends AbstractTenantScopedEntity { use EntityTitleDescriptionTrait; @@ -35,44 +32,28 @@ class Media extends AbstractTenantScopedEntity #[Vich\UploadableField(mapping: 'media_object', fileNameProperty: 'filePath', size: 'size')] public ?File $file = null; - /** - * @ORM\Column(nullable=true) - */ + #[ORM\Column(nullable: true)] public ?string $filePath = null; - /** - * @ORM\Column(type="string", length=255, nullable=true, options={"default": ""}) - */ + #[ORM\Column(type: 'string', length: 255, nullable: true, options: ['default' => ''])] private string $license = ''; - /** - * @ORM\Column(type="integer", options={"default": 0}) - */ + #[ORM\Column(type: 'integer', options: ['default' => 0])] private int $width = 0; - /** - * @ORM\Column(type="integer", options={"default": 0}) - */ + #[ORM\Column(type: 'integer', options: ['default' => 0])] private int $height = 0; - /** - * @ORM\Column(type="integer", options={"default": 0}) - */ + #[ORM\Column(type: 'integer', options: ['default' => 0])] private int $size = 0; - /** - * @ORM\Column(type="string", options={"default": ""}) - */ + #[ORM\Column(type: 'string', options: ['default' => ''])] private string $mimeType = ''; - /** - * @ORM\Column(type="string", options={"default": ""}) - */ + #[ORM\Column(type: 'string', options: ['default' => ''])] private string $sha = ''; - /** - * @ORM\ManyToMany(targetEntity=Slide::class, mappedBy="media") - */ + #[ORM\ManyToMany(targetEntity: Slide::class, mappedBy: 'media')] private Collection $slides; public function __construct() diff --git a/src/Entity/Tenant/Playlist.php b/src/Entity/Tenant/Playlist.php index d880bddd..631dcea1 100644 --- a/src/Entity/Tenant/Playlist.php +++ b/src/Entity/Tenant/Playlist.php @@ -13,45 +13,30 @@ use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; -/** - * @ORM\Entity(repositoryClass=PlaylistRepository::class) - */ +#[ORM\Entity(repositoryClass: PlaylistRepository::class)] class Playlist extends AbstractTenantScopedEntity implements MultiTenantInterface { use EntityPublishedTrait; use MultiTenantTrait; use EntityTitleDescriptionTrait; - /** - * @ORM\OneToMany(targetEntity=ScreenCampaign::class, mappedBy="campaign", orphanRemoval=true) - */ + #[ORM\OneToMany(mappedBy: 'campaign', targetEntity: ScreenCampaign::class, orphanRemoval: true)] private Collection $screenCampaigns; - /** - * @ORM\OneToMany(targetEntity=ScreenGroupCampaign::class, mappedBy="campaign", orphanRemoval=true) - */ + #[ORM\OneToMany(mappedBy: 'campaign', targetEntity: ScreenGroupCampaign::class, orphanRemoval: true)] private Collection $screenGroupCampaigns; - /** - * @ORM\OneToMany(targetEntity=PlaylistScreenRegion::class, mappedBy="playlist", orphanRemoval=true) - */ + #[ORM\OneToMany(mappedBy: 'playlist', targetEntity: PlaylistScreenRegion::class, orphanRemoval: true)] private Collection $playlistScreenRegions; - /** - * @ORM\OneToMany(targetEntity=PlaylistSlide::class, mappedBy="playlist", orphanRemoval=true) - * - * @ORM\OrderBy({"weight" = "ASC"}) - */ + #[ORM\OneToMany(mappedBy: 'playlist', targetEntity: PlaylistSlide::class, orphanRemoval: true)] + #[ORM\OrderBy(['weight' => 'ASC'])] private Collection $playlistSlides; - /** - * @ORM\Column(type="boolean") - */ + #[ORM\Column(type: 'boolean')] private bool $isCampaign = false; - /** - * @ORM\OneToMany(targetEntity=Schedule::class, mappedBy="playlist", orphanRemoval=true, cascade={"persist"}) - */ + #[ORM\OneToMany(mappedBy: 'playlist', targetEntity: Schedule::class, cascade: ['persist'], orphanRemoval: true)] private Collection $schedules; public function __construct() diff --git a/src/Entity/Tenant/PlaylistScreenRegion.php b/src/Entity/Tenant/PlaylistScreenRegion.php index 389d6369..c34c6eae 100644 --- a/src/Entity/Tenant/PlaylistScreenRegion.php +++ b/src/Entity/Tenant/PlaylistScreenRegion.php @@ -8,42 +8,24 @@ use App\Repository\PlaylistScreenRegionRepository; use Doctrine\ORM\Mapping as ORM; -/** - * @ORM\Entity(repositoryClass=PlaylistScreenRegionRepository::class) - * - * @ORM\Table ( - * uniqueConstraints={ - * - * @ORM\UniqueConstraint(name="unique_playlist_screen_region", columns={"playlist_id", "screen_id", "region_id"}) - * } - * ) - */ +#[ORM\Table] +#[ORM\UniqueConstraint(name: 'unique_playlist_screen_region', columns: ['playlist_id', 'screen_id', 'region_id'])] +#[ORM\Entity(repositoryClass: PlaylistScreenRegionRepository::class)] class PlaylistScreenRegion extends AbstractTenantScopedEntity { - /** - * @ORM\ManyToOne(targetEntity=Playlist::class, inversedBy="playlistScreenRegions") - * - * @ORM\JoinColumn(nullable=false) - */ + #[ORM\ManyToOne(targetEntity: Playlist::class, inversedBy: 'playlistScreenRegions')] + #[ORM\JoinColumn(nullable: false)] private ?Playlist $playlist = null; - /** - * @ORM\ManyToOne(targetEntity=Screen::class, inversedBy="playlistScreenRegions") - * - * @ORM\JoinColumn(nullable=false) - */ + #[ORM\ManyToOne(targetEntity: Screen::class, inversedBy: 'playlistScreenRegions')] + #[ORM\JoinColumn(nullable: false)] private ?Screen $screen = null; - /** - * @ORM\ManyToOne(targetEntity=ScreenLayoutRegions::class, inversedBy="playlistScreenRegions") - * - * @ORM\JoinColumn(nullable=false) - */ + #[ORM\ManyToOne(targetEntity: ScreenLayoutRegions::class, inversedBy: 'playlistScreenRegions')] + #[ORM\JoinColumn(nullable: false)] private ?ScreenLayoutRegions $region = null; - /** - * @ORM\Column(type="integer", options={"default": 0}) - */ + #[ORM\Column(type: 'integer', options: ['default' => 0])] private int $weight = 0; public function getPlaylist(): ?Playlist diff --git a/src/Entity/Tenant/PlaylistSlide.php b/src/Entity/Tenant/PlaylistSlide.php index 1eb5827a..f6bda1a7 100644 --- a/src/Entity/Tenant/PlaylistSlide.php +++ b/src/Entity/Tenant/PlaylistSlide.php @@ -7,28 +7,18 @@ use App\Repository\PlaylistSlideRepository; use Doctrine\ORM\Mapping as ORM; -/** - * @ORM\Entity(repositoryClass=PlaylistSlideRepository::class) - */ +#[ORM\Entity(repositoryClass: PlaylistSlideRepository::class)] class PlaylistSlide extends AbstractTenantScopedEntity { - /** - * @ORM\ManyToOne(targetEntity=Playlist::class, inversedBy="playlistSlides") - * - * @ORM\JoinColumn(nullable=false) - */ + #[ORM\ManyToOne(targetEntity: Playlist::class, inversedBy: 'playlistSlides')] + #[ORM\JoinColumn(nullable: false)] private Playlist $playlist; - /** - * @ORM\ManyToOne(targetEntity=Slide::class, inversedBy="playlistSlides") - * - * @ORM\JoinColumn(nullable=false) - */ + #[ORM\ManyToOne(targetEntity: Slide::class, inversedBy: 'playlistSlides')] + #[ORM\JoinColumn(nullable: false)] private Slide $slide; - /** - * @ORM\Column(type="integer", options={"default": 0}) - */ + #[ORM\Column(type: 'integer', options: ['default' => 0])] private int $weight = 0; public function getPlaylist(): Playlist diff --git a/src/Entity/Tenant/Schedule.php b/src/Entity/Tenant/Schedule.php index 2bc719d3..a4991593 100644 --- a/src/Entity/Tenant/Schedule.php +++ b/src/Entity/Tenant/Schedule.php @@ -8,26 +8,17 @@ use Doctrine\ORM\Mapping as ORM; use RRule\RRule; -/** - * @ORM\Entity(repositoryClass=ScheduleRepository::class) - */ +#[ORM\Entity(repositoryClass: ScheduleRepository::class)] class Schedule extends AbstractTenantScopedEntity { - /** - * @ORM\Column(type="rrule") - */ + #[ORM\Column(type: 'rrule')] private RRule $rrule; - /** - * @ORM\Column(type="integer") - */ + #[ORM\Column(type: 'integer')] private int $duration = 0; - /** - * @ORM\ManyToOne(targetEntity=Playlist::class, inversedBy="schedules") - * - * @ORM\JoinColumn(nullable=false) - */ + #[ORM\ManyToOne(targetEntity: Playlist::class, inversedBy: 'schedules')] + #[ORM\JoinColumn(nullable: false)] private ?Playlist $playlist = null; public function getRrule(): RRule diff --git a/src/Entity/Tenant/Screen.php b/src/Entity/Tenant/Screen.php index 5168ef98..56170fb3 100644 --- a/src/Entity/Tenant/Screen.php +++ b/src/Entity/Tenant/Screen.php @@ -12,65 +12,41 @@ use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; -/** - * @ORM\Entity(repositoryClass=ScreenRepository::class) - */ +#[ORM\Entity(repositoryClass: ScreenRepository::class)] class Screen extends AbstractTenantScopedEntity { use EntityTitleDescriptionTrait; - /** - * @ORM\Column(type="integer", options={"default": 0}) - */ + #[ORM\Column(type: 'integer', options: ['default' => 0])] private int $size = 0; - /** - * @ORM\Column(type="string", length=255, nullable=false, options={"default": ""}) - */ + #[ORM\Column(type: 'string', length: 255, nullable: false, options: ['default' => ''])] private string $resolution = ''; - /** - * @ORM\Column(type="string", length=255, nullable=false, options={"default": ""}) - */ + #[ORM\Column(type: 'string', length: 255, nullable: false, options: ['default' => ''])] private string $orientation = ''; - /** - * @ORM\OneToMany(targetEntity=ScreenCampaign::class, mappedBy="screen", orphanRemoval=true) - */ + #[ORM\OneToMany(mappedBy: 'screen', targetEntity: ScreenCampaign::class, orphanRemoval: true)] private Collection $screenCampaigns; - /** - * @ORM\ManyToOne(targetEntity=ScreenLayout::class, inversedBy="screens") - * - * @ORM\JoinColumn(nullable=false) - */ + #[ORM\ManyToOne(targetEntity: ScreenLayout::class, inversedBy: 'screens')] + #[ORM\JoinColumn(nullable: false)] private ScreenLayout $screenLayout; - /** - * @ORM\Column(type="string", length=255, nullable=true, options={"default": ""}) - */ + #[ORM\Column(type: 'string', length: 255, nullable: true, options: ['default' => ''])] private string $location = ''; - /** - * @ORM\OneToMany(targetEntity=PlaylistScreenRegion::class, mappedBy="screen", orphanRemoval=true) - * - * @ORM\OrderBy({"weight" = "ASC"}) - */ + #[ORM\OneToMany(mappedBy: 'screen', targetEntity: PlaylistScreenRegion::class, orphanRemoval: true)] + #[ORM\OrderBy(['weight' => 'ASC'])] private Collection $playlistScreenRegions; - /** - * @ORM\ManyToMany(targetEntity=ScreenGroup::class, mappedBy="screens") - */ + #[ORM\ManyToMany(targetEntity: ScreenGroup::class, mappedBy: 'screens')] private Collection $screenGroups; - /** - * @ORM\OneToOne(targetEntity=ScreenUser::class, mappedBy="screen", orphanRemoval="true") - */ + #[ORM\OneToOne(mappedBy: 'screen', targetEntity: ScreenUser::class, orphanRemoval: true)] private ?ScreenUser $screenUser = null; - /** - * @ORM\Column(type="boolean", nullable=true) - */ + #[ORM\Column(type: 'boolean', nullable: true)] private ?bool $enableColorSchemeChange = null; public function __construct() diff --git a/src/Entity/Tenant/ScreenCampaign.php b/src/Entity/Tenant/ScreenCampaign.php index b6102619..8a39bff0 100644 --- a/src/Entity/Tenant/ScreenCampaign.php +++ b/src/Entity/Tenant/ScreenCampaign.php @@ -7,23 +7,15 @@ use App\Repository\ScreenCampaignRepository; use Doctrine\ORM\Mapping as ORM; -/** - * @ORM\Entity(repositoryClass=ScreenCampaignRepository::class) - */ +#[ORM\Entity(repositoryClass: ScreenCampaignRepository::class)] class ScreenCampaign extends AbstractTenantScopedEntity { - /** - * @ORM\ManyToOne(targetEntity=Playlist::class, inversedBy="screenCampaigns") - * - * @ORM\JoinColumn(nullable=false) - */ + #[ORM\ManyToOne(targetEntity: Playlist::class, inversedBy: 'screenCampaigns')] + #[ORM\JoinColumn(nullable: false)] private Playlist $campaign; - /** - * @ORM\ManyToOne(targetEntity=Screen::class, inversedBy="screenCampaigns") - * - * @ORM\JoinColumn(nullable=false) - */ + #[ORM\ManyToOne(targetEntity: Screen::class, inversedBy: 'screenCampaigns')] + #[ORM\JoinColumn(nullable: false)] private Screen $screen; public function getCampaign(): Playlist diff --git a/src/Entity/Tenant/ScreenGroup.php b/src/Entity/Tenant/ScreenGroup.php index 88b8f3cc..d97c9c90 100644 --- a/src/Entity/Tenant/ScreenGroup.php +++ b/src/Entity/Tenant/ScreenGroup.php @@ -10,21 +10,15 @@ use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; -/** - * @ORM\Entity(repositoryClass=ScreenGroupRepository::class) - */ +#[ORM\Entity(repositoryClass: ScreenGroupRepository::class)] class ScreenGroup extends AbstractTenantScopedEntity { use EntityTitleDescriptionTrait; - /** - * @ORM\OneToMany(targetEntity=ScreenGroupCampaign::class, mappedBy="screenGroup", orphanRemoval=true) - */ + #[ORM\OneToMany(targetEntity: ScreenGroupCampaign::class, mappedBy: 'screenGroup', orphanRemoval: true)] private Collection $screenGroupCampaigns; - /** - * @ORM\ManyToMany(targetEntity=Screen::class, inversedBy="screenGroups") - */ + #[ORM\ManyToMany(targetEntity: Screen::class, inversedBy: 'screenGroups')] private Collection $screens; public function __construct() diff --git a/src/Entity/Tenant/ScreenGroupCampaign.php b/src/Entity/Tenant/ScreenGroupCampaign.php index 73f8b897..7ef79232 100644 --- a/src/Entity/Tenant/ScreenGroupCampaign.php +++ b/src/Entity/Tenant/ScreenGroupCampaign.php @@ -7,23 +7,15 @@ use App\Repository\ScreenGroupCampaignRepository; use Doctrine\ORM\Mapping as ORM; -/** - * @ORM\Entity(repositoryClass=ScreenGroupCampaignRepository::class) - */ +#[ORM\Entity(repositoryClass: ScreenGroupCampaignRepository::class)] class ScreenGroupCampaign extends AbstractTenantScopedEntity { - /** - * @ORM\ManyToOne(targetEntity=Playlist::class, inversedBy="screenGroupCampaigns") - * - * @ORM\JoinColumn(nullable=false) - */ + #[ORM\ManyToOne(targetEntity: Playlist::class, inversedBy: 'screenGroupCampaigns')] + #[ORM\JoinColumn(nullable: false)] private Playlist $campaign; - /** - * @ORM\ManyToOne(targetEntity=ScreenGroup::class, inversedBy="screenGroupCampaigns") - * - * @ORM\JoinColumn(nullable=false) - */ + #[ORM\ManyToOne(targetEntity: ScreenGroup::class, inversedBy: 'screenGroupCampaigns')] + #[ORM\JoinColumn(nullable: false)] private ScreenGroup $screenGroup; public function getCampaign(): Playlist diff --git a/src/Entity/Tenant/Slide.php b/src/Entity/Tenant/Slide.php index b6850044..c59c8d7e 100644 --- a/src/Entity/Tenant/Slide.php +++ b/src/Entity/Tenant/Slide.php @@ -12,56 +12,36 @@ use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; -/** - * @ORM\Entity(repositoryClass=SlideRepository::class) - */ +#[ORM\Entity(repositoryClass: SlideRepository::class)] class Slide extends AbstractTenantScopedEntity { use EntityPublishedTrait; use EntityTitleDescriptionTrait; - /** - * @ORM\ManyToOne(targetEntity=Template::class, inversedBy="slides") - * - * @ORM\JoinColumn(nullable=false) - */ + #[ORM\ManyToOne(targetEntity: Template::class, inversedBy: 'slides')] + #[ORM\JoinColumn(nullable: false)] private ?Template $template = null; - /** - * @ORM\ManyToOne(targetEntity=Theme::class, inversedBy="slides") - * - * @ORM\JoinColumn(onDelete="SET NULL") - */ + #[ORM\ManyToOne(targetEntity: Theme::class, inversedBy: 'slides')] + #[ORM\JoinColumn(onDelete: 'SET NULL')] private ?Theme $theme = null; - /** - * @ORM\Column(type="array", nullable=true) - */ + #[ORM\Column(type: 'array', nullable: true)] private array $templateOptions = []; - /** - * @ORM\Column(type="integer", nullable=true) - */ + #[ORM\Column(type: 'integer', nullable: true)] private ?int $duration = null; - /** - * @ORM\Column(type="json", nullable=true) - */ + #[ORM\Column(type: 'json', nullable: true)] private array $content = []; - /** - * @ORM\ManyToMany(targetEntity=Media::class, inversedBy="slides") - */ + #[ORM\ManyToMany(targetEntity: Media::class, inversedBy: 'slides')] private Collection $media; - /** - * @ORM\OneToMany(targetEntity=PlaylistSlide::class, mappedBy="slide", fetch="EXTRA_LAZY", cascade={"remove"}) - */ + #[ORM\OneToMany(targetEntity: PlaylistSlide::class, mappedBy: 'slide', fetch: 'EXTRA_LAZY', cascade: ['remove'])] private Collection $playlistSlides; - /** - * @ORM\OneToOne(targetEntity=Feed::class, cascade={"persist", "remove"}, orphanRemoval=true, inversedBy="slide") - */ + #[ORM\OneToOne(targetEntity: Feed::class, cascade: ['persist', 'remove'], orphanRemoval: true, inversedBy: 'slide')] private ?Feed $feed = null; public function __construct() diff --git a/src/Entity/Tenant/Theme.php b/src/Entity/Tenant/Theme.php index bce2840e..484a869b 100644 --- a/src/Entity/Tenant/Theme.php +++ b/src/Entity/Tenant/Theme.php @@ -10,28 +10,19 @@ use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; -/** - * @ORM\Entity(repositoryClass=ThemeRepository::class) - * - * @ORM\EntityListeners({"App\EventListener\ThemeDoctrineEventListener"}) - */ +#[ORM\Entity(repositoryClass: ThemeRepository::class)] +#[ORM\EntityListeners([\App\EventListener\ThemeDoctrineEventListener::class])] class Theme extends AbstractTenantScopedEntity { use EntityTitleDescriptionTrait; - /** - * @ORM\Column(type="text") - */ + #[ORM\Column(type: 'text')] private string $cssStyles = ''; - /** - * @ORM\OneToOne(targetEntity=Media::class) - */ + #[ORM\OneToOne(targetEntity: Media::class)] private ?Media $logo = null; - /** - * @ORM\OneToMany(targetEntity=Slide::class, mappedBy="theme") - */ + #[ORM\OneToMany(targetEntity: Slide::class, mappedBy: 'theme')] private Collection $slides; public function __construct() diff --git a/src/Entity/Traits/EntityPublishedTrait.php b/src/Entity/Traits/EntityPublishedTrait.php index 60c4b3ae..a1314bf5 100644 --- a/src/Entity/Traits/EntityPublishedTrait.php +++ b/src/Entity/Traits/EntityPublishedTrait.php @@ -11,14 +11,10 @@ */ trait EntityPublishedTrait { - /** - * @ORM\Column(type="datetime", nullable=true) - */ + #[ORM\Column(type: 'datetime', nullable: true)] private ?\DateTime $publishedFrom; - /** - * @ORM\Column(type="datetime", nullable=true) - */ + #[ORM\Column(type: 'datetime', nullable: true)] private ?\DateTime $publishedTo; public function getPublishedFrom(): ?\DateTime diff --git a/src/Entity/Traits/EntityTitleDescriptionTrait.php b/src/Entity/Traits/EntityTitleDescriptionTrait.php index 523df567..560b1d01 100644 --- a/src/Entity/Traits/EntityTitleDescriptionTrait.php +++ b/src/Entity/Traits/EntityTitleDescriptionTrait.php @@ -11,14 +11,10 @@ */ trait EntityTitleDescriptionTrait { - /** - * @ORM\Column(type="string", length=255, nullable=false, options={"default": ""}) - */ + #[ORM\Column(type: 'string', length: 255, nullable: false, options: ['default' => ''])] private string $title = ''; - /** - * @ORM\Column(type="string", length=255, nullable=false, options={"default": ""}) - */ + #[ORM\Column(type: 'string', length: 255, nullable: false, options: ['default' => ''])] private string $description = ''; public function getTitle(): string diff --git a/src/Entity/Traits/MultiTenantTrait.php b/src/Entity/Traits/MultiTenantTrait.php index cc1d9a5d..6f893285 100644 --- a/src/Entity/Traits/MultiTenantTrait.php +++ b/src/Entity/Traits/MultiTenantTrait.php @@ -6,12 +6,11 @@ use App\Entity\Tenant; use Doctrine\Common\Collections\Collection; +use Doctrine\ORM\Mapping as ORM; trait MultiTenantTrait { - /** - * @ORM\ManyToMany(targetEntity=Tenant::class) - */ + #[ORM\ManyToMany(targetEntity: Tenant::class)] private Collection $tenants; /** diff --git a/src/Entity/User.php b/src/Entity/User.php index fe5b7e05..2645efdd 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -13,38 +13,27 @@ use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Validator\Constraints as Assert; -/** - * @ORM\Entity(repositoryClass=UserRepository::class) - */ +#[ORM\Entity(repositoryClass: UserRepository::class)] class User extends AbstractBaseEntity implements UserInterface, PasswordAuthenticatedUserInterface, \JsonSerializable, TenantScopedUserInterface { - /** - * @ORM\Column(type="string", length=180, unique=true) - */ #[Assert\Email] + #[ORM\Column(type: 'string', length: 180, unique: true)] private string $email = ''; - /** - * @ORM\Column(type="string") - */ #[Assert\NotBlank] + #[ORM\Column(type: 'string')] private ?string $fullName = null; /** * @var string The hashed password - * - * @ORM\Column(type="string") */ + #[ORM\Column(type: 'string')] private string $password = ''; - /** - * @ORM\OneToMany(targetEntity=UserRoleTenant::class, mappedBy="user", cascade={"persist", "remove"}, orphanRemoval=true) - */ + #[ORM\OneToMany(targetEntity: UserRoleTenant::class, mappedBy: 'user', cascade: ['persist', 'remove'], orphanRemoval: true)] private Collection $userRoleTenants; - /** - * @ORM\Column(type="string") - */ + #[ORM\Column(type: 'string')] private ?string $provider = null; private ?Tenant $activeTenant = null; diff --git a/src/Entity/UserRoleTenant.php b/src/Entity/UserRoleTenant.php index 53e73a6f..28ed1dda 100644 --- a/src/Entity/UserRoleTenant.php +++ b/src/Entity/UserRoleTenant.php @@ -7,36 +7,20 @@ use App\Repository\UserRoleTenantRepository; use Doctrine\ORM\Mapping as ORM; -/** - * @ORM\Table(name="user_role_tenant", - * uniqueConstraints={ - * - * @ORM\UniqueConstraint(name="user_tenant_unique", - * columns={"user_id", "tenant_id"}) - * } - * ) - * - * @ORM\Entity(repositoryClass=UserRoleTenantRepository::class) - */ +#[ORM\Table(name: 'user_role_tenant')] +#[ORM\UniqueConstraint(name: 'user_tenant_unique', columns: ['user_id', 'tenant_id'])] +#[ORM\Entity(repositoryClass: UserRoleTenantRepository::class)] class UserRoleTenant extends AbstractBaseEntity implements \JsonSerializable { - /** - * @ORM\ManyToOne(targetEntity=User::class, inversedBy="userRoleTenants") - * - * @ORM\JoinColumn(nullable=false) - */ + #[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'userRoleTenants')] + #[ORM\JoinColumn(nullable: false)] private ?User $user = null; - /** - * @ORM\ManyToOne(targetEntity=Tenant::class, inversedBy="userRoleTenants") - * - * @ORM\JoinColumn(nullable=false) - */ + #[ORM\ManyToOne(targetEntity: Tenant::class, inversedBy: 'userRoleTenants')] + #[ORM\JoinColumn(nullable: false)] private ?Tenant $tenant = null; - /** - * @ORM\Column(type="array") - */ + #[ORM\Column(type: 'array')] private array $roles = []; public function getUser(): ?User diff --git a/symfony.lock b/symfony.lock index ed5e6359..cfef05e8 100644 --- a/symfony.lock +++ b/symfony.lock @@ -37,18 +37,6 @@ "dnoegel/php-xdg-base-dir": { "version": "v0.1.1" }, - "doctrine/annotations": { - "version": "1.0", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "1.0", - "ref": "a2759dd6123694c8d901d0ec80006e044c2e6457" - }, - "files": [ - "config/routes/annotations.yaml" - ] - }, "doctrine/cache": { "version": "2.1.1" },