Skip to content

Commit f346d43

Browse files
loic425diimpp
andcommitted
Apply suggestions from code review
Co-authored-by: Dmitri Perunov <[email protected]>
1 parent d00a2c0 commit f346d43

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

src/Component/src/Doctrine/Common/Metadata/Resource/Factory/DoctrineResourceMetadataCollectionFactory.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@ public function __construct(
3030
private RegistryInterface $resourceRegistry,
3131
private ResourceMetadataCollectionFactoryInterface $decorated,
3232
) {
33-
trigger_deprecation('sylius/resource', '1.13', 'The "%s" is deprecated use "%s instead.', self::class, DoctrineORMResourceMetadataCollectionFactory::class);
33+
trigger_deprecation(
34+
'sylius/resource',
35+
'1.13',
36+
'The "%s" class is deprecated, use "%s instead. It will be removed in 2.0.',
37+
self::class,
38+
DoctrineORMResourceMetadataCollectionFactory::class,
39+
);
3440
}
3541

3642
public function create(string $resourceClass): ResourceMetadataCollection

src/Component/src/Doctrine/ORM/Metadata/Resource/Factory/DoctrineORMResourceMetadataCollectionFactory.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public function create(string $resourceClass): ResourceMetadataCollection
4040
/** @var ResourceMetadata $resource */
4141
foreach ($resourceCollectionMetadata->getIterator() as $i => $resource) {
4242
$operations = $resource->getOperations() ?? new Operations();
43-
4443
$entityClass = $resource->getClass();
4544

4645
if (null === $entityClass) {
@@ -51,7 +50,6 @@ public function create(string $resourceClass): ResourceMetadataCollection
5150
foreach ($operations as $operation) {
5251
/** @var string $key */
5352
$key = $operation->getName();
54-
5553
$entityManager = $this->managerRegistry->getManagerForClass($entityClass);
5654

5755
if (!$entityManager instanceof EntityManagerInterface) {
@@ -64,7 +62,6 @@ public function create(string $resourceClass): ResourceMetadataCollection
6462
}
6563

6664
$resource = $resource->withOperations($operations);
67-
6865
$resourceCollectionMetadata[$i] = $resource;
6966
}
7067

src/Component/src/Metadata/ResourceMetadata.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ public function __construct(
4141
$this->operations = null === $operations ? null : new Operations($operations);
4242

4343
if (null !== $driver && false !== $driver) {
44-
trigger_deprecation('sylius/resource', '1.13', 'Using driver is deprecated. If your resource is managed by Doctrine you have nothing to do, otherwise use a customer provider.');
44+
trigger_deprecation(
45+
'sylius/resource',
46+
'1.13',
47+
'Using driver is deprecated. If your resource is managed by Doctrine you have nothing to do, otherwise use a custom provider.',
48+
);
4549
}
4650
}
4751

0 commit comments

Comments
 (0)