Skip to content

Commit c369252

Browse files
committed
Move PropertyInfoPass to the PropertyInfo component
1 parent e304146 commit c369252

File tree

4 files changed

+12
-32
lines changed

4 files changed

+12
-32
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ CHANGELOG
1919
* Deprecated `TestSessionListener`
2020
* Deprecated `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ConfigCachePass`.
2121
Use `Symfony\Component\Console\DependencyInjection\ConfigCachePass` instead.
22+
* Deprecated `PropertyInfoPass`, use `Symfony\Component\PropertyInfo\DependencyInjection\PropertyInfoPass` instead
2223

2324
3.2.0
2425
-----

DependencyInjection/Compiler/PropertyInfoPass.php

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,17 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler;
1313

14-
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
15-
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
16-
use Symfony\Component\DependencyInjection\Compiler\PriorityTaggedServiceTrait;
17-
use Symfony\Component\DependencyInjection\ContainerBuilder;
14+
@trigger_error(sprintf('The %s class is deprecated since version 3.3 and will be removed in 4.0. Use Symfony\Component\PropertyInfo\DependencyInjection\PropertyInfoPass instead.', PropertyInfoPass::class), E_USER_DEPRECATED);
15+
16+
use Symfony\Component\PropertyInfo\DependencyInjection\PropertyInfoPass as BasePropertyInfoPass;
1817

1918
/**
2019
* Adds extractors to the property_info service.
2120
*
2221
* @author Kévin Dunglas <dunglas@gmail.com>
22+
*
23+
* @deprecated since version 3.3, to be removed in 4.0. Use {@link BasePropertyInfoPass instead}.
2324
*/
24-
class PropertyInfoPass implements CompilerPassInterface
25+
class PropertyInfoPass extends BasePropertyInfoPass
2526
{
26-
use PriorityTaggedServiceTrait;
27-
28-
/**
29-
* {@inheritdoc}
30-
*/
31-
public function process(ContainerBuilder $container)
32-
{
33-
if (!$container->hasDefinition('property_info')) {
34-
return;
35-
}
36-
37-
$definition = $container->getDefinition('property_info');
38-
39-
$listExtractors = $this->findAndSortTaggedServices('property_info.list_extractor', $container);
40-
$definition->replaceArgument(0, new IteratorArgument($listExtractors));
41-
42-
$typeExtractors = $this->findAndSortTaggedServices('property_info.type_extractor', $container);
43-
$definition->replaceArgument(1, new IteratorArgument($typeExtractors));
44-
45-
$descriptionExtractors = $this->findAndSortTaggedServices('property_info.description_extractor', $container);
46-
$definition->replaceArgument(2, new IteratorArgument($descriptionExtractors));
47-
48-
$accessExtractors = $this->findAndSortTaggedServices('property_info.access_extractor', $container);
49-
$definition->replaceArgument(3, new IteratorArgument($accessExtractors));
50-
}
5127
}

FrameworkBundle.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CachePoolPass;
2020
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CachePoolClearerPass;
2121
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ControllerArgumentValueResolverPass;
22-
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\PropertyInfoPass;
2322
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\DataCollectorTranslatorPass;
2423
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\TemplatingPass;
2524
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\RoutingResolverPass;
@@ -37,6 +36,7 @@
3736
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ValidateWorkflowsPass;
3837
use Symfony\Component\Config\DependencyInjection\ConfigCachePass;
3938
use Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass;
39+
use Symfony\Component\PropertyInfo\DependencyInjection\PropertyInfoPass;
4040
use Symfony\Component\Serializer\DependencyInjection\SerializerPass;
4141
use Symfony\Component\Debug\ErrorHandler;
4242
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -95,7 +95,7 @@ public function build(ContainerBuilder $container)
9595
$container->addCompilerPass(new TranslationDumperPass());
9696
$container->addCompilerPass(new FragmentRendererPass(), PassConfig::TYPE_AFTER_REMOVING);
9797
$this->addCompilerPassIfExists($container, SerializerPass::class);
98-
$container->addCompilerPass(new PropertyInfoPass());
98+
$this->addCompilerPassIfExists($container, PropertyInfoPass::class);
9999
$container->addCompilerPass(new DataCollectorTranslatorPass());
100100
$container->addCompilerPass(new ControllerArgumentValueResolverPass());
101101
$container->addCompilerPass(new CachePoolPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 32);

Tests/DependencyInjection/Compiler/PropertyInfoPassTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\PropertyInfoPass;
1616
use Symfony\Component\DependencyInjection\Reference;
1717

18+
/**
19+
* @group legacy
20+
*/
1821
class PropertyInfoPassTest extends TestCase
1922
{
2023
public function testServicesAreOrderedAccordingToPriority()

0 commit comments

Comments
 (0)