Skip to content

Commit 693f7bc

Browse files
authored
fix: move event listeners to the symfony component (#6587)
1 parent 18729d6 commit 693f7bc

21 files changed

+186
-45
lines changed

src/Doctrine/Common/composer.json

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,10 @@
2727
"api-platform/state": "^3.4 || ^4.0",
2828
"doctrine/collections": "^2.1",
2929
"doctrine/common": "^3.2.2",
30-
"doctrine/persistence": "^3.2",
31-
"symfony/property-access": "^6.4 || ^7.0",
32-
"symfony/serializer": "^6.4 || ^7.0"
30+
"doctrine/persistence": "^3.2"
3331
},
3432
"require-dev": {
35-
"symfony/messenger": "^6.4 || ^7.0",
3633
"doctrine/mongodb-odm": "^2.6",
37-
"symfony/expression-language": "^6.4 || 7.0",
38-
"api-platform/http-cache": "^3.4 || ^4.0",
39-
"api-platform/graphql": "^3.4 || ^4.0",
40-
"api-platform/validator": "^3.4 || ^4.0",
41-
"api-platform/serializer": "^3.4 || ^4.0",
42-
"symfony/mercure-bundle": "*",
4334
"doctrine/orm": "^2.17 || ^3.0",
4435
"phpspec/prophecy-phpunit": "^2.0",
4536
"phpunit/phpunit": "^10.0",

src/Symfony/Bundle/Resources/config/doctrine_odm_mercure_publisher.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<!-- Event listener -->
1010

11-
<service id="api_platform.doctrine_mongodb.odm.listener.mercure.publish" class="ApiPlatform\Doctrine\Common\EventListener\PublishMercureUpdatesListener">
11+
<service id="api_platform.doctrine_mongodb.odm.listener.mercure.publish" class="ApiPlatform\Symfony\Doctrine\EventListener\PublishMercureUpdatesListener">
1212
<argument type="service" id="api_platform.resource_class_resolver" />
1313
<argument type="service" id="api_platform.symfony.iri_converter" />
1414
<argument type="service" id="api_platform.metadata.resource.metadata_collection_factory" />

src/Symfony/Bundle/Resources/config/doctrine_orm_http_cache_purger.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<!-- Event listener -->
1010

11-
<service id="api_platform.doctrine.listener.http_cache.purge" class="ApiPlatform\Doctrine\Common\EventListener\PurgeHttpCacheListener">
11+
<service id="api_platform.doctrine.listener.http_cache.purge" class="ApiPlatform\Symfony\Doctrine\EventListener\PurgeHttpCacheListener">
1212
<argument type="service" id="api_platform.http_cache.purger" />
1313
<argument type="service" id="api_platform.iri_converter" />
1414
<argument type="service" id="api_platform.resource_class_resolver" />

src/Symfony/Bundle/Resources/config/doctrine_orm_mercure_publisher.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<!-- Event listener -->
1010

11-
<service id="api_platform.doctrine.orm.listener.mercure.publish" class="ApiPlatform\Doctrine\Common\EventListener\PublishMercureUpdatesListener">
11+
<service id="api_platform.doctrine.orm.listener.mercure.publish" class="ApiPlatform\Symfony\Doctrine\EventListener\PublishMercureUpdatesListener">
1212
<argument type="service" id="api_platform.resource_class_resolver" />
1313
<argument type="service" id="api_platform.iri_converter" />
1414
<argument type="service" id="api_platform.metadata.resource.metadata_collection_factory" />

src/Doctrine/Common/EventListener/PublishMercureUpdatesListener.php renamed to src/Symfony/Doctrine/EventListener/PublishMercureUpdatesListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
declare(strict_types=1);
1313

14-
namespace ApiPlatform\Doctrine\Common\EventListener;
14+
namespace ApiPlatform\Symfony\Doctrine\EventListener;
1515

1616
use ApiPlatform\Api\IriConverterInterface as LegacyIriConverterInterface;
1717
use ApiPlatform\Api\ResourceClassResolverInterface as LegacyResourceClassResolverInterface;

src/Doctrine/Common/EventListener/PurgeHttpCacheListener.php renamed to src/Symfony/Doctrine/EventListener/PurgeHttpCacheListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
declare(strict_types=1);
1313

14-
namespace ApiPlatform\Doctrine\Common\EventListener;
14+
namespace ApiPlatform\Symfony\Doctrine\EventListener;
1515

1616
use ApiPlatform\Api\IriConverterInterface as LegacyIriConverterInterface;
1717
use ApiPlatform\Api\ResourceClassResolverInterface as LegacyResourceClassResolverInterface;

src/Doctrine/Common/Tests/EventListener/PublishMercureUpdatesListenerTest.php renamed to src/Symfony/Tests/Doctrine/EventListener/PublishMercureUpdatesListenerTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,8 @@
1111

1212
declare(strict_types=1);
1313

14-
namespace ApiPlatform\Doctrine\Common\Tests\EventListener;
15-
16-
use ApiPlatform\Doctrine\Common\EventListener\PublishMercureUpdatesListener;
17-
use ApiPlatform\Doctrine\Common\Tests\Fixtures\NotAResource;
18-
use ApiPlatform\Doctrine\Common\Tests\Fixtures\TestBundle\Entity\Dummy;
19-
use ApiPlatform\Doctrine\Common\Tests\Fixtures\TestBundle\Entity\DummyCar;
20-
use ApiPlatform\Doctrine\Common\Tests\Fixtures\TestBundle\Entity\DummyFriend;
21-
use ApiPlatform\Doctrine\Common\Tests\Fixtures\TestBundle\Entity\DummyMercure;
22-
use ApiPlatform\Doctrine\Common\Tests\Fixtures\TestBundle\Entity\DummyOffer;
23-
use ApiPlatform\Doctrine\Common\Tests\Fixtures\TestBundle\Entity\MercureWithTopicsAndGetOperation;
14+
namespace ApiPlatform\Symfony\Tests\Doctrine\EventListener;
15+
2416
use ApiPlatform\GraphQl\Subscription\MercureSubscriptionIriGeneratorInterface as GraphQlMercureSubscriptionIriGeneratorInterface;
2517
use ApiPlatform\GraphQl\Subscription\SubscriptionManagerInterface as GraphQlSubscriptionManagerInterface;
2618
use ApiPlatform\Metadata\ApiResource;
@@ -32,6 +24,14 @@
3224
use ApiPlatform\Metadata\Resource\ResourceMetadataCollection;
3325
use ApiPlatform\Metadata\ResourceClassResolverInterface;
3426
use ApiPlatform\Metadata\UrlGeneratorInterface;
27+
use ApiPlatform\Symfony\Doctrine\EventListener\PublishMercureUpdatesListener;
28+
use ApiPlatform\Symfony\Tests\Fixtures\NotAResource;
29+
use ApiPlatform\Symfony\Tests\Fixtures\TestBundle\Entity\Dummy;
30+
use ApiPlatform\Symfony\Tests\Fixtures\TestBundle\Entity\DummyCar;
31+
use ApiPlatform\Symfony\Tests\Fixtures\TestBundle\Entity\DummyFriend;
32+
use ApiPlatform\Symfony\Tests\Fixtures\TestBundle\Entity\DummyMercure;
33+
use ApiPlatform\Symfony\Tests\Fixtures\TestBundle\Entity\DummyOffer;
34+
use ApiPlatform\Symfony\Tests\Fixtures\TestBundle\Entity\MercureWithTopicsAndGetOperation;
3535
use Doctrine\ORM\EntityManagerInterface;
3636
use Doctrine\ORM\Event\OnFlushEventArgs;
3737
use Doctrine\ORM\UnitOfWork;

src/Doctrine/Common/Tests/EventListener/PurgeHttpCacheListenerTest.php renamed to src/Symfony/Tests/Doctrine/EventListener/PurgeHttpCacheListenerTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@
1111

1212
declare(strict_types=1);
1313

14-
namespace ApiPlatform\Doctrine\Common\Tests\EventListener;
15-
16-
use ApiPlatform\Doctrine\Common\EventListener\PurgeHttpCacheListener;
17-
use ApiPlatform\Doctrine\Common\Tests\Fixtures\NotAResource;
18-
use ApiPlatform\Doctrine\Common\Tests\Fixtures\TestBundle\Entity\ContainNonResource;
19-
use ApiPlatform\Doctrine\Common\Tests\Fixtures\TestBundle\Entity\Dummy;
20-
use ApiPlatform\Doctrine\Common\Tests\Fixtures\TestBundle\Entity\DummyNoGetOperation;
21-
use ApiPlatform\Doctrine\Common\Tests\Fixtures\TestBundle\Entity\RelatedDummy;
14+
namespace ApiPlatform\Symfony\Tests\Doctrine\EventListener;
15+
2216
use ApiPlatform\HttpCache\PurgerInterface;
2317
use ApiPlatform\Metadata\Exception\InvalidArgumentException;
2418
use ApiPlatform\Metadata\Exception\ItemNotFoundException;
2519
use ApiPlatform\Metadata\GetCollection;
2620
use ApiPlatform\Metadata\IriConverterInterface;
2721
use ApiPlatform\Metadata\ResourceClassResolverInterface;
2822
use ApiPlatform\Metadata\UrlGeneratorInterface;
23+
use ApiPlatform\Symfony\Doctrine\EventListener\PurgeHttpCacheListener;
24+
use ApiPlatform\Symfony\Tests\Fixtures\NotAResource;
25+
use ApiPlatform\Symfony\Tests\Fixtures\TestBundle\Entity\ContainNonResource;
26+
use ApiPlatform\Symfony\Tests\Fixtures\TestBundle\Entity\Dummy;
27+
use ApiPlatform\Symfony\Tests\Fixtures\TestBundle\Entity\DummyNoGetOperation;
28+
use ApiPlatform\Symfony\Tests\Fixtures\TestBundle\Entity\RelatedDummy;
2929
use Doctrine\ORM\EntityManagerInterface;
3030
use Doctrine\ORM\Event\OnFlushEventArgs;
3131
use Doctrine\ORM\Event\PreUpdateEventArgs;

src/Doctrine/Common/Tests/Fixtures/NotAResource.php renamed to src/Symfony/Tests/Fixtures/NotAResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
declare(strict_types=1);
1313

14-
namespace ApiPlatform\Doctrine\Common\Tests\Fixtures;
14+
namespace ApiPlatform\Symfony\Tests\Fixtures;
1515

1616
use Symfony\Component\Serializer\Annotation\Groups;
1717

src/Doctrine/Common/Tests/Fixtures/TestBundle/Entity/ContainNonResource.php renamed to src/Symfony/Tests/Fixtures/TestBundle/Entity/ContainNonResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
declare(strict_types=1);
1313

14-
namespace ApiPlatform\Doctrine\Common\Tests\Fixtures\TestBundle\Entity;
14+
namespace ApiPlatform\Symfony\Tests\Fixtures\TestBundle\Entity;
1515

1616
use ApiPlatform\Metadata\ApiResource;
1717
use ApiPlatform\Tests\Fixtures\NotAResource;

0 commit comments

Comments
 (0)