8000 [FrameworkBundle] Fixed the registration of validation.xml file when … · symfony/symfony@cfa5aa5 · GitHub
[go: up one dir, main page]

Skip to content

Commit cfa5aa5

Browse files
committed
[FrameworkBundle] Fixed the registration of validation.xml file when the form is disabled
1 parent fc0a09a commit cfa5aa5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,9 +587,13 @@ private function registerValidationConfiguration(array $config, ContainerBuilder
587587

588588
private function getValidatorXmlMappingFiles(ContainerBuilder $container)
589589
{
590-
$reflClass = new \ReflectionClass('Symfony\Component\Form\FormInterface');
591-
$files = array(dirname($reflClass->getFileName()).'/Resources/config/validation.xml');
592-
$container->addResource(new FileResource($files[0]));
590+
$files = array();
591+
592+
if (interface_exists('Symfony\Component\Form\FormInterface')) {
593+
$reflClass = new \ReflectionClass('Symfony\Component\Form\FormInterface');
594+
$files[] = dirname($reflClass->getFileName()).'/Resources/config/validation.xml';
595+
$container->addResource(new FileResource($files[0]));
596+
}
593597

594598
foreach ($container->getParameter('kernel.bundles') as $bundle) {
595599
$reflection = new \ReflectionClass($bundle);

0 commit comments

Comments
 (0)
0