[FrameworkBundle] avoid using deprecated classes for reflection
This commit is contained in:
parent
c7bee8f861
commit
26fa1a5417
@ -90,7 +90,7 @@ class FrameworkExtension extends Extension
|
||||
$this->registerFormConfiguration($config, $container, $loader);
|
||||
$config['validation']['enabled'] = true;
|
||||
|
||||
if (!class_exists('Symfony\Component\Validator\Validator')) {
|
||||
if (!class_exists('Symfony\Component\Validator\Validation')) {
|
||||
throw new LogicException('The Validator component is required to use the Form component.');
|
||||
}
|
||||
|
||||
@ -643,8 +643,8 @@ class FrameworkExtension extends Extension
|
||||
|
||||
// Discover translation directories
|
||||
$dirs = array();
|
||||
if (class_exists('Symfony\Component\Validator\Validator')) {
|
||||
$r = new \ReflectionClass('Symfony\Component\Validator\Validator');
|
||||
if (class_exists('Symfony\Component\Validator\Validation')) {
|
||||
$r = new \ReflectionClass('Symfony\Component\Validator\Validation');
|
||||
|
||||
$dirs[] = dirname($r->getFilename()).'/Resources/translations';
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ abstract class FrameworkExtensionTest extends TestCase
|
||||
}
|
||||
|
||||
$files = array_map(function ($resource) { return realpath($resource[1]); }, $resources);
|
||||
$ref = new \ReflectionClass('Symfony\Component\Validator\Validator');
|
||||
$ref = new \ReflectionClass('Symfony\Component\Validator\Validation');
|
||||
$this->assertContains(
|
||||
strtr(dirname($ref->getFileName()).'/Resources/translations/validators.en.xlf', '/', DIRECTORY_SEPARATOR),
|
||||
$files,
|
||||
@ -250,7 +250,7 @@ abstract class FrameworkExtensionTest extends TestCase
|
||||
$files,
|
||||
'->registerTranslatorConfiguration() finds Form translation resources'
|
||||
);
|
||||
$ref = new \ReflectionClass('Symfony\Component\Security\Core\SecurityContext');
|
||||
$ref = new \ReflectionClass('Symfony\Component\Security\Core\Security');
|
||||
$this->assertContains(
|
||||
strtr(dirname($ref->getFileName()).'/Resources/translations/security.en.xlf', '/', DIRECTORY_SEPARATOR),
|
||||
$files,
|
||||
|
Reference in New Issue
Block a user