Skip to content

Commit 1955278

Browse files
authored
bug #917 Quick Fix ORM translatable listener for Symfony 5 (loic425)
This PR was merged into the 1.11 branch. Discussion ---------- | Q | A | --------------- | ----- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | | License | MIT Commits ------- f17ae07 Fix ORM translatable listener for Symfony 5 4a8a62c Fix coding standard
2 parents b9fce22 + 4a8a62c commit 1955278

File tree

8 files changed

+3
-19
lines changed

8 files changed

+3
-19
lines changed

src/Bundle/AbstractResourceBundle.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ protected function getDoctrineMappingDirectory(): string
8585

8686
/**
8787
* Return the entity namespace.
88-
*
89-
* @return string
9088
*/
9189
protected function getModelNamespace(): ?string
9290
{

src/Bundle/EventListener/ORMTranslatableListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
namespace Sylius\Bundle\ResourceBundle\EventListener;
1515

1616
use Doctrine\Common\EventSubscriber;
17-
use Doctrine\ORM\Event\LifecycleEventArgs;
1817
use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
18+
use Doctrine\ORM\Event\PostLoadEventArgs;
1919
use Doctrine\ORM\Events;
2020
use Doctrine\ORM\Mapping\ClassMetadata;
2121
use Doctrine\ORM\Mapping\ClassMetadataInfo;
@@ -72,7 +72,7 @@ public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs): void
7272
}
7373
}
7474

75-
public function postLoad(LifecycleEventArgs $args): void
75+
public function postLoad(PostLoadEventArgs $args): void
7676
{
7777
$entity = $args->getObject();
7878

src/Bundle/Form/EventSubscriber/AddCodeFormSubscriber.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ final class AddCodeFormSubscriber implements EventSubscriberInterface
2626

2727
private array $options;
2828

29-
/**
30-
* @param string $type
31-
*/
3229
public function __construct(?string $type = null, array $options = [])
3330
{
3431
$this->type = $type ?? TextType::class;

src/Bundle/Resources/config/services/integrations/translation.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
<service id="sylius.translation.translatable_listener.doctrine.orm" class="Sylius\Bundle\ResourceBundle\EventListener\ORMTranslatableListener">
3131
<argument type="service" id="sylius.resource_registry" />
3232
<argument type="service" id="sylius.translatable_entity_locale_assigner" />
33-
<tag name="doctrine.event_listener" connection="default" event="loadClassMetadata" priority="99" />
34-
<tag name="doctrine.event_listener" connection="default" event="postLoad" priority="99" />
33+
<tag name="doctrine.event_subscriber" connection="default" priority="99" />
3534
</service>
3635
<service id="Sylius\Bundle\ResourceBundle\EventListener\ORMTranslatableListener" alias="sylius.translation.translatable_listener.doctrine.orm" />
3736

src/Component/src/Doctrine/Persistence/RepositoryInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
/**
2020
* @template T of ResourceInterface
21-
*
2221
* @extends ObjectRepository<T>
2322
*/
2423
interface RepositoryInterface extends ObjectRepository

src/Component/src/Metadata/MetadataInterface.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ public function getPluralName(): string;
3030

3131
public function getDriver(): string|false;
3232

33-
/**
34-
* @return ?string
35-
*/
3633
public function getTemplatesNamespace(): ?string;
3734

3835
/**

src/Component/src/Model/ToggleableInterface.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ interface ToggleableInterface
2222
*/
2323
public function isEnabled();
2424

25-
/**
26-
* @param bool $enabled
27-
*/
2825
public function setEnabled(?bool $enabled): void;
2926

3027
public function enable(): void;

src/Component/src/Model/ToggleableTrait.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ public function isEnabled(): bool
2323
return $this->enabled;
2424
}
2525

26-
/**
27-
* @param bool $enabled
28-
*/
2926
public function setEnabled(?bool $enabled): void
3027
{
3128
$this->enabled = (bool) $enabled;

0 commit comments

Comments
 (0)