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 85e922a

Browse filesBrowse files
minor #60095 [FrameworkBundle] Exclude validator constraints, attributes, enums from the container (nicolas-grekas)
This PR was merged into the 7.3 branch. Discussion ---------- [FrameworkBundle] Exclude validator constraints, attributes, enums from the container | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT Instead of #54887 Commits ------- 4ae07d6 [FrameworkBundle] Exclude validator constrains, attributes, enums from the container
2 parents ab46732 + 4ae07d6 commit 85e922a
Copy full SHA for 85e922a

File tree

Expand file treeCollapse file tree

1 file changed

+15
-9
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+15
-9
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+15-9Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@
204204
use Symfony\Component\TypeInfo\TypeResolver\TypeResolverInterface;
205205
use Symfony\Component\Uid\Factory\UuidFactory;
206206
use Symfony\Component\Uid\UuidV4;
207+
use Symfony\Component\Validator\Constraint;
207208
use Symfony\Component\Validator\Constraints\ExpressionLanguageProvider;
208209
use Symfony\Component\Validator\ConstraintValidatorInterface;
209210
use Symfony\Component\Validator\GroupProviderInterface;
@@ -786,29 +787,34 @@ static function (ChildDefinition $definition, AsPeriodicTask|AsCronTask $attribu
786787
}
787788

788789
$container->registerForAutoconfiguration(CompilerPassInterface::class)
789-
->addTag('container.excluded.compiler_pass')->addTag('container.excluded')->setAbstract(true);
790+
->addTag('container.excluded', ['source' => 'because it\'s a compiler pass'])->setAbstract(true);
791+
$container->registerForAutoconfiguration(Constraint::class)
792+
->addTag('container.excluded', ['source' => 'because it\'s a validation constraint'])->setAbstract(true);
790793
$container->registerForAutoconfiguration(TestCase::class)
791-
->addTag('container.excluded.test_case')->addTag('container.excluded')->setAbstract(true);
794+
->addTag('container.excluded', ['source' => 'because it\'s a test case'])->setAbstract(true);
795+
$container->registerForAutoconfiguration(\UnitEnum::class)
796+
->addTag('container.excluded', ['source' => 'because it\'s an enum'])->setAbstract(true);
792797
$container->registerAttributeForAutoconfiguration(AsMessage::class, static function (ChildDefinition $definition) {
793-
$definition->addTag('container.excluded.messenger.message')->addTag('container.excluded')->setAbstract(true);
798+
$definition->addTag('container.excluded', ['source' => 'because it\'s a messenger message'])->setAbstract(true);
799+
});
800+
$container->registerAttributeForAutoconfiguration(\Attribute::class, static function (ChildDefinition $definition) {
801+
$definition->addTag('container.excluded', ['source' => 'because it\'s an attribute'])->setAbstract(true);
794802
});
795803
$container->registerAttributeForAutoconfiguration(Entity::class, static function (ChildDefinition $definition) {
796-
$definition->addTag('container.excluded.doctrine.entity')->addTag('container.excluded')->setAbstract(true);
804+
$definition->addTag('container.excluded', ['source' => 'because it\'s a doctrine entity'])->setAbstract(true);
797805
});
798806
$container->registerAttributeForAutoconfiguration(Embeddable::class, static function (ChildDefinition $definition) {
799-
$definition->addTag('container.excluded.doctrine.embeddable')->addTag('container.excluded')->setAbstract(true);
807+
$definition->addTag('container.excluded', ['source' => 'because it\'s a doctrine embeddable'])->setAbstract(true);
800808
});
801809
$container->registerAttributeForAutoconfiguration(MappedSuperclass::class, static function (ChildDefinition $definition) {
802-
$definition->addTag('container.excluded.doctrine.mapped_superclass')->addTag('container.excluded')->setAbstract(true);
810+
$definition->addTag('container.excluded', ['source' => 'because it\'s a doctrine mapped superclass'])->setAbstract(true);
803811
});
804812

805813
$container->registerAttributeForAutoconfiguration(JsonStreamable::class, static function (ChildDefinition $definition, JsonStreamable $attribute) {
806814
$definition->addTag('json_streamer.streamable', [
807815
'object' => $attribute->asObject,
808816
'list' => $attribute->asList,
809-
]);
810-
$definition->addTag('container.excluded');
811-
$definition->setAbstract(true);
817+
])->addTag('container.excluded', ['source' => 'because it\'s a streamable JSON'])->setAbstract(true);
812818
});
813819

814820
if (!$container->getParameter('kernel.debug')) {

0 commit comments

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