-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
Q | A |
---|---|
Bug report? | yes |
Feature request? | no |
BC Break report? | no |
RFC? | no |
Symfony version | 3.3.0-RC1 |
After speaking with @weaverryan and looking at
symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
Lines 1112 to 1140 in 8514e22
private function registerValidatorMapping(ContainerBuilder $container, array $config, array &$files) | |
{ | |
$fileRecorder = function ($extension, $path) use (&$files) { | |
$files['yaml' === $extension ? 'yml' : $extension][] = $path; | |
}; | |
if (interface_exists('Symfony\Component\Form\FormInterface')) { | |
$reflClass = new \ReflectionClass('Symfony\Component\Form\FormInterface'); | |
$fileRecorder('xml', dirname($reflClass->getFileName()).'/Resources/config/validation.xml'); | |
} | |
foreach ($container->getParameter('kernel.bundles_metadata') as $bundle) { | |
$dirname = $bundle['path']; | |
if ($container->fileExists($file = $dirname.'/Resources/config/validation.yml', false)) { | |
$fileRecorder('yml', $file); | |
} | |
if ($container->fileExists($file = $dirname.'/Resources/config/validation.xml', false)) { | |
$fileRecorder('xml', $file); | |
} | |
if ($container->fileExists($dir = $dirname.'/Resources/config/validation', '/^$/')) { | |
$this->registerMappingFilesFromDir($dir, $fileRecorder); | |
} | |
} | |
$this->registerMappingFilesFromConfig($container, $config, $fileRecorder); | |
} |
It should be possible to read the validation config from the etc
or newly proposed config
directory, searching for a file named validation.yaml
or similar.
I'd really like this as part of 3.3 if possible.
Are we correct in thinking this? Could it be done for 3.3?
Metadata
Metadata
Assignees
Labels
No labels