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

Skip to content

Commit 3aa4e14

Browse files
committed
bug symfony#9443 [FrameworkBundle] Fixed the registration of validation.xml file when the form is disabled (hason)
This PR was submitted for the 2.1 branch but it was merged into the 2.2 branch instead (closes symfony#9443). Discussion ---------- [FrameworkBundle] Fixed the registration of validation.xml file when the form is disabled | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- cfa5aa5 [FrameworkBundle] Fixed the registration of validation.xml file when the form is disabled
2 parents be0a310 + d0c1db8 commit 3aa4e14

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)