This commit is contained in:
Fabien Potencier 2019-01-16 21:41:24 +01:00
parent d2098d7e5d
commit e03db43894
79 changed files with 1726 additions and 1726 deletions

View File

@ -3,7 +3,7 @@
return new class
{
public $proxyClass;
private $privates = array();
private $privates = [];
public function getFooService($lazyLoad = true)
{

View File

@ -136,7 +136,7 @@ class ProxyDumperTest extends TestCase
return new class
{
public \$proxyClass;
private \$privates = array();
private \$privates = [];
public function getFooService(\$lazyLoad = true)
{

View File

@ -49,7 +49,7 @@ class TranslationExtensionTest extends TestCase
* @group legacy
* @dataProvider getTransChoiceTests
*/
public function testTransChoice($template, $expected, array $variables = array())
public function testTransChoice($template, $expected, array $variables = [])
{
$this->testTrans($template, $expected, $variables);
}
@ -98,48 +98,48 @@ class TranslationExtensionTest extends TestCase
['{% trans into "fr"%}Hello{% endtrans %}', 'Hello'],
// trans with count
array(
[
'{% trans from "messages" %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtrans %}',
'There is no apples',
array('count' => 0),
),
array(
['count' => 0],
],
[
'{% trans %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtrans %}',
'There is 5 apples',
array('count' => 5),
),
array(
['count' => 5],
],
[
'{% trans %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtrans %}',
'There is 5 apples (Symfony)',
array('count' => 5, 'name' => 'Symfony'),
),
array(
['count' => 5, 'name' => 'Symfony'],
],
[
'{% trans with { \'%name%\': \'Symfony\' } %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtrans %}',
'There is 5 apples (Symfony)',
array('count' => 5),
),
array(
['count' => 5],
],
[
'{% trans into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtrans %}',
'There is no apples',
array('count' => 0),
),
array(
['count' => 0],
],
[
'{% trans count 5 into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtrans %}',
'There is 5 apples',
),
],
// trans filter
array('{{ "Hello"|trans }}', 'Hello'),
array('{{ name|trans }}', 'Symfony', array('name' => 'Symfony')),
array('{{ hello|trans({ \'%name%\': \'Symfony\' }) }}', 'Hello Symfony', array('hello' => 'Hello %name%')),
array('{% set vars = { \'%name%\': \'Symfony\' } %}{{ hello|trans(vars) }}', 'Hello Symfony', array('hello' => 'Hello %name%')),
array('{{ "Hello"|trans({}, "messages", "fr") }}', 'Hello'),
['{{ "Hello"|trans }}', 'Hello'],
['{{ name|trans }}', 'Symfony', ['name' => 'Symfony']],
['{{ hello|trans({ \'%name%\': \'Symfony\' }) }}', 'Hello Symfony', ['hello' => 'Hello %name%']],
['{% set vars = { \'%name%\': \'Symfony\' } %}{{ hello|trans(vars) }}', 'Hello Symfony', ['hello' => 'Hello %name%']],
['{{ "Hello"|trans({}, "messages", "fr") }}', 'Hello'],
// trans filter with count
array('{{ "{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples"|trans(count=count) }}', 'There is 5 apples', array('count' => 5)),
array('{{ text|trans(count=5, arguments={\'%name%\': \'Symfony\'}) }}', 'There is 5 apples (Symfony)', array('text' => '{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%)')),
array('{{ "{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples"|trans({}, "messages", "fr", count) }}', 'There is 5 apples', array('count' => 5)),
);
['{{ "{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples"|trans(count=count) }}', 'There is 5 apples', ['count' => 5]],
['{{ text|trans(count=5, arguments={\'%name%\': \'Symfony\'}) }}', 'There is 5 apples (Symfony)', ['text' => '{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%)']],
['{{ "{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples"|trans({}, "messages", "fr", count) }}', 'There is 5 apples', ['count' => 5]],
];
}
/**
@ -147,18 +147,18 @@ class TranslationExtensionTest extends TestCase
*/
public function getTransChoiceTests()
{
return array(
return [
// trans tag
array('{% trans %}Hello{% endtrans %}', 'Hello'),
array('{% trans %}%name%{% endtrans %}', 'Symfony', array('name' => 'Symfony')),
['{% trans %}Hello{% endtrans %}', 'Hello'],
['{% trans %}%name%{% endtrans %}', 'Symfony', ['name' => 'Symfony']],
array('{% trans from elsewhere %}Hello{% endtrans %}', 'Hello'),
['{% trans from elsewhere %}Hello{% endtrans %}', 'Hello'],
array('{% trans %}Hello %name%{% endtrans %}', 'Hello Symfony', array('name' => 'Symfony')),
array('{% trans with { \'%name%\': \'Symfony\' } %}Hello %name%{% endtrans %}', 'Hello Symfony'),
array('{% set vars = { \'%name%\': \'Symfony\' } %}{% trans with vars %}Hello %name%{% endtrans %}', 'Hello Symfony'),
['{% trans %}Hello %name%{% endtrans %}', 'Hello Symfony', ['name' => 'Symfony']],
['{% trans with { \'%name%\': \'Symfony\' } %}Hello %name%{% endtrans %}', 'Hello Symfony'],
['{% set vars = { \'%name%\': \'Symfony\' } %}{% trans with vars %}Hello %name%{% endtrans %}', 'Hello Symfony'],
array('{% trans into "fr"%}Hello{% endtrans %}', 'Hello'),
['{% trans into "fr"%}Hello{% endtrans %}', 'Hello'],
// transchoice
[

View File

@ -1,4 +1,4 @@
<?php if (!empty($help)): ?>
<?php $help_attr['class'] = isset($help_attr['class']) ? trim($help_attr['class'].' help-text') : 'help-text'; ?>
<p id="<?php echo $view->escape($id); ?>_help" <?php echo ' '.$view['form']->block($form, 'attributes', array('attr' => $help_attr)); ?>><?php echo $view->escape(false !== $translation_domain ? $view['translator']->trans($help, array(), $translation_domain) : $help); ?></p>
<p id="<?php echo $view->escape($id); ?>_help" <?php echo ' '.$view['form']->block($form, 'attributes', ['attr' => $help_attr]); ?>><?php echo $view->escape(false !== $translation_domain ? $view['translator']->trans($help, [], $translation_domain) : $help); ?></p>
<?php endif; ?>

View File

@ -316,7 +316,7 @@ abstract class Client
public function submit(Form $form, array $values = []/*, array $serverParameters = []*/)
{
if (\func_num_args() < 3 && __CLASS__ !== \get_class($this) && __CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName() && !$this instanceof \PHPUnit\Framework\MockObject\MockObject && !$this instanceof \Prophecy\Prophecy\ProphecySubjectInterface) {
@trigger_error(sprintf('The "%s()" method will have a new "array $serverParameters = array()" argument in version 5.0, not defining it is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s()" method will have a new "array $serverParameters = []" argument in version 5.0, not defining it is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
}
$form->setValues($values);
@ -330,7 +330,7 @@ abstract class Client
* uses it to submit the given form field values.
*
* @param string $button The text content, id, value or name of the form <button> or <input type="submit">
* @param array $fieldValues Use this syntax: array('my_form[name]' => '...', 'my_form[email]' => '...')
* @param array $fieldValues Use this syntax: ['my_form[name]' => '...', 'my_form[email]' => '...']
* @param string $method The HTTP method used to submit the form
* @param array $serverParameters These values override the ones stored in $_SERVER (HTTP headers must include a HTTP_ prefix as PHP does)
*/

View File

@ -896,7 +896,7 @@ class ClientTest extends TestCase
/**
* @group legacy
* @expectedDeprecation The "Symfony\Component\BrowserKit\Client::submit()" method will have a new "array $serverParameters = array()" argument in version 5.0, not defining it is deprecated since Symfony 4.2.
* @expectedDeprecation The "Symfony\Component\BrowserKit\Client::submit()" method will have a new "array $serverParameters = []" argument in version 5.0, not defining it is deprecated since Symfony 4.2.
*/
public function testInheritedClassCallSubmitWithTwoArguments()
{

View File

@ -39,7 +39,7 @@ class PdoAdapter extends AbstractAdapter implements PruneableInterface
* * db_time_col: The column where to store the timestamp [default: item_time]
* * db_username: The username when lazy-connect [default: '']
* * db_password: The password when lazy-connect [default: '']
* * db_connection_options: An array of driver-specific connection options [default: array()]
* * db_connection_options: An array of driver-specific connection options [default: []]
*
* @param \PDO|Connection|string $connOrDsn a \PDO or Connection instance or DSN string or null
*

View File

@ -37,7 +37,7 @@ class PdoCache extends AbstractCache implements PruneableInterface
* * db_time_col: The column where to store the timestamp [default: item_time]
* * db_username: The username when lazy-connect [default: '']
* * db_password: The password when lazy-connect [default: '']
* * db_connection_options: An array of driver-specific connection options [default: array()]
* * db_connection_options: An array of driver-specific connection options [default: []]
*
* @param \PDO|Connection|string $connOrDsn a \PDO or Connection instance or DSN string or null
*

View File

@ -68,7 +68,7 @@ trait MemcachedTrait
*
* Examples for servers:
* - 'memcached://user:pass@localhost?weight=33'
* - array(array('localhost', 11211, 33))
* - [['localhost', 11211, 33]]
*
* @param array[]|string|string[] $servers An array of servers, a DSN, or an array of DSNs
* @param array $options An array of options

View File

@ -63,7 +63,7 @@ trait PhpArrayTrait
// This file has been auto-generated by the Symfony Cache Component.
return array(array(
return [[
EOF;
@ -106,7 +106,7 @@ EOF;
$dump .= var_export($key, true)." => {$id},\n";
}
$dump .= "\n), array(\n\n{$dumpedValues}\n));\n";
$dump .= "\n], [\n\n{$dumpedValues}\n]];\n";
$tmpFile = uniqid($this->file, true);

View File

@ -195,7 +195,7 @@ trait PhpFilesTrait
$file = $this->files[$key] = $this->getFile($key, true);
// Since OPcache only compiles files older than the script execution start, set the file's mtime in the past
$ok = $this->write($file, "<?php return array({$expiry}, {$value});\n", self::$startTime - 10) && $ok;
$ok = $this->write($file, "<?php return [{$expiry}, {$value}];\n", self::$startTime - 10) && $ok;
if ($allowCompile) {
@opcache_invalidate($file, true);

View File

@ -4,7 +4,7 @@ CHANGELOG
4.2.0
-----
* allowed passing commands as `array($process, 'ENV_VAR' => 'value')` to
* allowed passing commands as `[$process, 'ENV_VAR' => 'value']` to
`ProcessHelper::run()` to pass environment variables
* deprecated passing a command as a string to `ProcessHelper::run()`,
pass it the command as an array of its arguments instead

View File

@ -275,7 +275,7 @@ class DebugClassLoaderTest extends TestCase
public function testExtendedMethodDefinesNewParameters()
{
$deprecations = array();
$deprecations = [];
set_error_handler(function ($type, $msg) use (&$deprecations) { $deprecations[] = $msg; });
$e = error_reporting(E_USER_DEPRECATED);
@ -284,11 +284,11 @@ class DebugClassLoaderTest extends TestCase
error_reporting($e);
restore_error_handler();
$this->assertSame(array(
$this->assertSame([
'The "Symfony\Component\Debug\Tests\Fixtures\SubClassWithAnnotatedParameters::quzMethod()" method will require a new "Quz $quz" argument in the next major version of its parent class "Symfony\Component\Debug\Tests\Fixtures\ClassWithAnnotatedParameters", not defining it is deprecated.',
'The "Symfony\Component\Debug\Tests\Fixtures\SubClassWithAnnotatedParameters::whereAmI()" method will require a new "bool $matrix" argument in the next major version of its parent class "Symfony\Component\Debug\Tests\Fixtures\InterfaceWithAnnotatedParameters", not defining it is deprecated.',
'The "Symfony\Component\Debug\Tests\Fixtures\SubClassWithAnnotatedParameters::isSymfony()" method will require a new "true $yes" argument in the next major version of its parent class "Symfony\Component\Debug\Tests\Fixtures\ClassWithAnnotatedParameters", not defining it is deprecated.',
), $deprecations);
], $deprecations);
}
public function testUseTraitWithInternalMethod()

View File

@ -618,7 +618,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
* the parameters passed to the container constructor to have precedence
* over the loaded ones.
*
* $container = new ContainerBuilder(new ParameterBag(array('foo' => 'bar')));
* $container = new ContainerBuilder(new ParameterBag(['foo' => 'bar']));
* $loader = new LoaderXXX($container);
* $loader->load('resource_name');
* $container->register('foo', 'stdClass');
@ -1253,7 +1253,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
*
* Example:
*
* $container->register('foo')->addTag('my.tag', array('hello' => 'world'));
* $container->register('foo')->addTag('my.tag', ['hello' => 'world']);
*
* $serviceIds = $container->findTaggedServiceIds('my.tag');
* foreach ($serviceIds as $serviceId => $tags) {

View File

@ -224,7 +224,7 @@ class PhpDumper extends Dumper
if ($this->addGetService) {
$code = preg_replace(
"/(\r?\n\r?\n public function __construct.+?\\{\r?\n)/s",
"\n private \$getService;$1 \$this->getService = \\Closure::fromCallable(array(\$this, 'getService'));\n",
"\n private \$getService;$1 \$this->getService = \\Closure::fromCallable([\$this, 'getService']);\n",
$code,
1
);
@ -250,11 +250,11 @@ EOF;
}
if ($ids = array_keys($ids)) {
sort($ids);
$c = "<?php\n\nreturn array(\n";
$c = "<?php\n\nreturn [\n";
foreach ($ids as $id) {
$c .= ' '.$this->doExport($id)." => true,\n";
}
$files['removed-ids.php'] = $c .= ");\n";
$files['removed-ids.php'] = $c .= "];\n";
}
foreach ($this->generateServiceFiles($services) as $file => $c) {
@ -293,11 +293,11 @@ if (!\\class_exists({$options['class']}::class, false)) {
\\class_alias(\\Container{$hash}\\{$options['class']}::class, {$options['class']}::class, false);
}
return new \\Container{$hash}\\{$options['class']}(array(
return new \\Container{$hash}\\{$options['class']}([
'container.build_hash' => '$hash',
'container.build_id' => '$id',
'container.build_time' => $time,
), __DIR__.\\DIRECTORY_SEPARATOR.'Container{$hash}');
], __DIR__.\\DIRECTORY_SEPARATOR.'Container{$hash}');
EOF;
} else {
@ -952,7 +952,7 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class $class extends $baseClass
{
private \$parameters;
private \$targetDirs = array();
private \$targetDirs = [];
public function __construct()
{
@ -970,7 +970,7 @@ EOF;
}
if ($this->asFiles) {
$code = str_replace('$parameters', "\$buildParameters;\n private \$containerDir;\n private \$parameters", $code);
$code = str_replace('__construct()', '__construct(array $buildParameters = array(), $containerDir = __DIR__)', $code);
$code = str_replace('__construct()', '__construct(array $buildParameters = [], $containerDir = __DIR__)', $code);
$code .= " \$this->buildParameters = \$buildParameters;\n";
$code .= " \$this->containerDir = \$containerDir;\n";
}
@ -990,7 +990,7 @@ EOF;
if ($this->container->getParameterBag()->all()) {
$code .= " \$this->parameters = \$this->getDefaultParameters();\n\n";
}
$code .= " \$this->services = \$this->privates = array();\n";
$code .= " \$this->services = \$this->privates = [];\n";
$code .= $this->addSyntheticIds();
$code .= $this->addMethodMap();
@ -1064,7 +1064,7 @@ EOF;
}
}
return $code ? " \$this->syntheticIds = array(\n{$code} );\n" : '';
return $code ? " \$this->syntheticIds = [\n{$code} ];\n" : '';
}
private function addRemovedIds(): string
@ -1091,7 +1091,7 @@ EOF;
$code .= ' '.$this->doExport($id)." => true,\n";
}
$code = "array(\n{$code} )";
$code = "[\n{$code} ]";
}
return <<<EOF
@ -1115,7 +1115,7 @@ EOF;
}
}
return $code ? " \$this->methodMap = array(\n{$code} );\n" : '';
return $code ? " \$this->methodMap = [\n{$code} ];\n" : '';
}
private function addFileMap(): string
@ -1129,16 +1129,16 @@ EOF;
}
}
return $code ? " \$this->fileMap = array(\n{$code} );\n" : '';
return $code ? " \$this->fileMap = [\n{$code} ];\n" : '';
}
private function addAliases(): string
{
if (!$aliases = $this->container->getAliases()) {
return "\n \$this->aliases = array();\n";
return "\n \$this->aliases = [];\n";
}
$code = " \$this->aliases = array(\n";
$code = " \$this->aliases = [\n";
ksort($aliases);
foreach ($aliases as $alias => $id) {
$id = (string) $id;
@ -1148,7 +1148,7 @@ EOF;
$code .= ' '.$this->doExport($alias).' => '.$this->doExport($id).",\n";
}
return $code." );\n";
return $code." ];\n";
}
private function addInlineRequires(): string
@ -1196,7 +1196,7 @@ EOF;
throw new InvalidArgumentException(sprintf('Parameter name cannot use env parameters: %s.', $resolvedKey));
}
$export = $this->exportParameters([$value]);
$export = explode('0 => ', substr(rtrim($export, " )\n"), 7, -1), 2);
$export = explode('0 => ', substr(rtrim($export, " ]\n"), 2, -1), 2);
if (preg_match("/\\\$this->(?:getEnv\('(?:\w++:)*+\w++'\)|targetDirs\[\d++\])/", $export[1])) {
$dynamicPhp[$key] = sprintf('%scase %s: $value = %s; break;', $export[0], $this->export($key), $export[1]);
@ -1204,7 +1204,7 @@ EOF;
$php[] = sprintf('%s%s => %s,', $export[0], $this->export($key), $export[1]);
}
}
$parameters = sprintf("array(\n%s\n%s)", implode("\n", $php), str_repeat(' ', 8));
$parameters = sprintf("[\n%s\n%s]", implode("\n", $php), str_repeat(' ', 8));
$code = <<<'EOF'
@ -1274,14 +1274,14 @@ EOF;
EOF;
$getDynamicParameter = sprintf($getDynamicParameter, implode("\n", $dynamicPhp));
} else {
$loadedDynamicParameters = 'array()';
$loadedDynamicParameters = '[]';
$getDynamicParameter = str_repeat(' ', 8).'throw new InvalidArgumentException(sprintf(\'The dynamic parameter "%s" must be defined.\', $name));';
}
$code .= <<<EOF
private \$loadedDynamicParameters = {$loadedDynamicParameters};
private \$dynamicParameters = array();
private \$dynamicParameters = [];
/*{$this->docStar}
* Computes a dynamic parameter.
@ -1338,7 +1338,7 @@ EOF;
$php[] = sprintf('%s%s => %s,', str_repeat(' ', $indent), $this->export($key), $value);
}
return sprintf("array(\n%s\n%s)", implode("\n", $php), str_repeat(' ', $indent - 4));
return sprintf("[\n%s\n%s]", implode("\n", $php), str_repeat(' ', $indent - 4));
}
private function endClass(): string
@ -1444,7 +1444,7 @@ EOF;
$code[] = sprintf('%s => %s', $this->dumpValue($k, $interpolate), $this->dumpValue($v, $interpolate));
}
return sprintf('array(%s)', implode(', ', $code));
return sprintf('[%s]', implode(', ', $code));
} elseif ($value instanceof ArgumentInterface) {
$scope = [$this->definitionVariables, $this->referenceVariables];
$this->definitionVariables = $this->referenceVariables = null;
@ -1502,7 +1502,7 @@ EOF;
}
$definition = $this->container->findDefinition($id = (string) $v);
$load = !($e = $definition->getErrors()) ? $this->asFiles && !$this->isHotPath($definition) : reset($e);
$serviceMap .= sprintf("\n %s => array(%s, %s, %s, %s),",
$serviceMap .= sprintf("\n %s => [%s, %s, %s, %s],",
$this->export($k),
$this->export($definition->isShared() ? ($definition->isPublic() ? 'services' : 'privates') : false),
$this->export($id),
@ -1513,7 +1513,7 @@ EOF;
}
$this->addGetService = true;
return sprintf('new \%s($this->getService, array(%s%s))', ServiceLocator::class, $serviceMap, $serviceMap ? "\n " : '');
return sprintf('new \%s($this->getService, [%s%s])', ServiceLocator::class, $serviceMap, $serviceMap ? "\n " : '');
}
} finally {
list($this->definitionVariables, $this->referenceVariables) = $scope;

View File

@ -9,11 +9,11 @@ return function (ContainerConfigurator $c) {
->tag('baz');
$di->load(Prototype::class.'\\', '../Prototype')
->autoconfigure()
->exclude(array('../Prototype/OtherDir', '../Prototype/BadClasses'))
->exclude(['../Prototype/OtherDir', '../Prototype/BadClasses'])
->factory('f')
->deprecate('%service_id%')
->args(array(0))
->args(array(1))
->args([0])
->args([1])
->autoconfigure(false)
->tag('foo')
->parent('foo');

View File

@ -33,13 +33,13 @@ $container
$container
->register('bar', 'stdClass')
->setProperty('locator', new ServiceLocatorArgument(array(
->setProperty('locator', new ServiceLocatorArgument([
'foo1' => new Reference('foo1'),
'foo2' => new Reference('foo2'),
'foo3' => new Reference('foo3'),
'foo4' => new Reference('foo4', $container::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE),
'foo5' => new Reference('foo5', $container::IGNORE_ON_UNINITIALIZED_REFERENCE),
)))
]))
->setPublic(true)
;

View File

@ -19,16 +19,16 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends \Symfony\Component\DependencyInjection\Tests\Fixtures\Container\ConstructorWithoutArgumentsContainer
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
parent::__construct();
$this->parameterBag = null;
$this->services = $this->privates = array();
$this->services = $this->privates = [];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -43,9 +43,9 @@ class ProjectServiceContainer extends \Symfony\Component\DependencyInjection\Tes
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
);
];
}
}

View File

@ -19,13 +19,13 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends \Symfony\Component\DependencyInjection\Tests\Fixtures\Container\ConstructorWithMandatoryArgumentsContainer
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->services = $this->privates = array();
$this->services = $this->privates = [];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -40,9 +40,9 @@ class ProjectServiceContainer extends \Symfony\Component\DependencyInjection\Tes
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
);
];
}
}

View File

@ -19,16 +19,16 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends \Symfony\Component\DependencyInjection\Tests\Fixtures\Container\ConstructorWithOptionalArgumentsContainer
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
parent::__construct();
$this->parameterBag = null;
$this->services = $this->privates = array();
$this->services = $this->privates = [];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -43,9 +43,9 @@ class ProjectServiceContainer extends \Symfony\Component\DependencyInjection\Tes
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
);
];
}
}

View File

@ -19,13 +19,13 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends \Symfony\Component\DependencyInjection\Tests\Fixtures\Container\NoConstructorContainer
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->services = $this->privates = array();
$this->services = $this->privates = [];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -40,9 +40,9 @@ class ProjectServiceContainer extends \Symfony\Component\DependencyInjection\Tes
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
);
];
}
}

View File

@ -19,13 +19,13 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class Container extends \Symfony\Component\DependencyInjection\Dump\AbstractContainer
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->services = $this->privates = array();
$this->services = $this->privates = [];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -40,9 +40,9 @@ class Container extends \Symfony\Component\DependencyInjection\Dump\AbstractCont
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
);
];
}
}

View File

@ -17,13 +17,13 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->services = $this->privates = array();
$this->services = $this->privates = [];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -38,9 +38,9 @@ class ProjectServiceContainer extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
);
];
}
}

View File

@ -17,18 +17,18 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->parameters = $this->getDefaultParameters();
$this->services = $this->privates = array();
$this->methodMap = array(
$this->services = $this->privates = [];
$this->methodMap = [
'test' => 'getTestService',
);
];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -43,10 +43,10 @@ class ProjectServiceContainer extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
);
];
}
/**
@ -56,7 +56,7 @@ class ProjectServiceContainer extends Container
*/
protected function getTestService()
{
return $this->services['test'] = new \stdClass(array('only dot' => '.', 'concatenation as value' => '.\'\'.', 'concatenation from the start value' => '\'\'.', '.' => 'dot as a key', '.\'\'.' => 'concatenation as a key', '\'\'.' => 'concatenation from the start key', 'optimize concatenation' => 'string1-string2', 'optimize concatenation with empty string' => 'string1string2', 'optimize concatenation from the start' => 'start', 'optimize concatenation at the end' => 'end', 'new line' => 'string with '."\n".'new line'));
return $this->services['test'] = new \stdClass(['only dot' => '.', 'concatenation as value' => '.\'\'.', 'concatenation from the start value' => '\'\'.', '.' => 'dot as a key', '.\'\'.' => 'concatenation as a key', '\'\'.' => 'concatenation from the start key', 'optimize concatenation' => 'string1-string2', 'optimize concatenation with empty string' => 'string1string2', 'optimize concatenation from the start' => 'start', 'optimize concatenation at the end' => 'end', 'new line' => 'string with '."\n".'new line']);
}
public function getParameter($name)
@ -98,8 +98,8 @@ class ProjectServiceContainer extends Container
return $this->parameterBag;
}
private $loadedDynamicParameters = array();
private $dynamicParameters = array();
private $loadedDynamicParameters = [];
private $dynamicParameters = [];
/**
* Computes a dynamic parameter.
@ -122,9 +122,9 @@ class ProjectServiceContainer extends Container
*/
protected function getDefaultParameters()
{
return array(
return [
'empty_value' => '',
'some_string' => '-',
);
];
}
}

View File

@ -17,7 +17,7 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
@ -27,12 +27,12 @@ class ProjectServiceContainer extends Container
}
$this->parameters = $this->getDefaultParameters();
$this->services = $this->privates = array();
$this->methodMap = array(
$this->services = $this->privates = [];
$this->methodMap = [
'test' => 'getTestService',
);
];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -47,10 +47,10 @@ class ProjectServiceContainer extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
);
];
}
/**
@ -60,7 +60,7 @@ class ProjectServiceContainer extends Container
*/
protected function getTestService()
{
return $this->services['test'] = new \stdClass(('wiz'.$this->targetDirs[1]), array(('wiz'.$this->targetDirs[1]) => ($this->targetDirs[2].'/')));
return $this->services['test'] = new \stdClass(('wiz'.$this->targetDirs[1]), [('wiz'.$this->targetDirs[1]) => ($this->targetDirs[2].'/')]);
}
public function getParameter($name)
@ -102,11 +102,11 @@ class ProjectServiceContainer extends Container
return $this->parameterBag;
}
private $loadedDynamicParameters = array(
private $loadedDynamicParameters = [
'foo' => false,
'buz' => false,
);
private $dynamicParameters = array();
];
private $dynamicParameters = [];
/**
* Computes a dynamic parameter.
@ -136,9 +136,9 @@ class ProjectServiceContainer extends Container
*/
protected function getDefaultParameters()
{
return array(
return [
'bar' => __DIR__,
'baz' => (__DIR__.'/PhpDumperTest.php'),
);
];
}
}

View File

@ -17,16 +17,16 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->services = $this->privates = array();
$this->methodMap = array(
$this->services = $this->privates = [];
$this->methodMap = [
'bar' => 'getBarService',
);
];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -41,11 +41,11 @@ class ProjectServiceContainer extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
'foo' => true,
);
];
}
/**

View File

@ -17,19 +17,19 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->parameters = $this->getDefaultParameters();
$this->services = $this->privates = array();
$this->methodMap = array(
$this->services = $this->privates = [];
$this->methodMap = [
'service_from_anonymous_factory' => 'getServiceFromAnonymousFactoryService',
'service_with_method_call_and_factory' => 'getServiceWithMethodCallAndFactoryService',
);
];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -44,10 +44,10 @@ class ProjectServiceContainer extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
);
];
}
/**
@ -113,10 +113,10 @@ class ProjectServiceContainer extends Container
return $this->parameterBag;
}
private $loadedDynamicParameters = array(
private $loadedDynamicParameters = [
'foo' => false,
);
private $dynamicParameters = array();
];
private $dynamicParameters = [];
/**
* Computes a dynamic parameter.
@ -145,8 +145,8 @@ class ProjectServiceContainer extends Container
*/
protected function getDefaultParameters()
{
return array(
return [
'env(FOO)' => 'Bar\\FaooClass',
);
];
}
}

View File

@ -17,16 +17,16 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->services = $this->privates = array();
$this->methodMap = array(
$this->services = $this->privates = [];
$this->methodMap = [
'foo' => 'getFooService',
);
];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -41,10 +41,10 @@ class ProjectServiceContainer extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
);
];
}
/**

View File

@ -17,7 +17,7 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class Symfony_DI_PhpDumper_Test_EnvParameters extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
@ -27,13 +27,13 @@ class Symfony_DI_PhpDumper_Test_EnvParameters extends Container
}
$this->parameters = $this->getDefaultParameters();
$this->services = $this->privates = array();
$this->methodMap = array(
$this->services = $this->privates = [];
$this->methodMap = [
'bar' => 'getBarService',
'test' => 'getTestService',
);
];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -48,10 +48,10 @@ class Symfony_DI_PhpDumper_Test_EnvParameters extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
);
];
}
/**
@ -113,14 +113,14 @@ class Symfony_DI_PhpDumper_Test_EnvParameters extends Container
return $this->parameterBag;
}
private $loadedDynamicParameters = array(
private $loadedDynamicParameters = [
'bar' => false,
'baz' => false,
'json' => false,
'db_dsn' => false,
'env(json_file)' => false,
);
private $dynamicParameters = array();
];
private $dynamicParameters = [];
/**
* Computes a dynamic parameter.
@ -153,10 +153,10 @@ class Symfony_DI_PhpDumper_Test_EnvParameters extends Container
*/
protected function getDefaultParameters()
{
return array(
return [
'project_dir' => '/foo/bar',
'env(FOO)' => 'foo',
'env(DB)' => 'sqlite://%project_dir%/var/data.db',
);
];
}
}

View File

@ -17,17 +17,17 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->services = $this->privates = array();
$this->methodMap = array(
$this->services = $this->privates = [];
$this->methodMap = [
'Bar\\Foo' => 'getFooService',
'Foo\\Foo' => 'getFoo2Service',
);
];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -42,10 +42,10 @@ class ProjectServiceContainer extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
);
];
}
/**

View File

@ -17,15 +17,15 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->parameters = $this->getDefaultParameters();
$this->services = $this->privates = array();
$this->services = $this->privates = [];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -40,10 +40,10 @@ class ProjectServiceContainer extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
);
];
}
public function getParameter($name)
@ -85,8 +85,8 @@ class ProjectServiceContainer extends Container
return $this->parameterBag;
}
private $loadedDynamicParameters = array();
private $dynamicParameters = array();
private $loadedDynamicParameters = [];
private $dynamicParameters = [];
/**
* Computes a dynamic parameter.
@ -109,12 +109,12 @@ class ProjectServiceContainer extends Container
*/
protected function getDefaultParameters()
{
return array(
return [
'foo' => 'bar',
'baz' => 'bar',
'bar' => 'foo is %foo bar',
'escape' => '@escapeme',
'values' => array(
'values' => [
0 => true,
1 => false,
2 => NULL,
@ -123,9 +123,9 @@ class ProjectServiceContainer extends Container
5 => 'true',
6 => 'false',
7 => 'null',
),
],
'binary' => 'ðððð',
'binary-control-char' => 'This is a Bell char ',
);
];
}
}

View File

@ -2,7 +2,7 @@ Array
(
[Container%s/removed-ids.php] => <?php
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
'configurator_service' => true,
@ -15,7 +15,7 @@ return array(
'inlined' => true,
'new_factory' => true,
'tagged_iterator_foo' => true,
);
];
[Container%s/getBAR2Service.php] => <?php
@ -170,11 +170,11 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
$a = ($this->services['foo.baz'] ?? $this->load('getFoo_BazService.php'));
$this->services['foo'] = $instance = \Bar\FooClass::getInstance('foo', $a, array('bar' => 'foo is bar', 'foobar' => 'bar'), true, $this);
$this->services['foo'] = $instance = \Bar\FooClass::getInstance('foo', $a, ['bar' => 'foo is bar', 'foobar' => 'bar'], true, $this);
$instance->foo = 'bar';
$instance->moo = $a;
$instance->qux = array('bar' => 'foo is bar', 'foobar' => 'bar');
$instance->qux = ['bar' => 'foo is bar', 'foobar' => 'bar'];
$instance->setBar(($this->services['bar'] ?? $this->getBarService()));
$instance->initialize();
sc_configure($instance);
@ -374,9 +374,9 @@ class ProjectServiceContainer extends Container
private $buildParameters;
private $containerDir;
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct(array $buildParameters = array(), $containerDir = __DIR__)
public function __construct(array $buildParameters = [], $containerDir = __DIR__)
{
$dir = $this->targetDirs[0] = \dirname($containerDir);
for ($i = 1; $i <= 5; ++$i) {
@ -386,14 +386,14 @@ class ProjectServiceContainer extends Container
$this->containerDir = $containerDir;
$this->parameters = $this->getDefaultParameters();
$this->services = $this->privates = array();
$this->syntheticIds = array(
$this->services = $this->privates = [];
$this->syntheticIds = [
'request' => true,
);
$this->methodMap = array(
];
$this->methodMap = [
'bar' => 'getBarService',
);
$this->fileMap = array(
];
$this->fileMap = [
'BAR' => 'getBAR2Service.php',
'BAR2' => 'getBAR22Service.php',
'bar2' => 'getBar23Service.php',
@ -418,12 +418,12 @@ class ProjectServiceContainer extends Container
'service_from_static_method' => 'getServiceFromStaticMethodService.php',
'tagged_iterator' => 'getTaggedIteratorService.php',
'throwing_one' => 'getThrowingOneService.php',
);
$this->aliases = array(
];
$this->aliases = [
'alias_for_alias' => 'foo',
'alias_for_foo' => 'foo',
'decorated' => 'decorator_service_with_name',
);
];
}
public function compile()
@ -510,8 +510,8 @@ class ProjectServiceContainer extends Container
return $this->parameterBag;
}
private $loadedDynamicParameters = array();
private $dynamicParameters = array();
private $loadedDynamicParameters = [];
private $dynamicParameters = [];
/**
* Computes a dynamic parameter.
@ -534,11 +534,11 @@ class ProjectServiceContainer extends Container
*/
protected function getDefaultParameters()
{
return array(
return [
'baz_class' => 'BazClass',
'foo_class' => 'Bar\\FooClass',
'foo' => 'bar',
);
];
}
protected function throw($message)
@ -563,10 +563,10 @@ if (!\class_exists(ProjectServiceContainer::class, false)) {
\class_alias(\Container%s\ProjectServiceContainer::class, ProjectServiceContainer::class, false);
}
return new \Container%s\ProjectServiceContainer(array(
return new \Container%s\ProjectServiceContainer([
'container.build_hash' => '%s',
'container.build_id' => '%s',
'container.build_time' => %d,
), __DIR__.\DIRECTORY_SEPARATOR.'Container%s');
], __DIR__.\DIRECTORY_SEPARATOR.'Container%s');
)

View File

@ -17,17 +17,17 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->parameters = $this->getDefaultParameters();
$this->services = $this->privates = array();
$this->syntheticIds = array(
$this->services = $this->privates = [];
$this->syntheticIds = [
'request' => true,
);
$this->methodMap = array(
];
$this->methodMap = [
'BAR' => 'getBARService',
'BAR2' => 'getBAR2Service',
'bar' => 'getBar3Service',
@ -51,12 +51,12 @@ class ProjectServiceContainer extends Container
'runtime_error' => 'getRuntimeErrorService',
'service_from_static_method' => 'getServiceFromStaticMethodService',
'tagged_iterator' => 'getTaggedIteratorService',
);
$this->aliases = array(
];
$this->aliases = [
'alias_for_alias' => 'foo',
'alias_for_foo' => 'foo',
'decorated' => 'decorator_service_with_name',
);
];
}
public function compile()
@ -71,7 +71,7 @@ class ProjectServiceContainer extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
'configurator_service' => true,
@ -83,7 +83,7 @@ class ProjectServiceContainer extends Container
'inlined' => true,
'new_factory' => true,
'tagged_iterator_foo' => true,
);
];
}
/**
@ -244,11 +244,11 @@ class ProjectServiceContainer extends Container
{
$a = ($this->services['foo.baz'] ?? $this->getFoo_BazService());
$this->services['foo'] = $instance = \Bar\FooClass::getInstance('foo', $a, array('bar' => 'foo is bar', 'foobar' => 'bar'), true, $this);
$this->services['foo'] = $instance = \Bar\FooClass::getInstance('foo', $a, ['bar' => 'foo is bar', 'foobar' => 'bar'], true, $this);
$instance->foo = 'bar';
$instance->moo = $a;
$instance->qux = array('bar' => 'foo is bar', 'foobar' => 'bar');
$instance->qux = ['bar' => 'foo is bar', 'foobar' => 'bar'];
$instance->setBar(($this->services['bar'] ?? $this->getBar3Service()));
$instance->initialize();
sc_configure($instance);
@ -448,8 +448,8 @@ class ProjectServiceContainer extends Container
return $this->parameterBag;
}
private $loadedDynamicParameters = array();
private $dynamicParameters = array();
private $loadedDynamicParameters = [];
private $dynamicParameters = [];
/**
* Computes a dynamic parameter.
@ -472,11 +472,11 @@ class ProjectServiceContainer extends Container
*/
protected function getDefaultParameters()
{
return array(
return [
'baz_class' => 'BazClass',
'foo_class' => 'Bar\\FooClass',
'foo' => 'bar',
);
];
}
protected function throw($message)

View File

@ -17,17 +17,17 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->services = $this->privates = array();
$this->methodMap = array(
$this->services = $this->privates = [];
$this->methodMap = [
'App\\Bus' => 'getBusService',
'App\\Db' => 'getDbService',
);
];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -42,7 +42,7 @@ class ProjectServiceContainer extends Container
public function getRemovedIds()
{
return array(
return [
'App\\Handler1' => true,
'App\\Handler2' => true,
'App\\Processor' => true,
@ -50,7 +50,7 @@ class ProjectServiceContainer extends Container
'App\\Schema' => true,
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
);
];
}
/**
@ -66,7 +66,7 @@ class ProjectServiceContainer extends Container
$b = ($this->privates['App\Schema'] ?? $this->getSchemaService());
$c = new \App\Registry();
$c->processor = array(0 => $a, 1 => $instance);
$c->processor = [0 => $a, 1 => $instance];
$d = new \App\Processor($c, $a);

View File

@ -17,12 +17,12 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class Symfony_DI_PhpDumper_Test_Almost_Circular_Private extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->services = $this->privates = array();
$this->methodMap = array(
$this->services = $this->privates = [];
$this->methodMap = [
'bar2' => 'getBar2Service',
'bar3' => 'getBar3Service',
'baz6' => 'getBaz6Service',
@ -38,9 +38,9 @@ class Symfony_DI_PhpDumper_Test_Almost_Circular_Private extends Container
'manager2' => 'getManager2Service',
'root' => 'getRootService',
'subscriber' => 'getSubscriberService',
);
];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -55,7 +55,7 @@ class Symfony_DI_PhpDumper_Test_Almost_Circular_Private extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
'bar' => true,
@ -77,7 +77,7 @@ class Symfony_DI_PhpDumper_Test_Almost_Circular_Private extends Container
'logger2' => true,
'multiuse1' => true,
'subscriber2' => true,
);
];
}
/**

View File

@ -17,12 +17,12 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class Symfony_DI_PhpDumper_Test_Almost_Circular_Public extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->services = $this->privates = array();
$this->methodMap = array(
$this->services = $this->privates = [];
$this->methodMap = [
'bar' => 'getBarService',
'bar3' => 'getBar3Service',
'bar5' => 'getBar5Service',
@ -45,9 +45,9 @@ class Symfony_DI_PhpDumper_Test_Almost_Circular_Public extends Container
'manager2' => 'getManager2Service',
'root' => 'getRootService',
'subscriber' => 'getSubscriberService',
);
];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -62,7 +62,7 @@ class Symfony_DI_PhpDumper_Test_Almost_Circular_Public extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
'bar2' => true,
@ -77,7 +77,7 @@ class Symfony_DI_PhpDumper_Test_Almost_Circular_Public extends Container
'logger2' => true,
'multiuse1' => true,
'subscriber2' => true,
);
];
}
/**

View File

@ -17,7 +17,7 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
@ -27,12 +27,12 @@ class ProjectServiceContainer extends Container
}
$this->parameters = $this->getDefaultParameters();
$this->services = $this->privates = array();
$this->methodMap = array(
$this->services = $this->privates = [];
$this->methodMap = [
'bar' => 'getBarService',
);
];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -47,10 +47,10 @@ class ProjectServiceContainer extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
);
];
}
/**
@ -106,10 +106,10 @@ class ProjectServiceContainer extends Container
return $this->parameterBag;
}
private $loadedDynamicParameters = array(
private $loadedDynamicParameters = [
'array_2' => false,
);
private $dynamicParameters = array();
];
private $dynamicParameters = [];
/**
* Computes a dynamic parameter.
@ -123,9 +123,9 @@ class ProjectServiceContainer extends Container
private function getDynamicParameter($name)
{
switch ($name) {
case 'array_2': $value = array(
case 'array_2': $value = [
0 => ($this->targetDirs[2].'/Dumper'),
); break;
]; break;
default: throw new InvalidArgumentException(sprintf('The dynamic parameter "%s" must be defined.', $name));
}
$this->loadedDynamicParameters[$name] = true;
@ -140,10 +140,10 @@ class ProjectServiceContainer extends Container
*/
protected function getDefaultParameters()
{
return array(
'array_1' => array(
return [
'array_1' => [
0 => 123,
),
);
],
];
}
}

View File

@ -17,15 +17,15 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class Symfony_DI_PhpDumper_Test_Base64Parameters extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->parameters = $this->getDefaultParameters();
$this->services = $this->privates = array();
$this->services = $this->privates = [];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -40,10 +40,10 @@ class Symfony_DI_PhpDumper_Test_Base64Parameters extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
);
];
}
public function getParameter($name)
@ -85,10 +85,10 @@ class Symfony_DI_PhpDumper_Test_Base64Parameters extends Container
return $this->parameterBag;
}
private $loadedDynamicParameters = array(
private $loadedDynamicParameters = [
'hello' => false,
);
private $dynamicParameters = array();
];
private $dynamicParameters = [];
/**
* Computes a dynamic parameter.
@ -117,8 +117,8 @@ class Symfony_DI_PhpDumper_Test_Base64Parameters extends Container
*/
protected function getDefaultParameters()
{
return array(
return [
'env(foo)' => 'd29ybGQ=',
);
];
}
}

View File

@ -17,15 +17,15 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class Symfony_DI_PhpDumper_Test_CsvParameters extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->parameters = $this->getDefaultParameters();
$this->services = $this->privates = array();
$this->services = $this->privates = [];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -40,10 +40,10 @@ class Symfony_DI_PhpDumper_Test_CsvParameters extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
);
];
}
public function getParameter($name)
@ -85,10 +85,10 @@ class Symfony_DI_PhpDumper_Test_CsvParameters extends Container
return $this->parameterBag;
}
private $loadedDynamicParameters = array(
private $loadedDynamicParameters = [
'hello' => false,
);
private $dynamicParameters = array();
];
private $dynamicParameters = [];
/**
* Computes a dynamic parameter.
@ -117,8 +117,8 @@ class Symfony_DI_PhpDumper_Test_CsvParameters extends Container
*/
protected function getDefaultParameters()
{
return array(
return [
'env(foo)' => 'foo,bar',
);
];
}
}

View File

@ -17,17 +17,17 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->services = $this->privates = array();
$this->methodMap = array(
$this->services = $this->privates = [];
$this->methodMap = [
'bar' => 'getBarService',
'foo' => 'getFooService',
);
];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -42,10 +42,10 @@ class ProjectServiceContainer extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
);
];
}
protected function createProxy($class, \Closure $factory)

View File

@ -17,17 +17,17 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class Symfony_DI_PhpDumper_Test_Deep_Graph extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->services = $this->privates = array();
$this->methodMap = array(
$this->services = $this->privates = [];
$this->methodMap = [
'bar' => 'getBarService',
'foo' => 'getFooService',
);
];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -42,10 +42,10 @@ class Symfony_DI_PhpDumper_Test_Deep_Graph extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
);
];
}
/**

View File

@ -17,19 +17,19 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->parameters = $this->getDefaultParameters();
$this->services = $this->privates = array();
$this->methodMap = array(
$this->services = $this->privates = [];
$this->methodMap = [
'bar' => 'getBarService',
'foo' => 'getFooService',
);
];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -44,12 +44,12 @@ class ProjectServiceContainer extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
'bar_%env(BAR)%' => true,
'baz_%env(BAR)%' => true,
);
];
}
/**
@ -69,7 +69,7 @@ class ProjectServiceContainer extends Container
*/
protected function getFooService()
{
return $this->services['foo'] = new \stdClass(($this->privates['bar_%env(BAR)%'] ?? ($this->privates['bar_%env(BAR)%'] = new \stdClass())), array('baz_'.$this->getEnv('string:BAR') => new \stdClass()));
return $this->services['foo'] = new \stdClass(($this->privates['bar_%env(BAR)%'] ?? ($this->privates['bar_%env(BAR)%'] = new \stdClass())), ['baz_'.$this->getEnv('string:BAR') => new \stdClass()]);
}
public function getParameter($name)
@ -111,8 +111,8 @@ class ProjectServiceContainer extends Container
return $this->parameterBag;
}
private $loadedDynamicParameters = array();
private $dynamicParameters = array();
private $loadedDynamicParameters = [];
private $dynamicParameters = [];
/**
* Computes a dynamic parameter.
@ -135,8 +135,8 @@ class ProjectServiceContainer extends Container
*/
protected function getDefaultParameters()
{
return array(
return [
'env(BAR)' => 'bar',
);
];
}
}

View File

@ -17,17 +17,17 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class Symfony_DI_PhpDumper_Errored_Definition extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->parameters = $this->getDefaultParameters();
$this->services = $this->privates = array();
$this->syntheticIds = array(
$this->services = $this->privates = [];
$this->syntheticIds = [
'request' => true,
);
$this->methodMap = array(
];
$this->methodMap = [
'BAR' => 'getBARService',
'BAR2' => 'getBAR2Service',
'bar' => 'getBar3Service',
@ -51,12 +51,12 @@ class Symfony_DI_PhpDumper_Errored_Definition extends Container
'runtime_error' => 'getRuntimeErrorService',
'service_from_static_method' => 'getServiceFromStaticMethodService',
'tagged_iterator' => 'getTaggedIteratorService',
);
$this->aliases = array(
];
$this->aliases = [
'alias_for_alias' => 'foo',
'alias_for_foo' => 'foo',
'decorated' => 'decorator_service_with_name',
);
];
}
public function compile()
@ -71,7 +71,7 @@ class Symfony_DI_PhpDumper_Errored_Definition extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
'configurator_service' => true,
@ -83,7 +83,7 @@ class Symfony_DI_PhpDumper_Errored_Definition extends Container
'inlined' => true,
'new_factory' => true,
'tagged_iterator_foo' => true,
);
];
}
/**
@ -244,11 +244,11 @@ class Symfony_DI_PhpDumper_Errored_Definition extends Container
{
$a = ($this->services['foo.baz'] ?? $this->getFoo_BazService());
$this->services['foo'] = $instance = \Bar\FooClass::getInstance('foo', $a, array('bar' => 'foo is bar', 'foobar' => 'bar'), true, $this);
$this->services['foo'] = $instance = \Bar\FooClass::getInstance('foo', $a, ['bar' => 'foo is bar', 'foobar' => 'bar'], true, $this);
$instance->foo = 'bar';
$instance->moo = $a;
$instance->qux = array('bar' => 'foo is bar', 'foobar' => 'bar');
$instance->qux = ['bar' => 'foo is bar', 'foobar' => 'bar'];
$instance->setBar(($this->services['bar'] ?? $this->getBar3Service()));
$instance->initialize();
sc_configure($instance);
@ -448,8 +448,8 @@ class Symfony_DI_PhpDumper_Errored_Definition extends Container
return $this->parameterBag;
}
private $loadedDynamicParameters = array();
private $dynamicParameters = array();
private $loadedDynamicParameters = [];
private $dynamicParameters = [];
/**
* Computes a dynamic parameter.
@ -472,12 +472,12 @@ class Symfony_DI_PhpDumper_Errored_Definition extends Container
*/
protected function getDefaultParameters()
{
return array(
return [
'baz_class' => 'BazClass',
'foo_class' => 'Bar\\FooClass',
'foo' => 'bar',
'foo_bar' => 'foo_bar',
);
];
}
protected function throw($message)

View File

@ -17,7 +17,7 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
@ -27,14 +27,14 @@ class ProjectServiceContainer extends Container
}
$this->parameters = $this->getDefaultParameters();
$this->services = $this->privates = array();
$this->methodMap = array(
$this->services = $this->privates = [];
$this->methodMap = [
'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\ParentNotExists' => 'getParentNotExistsService',
'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\includes\\HotPath\\C1' => 'getC1Service',
'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\includes\\HotPath\\C2' => 'getC2Service',
);
];
$this->aliases = array();
$this->aliases = [];
$this->privates['service_container'] = function () {
include_once $this->targetDirs[1].'/includes/HotPath/I1.php';
@ -56,11 +56,11 @@ class ProjectServiceContainer extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\includes\\HotPath\\C3' => true,
);
];
}
/**
@ -135,8 +135,8 @@ class ProjectServiceContainer extends Container
return $this->parameterBag;
}
private $loadedDynamicParameters = array();
private $dynamicParameters = array();
private $loadedDynamicParameters = [];
private $dynamicParameters = [];
/**
* Computes a dynamic parameter.
@ -159,8 +159,8 @@ class ProjectServiceContainer extends Container
*/
protected function getDefaultParameters()
{
return array(
return [
'inline_requires' => true,
);
];
}
}

View File

@ -17,16 +17,16 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class Symfony_DI_PhpDumper_Test_Inline_Self_Ref extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->services = $this->privates = array();
$this->methodMap = array(
$this->services = $this->privates = [];
$this->methodMap = [
'App\\Foo' => 'getFooService',
);
];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -41,10 +41,10 @@ class Symfony_DI_PhpDumper_Test_Inline_Self_Ref extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
);
];
}
/**

View File

@ -17,15 +17,15 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class Symfony_DI_PhpDumper_Test_JsonParameters extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->parameters = $this->getDefaultParameters();
$this->services = $this->privates = array();
$this->services = $this->privates = [];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -40,10 +40,10 @@ class Symfony_DI_PhpDumper_Test_JsonParameters extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
);
];
}
public function getParameter($name)
@ -85,11 +85,11 @@ class Symfony_DI_PhpDumper_Test_JsonParameters extends Container
return $this->parameterBag;
}
private $loadedDynamicParameters = array(
private $loadedDynamicParameters = [
'hello' => false,
'hello-bar' => false,
);
private $dynamicParameters = array();
];
private $dynamicParameters = [];
/**
* Computes a dynamic parameter.
@ -119,9 +119,9 @@ class Symfony_DI_PhpDumper_Test_JsonParameters extends Container
*/
protected function getDefaultParameters()
{
return array(
return [
'env(foo)' => '["foo","bar"]',
'env(bar)' => 'null',
);
];
}
}

View File

@ -17,12 +17,12 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->services = $this->privates = array();
$this->methodMap = array(
$this->services = $this->privates = [];
$this->methodMap = [
'bar_service' => 'getBarServiceService',
'foo_service' => 'getFooServiceService',
'translator.loader_1' => 'getTranslator_Loader1Service',
@ -31,9 +31,9 @@ class ProjectServiceContainer extends Container
'translator_1' => 'getTranslator1Service',
'translator_2' => 'getTranslator2Service',
'translator_3' => 'getTranslator3Service',
);
];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -48,14 +48,14 @@ class ProjectServiceContainer extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
'baz_service' => true,
'translator.loader_1_locator' => true,
'translator.loader_2_locator' => true,
'translator.loader_3_locator' => true,
);
];
}
/**
@ -75,13 +75,13 @@ class ProjectServiceContainer extends Container
*/
protected function getFooServiceService()
{
return $this->services['foo_service'] = new \Symfony\Component\DependencyInjection\ServiceLocator(array('bar' => function () {
return $this->services['foo_service'] = new \Symfony\Component\DependencyInjection\ServiceLocator(['bar' => function () {
return ($this->services['bar_service'] ?? $this->getBarServiceService());
}, 'baz' => function (): \stdClass {
return ($this->privates['baz_service'] ?? ($this->privates['baz_service'] = new \stdClass()));
}, 'nil' => function () {
return NULL;
}));
}]);
}
/**
@ -121,9 +121,9 @@ class ProjectServiceContainer extends Container
*/
protected function getTranslator1Service()
{
return $this->services['translator_1'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\StubbedTranslator(new \Symfony\Component\DependencyInjection\ServiceLocator(array('translator.loader_1' => function () {
return $this->services['translator_1'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\StubbedTranslator(new \Symfony\Component\DependencyInjection\ServiceLocator(['translator.loader_1' => function () {
return ($this->services['translator.loader_1'] ?? ($this->services['translator.loader_1'] = new \stdClass()));
})));
}]));
}
/**
@ -133,9 +133,9 @@ class ProjectServiceContainer extends Container
*/
protected function getTranslator2Service()
{
$this->services['translator_2'] = $instance = new \Symfony\Component\DependencyInjection\Tests\Fixtures\StubbedTranslator(new \Symfony\Component\DependencyInjection\ServiceLocator(array('translator.loader_2' => function () {
$this->services['translator_2'] = $instance = new \Symfony\Component\DependencyInjection\Tests\Fixtures\StubbedTranslator(new \Symfony\Component\DependencyInjection\ServiceLocator(['translator.loader_2' => function () {
return ($this->services['translator.loader_2'] ?? ($this->services['translator.loader_2'] = new \stdClass()));
})));
}]));
$instance->addResource('db', ($this->services['translator.loader_2'] ?? ($this->services['translator.loader_2'] = new \stdClass())), 'nl');
@ -149,9 +149,9 @@ class ProjectServiceContainer extends Container
*/
protected function getTranslator3Service()
{
$this->services['translator_3'] = $instance = new \Symfony\Component\DependencyInjection\Tests\Fixtures\StubbedTranslator(new \Symfony\Component\DependencyInjection\ServiceLocator(array('translator.loader_3' => function () {
$this->services['translator_3'] = $instance = new \Symfony\Component\DependencyInjection\Tests\Fixtures\StubbedTranslator(new \Symfony\Component\DependencyInjection\ServiceLocator(['translator.loader_3' => function () {
return ($this->services['translator.loader_3'] ?? ($this->services['translator.loader_3'] = new \stdClass()));
})));
}]));
$a = ($this->services['translator.loader_3'] ?? ($this->services['translator.loader_3'] = new \stdClass()));

View File

@ -17,16 +17,16 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->services = $this->privates = array();
$this->methodMap = array(
$this->services = $this->privates = [];
$this->methodMap = [
'bar' => 'getBarService',
);
];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -41,11 +41,11 @@ class ProjectServiceContainer extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
'foo' => true,
);
];
}
protected function createProxy($class, \Closure $factory)

View File

@ -17,17 +17,17 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->services = $this->privates = array();
$this->methodMap = array(
$this->services = $this->privates = [];
$this->methodMap = [
'bar_service' => 'getBarServiceService',
'foo_service' => 'getFooServiceService',
);
];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -42,11 +42,11 @@ class ProjectServiceContainer extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
'baz_service' => true,
);
];
}
/**

View File

@ -17,16 +17,16 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->services = $this->privates = array();
$this->methodMap = array(
$this->services = $this->privates = [];
$this->methodMap = [
'public_foo' => 'getPublicFooService',
);
];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -41,12 +41,12 @@ class ProjectServiceContainer extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
'private_bar' => true,
'private_foo' => true,
);
];
}
/**

View File

@ -17,21 +17,21 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class Symfony_DI_PhpDumper_Test_Rot13Parameters extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
private $getService;
public function __construct()
{
$this->getService = \Closure::fromCallable(array($this, 'getService'));
$this->getService = \Closure::fromCallable([$this, 'getService']);
$this->parameters = $this->getDefaultParameters();
$this->services = $this->privates = array();
$this->methodMap = array(
$this->services = $this->privates = [];
$this->methodMap = [
'Symfony\\Component\\DependencyInjection\\Tests\\Dumper\\Rot13EnvVarProcessor' => 'getRot13EnvVarProcessorService',
'container.env_var_processors_locator' => 'getContainer_EnvVarProcessorsLocatorService',
);
];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -46,11 +46,11 @@ class Symfony_DI_PhpDumper_Test_Rot13Parameters extends Container
public function getRemovedIds()
{
return array(
return [
'.service_locator.GU08LT9' => true,
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
);
];
}
/**
@ -70,9 +70,9 @@ class Symfony_DI_PhpDumper_Test_Rot13Parameters extends Container
*/
protected function getContainer_EnvVarProcessorsLocatorService()
{
return $this->services['container.env_var_processors_locator'] = new \Symfony\Component\DependencyInjection\Argument\ServiceLocator($this->getService, array(
'rot13' => array('services', 'Symfony\\Component\\DependencyInjection\\Tests\\Dumper\\Rot13EnvVarProcessor', 'getRot13EnvVarProcessorService', false),
));
return $this->services['container.env_var_processors_locator'] = new \Symfony\Component\DependencyInjection\Argument\ServiceLocator($this->getService, [
'rot13' => ['services', 'Symfony\\Component\\DependencyInjection\\Tests\\Dumper\\Rot13EnvVarProcessor', 'getRot13EnvVarProcessorService', false],
]);
}
public function getParameter($name)
@ -114,10 +114,10 @@ class Symfony_DI_PhpDumper_Test_Rot13Parameters extends Container
return $this->parameterBag;
}
private $loadedDynamicParameters = array(
private $loadedDynamicParameters = [
'hello' => false,
);
private $dynamicParameters = array();
];
private $dynamicParameters = [];
/**
* Computes a dynamic parameter.
@ -146,8 +146,8 @@ class Symfony_DI_PhpDumper_Test_Rot13Parameters extends Container
*/
protected function getDefaultParameters()
{
return array(
return [
'env(foo)' => 'jbeyq',
);
];
}
}

View File

@ -17,22 +17,22 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class Symfony_DI_PhpDumper_Service_Locator_Argument extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
private $getService;
public function __construct()
{
$this->getService = \Closure::fromCallable(array($this, 'getService'));
$this->services = $this->privates = array();
$this->syntheticIds = array(
$this->getService = \Closure::fromCallable([$this, 'getService']);
$this->services = $this->privates = [];
$this->syntheticIds = [
'foo5' => true,
);
$this->methodMap = array(
];
$this->methodMap = [
'bar' => 'getBarService',
'foo1' => 'getFoo1Service',
);
];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -47,14 +47,14 @@ class Symfony_DI_PhpDumper_Service_Locator_Argument extends Container
public function getRemovedIds()
{
return array(
return [
'.service_locator.38dy3OH' => true,
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
'foo2' => true,
'foo3' => true,
'foo4' => true,
);
];
}
/**
@ -66,13 +66,13 @@ class Symfony_DI_PhpDumper_Service_Locator_Argument extends Container
{
$this->services['bar'] = $instance = new \stdClass();
$instance->locator = new \Symfony\Component\DependencyInjection\Argument\ServiceLocator($this->getService, array(
'foo1' => array('services', 'foo1', 'getFoo1Service', false),
'foo2' => array('privates', 'foo2', 'getFoo2Service', false),
'foo3' => array(false, 'foo3', 'getFoo3Service', false),
'foo4' => array('privates', 'foo4', NULL, 'BOOM'),
'foo5' => array('services', 'foo5', NULL, false),
));
$instance->locator = new \Symfony\Component\DependencyInjection\Argument\ServiceLocator($this->getService, [
'foo1' => ['services', 'foo1', 'getFoo1Service', false],
'foo2' => ['privates', 'foo2', 'getFoo2Service', false],
'foo3' => [false, 'foo3', 'getFoo3Service', false],
'foo4' => ['privates', 'foo4', NULL, 'BOOM'],
'foo5' => ['services', 'foo5', NULL, false],
]);
return $instance;
}

View File

@ -17,19 +17,19 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
private $getService;
public function __construct()
{
$this->getService = \Closure::fromCallable(array($this, 'getService'));
$this->services = $this->privates = array();
$this->methodMap = array(
$this->getService = \Closure::fromCallable([$this, 'getService']);
$this->services = $this->privates = [];
$this->methodMap = [
'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestServiceSubscriber' => 'getTestServiceSubscriberService',
'foo_service' => 'getFooServiceService',
);
];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -44,13 +44,13 @@ class ProjectServiceContainer extends Container
public function getRemovedIds()
{
return array(
return [
'.service_locator.nZQiwdg' => true,
'.service_locator.nZQiwdg.foo_service' => true,
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition' => true,
);
];
}
/**
@ -70,12 +70,12 @@ class ProjectServiceContainer extends Container
*/
protected function getFooServiceService()
{
return $this->services['foo_service'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\TestServiceSubscriber((new \Symfony\Component\DependencyInjection\Argument\ServiceLocator($this->getService, array(
'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition' => array('privates', 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition', 'getCustomDefinitionService', false),
'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestServiceSubscriber' => array('services', 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestServiceSubscriber', 'getTestServiceSubscriberService', false),
'bar' => array('services', 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestServiceSubscriber', 'getTestServiceSubscriberService', false),
'baz' => array('privates', 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition', 'getCustomDefinitionService', false),
)))->withContext('foo_service', $this));
return $this->services['foo_service'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\TestServiceSubscriber((new \Symfony\Component\DependencyInjection\Argument\ServiceLocator($this->getService, [
'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition' => ['privates', 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition', 'getCustomDefinitionService', false],
'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestServiceSubscriber' => ['services', 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestServiceSubscriber', 'getTestServiceSubscriberService', false],
'bar' => ['services', 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestServiceSubscriber', 'getTestServiceSubscriberService', false],
'baz' => ['privates', 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition', 'getCustomDefinitionService', false],
]))->withContext('foo_service', $this));
}
/**

View File

@ -17,17 +17,17 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class ProjectServiceContainer extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->services = $this->privates = array();
$this->methodMap = array(
$this->services = $this->privates = [];
$this->methodMap = [
'tsantos_serializer' => 'getTsantosSerializerService',
);
$this->aliases = array(
];
$this->aliases = [
'TSantos\\Serializer\\SerializerInterface' => 'tsantos_serializer',
);
];
}
public function compile()
@ -42,10 +42,10 @@ class ProjectServiceContainer extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
);
];
}
/**

View File

@ -17,18 +17,18 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class Symfony_DI_PhpDumper_Test_Uninitialized_Reference extends Container
{
private $parameters;
private $targetDirs = array();
private $targetDirs = [];
public function __construct()
{
$this->services = $this->privates = array();
$this->methodMap = array(
$this->services = $this->privates = [];
$this->methodMap = [
'bar' => 'getBarService',
'baz' => 'getBazService',
'foo1' => 'getFoo1Service',
);
];
$this->aliases = array();
$this->aliases = [];
}
public function compile()
@ -43,12 +43,12 @@ class Symfony_DI_PhpDumper_Test_Uninitialized_Reference extends Container
public function getRemovedIds()
{
return array(
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
'foo2' => true,
'foo3' => true,
);
];
}
/**
@ -63,13 +63,13 @@ class Symfony_DI_PhpDumper_Test_Uninitialized_Reference extends Container
$instance->foo1 = ($this->services['foo1'] ?? null);
$instance->foo2 = null;
$instance->foo3 = ($this->privates['foo3'] ?? null);
$instance->closures = array(0 => function () {
$instance->closures = [0 => function () {
return ($this->services['foo1'] ?? null);
}, 1 => function () {
return null;
}, 2 => function () {
return ($this->privates['foo3'] ?? null);
});
}];
$instance->iter = new RewindableGenerator(function () {
if (isset($this->services['foo1'])) {
yield 'foo1' => ($this->services['foo1'] ?? null);

View File

@ -28,7 +28,7 @@ CHANGELOG
{
public static function getExtendedTypes(): iterable
{
return array(FormType::class);
return [FormType::class];
}
// ...

View File

@ -61,7 +61,7 @@ class PdoStore implements StoreInterface
* * db_expiration_col: The column where to store the expiration [default: key_expiration]
* * db_username: The username when lazy-connect [default: '']
* * db_password: The password when lazy-connect [default: '']
* * db_connection_options: An array of driver-specific connection options [default: array()]
* * db_connection_options: An array of driver-specific connection options [default: []]
*
* @param \PDO|Connection|string $connOrDsn A \PDO or Connection instance or DSN string or null
* @param array $options An associative array of options

View File

@ -146,7 +146,7 @@ class OptionsResolver implements Options
* following signature:
*
* $options->setDefault('database', function (OptionsResolver $resolver) {
* $resolver->setDefined(array('dbname', 'host', 'port', 'user', 'pass'));
* $resolver->setDefined(['dbname', 'host', 'port', 'user', 'pass']);
* }
*
* To get access to the parent options, add a second argument to the closure's

View File

@ -1157,8 +1157,8 @@ class ProcessTest extends TestCase
{
return [
//expected output / getter / code to execute
//array(1,'getExitCode','exit(1);'),
//array(true,'isSuccessful','exit();'),
// [1,'getExitCode','exit(1);'],
// [true,'isSuccessful','exit();'],
['output', 'getOutput', 'echo \'output\';'],
];
}

View File

@ -207,15 +207,15 @@ EOF;
$code = '';
foreach ($staticRoutes as $url => $routes) {
$code .= self::export($url)." => array(\n";
$code .= self::export($url)." => [\n";
foreach ($routes as $name => list($route, $hasTrailingSlash)) {
$code .= $this->compileRoute($route, $name, !$route->compile()->getHostVariables() ? $route->getHost() : $route->compile()->getHostRegex() ?: null, $hasTrailingSlash, false, $conditions);
}
$code .= "),\n";
$code .= "],\n";
}
if ($code) {
return "\$this->staticRoutes = array(\n{$this->indent($code, 1)});\n";
return "\$this->staticRoutes = [\n{$this->indent($code, 1)}];\n";
}
return $code;
@ -348,8 +348,8 @@ EOF;
unset($state->getVars);
return "\$this->regexpList = array({$code}\n);\n"
."\$this->dynamicRoutes = array(\n{$this->indent($state->routes, 1)});\n";
return "\$this->regexpList = [{$code}\n];\n"
."\$this->dynamicRoutes = [\n{$this->indent($state->routes, 1)}];\n";
}
/**
@ -394,7 +394,7 @@ EOF;
$state->regex .= $rx;
$prevRegex = $compiledRoute->getRegex();
$state->routes .= sprintf("%s => array(\n%s),\n", $state->mark, $this->compileRoute($route, $name, $vars, $hasTrailingSlash, $hasTrailingVar, $conditions));
$state->routes .= sprintf("%s => [\n%s],\n", $state->mark, $this->compileRoute($route, $name, $vars, $hasTrailingSlash, $hasTrailingVar, $conditions));
}
return $code;
@ -420,7 +420,7 @@ EOF;
}
return sprintf(
" array(%s, %s, %s, %s, %s, %s, %s),\n",
" [%s, %s, %s, %s, %s, %s, %s],\n",
self::export(['_route' => $name] + $defaults),
self::export($vars),
self::export(array_flip($route->getMethods()) ?: null),
@ -445,7 +445,7 @@ EOF;
private function indent($code, $level = 1)
{
$code = preg_replace('/ => array\(\n (array\(.+),\n\),/', ' => array($1),', $code);
$code = preg_replace('/ => \[\n (\[.+),\n\],/', ' => [$1],', $code);
return preg_replace('/^./m', str_repeat(' ', $level).'$0', $code);
}
@ -466,11 +466,11 @@ EOF;
return str_replace("\n", '\'."\n".\'', var_export($value, true));
}
if (!$value) {
return 'array()';
return '[]';
}
$i = 0;
$export = 'array(';
$export = '[';
foreach ($value as $k => $v) {
if ($i === $k) {
@ -486,6 +486,6 @@ EOF;
$export .= self::export($v).', ';
}
return substr_replace($export, ')', -2);
return substr_replace($export, ']', -2);
}
}

View File

@ -15,26 +15,26 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
{
$this->context = $context;
$this->matchHost = true;
$this->staticRoutes = array(
'/test/baz' => array(array(array('_route' => 'baz'), null, null, null, false, false, null)),
'/test/baz.html' => array(array(array('_route' => 'baz2'), null, null, null, false, false, null)),
'/test/baz3' => array(array(array('_route' => 'baz3'), null, null, null, true, false, null)),
'/foofoo' => array(array(array('_route' => 'foofoo', 'def' => 'test'), null, null, null, false, false, null)),
'/spa ce' => array(array(array('_route' => 'space'), null, null, null, false, false, null)),
'/multi/new' => array(array(array('_route' => 'overridden2'), null, null, null, false, false, null)),
'/multi/hey' => array(array(array('_route' => 'hey'), null, null, null, true, false, null)),
'/ababa' => array(array(array('_route' => 'ababa'), null, null, null, false, false, null)),
'/route1' => array(array(array('_route' => 'route1'), 'a.example.com', null, null, false, false, null)),
'/c2/route2' => array(array(array('_route' => 'route2'), 'a.example.com', null, null, false, false, null)),
'/route4' => array(array(array('_route' => 'route4'), 'a.example.com', null, null, false, false, null)),
'/c2/route3' => array(array(array('_route' => 'route3'), 'b.example.com', null, null, false, false, null)),
'/route5' => array(array(array('_route' => 'route5'), 'c.example.com', null, null, false, false, null)),
'/route6' => array(array(array('_route' => 'route6'), null, null, null, false, false, null)),
'/route11' => array(array(array('_route' => 'route11'), '#^(?P<var1>[^\\.]++)\\.example\\.com$#sDi', null, null, false, false, null)),
'/route12' => array(array(array('_route' => 'route12', 'var1' => 'val'), '#^(?P<var1>[^\\.]++)\\.example\\.com$#sDi', null, null, false, false, null)),
'/route17' => array(array(array('_route' => 'route17'), null, null, null, false, false, null)),
);
$this->regexpList = array(
$this->staticRoutes = [
'/test/baz' => [[['_route' => 'baz'], null, null, null, false, false, null]],
'/test/baz.html' => [[['_route' => 'baz2'], null, null, null, false, false, null]],
'/test/baz3' => [[['_route' => 'baz3'], null, null, null, true, false, null]],
'/foofoo' => [[['_route' => 'foofoo', 'def' => 'test'], null, null, null, false, false, null]],
'/spa ce' => [[['_route' => 'space'], null, null, null, false, false, null]],
'/multi/new' => [[['_route' => 'overridden2'], null, null, null, false, false, null]],
'/multi/hey' => [[['_route' => 'hey'], null, null, null, true, false, null]],
'/ababa' => [[['_route' => 'ababa'], null, null, null, false, false, null]],
'/route1' => [[['_route' => 'route1'], 'a.example.com', null, null, false, false, null]],
'/c2/route2' => [[['_route' => 'route2'], 'a.example.com', null, null, false, false, null]],
'/route4' => [[['_route' => 'route4'], 'a.example.com', null, null, false, false, null]],
'/c2/route3' => [[['_route' => 'route3'], 'b.example.com', null, null, false, false, null]],
'/route5' => [[['_route' => 'route5'], 'c.example.com', null, null, false, false, null]],
'/route6' => [[['_route' => 'route6'], null, null, null, false, false, null]],
'/route11' => [[['_route' => 'route11'], '#^(?P<var1>[^\\.]++)\\.example\\.com$#sDi', null, null, false, false, null]],
'/route12' => [[['_route' => 'route12', 'var1' => 'val'], '#^(?P<var1>[^\\.]++)\\.example\\.com$#sDi', null, null, false, false, null]],
'/route17' => [[['_route' => 'route17'], null, null, null, false, false, null]],
];
$this->regexpList = [
0 => '{^(?'
.'|(?:(?:[^./]*+\\.)++)(?'
.'|/foo/(baz|symfony)(*:47)'
@ -81,33 +81,33 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
.')'
.')'
.')/?$}sD',
);
$this->dynamicRoutes = array(
47 => array(array(array('_route' => 'foo', 'def' => 'test'), array('bar'), null, null, false, true, null)),
70 => array(array(array('_route' => 'bar'), array('foo'), array('GET' => 0, 'HEAD' => 1), null, false, true, null)),
90 => array(array(array('_route' => 'barhead'), array('foo'), array('GET' => 0), null, false, true, null)),
115 => array(
array(array('_route' => 'baz4'), array('foo'), null, null, true, true, null),
array(array('_route' => 'baz5'), array('foo'), array('POST' => 0), null, true, true, null),
array(array('_route' => 'baz.baz6'), array('foo'), array('PUT' => 0), null, true, true, null),
),
131 => array(array(array('_route' => 'quoter'), array('quoter'), null, null, false, true, null)),
160 => array(array(array('_route' => 'foo1'), array('foo'), array('PUT' => 0), null, false, true, null)),
168 => array(array(array('_route' => 'bar1'), array('bar'), null, null, false, true, null)),
181 => array(array(array('_route' => 'overridden'), array('var'), null, null, false, true, null)),
204 => array(array(array('_route' => 'foo2'), array('foo1'), null, null, false, true, null)),
212 => array(array(array('_route' => 'bar2'), array('bar1'), null, null, false, true, null)),
248 => array(array(array('_route' => 'helloWorld', 'who' => 'World!'), array('who'), null, null, false, true, null)),
279 => array(array(array('_route' => 'foo3'), array('_locale', 'foo'), null, null, false, true, null)),
287 => array(array(array('_route' => 'bar3'), array('_locale', 'bar'), null, null, false, true, null)),
309 => array(array(array('_route' => 'foo4'), array('foo'), null, null, false, true, null)),
371 => array(array(array('_route' => 'route13'), array('var1', 'name'), null, null, false, true, null)),
389 => array(array(array('_route' => 'route14', 'var1' => 'val'), array('var1', 'name'), null, null, false, true, null)),
441 => array(array(array('_route' => 'route15'), array('name'), null, null, false, true, null)),
489 => array(array(array('_route' => 'route16', 'var1' => 'val'), array('name'), null, null, false, true, null)),
510 => array(array(array('_route' => 'a'), array(), null, null, false, false, null)),
531 => array(array(array('_route' => 'b'), array('var'), null, null, false, true, null)),
549 => array(array(array('_route' => 'c'), array('var'), null, null, false, true, null)),
);
];
$this->dynamicRoutes = [
47 => [[['_route' => 'foo', 'def' => 'test'], ['bar'], null, null, false, true, null]],
70 => [[['_route' => 'bar'], ['foo'], ['GET' => 0, 'HEAD' => 1], null, false, true, null]],
90 => [[['_route' => 'barhead'], ['foo'], ['GET' => 0], null, false, true, null]],
115 => [
[['_route' => 'baz4'], ['foo'], null, null, true, true, null],
[['_route' => 'baz5'], ['foo'], ['POST' => 0], null, true, true, null],
[['_route' => 'baz.baz6'], ['foo'], ['PUT' => 0], null, true, true, null],
],
131 => [[['_route' => 'quoter'], ['quoter'], null, null, false, true, null]],
160 => [[['_route' => 'foo1'], ['foo'], ['PUT' => 0], null, false, true, null]],
168 => [[['_route' => 'bar1'], ['bar'], null, null, false, true, null]],
181 => [[['_route' => 'overridden'], ['var'], null, null, false, true, null]],
204 => [[['_route' => 'foo2'], ['foo1'], null, null, false, true, null]],
212 => [[['_route' => 'bar2'], ['bar1'], null, null, false, true, null]],
248 => [[['_route' => 'helloWorld', 'who' => 'World!'], ['who'], null, null, false, true, null]],
279 => [[['_route' => 'foo3'], ['_locale', 'foo'], null, null, false, true, null]],
287 => [[['_route' => 'bar3'], ['_locale', 'bar'], null, null, false, true, null]],
309 => [[['_route' => 'foo4'], ['foo'], null, null, false, true, null]],
371 => [[['_route' => 'route13'], ['var1', 'name'], null, null, false, true, null]],
389 => [[['_route' => 'route14', 'var1' => 'val'], ['var1', 'name'], null, null, false, true, null]],
441 => [[['_route' => 'route15'], ['name'], null, null, false, true, null]],
489 => [[['_route' => 'route16', 'var1' => 'val'], ['name'], null, null, false, true, null]],
510 => [[['_route' => 'a'], [], null, null, false, false, null]],
531 => [[['_route' => 'b'], ['var'], null, null, false, true, null]],
549 => [[['_route' => 'c'], ['var'], null, null, false, true, null]],
];
}
}

View File

@ -14,7 +14,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
public function __construct(RequestContext $context)
{
$this->context = $context;
$this->regexpList = array(
$this->regexpList = [
0 => '{^(?'
.'|/(en|fr)/(?'
.'|admin/post(?'
@ -45,22 +45,22 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
.')'
.'|/(en|fr)?(*:264)'
.')/?$}sD',
);
$this->dynamicRoutes = array(
32 => array(array(array('_route' => 'a', '_locale' => 'en'), array('_locale'), null, null, true, false, null)),
46 => array(array(array('_route' => 'b', '_locale' => 'en'), array('_locale'), null, null, false, false, null)),
58 => array(array(array('_route' => 'c', '_locale' => 'en'), array('_locale', 'id'), null, null, false, true, null)),
75 => array(array(array('_route' => 'd', '_locale' => 'en'), array('_locale', 'id'), null, null, false, false, null)),
94 => array(array(array('_route' => 'e', '_locale' => 'en'), array('_locale', 'id'), null, null, false, false, null)),
110 => array(array(array('_route' => 'f', '_locale' => 'en'), array('_locale'), null, null, true, false, null)),
130 => array(array(array('_route' => 'g', '_locale' => 'en'), array('_locale'), null, null, false, false, null)),
154 => array(array(array('_route' => 'h', '_locale' => 'en'), array('_locale', 'page'), null, null, false, true, null)),
175 => array(array(array('_route' => 'i', '_locale' => 'en'), array('_locale', 'page'), null, null, false, true, null)),
202 => array(array(array('_route' => 'j', '_locale' => 'en'), array('_locale', 'id'), null, null, false, false, null)),
216 => array(array(array('_route' => 'k', '_locale' => 'en'), array('_locale'), null, null, false, false, null)),
234 => array(array(array('_route' => 'l', '_locale' => 'en'), array('_locale'), null, null, false, false, null)),
245 => array(array(array('_route' => 'm', '_locale' => 'en'), array('_locale'), null, null, false, false, null)),
264 => array(array(array('_route' => 'n', '_locale' => 'en'), array('_locale'), null, null, false, true, null)),
);
];
$this->dynamicRoutes = [
32 => [[['_route' => 'a', '_locale' => 'en'], ['_locale'], null, null, true, false, null]],
46 => [[['_route' => 'b', '_locale' => 'en'], ['_locale'], null, null, false, false, null]],
58 => [[['_route' => 'c', '_locale' => 'en'], ['_locale', 'id'], null, null, false, true, null]],
75 => [[['_route' => 'd', '_locale' => 'en'], ['_locale', 'id'], null, null, false, false, null]],
94 => [[['_route' => 'e', '_locale' => 'en'], ['_locale', 'id'], null, null, false, false, null]],
110 => [[['_route' => 'f', '_locale' => 'en'], ['_locale'], null, null, true, false, null]],
130 => [[['_route' => 'g', '_locale' => 'en'], ['_locale'], null, null, false, false, null]],
154 => [[['_route' => 'h', '_locale' => 'en'], ['_locale', 'page'], null, null, false, true, null]],
175 => [[['_route' => 'i', '_locale' => 'en'], ['_locale', 'page'], null, null, false, true, null]],
202 => [[['_route' => 'j', '_locale' => 'en'], ['_locale', 'id'], null, null, false, false, null]],
216 => [[['_route' => 'k', '_locale' => 'en'], ['_locale'], null, null, false, false, null]],
234 => [[['_route' => 'l', '_locale' => 'en'], ['_locale'], null, null, false, false, null]],
245 => [[['_route' => 'm', '_locale' => 'en'], ['_locale'], null, null, false, false, null]],
264 => [[['_route' => 'n', '_locale' => 'en'], ['_locale'], null, null, false, true, null]],
];
}
}

View File

@ -14,7 +14,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
public function __construct(RequestContext $context)
{
$this->context = $context;
$this->regexpList = array(
$this->regexpList = [
0 => '{^(?'
.'|/abc([^/]++)/(?'
.'|1(?'
@ -33,14 +33,14 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
.')'
.')'
.')/?$}sD',
);
$this->dynamicRoutes = array(
27 => array(array(array('_route' => 'r1'), array('foo'), null, null, false, false, null)),
38 => array(array(array('_route' => 'r10'), array('foo'), null, null, false, false, null)),
46 => array(array(array('_route' => 'r100'), array('foo'), null, null, false, false, null)),
59 => array(array(array('_route' => 'r2'), array('foo'), null, null, false, false, null)),
70 => array(array(array('_route' => 'r20'), array('foo'), null, null, false, false, null)),
78 => array(array(array('_route' => 'r200'), array('foo'), null, null, false, false, null)),
);
];
$this->dynamicRoutes = [
27 => [[['_route' => 'r1'], ['foo'], null, null, false, false, null]],
38 => [[['_route' => 'r10'], ['foo'], null, null, false, false, null]],
46 => [[['_route' => 'r100'], ['foo'], null, null, false, false, null]],
59 => [[['_route' => 'r2'], ['foo'], null, null, false, false, null]],
70 => [[['_route' => 'r20'], ['foo'], null, null, false, false, null]],
78 => [[['_route' => 'r200'], ['foo'], null, null, false, false, null]],
];
}
}

View File

@ -15,7 +15,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
{
$this->context = $context;
$this->matchHost = true;
$this->regexpList = array(
$this->regexpList = [
0 => '{^(?'
.'|(?i:([^\\.]++)\\.exampple\\.com)\\.(?'
.'|/abc([^/]++)(?'
@ -23,12 +23,12 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
.')'
.')'
.')/?$}sD',
);
$this->dynamicRoutes = array(
56 => array(
array(array('_route' => 'r1'), array('foo', 'foo'), null, null, false, true, null),
array(array('_route' => 'r2'), array('foo', 'foo'), null, null, false, true, null),
),
);
];
$this->dynamicRoutes = [
56 => [
[['_route' => 'r1'], ['foo', 'foo'], null, null, false, true, null],
[['_route' => 'r2'], ['foo', 'foo'], null, null, false, true, null],
],
];
}
}

View File

@ -15,28 +15,28 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
{
$this->context = $context;
$this->matchHost = true;
$this->staticRoutes = array(
'/test/baz' => array(array(array('_route' => 'baz'), null, null, null, false, false, null)),
'/test/baz.html' => array(array(array('_route' => 'baz2'), null, null, null, false, false, null)),
'/test/baz3' => array(array(array('_route' => 'baz3'), null, null, null, true, false, null)),
'/foofoo' => array(array(array('_route' => 'foofoo', 'def' => 'test'), null, null, null, false, false, null)),
'/spa ce' => array(array(array('_route' => 'space'), null, null, null, false, false, null)),
'/multi/new' => array(array(array('_route' => 'overridden2'), null, null, null, false, false, null)),
'/multi/hey' => array(array(array('_route' => 'hey'), null, null, null, true, false, null)),
'/ababa' => array(array(array('_route' => 'ababa'), null, null, null, false, false, null)),
'/route1' => array(array(array('_route' => 'route1'), 'a.example.com', null, null, false, false, null)),
'/c2/route2' => array(array(array('_route' => 'route2'), 'a.example.com', null, null, false, false, null)),
'/route4' => array(array(array('_route' => 'route4'), 'a.example.com', null, null, false, false, null)),
'/c2/route3' => array(array(array('_route' => 'route3'), 'b.example.com', null, null, false, false, null)),
'/route5' => array(array(array('_route' => 'route5'), 'c.example.com', null, null, false, false, null)),
'/route6' => array(array(array('_route' => 'route6'), null, null, null, false, false, null)),
'/route11' => array(array(array('_route' => 'route11'), '#^(?P<var1>[^\\.]++)\\.example\\.com$#sDi', null, null, false, false, null)),
'/route12' => array(array(array('_route' => 'route12', 'var1' => 'val'), '#^(?P<var1>[^\\.]++)\\.example\\.com$#sDi', null, null, false, false, null)),
'/route17' => array(array(array('_route' => 'route17'), null, null, null, false, false, null)),
'/secure' => array(array(array('_route' => 'secure'), null, null, array('https' => 0), false, false, null)),
'/nonsecure' => array(array(array('_route' => 'nonsecure'), null, null, array('http' => 0), false, false, null)),
);
$this->regexpList = array(
$this->staticRoutes = [
'/test/baz' => [[['_route' => 'baz'], null, null, null, false, false, null]],
'/test/baz.html' => [[['_route' => 'baz2'], null, null, null, false, false, null]],
'/test/baz3' => [[['_route' => 'baz3'], null, null, null, true, false, null]],
'/foofoo' => [[['_route' => 'foofoo', 'def' => 'test'], null, null, null, false, false, null]],
'/spa ce' => [[['_route' => 'space'], null, null, null, false, false, null]],
'/multi/new' => [[['_route' => 'overridden2'], null, null, null, false, false, null]],
'/multi/hey' => [[['_route' => 'hey'], null, null, null, true, false, null]],
'/ababa' => [[['_route' => 'ababa'], null, null, null, false, false, null]],
'/route1' => [[['_route' => 'route1'], 'a.example.com', null, null, false, false, null]],
'/c2/route2' => [[['_route' => 'route2'], 'a.example.com', null, null, false, false, null]],
'/route4' => [[['_route' => 'route4'], 'a.example.com', null, null, false, false, null]],
'/c2/route3' => [[['_route' => 'route3'], 'b.example.com', null, null, false, false, null]],
'/route5' => [[['_route' => 'route5'], 'c.example.com', null, null, false, false, null]],
'/route6' => [[['_route' => 'route6'], null, null, null, false, false, null]],
'/route11' => [[['_route' => 'route11'], '#^(?P<var1>[^\\.]++)\\.example\\.com$#sDi', null, null, false, false, null]],
'/route12' => [[['_route' => 'route12', 'var1' => 'val'], '#^(?P<var1>[^\\.]++)\\.example\\.com$#sDi', null, null, false, false, null]],
'/route17' => [[['_route' => 'route17'], null, null, null, false, false, null]],
'/secure' => [[['_route' => 'secure'], null, null, ['https' => 0], false, false, null]],
'/nonsecure' => [[['_route' => 'nonsecure'], null, null, ['http' => 0], false, false, null]],
];
$this->regexpList = [
0 => '{^(?'
.'|(?:(?:[^./]*+\\.)++)(?'
.'|/foo/(baz|symfony)(*:47)'
@ -83,33 +83,33 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
.')'
.')'
.')/?$}sD',
);
$this->dynamicRoutes = array(
47 => array(array(array('_route' => 'foo', 'def' => 'test'), array('bar'), null, null, false, true, null)),
70 => array(array(array('_route' => 'bar'), array('foo'), array('GET' => 0, 'HEAD' => 1), null, false, true, null)),
90 => array(array(array('_route' => 'barhead'), array('foo'), array('GET' => 0), null, false, true, null)),
115 => array(
array(array('_route' => 'baz4'), array('foo'), null, null, true, true, null),
array(array('_route' => 'baz5'), array('foo'), array('POST' => 0), null, true, true, null),
array(array('_route' => 'baz.baz6'), array('foo'), array('PUT' => 0), null, true, true, null),
),
131 => array(array(array('_route' => 'quoter'), array('quoter'), null, null, false, true, null)),
160 => array(array(array('_route' => 'foo1'), array('foo'), array('PUT' => 0), null, false, true, null)),
168 => array(array(array('_route' => 'bar1'), array('bar'), null, null, false, true, null)),
181 => array(array(array('_route' => 'overridden'), array('var'), null, null, false, true, null)),
204 => array(array(array('_route' => 'foo2'), array('foo1'), null, null, false, true, null)),
212 => array(array(array('_route' => 'bar2'), array('bar1'), null, null, false, true, null)),
248 => array(array(array('_route' => 'helloWorld', 'who' => 'World!'), array('who'), null, null, false, true, null)),
279 => array(array(array('_route' => 'foo3'), array('_locale', 'foo'), null, null, false, true, null)),
287 => array(array(array('_route' => 'bar3'), array('_locale', 'bar'), null, null, false, true, null)),
309 => array(array(array('_route' => 'foo4'), array('foo'), null, null, false, true, null)),
371 => array(array(array('_route' => 'route13'), array('var1', 'name'), null, null, false, true, null)),
389 => array(array(array('_route' => 'route14', 'var1' => 'val'), array('var1', 'name'), null, null, false, true, null)),
441 => array(array(array('_route' => 'route15'), array('name'), null, null, false, true, null)),
489 => array(array(array('_route' => 'route16', 'var1' => 'val'), array('name'), null, null, false, true, null)),
510 => array(array(array('_route' => 'a'), array(), null, null, false, false, null)),
531 => array(array(array('_route' => 'b'), array('var'), null, null, false, true, null)),
549 => array(array(array('_route' => 'c'), array('var'), null, null, false, true, null)),
);
];
$this->dynamicRoutes = [
47 => [[['_route' => 'foo', 'def' => 'test'], ['bar'], null, null, false, true, null]],
70 => [[['_route' => 'bar'], ['foo'], ['GET' => 0, 'HEAD' => 1], null, false, true, null]],
90 => [[['_route' => 'barhead'], ['foo'], ['GET' => 0], null, false, true, null]],
115 => [
[['_route' => 'baz4'], ['foo'], null, null, true, true, null],
[['_route' => 'baz5'], ['foo'], ['POST' => 0], null, true, true, null],
[['_route' => 'baz.baz6'], ['foo'], ['PUT' => 0], null, true, true, null],
],
131 => [[['_route' => 'quoter'], ['quoter'], null, null, false, true, null]],
160 => [[['_route' => 'foo1'], ['foo'], ['PUT' => 0], null, false, true, null]],
168 => [[['_route' => 'bar1'], ['bar'], null, null, false, true, null]],
181 => [[['_route' => 'overridden'], ['var'], null, null, false, true, null]],
204 => [[['_route' => 'foo2'], ['foo1'], null, null, false, true, null]],
212 => [[['_route' => 'bar2'], ['bar1'], null, null, false, true, null]],
248 => [[['_route' => 'helloWorld', 'who' => 'World!'], ['who'], null, null, false, true, null]],
279 => [[['_route' => 'foo3'], ['_locale', 'foo'], null, null, false, true, null]],
287 => [[['_route' => 'bar3'], ['_locale', 'bar'], null, null, false, true, null]],
309 => [[['_route' => 'foo4'], ['foo'], null, null, false, true, null]],
371 => [[['_route' => 'route13'], ['var1', 'name'], null, null, false, true, null]],
389 => [[['_route' => 'route14', 'var1' => 'val'], ['var1', 'name'], null, null, false, true, null]],
441 => [[['_route' => 'route15'], ['name'], null, null, false, true, null]],
489 => [[['_route' => 'route16', 'var1' => 'val'], ['name'], null, null, false, true, null]],
510 => [[['_route' => 'a'], [], null, null, false, false, null]],
531 => [[['_route' => 'b'], ['var'], null, null, false, true, null]],
549 => [[['_route' => 'c'], ['var'], null, null, false, true, null]],
];
}
}

View File

@ -14,18 +14,18 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
public function __construct(RequestContext $context)
{
$this->context = $context;
$this->staticRoutes = array(
'/rootprefix/test' => array(array(array('_route' => 'static'), null, null, null, false, false, null)),
'/with-condition' => array(array(array('_route' => 'with-condition'), null, null, null, false, false, -1)),
);
$this->regexpList = array(
$this->staticRoutes = [
'/rootprefix/test' => [[['_route' => 'static'], null, null, null, false, false, null]],
'/with-condition' => [[['_route' => 'with-condition'], null, null, null, false, false, -1]],
];
$this->regexpList = [
0 => '{^(?'
.'|/rootprefix/([^/]++)(*:27)'
.')/?$}sD',
);
$this->dynamicRoutes = array(
27 => array(array(array('_route' => 'dynamic'), array('var'), null, null, false, true, null)),
);
];
$this->dynamicRoutes = [
27 => [[['_route' => 'dynamic'], ['var'], null, null, false, true, null]],
];
$this->checkCondition = static function ($condition, $context, $request) {
switch ($condition) {
case -1: return ($context->getMethod() == "GET");

View File

@ -14,15 +14,15 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
public function __construct(RequestContext $context)
{
$this->context = $context;
$this->staticRoutes = array(
'/just_head' => array(array(array('_route' => 'just_head'), null, array('HEAD' => 0), null, false, false, null)),
'/head_and_get' => array(array(array('_route' => 'head_and_get'), null, array('HEAD' => 0, 'GET' => 1), null, false, false, null)),
'/get_and_head' => array(array(array('_route' => 'get_and_head'), null, array('GET' => 0, 'HEAD' => 1), null, false, false, null)),
'/post_and_head' => array(array(array('_route' => 'post_and_head'), null, array('POST' => 0, 'HEAD' => 1), null, false, false, null)),
'/put_and_post' => array(
array(array('_route' => 'put_and_post'), null, array('PUT' => 0, 'POST' => 1), null, false, false, null),
array(array('_route' => 'put_and_get_and_head'), null, array('PUT' => 0, 'GET' => 1, 'HEAD' => 2), null, false, false, null),
),
);
$this->staticRoutes = [
'/just_head' => [[['_route' => 'just_head'], null, ['HEAD' => 0], null, false, false, null]],
'/head_and_get' => [[['_route' => 'head_and_get'], null, ['HEAD' => 0, 'GET' => 1], null, false, false, null]],
'/get_and_head' => [[['_route' => 'get_and_head'], null, ['GET' => 0, 'HEAD' => 1], null, false, false, null]],
'/post_and_head' => [[['_route' => 'post_and_head'], null, ['POST' => 0, 'HEAD' => 1], null, false, false, null]],
'/put_and_post' => [
[['_route' => 'put_and_post'], null, ['PUT' => 0, 'POST' => 1], null, false, false, null],
[['_route' => 'put_and_get_and_head'], null, ['PUT' => 0, 'GET' => 1, 'HEAD' => 2], null, false, false, null],
],
];
}
}

View File

@ -14,29 +14,29 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
public function __construct(RequestContext $context)
{
$this->context = $context;
$this->staticRoutes = array(
'/a/11' => array(array(array('_route' => 'a_first'), null, null, null, false, false, null)),
'/a/22' => array(array(array('_route' => 'a_second'), null, null, null, false, false, null)),
'/a/333' => array(array(array('_route' => 'a_third'), null, null, null, false, false, null)),
'/a/44' => array(array(array('_route' => 'a_fourth'), null, null, null, true, false, null)),
'/a/55' => array(array(array('_route' => 'a_fifth'), null, null, null, true, false, null)),
'/a/66' => array(array(array('_route' => 'a_sixth'), null, null, null, true, false, null)),
'/nested/group/a' => array(array(array('_route' => 'nested_a'), null, null, null, true, false, null)),
'/nested/group/b' => array(array(array('_route' => 'nested_b'), null, null, null, true, false, null)),
'/nested/group/c' => array(array(array('_route' => 'nested_c'), null, null, null, true, false, null)),
'/slashed/group' => array(array(array('_route' => 'slashed_a'), null, null, null, true, false, null)),
'/slashed/group/b' => array(array(array('_route' => 'slashed_b'), null, null, null, true, false, null)),
'/slashed/group/c' => array(array(array('_route' => 'slashed_c'), null, null, null, true, false, null)),
);
$this->regexpList = array(
$this->staticRoutes = [
'/a/11' => [[['_route' => 'a_first'], null, null, null, false, false, null]],
'/a/22' => [[['_route' => 'a_second'], null, null, null, false, false, null]],
'/a/333' => [[['_route' => 'a_third'], null, null, null, false, false, null]],
'/a/44' => [[['_route' => 'a_fourth'], null, null, null, true, false, null]],
'/a/55' => [[['_route' => 'a_fifth'], null, null, null, true, false, null]],
'/a/66' => [[['_route' => 'a_sixth'], null, null, null, true, false, null]],
'/nested/group/a' => [[['_route' => 'nested_a'], null, null, null, true, false, null]],
'/nested/group/b' => [[['_route' => 'nested_b'], null, null, null, true, false, null]],
'/nested/group/c' => [[['_route' => 'nested_c'], null, null, null, true, false, null]],
'/slashed/group' => [[['_route' => 'slashed_a'], null, null, null, true, false, null]],
'/slashed/group/b' => [[['_route' => 'slashed_b'], null, null, null, true, false, null]],
'/slashed/group/c' => [[['_route' => 'slashed_c'], null, null, null, true, false, null]],
];
$this->regexpList = [
0 => '{^(?'
.'|/([^/]++)(*:16)'
.'|/nested/([^/]++)(*:39)'
.')/?$}sD',
);
$this->dynamicRoutes = array(
16 => array(array(array('_route' => 'a_wildcard'), array('param'), null, null, false, true, null)),
39 => array(array(array('_route' => 'nested_wildcard'), array('param'), null, null, false, true, null)),
);
];
$this->dynamicRoutes = [
16 => [[['_route' => 'a_wildcard'], ['param'], null, null, false, true, null]],
39 => [[['_route' => 'nested_wildcard'], ['param'], null, null, false, true, null]],
];
}
}

View File

@ -14,17 +14,17 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
public function __construct(RequestContext $context)
{
$this->context = $context;
$this->staticRoutes = array(
'/trailing/simple/no-methods' => array(array(array('_route' => 'simple_trailing_slash_no_methods'), null, null, null, true, false, null)),
'/trailing/simple/get-method' => array(array(array('_route' => 'simple_trailing_slash_GET_method'), null, array('GET' => 0), null, true, false, null)),
'/trailing/simple/head-method' => array(array(array('_route' => 'simple_trailing_slash_HEAD_method'), null, array('HEAD' => 0), null, true, false, null)),
'/trailing/simple/post-method' => array(array(array('_route' => 'simple_trailing_slash_POST_method'), null, array('POST' => 0), null, true, false, null)),
'/not-trailing/simple/no-methods' => array(array(array('_route' => 'simple_not_trailing_slash_no_methods'), null, null, null, false, false, null)),
'/not-trailing/simple/get-method' => array(array(array('_route' => 'simple_not_trailing_slash_GET_method'), null, array('GET' => 0), null, false, false, null)),
'/not-trailing/simple/head-method' => array(array(array('_route' => 'simple_not_trailing_slash_HEAD_method'), null, array('HEAD' => 0), null, false, false, null)),
'/not-trailing/simple/post-method' => array(array(array('_route' => 'simple_not_trailing_slash_POST_method'), null, array('POST' => 0), null, false, false, null)),
);
$this->regexpList = array(
$this->staticRoutes = [
'/trailing/simple/no-methods' => [[['_route' => 'simple_trailing_slash_no_methods'], null, null, null, true, false, null]],
'/trailing/simple/get-method' => [[['_route' => 'simple_trailing_slash_GET_method'], null, ['GET' => 0], null, true, false, null]],
'/trailing/simple/head-method' => [[['_route' => 'simple_trailing_slash_HEAD_method'], null, ['HEAD' => 0], null, true, false, null]],
'/trailing/simple/post-method' => [[['_route' => 'simple_trailing_slash_POST_method'], null, ['POST' => 0], null, true, false, null]],
'/not-trailing/simple/no-methods' => [[['_route' => 'simple_not_trailing_slash_no_methods'], null, null, null, false, false, null]],
'/not-trailing/simple/get-method' => [[['_route' => 'simple_not_trailing_slash_GET_method'], null, ['GET' => 0], null, false, false, null]],
'/not-trailing/simple/head-method' => [[['_route' => 'simple_not_trailing_slash_HEAD_method'], null, ['HEAD' => 0], null, false, false, null]],
'/not-trailing/simple/post-method' => [[['_route' => 'simple_not_trailing_slash_POST_method'], null, ['POST' => 0], null, false, false, null]],
];
$this->regexpList = [
0 => '{^(?'
.'|/trailing/regex/(?'
.'|no\\-methods/([^/]++)(*:46)'
@ -39,16 +39,16 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
.'|post\\-method/([^/]++)(*:269)'
.')'
.')/?$}sD',
);
$this->dynamicRoutes = array(
46 => array(array(array('_route' => 'regex_trailing_slash_no_methods'), array('param'), null, null, true, true, null)),
73 => array(array(array('_route' => 'regex_trailing_slash_GET_method'), array('param'), array('GET' => 0), null, true, true, null)),
101 => array(array(array('_route' => 'regex_trailing_slash_HEAD_method'), array('param'), array('HEAD' => 0), null, true, true, null)),
130 => array(array(array('_route' => 'regex_trailing_slash_POST_method'), array('param'), array('POST' => 0), null, true, true, null)),
183 => array(array(array('_route' => 'regex_not_trailing_slash_no_methods'), array('param'), null, null, false, true, null)),
211 => array(array(array('_route' => 'regex_not_trailing_slash_GET_method'), array('param'), array('GET' => 0), null, false, true, null)),
240 => array(array(array('_route' => 'regex_not_trailing_slash_HEAD_method'), array('param'), array('HEAD' => 0), null, false, true, null)),
269 => array(array(array('_route' => 'regex_not_trailing_slash_POST_method'), array('param'), array('POST' => 0), null, false, true, null)),
);
];
$this->dynamicRoutes = [
46 => [[['_route' => 'regex_trailing_slash_no_methods'], ['param'], null, null, true, true, null]],
73 => [[['_route' => 'regex_trailing_slash_GET_method'], ['param'], ['GET' => 0], null, true, true, null]],
101 => [[['_route' => 'regex_trailing_slash_HEAD_method'], ['param'], ['HEAD' => 0], null, true, true, null]],
130 => [[['_route' => 'regex_trailing_slash_POST_method'], ['param'], ['POST' => 0], null, true, true, null]],
183 => [[['_route' => 'regex_not_trailing_slash_no_methods'], ['param'], null, null, false, true, null]],
211 => [[['_route' => 'regex_not_trailing_slash_GET_method'], ['param'], ['GET' => 0], null, false, true, null]],
240 => [[['_route' => 'regex_not_trailing_slash_HEAD_method'], ['param'], ['HEAD' => 0], null, false, true, null]],
269 => [[['_route' => 'regex_not_trailing_slash_POST_method'], ['param'], ['POST' => 0], null, false, true, null]],
];
}
}

View File

@ -14,17 +14,17 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
public function __construct(RequestContext $context)
{
$this->context = $context;
$this->staticRoutes = array(
'/trailing/simple/no-methods' => array(array(array('_route' => 'simple_trailing_slash_no_methods'), null, null, null, true, false, null)),
'/trailing/simple/get-method' => array(array(array('_route' => 'simple_trailing_slash_GET_method'), null, array('GET' => 0), null, true, false, null)),
'/trailing/simple/head-method' => array(array(array('_route' => 'simple_trailing_slash_HEAD_method'), null, array('HEAD' => 0), null, true, false, null)),
'/trailing/simple/post-method' => array(array(array('_route' => 'simple_trailing_slash_POST_method'), null, array('POST' => 0), null, true, false, null)),
'/not-trailing/simple/no-methods' => array(array(array('_route' => 'simple_not_trailing_slash_no_methods'), null, null, null, false, false, null)),
'/not-trailing/simple/get-method' => array(array(array('_route' => 'simple_not_trailing_slash_GET_method'), null, array('GET' => 0), null, false, false, null)),
'/not-trailing/simple/head-method' => array(array(array('_route' => 'simple_not_trailing_slash_HEAD_method'), null, array('HEAD' => 0), null, false, false, null)),
'/not-trailing/simple/post-method' => array(array(array('_route' => 'simple_not_trailing_slash_POST_method'), null, array('POST' => 0), null, false, false, null)),
);
$this->regexpList = array(
$this->staticRoutes = [
'/trailing/simple/no-methods' => [[['_route' => 'simple_trailing_slash_no_methods'], null, null, null, true, false, null]],
'/trailing/simple/get-method' => [[['_route' => 'simple_trailing_slash_GET_method'], null, ['GET' => 0], null, true, false, null]],
'/trailing/simple/head-method' => [[['_route' => 'simple_trailing_slash_HEAD_method'], null, ['HEAD' => 0], null, true, false, null]],
'/trailing/simple/post-method' => [[['_route' => 'simple_trailing_slash_POST_method'], null, ['POST' => 0], null, true, false, null]],
'/not-trailing/simple/no-methods' => [[['_route' => 'simple_not_trailing_slash_no_methods'], null, null, null, false, false, null]],
'/not-trailing/simple/get-method' => [[['_route' => 'simple_not_trailing_slash_GET_method'], null, ['GET' => 0], null, false, false, null]],
'/not-trailing/simple/head-method' => [[['_route' => 'simple_not_trailing_slash_HEAD_method'], null, ['HEAD' => 0], null, false, false, null]],
'/not-trailing/simple/post-method' => [[['_route' => 'simple_not_trailing_slash_POST_method'], null, ['POST' => 0], null, false, false, null]],
];
$this->regexpList = [
0 => '{^(?'
.'|/trailing/regex/(?'
.'|no\\-methods/([^/]++)(*:46)'
@ -39,16 +39,16 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
.'|post\\-method/([^/]++)(*:269)'
.')'
.')/?$}sD',
);
$this->dynamicRoutes = array(
46 => array(array(array('_route' => 'regex_trailing_slash_no_methods'), array('param'), null, null, true, true, null)),
73 => array(array(array('_route' => 'regex_trailing_slash_GET_method'), array('param'), array('GET' => 0), null, true, true, null)),
101 => array(array(array('_route' => 'regex_trailing_slash_HEAD_method'), array('param'), array('HEAD' => 0), null, true, true, null)),
130 => array(array(array('_route' => 'regex_trailing_slash_POST_method'), array('param'), array('POST' => 0), null, true, true, null)),
183 => array(array(array('_route' => 'regex_not_trailing_slash_no_methods'), array('param'), null, null, false, true, null)),
211 => array(array(array('_route' => 'regex_not_trailing_slash_GET_method'), array('param'), array('GET' => 0), null, false, true, null)),
240 => array(array(array('_route' => 'regex_not_trailing_slash_HEAD_method'), array('param'), array('HEAD' => 0), null, false, true, null)),
269 => array(array(array('_route' => 'regex_not_trailing_slash_POST_method'), array('param'), array('POST' => 0), null, false, true, null)),
);
];
$this->dynamicRoutes = [
46 => [[['_route' => 'regex_trailing_slash_no_methods'], ['param'], null, null, true, true, null]],
73 => [[['_route' => 'regex_trailing_slash_GET_method'], ['param'], ['GET' => 0], null, true, true, null]],
101 => [[['_route' => 'regex_trailing_slash_HEAD_method'], ['param'], ['HEAD' => 0], null, true, true, null]],
130 => [[['_route' => 'regex_trailing_slash_POST_method'], ['param'], ['POST' => 0], null, true, true, null]],
183 => [[['_route' => 'regex_not_trailing_slash_no_methods'], ['param'], null, null, false, true, null]],
211 => [[['_route' => 'regex_not_trailing_slash_GET_method'], ['param'], ['GET' => 0], null, false, true, null]],
240 => [[['_route' => 'regex_not_trailing_slash_HEAD_method'], ['param'], ['HEAD' => 0], null, false, true, null]],
269 => [[['_route' => 'regex_not_trailing_slash_POST_method'], ['param'], ['POST' => 0], null, false, true, null]],
];
}
}

View File

@ -14,7 +14,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
public function __construct(RequestContext $context)
{
$this->context = $context;
$this->regexpList = array(
$this->regexpList = [
0 => '{^(?'
.'|/(a)(*:11)'
.')/?$}sD',
@ -24,11 +24,11 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
22 => '{^(?'
.'|/(.)(*:33)'
.')/?$}sD',
);
$this->dynamicRoutes = array(
11 => array(array(array('_route' => 'a'), array('a'), null, null, false, true, null)),
22 => array(array(array('_route' => 'b'), array('a'), null, null, false, true, null)),
33 => array(array(array('_route' => 'c'), array('a'), null, null, false, true, null)),
);
];
$this->dynamicRoutes = [
11 => [[['_route' => 'a'], ['a'], null, null, false, true, null]],
22 => [[['_route' => 'b'], ['a'], null, null, false, true, null]],
33 => [[['_route' => 'c'], ['a'], null, null, false, true, null]],
];
}
}

View File

@ -15,12 +15,12 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
{
$this->context = $context;
$this->matchHost = true;
$this->staticRoutes = array(
'/' => array(
array(array('_route' => 'a'), '#^(?P<d>[^\\.]++)\\.e\\.c\\.b\\.a$#sDi', null, null, false, false, null),
array(array('_route' => 'c'), '#^(?P<e>[^\\.]++)\\.e\\.c\\.b\\.a$#sDi', null, null, false, false, null),
array(array('_route' => 'b'), 'd.c.b.a', null, null, false, false, null),
),
);
$this->staticRoutes = [
'/' => [
[['_route' => 'a'], '#^(?P<d>[^\\.]++)\\.e\\.c\\.b\\.a$#sDi', null, null, false, false, null],
[['_route' => 'c'], '#^(?P<e>[^\\.]++)\\.e\\.c\\.b\\.a$#sDi', null, null, false, false, null],
[['_route' => 'b'], 'd.c.b.a', null, null, false, false, null],
],
];
}
}

View File

@ -64,7 +64,7 @@ class SecurityTest extends TestCase
yield ['string_username', null];
//yield array(new StringishUser(), null); // 5.0 behavior
//yield [new StringishUser(), null]; // 5.0 behavior
$user = new User('nice_user', 'foo');
yield [$user, $user];

View File

@ -33,7 +33,7 @@ interface FirewallMapInterface
* If there is no logout listener, the third element of the outer array
* must be null.
*
* @return array of the format array(array(AuthenticationListener), ExceptionListener, LogoutListener)
* @return array of the format [[AuthenticationListener], ExceptionListener, LogoutListener]
*/
public function getListeners(Request $request);
}

View File

@ -431,7 +431,7 @@ class XmlEncoder implements EncoderInterface, DecoderInterface, NormalizationAwa
/*
* Create nodes to append to $parentNode based on the $key of this array
* Produces <xml><item>0</item><item>1</item></xml>
* From array("item" => array(0,1));.
* From ["item" => [0,1]];.
*/
foreach ($data as $subData) {
$append = $this->appendNode($parentNode, $subData, $key);

View File

@ -239,10 +239,10 @@ abstract class AbstractNormalizer implements NormalizerInterface, DenormalizerIn
*
* @throws CircularReferenceException
*/
protected function handleCircularReference($object/*, string $format = null, array $context = array()*/)
protected function handleCircularReference($object/*, string $format = null, array $context = []*/)
{
if (\func_num_args() < 2 && __CLASS__ !== \get_class($this) && __CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName() && !$this instanceof \PHPUnit\Framework\MockObject\MockObject && !$this instanceof \Prophecy\Prophecy\ProphecySubjectInterface) {
@trigger_error(sprintf('The "%s()" method will have two new "string $format = null" and "array $context = array()" arguments in version 5.0, not defining it is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s()" method will have two new "string $format = null" and "array $context = []" arguments in version 5.0, not defining it is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
}
$format = \func_num_args() > 1 ? func_get_arg(1) : null;
$context = \func_num_args() > 2 ? func_get_arg(2) : [];

View File

@ -14,19 +14,19 @@ $foo->bar = 'bar';
$g = fopen(__FILE__, 'r');
$var = array(
$var = [
'number' => 1, null,
'const' => 1.1, true, false, NAN, INF, -INF, PHP_INT_MAX,
'str' => "déjà\n", "\xE9\x00test\t\ning",
'[]' => array(),
'[]' => [],
'res' => $g,
'obj' => $foo,
'closure' => function ($a, \PDO &$b = null) {},
'line' => __LINE__ - 1,
'nobj' => array((object) array()),
);
'nobj' => [(object) []],
];
$r = array();
$r = [];
$r[] = &$r;
$var['recurs'] = &$r;

View File

@ -33,19 +33,19 @@ interface ServiceSubscriberInterface
*
* For mandatory dependencies:
*
* * array('logger' => 'Psr\Log\LoggerInterface') means the objects use the "logger" name
* * ['logger' => 'Psr\Log\LoggerInterface'] means the objects use the "logger" name
* internally to fetch a service which must implement Psr\Log\LoggerInterface.
* * array('loggers' => 'Psr\Log\LoggerInterface[]') means the objects use the "loggers" name
* * ['loggers' => 'Psr\Log\LoggerInterface[]'] means the objects use the "loggers" name
* internally to fetch an iterable of Psr\Log\LoggerInterface instances.
* * array('Psr\Log\LoggerInterface') is a shortcut for
* * array('Psr\Log\LoggerInterface' => 'Psr\Log\LoggerInterface')
* * ['Psr\Log\LoggerInterface'] is a shortcut for
* * ['Psr\Log\LoggerInterface' => 'Psr\Log\LoggerInterface']
*
* otherwise:
*
* * array('logger' => '?Psr\Log\LoggerInterface') denotes an optional dependency
* * array('loggers' => '?Psr\Log\LoggerInterface[]') denotes an optional iterable dependency
* * array('?Psr\Log\LoggerInterface') is a shortcut for
* * array('Psr\Log\LoggerInterface' => '?Psr\Log\LoggerInterface')
* * ['logger' => '?Psr\Log\LoggerInterface'] denotes an optional dependency
* * ['loggers' => '?Psr\Log\LoggerInterface[]'] denotes an optional iterable dependency
* * ['?Psr\Log\LoggerInterface'] is a shortcut for
* * ['Psr\Log\LoggerInterface' => '?Psr\Log\LoggerInterface']
*
* @return array The required service types, optionally keyed by service names
*/