Skip to content

Commit b02fa61

Browse files
feature #21654 [PropertyInfo] Use iterators for PropertyInfoExtractor (GuilhemN)
This PR was merged into the 3.3-dev branch. Discussion ---------- [PropertyInfo] Use iterators for PropertyInfoExtractor | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Most of the time, when using the cache, the property info extractors are not used: the new iterator feature looks perfect to prevent their instantiation. Commits ------- 38523a9 [PropertyInfo] Use iterators for PropertyInfoExtractor
2 parents 5fdbab9 + 2d8177c commit b02fa61

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

DependencyInjection/Compiler/PropertyInfoPass.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

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

14+
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
1415
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
1516
use Symfony\Component\DependencyInjection\Compiler\PriorityTaggedServiceTrait;
1617
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -36,15 +37,15 @@ public function process(ContainerBuilder $container)
3637
$definition = $container->getDefinition('property_info');
3738

3839
$listExtractors = $this->findAndSortTaggedServices('property_info.list_extractor', $container);
39-
$definition->replaceArgument(0, $listExtractors);
40+
$definition->replaceArgument(0, new IteratorArgument($listExtractors));
4041

4142
$typeExtractors = $this->findAndSortTaggedServices('property_info.type_extractor', $container);
42-
$definition->replaceArgument(1, $typeExtractors);
43+
$definition->replaceArgument(1, new IteratorArgument($typeExtractors));
4344

4445
$descriptionExtractors = $this->findAndSortTaggedServices('property_info.description_extractor', $container);
45-
$definition->replaceArgument(2, $descriptionExtractors);
46+
$definition->replaceArgument(2, new IteratorArgument($descriptionExtractors));
4647

4748
$accessExtractors = $this->findAndSortTaggedServices('property_info.access_extractor', $container);
48-
$definition->replaceArgument(3, $accessExtractors);
49+
$definition->replaceArgument(3, new IteratorArgument($accessExtractors));
4950
}
5051
}

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"symfony/templating": "~2.8|~3.0",
5252
"symfony/validator": "~3.2",
5353
"symfony/yaml": "~3.2",
54-
"symfony/property-info": "~3.1",
54+
"symfony/property-info": "~3.3",
5555
"doctrine/annotations": "~1.0",
5656
"phpdocumentor/reflection-docblock": "^3.0",
5757
"twig/twig": "~1.26|~2.0",
@@ -62,7 +62,8 @@
6262
"phpdocumentor/type-resolver": "<0.2.0",
6363
"symfony/console": "<3.3",
6464
"symfony/serializer": "<3.3",
65-
"symfony/form": "<3.3"
65+
"symfony/form": "<3.3",
66+
"symfony/property-info": "<3.3"
6667
},
6768
"suggest": {
6869
"ext-apcu": "For best performance of the system caches",

0 commit comments

Comments
 (0)