Use PHP functions as array_map callbacks when possible
This commit is contained in:
parent
71b2c3a52e
commit
405bd4cc81
@ -224,7 +224,7 @@ abstract class FrameworkExtensionTest extends TestCase
|
||||
$this->assertEquals('translator.default', (string) $container->getAlias('translator'), '->registerTranslatorConfiguration() redefines translator service from identity to real translator');
|
||||
$options = $container->getDefinition('translator.default')->getArgument(3);
|
||||
|
||||
$files = array_map(function ($resource) { return realpath($resource); }, $options['resource_files']['en']);
|
||||
$files = array_map('realpath', $options['resource_files']['en']);
|
||||
$ref = new \ReflectionClass('Symfony\Component\Validator\Validation');
|
||||
$this->assertContains(
|
||||
strtr(dirname($ref->getFileName()).'/Resources/translations/validators.en.xlf', '/', DIRECTORY_SEPARATOR),
|
||||
|
@ -73,7 +73,7 @@ abstract class CompleteConfigurationTest extends TestCase
|
||||
foreach (array_keys($arguments[1]) as $contextId) {
|
||||
$contextDef = $container->getDefinition($contextId);
|
||||
$arguments = $contextDef->getArguments();
|
||||
$listeners[] = array_map(function ($ref) { return (string) $ref; }, $arguments['index_0']);
|
||||
$listeners[] = array_map('strval', $arguments['index_0']);
|
||||
}
|
||||
|
||||
$this->assertEquals(array(
|
||||
|
@ -317,7 +317,7 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
||||
|
||||
$finder = $this->buildFinder();
|
||||
$a = iterator_to_array($finder->directories()->in(self::$tmpDir));
|
||||
$a = array_values(array_map(function ($a) { return (string) $a; }, $a));
|
||||
$a = array_values(array_map('strval', $a));
|
||||
sort($a);
|
||||
$this->assertEquals($expected, $a, 'implements the \IteratorAggregate interface');
|
||||
}
|
||||
|
Reference in New Issue
Block a user