Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d0c1db8

Browse files
hasonfabpot
authored andcommitted
Fixed the registration of validation.xml file when the form is disabled
1 parent be0a310 commit d0c1db8

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
@@ -624,9 +624,13 @@ private function registerValidationConfiguration(array $config, ContainerBuilder
624624

625625
private function getValidatorXmlMappingFiles(ContainerBuilder $container)
626626
{
627-
$reflClass = new \ReflectionClass('Symfony\Component\Form\FormInterface');
628-
$files = array(dirname($reflClass->getFileName()).'/Resources/config/validation.xml');
629-
$container->addResource(new FileResource($files[0]));
627+
$files = array();
628+
629+
if (interface_exists('Symfony\Component\Form\FormInterface')) {
630+
$reflClass = new \ReflectionClass('Symfony\Component\Form\FormInterface');
631+
$files[] = dirname($reflClass->getFileName()).'/Resources/config/validation.xml';
632+
$container->addResource(new FileResource($files[0]));
633+
}
630634

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

0 commit comments

Comments
 (0)