Skip to content

Commit dd56c97

Browse files
committed
Use short array deconstruction syntax.
1 parent 0067e02 commit dd56c97

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

Controller/ControllerNameParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function parse($controller)
5858
}
5959

6060
$originalController = $controller;
61-
list($bundleName, $controller, $action) = $parts;
61+
[$bundleName, $controller, $action] = $parts;
6262
$controller = str_replace('/', '\\', $controller);
6363

6464
try {

DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $
589589
$container->setParameter('profiler_listener.only_master_requests', $config['only_master_requests']);
590590

591591
// Choose storage class based on the DSN
592-
list($class) = explode(':', $config['dsn'], 2);
592+
[$class] = explode(':', $config['dsn'], 2);
593593
if ('file' !== $class) {
594594
throw new \LogicException(sprintf('Driver "%s" is not supported for the profiler.', $class));
595595
}

Templating/Helper/CodeHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function abbrClass($class)
6464
public function abbrMethod($method)
6565
{
6666
if (false !== strpos($method, '::')) {
67-
list($class, $method) = explode('::', $method, 2);
67+
[$class, $method] = explode('::', $method, 2);
6868
$result = sprintf('%s::%s()', $this->abbrClass($class), $method);
6969
} elseif ('Closure' === $method) {
7070
$result = sprintf('<abbr title="%s">%1$s</abbr>', $method);

Tests/Functional/Bundle/TestBundle/Controller/SessionController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function showFlashAction(Request $request)
7171
$session = $request->getSession();
7272

7373
if ($session->getFlashBag()->has('notice')) {
74-
list($output) = $session->getFlashBag()->get('notice');
74+
[$output] = $session->getFlashBag()->get('notice');
7575
} else {
7676
$output = 'No flash was set.';
7777
}

Translation/Translator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ protected function initialize()
144144
$this->addResourceFiles();
145145
}
146146
foreach ($this->resources as $key => $params) {
147-
list($format, $resource, $locale, $domain) = $params;
147+
[$format, $resource, $locale, $domain] = $params;
148148
parent::addResource($format, $resource, $locale, $domain);
149149
}
150150
$this->resources = [];

0 commit comments

Comments
 (0)