Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 124c139

Browse filesBrowse files
committed
minor #37203 [PropertyInfo] Move configuration to PHP (qneyrat)
This PR was squashed before being merged into the 5.2-dev branch. Discussion ---------- [PropertyInfo] Move configuration to PHP | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Ref #37186 | License | MIT | Doc PR | n/a Commits ------- 5dab6ff [PropertyInfo] Move configuration to PHP
2 parents 263d54f + 5dab6ff commit 124c139
Copy full SHA for 124c139

File tree

Expand file treeCollapse file tree

3 files changed

+55
-43
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+55
-43
lines changed

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ public function load(array $configs, ContainerBuilder $container)
386386
}
387387

388388
if ($propertyInfoEnabled) {
389-
$this->registerPropertyInfoConfiguration($container, $loader);
389+
$this->registerPropertyInfoConfiguration($container, $phpLoader);
390390
}
391391

392392
if ($this->isConfigEnabled($container, $config['lock'])) {
@@ -1548,13 +1548,13 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
15481548
}
15491549
}
15501550

1551-
private function registerPropertyInfoConfiguration(ContainerBuilder $container, XmlFileLoader $loader)
1551+
private function registerPropertyInfoConfiguration(ContainerBuilder $container, PhpFileLoader $loader)
15521552
{
15531553
if (!interface_exists(PropertyInfoExtractorInterface::class)) {
15541554
throw new LogicException('PropertyInfo support cannot be enabled as the PropertyInfo component is not installed. Try running "composer require symfony/property-info".');
15551555
}
15561556

1557-
$loader->load('property_info.xml');
1557+
$loader->load('property_info.php');
15581558

15591559
if (interface_exists('phpDocumentor\Reflection\DocBlockFactoryInterface')) {
15601560
$definition = $container->register('property_info.php_doc_extractor', 'Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor');
+52Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
13+
14+
use Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor;
15+
use Symfony\Component\PropertyInfo\PropertyAccessExtractorInterface;
16+
use Symfony\Component\PropertyInfo\PropertyDescriptionExtractorInterface;
17+
use Symfony\Component\PropertyInfo\PropertyInfoCacheExtractor;
18+
use Symfony\Component\PropertyInfo\PropertyInfoExtractor;
19+
use Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface;
20+
use Symfony\Component\PropertyInfo\PropertyInitializableExtractorInterface;
21+
use Symfony\Component\PropertyInfo\PropertyListExtractorInterface;
22+
use Symfony\Component\PropertyInfo\PropertyReadInfoExtractorInterface;
23+
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
24+
use Symfony\Component\PropertyInfo\PropertyWriteInfoExtractorInterface;
25+
26+
return static function (ContainerConfigurator $container) {
27+
$container->services()
28+
->set('property_info', PropertyInfoExtractor::class)
29+
->args([[], [], [], [], []])
30+
31+
->alias(PropertyAccessExtractorInterface::class, 'property_info')
32+
->alias(PropertyDescriptionExtractorInterface::class, 'property_info')
33+
->alias(PropertyInfoExtractorInterface::class, 'property_info')
34+
->alias(PropertyTypeExtractorInterface::class, 'property_info')
35+
->alias(PropertyListExtractorInterface::class, 'property_info')
36+
->alias(PropertyInitializableExtractorInterface::class, 'property_info')
37+
38+
->set('property_info.cache', PropertyInfoCacheExtractor::class)
39+
->decorate('property_info')
40+
->args([service('property_info.cache.inner'), service('cache.property_info')])
41+
42+
// Extractor
43+
->set('property_info.reflection_extractor', ReflectionExtractor::class)
44+
->tag('property_info.list_extractor', ['priority' => -1000])
45+
->tag('property_info.type_extractor', ['priority' => -1002])
46+
->tag('property_info.access_extractor', ['priority' => -1000])
47+
->tag('property_info.initializable_extractor', ['priority' => -1000])
48+
49+
->alias(PropertyReadInfoExtractorInterface::class, 'property_info.reflection_extractor')
50+
->alias(PropertyWriteInfoExtractorInterface::class, 'property_info.reflection_extractor')
51+
;
52+
};

‎src/Symfony/Bundle/FrameworkBundle/Resources/config/property_info.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/config/property_info.xml
-40Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.