Skip to content

Commit 3df65aa

Browse files
giosh94mhzGiorgio Premi
andauthored
fix(symfony): allow disabling PHPStan PhpDocParser (#7507)
Co-authored-by: Giorgio Premi <[email protected]>
1 parent 0edbc37 commit 3df65aa

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ private function registerMetadataConfiguration(ContainerBuilder $container, arra
337337
$container->getDefinition('api_platform.metadata.resource_extractor.xml')->replaceArgument(0, $xmlResources);
338338
$container->getDefinition('api_platform.metadata.property_extractor.xml')->replaceArgument(0, $xmlResources);
339339

340-
if (class_exists(PhpDocParser::class)) {
340+
if ($config['enable_phpdoc_parser'] && class_exists(PhpDocParser::class)) {
341341
$loader->load('metadata/php_doc.xml');
342342
}
343343

src/Symfony/Bundle/DependencyInjection/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ public function getConfigTreeBuilder(): TreeBuilder
111111
->booleanNode('enable_entrypoint')->defaultTrue()->info('Enable the entrypoint')->end()
112112
->booleanNode('enable_docs')->defaultTrue()->info('Enable the docs')->end()
113113
->booleanNode('enable_profiler')->defaultTrue()->info('Enable the data collector and the WebProfilerBundle integration.')->end()
114+
->booleanNode('enable_phpdoc_parser')->defaultTrue()->info('Enable resource metadata collector using PHPStan PhpDocParser.')->end()
114115
->booleanNode('enable_link_security')->defaultFalse()->info('Enable security for Links (sub resources)')->end()
115116
->arrayNode('collection')
116117
->addDefaultsIfNotSet()

0 commit comments

Comments
 (0)