Skip to content
This repository was archived by the owner on Nov 27, 2020. It is now read-only.

Commit 4a6b007

Browse files
committed
minor #898 Replace old array() syntax with new [] (bocharsky-bw)
This PR was submitted for the master branch but it was merged into the 3.0 branch instead (closes #898). Discussion ---------- Replace old array() syntax with new [] We could use a new array syntax `[]` based on the fact that Symfony 3 require PHP `>=5.5.9` Commits ------- f5b1ae8 Replace old array() syntax with new []
2 parents ba39237 + f5b1ae8 commit 4a6b007

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

app/AppKernel.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class AppKernel extends Kernel
77
{
88
public function registerBundles()
99
{
10-
$bundles = array(
10+
$bundles = [
1111
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
1212
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
1313
new Symfony\Bundle\TwigBundle\TwigBundle(),
@@ -16,9 +16,9 @@ public function registerBundles()
1616
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
1717
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
1818
new AppBundle\AppBundle(),
19-
);
19+
];
2020

21-
if (in_array($this->getEnvironment(), array('dev', 'test'), true)) {
21+
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
2222
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
2323
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
2424
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();

app/autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
*/
99
$loader = require __DIR__.'/../vendor/autoload.php';
1010

11-
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
11+
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
1212

1313
return $loader;

bin/console

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ set_time_limit(0);
1717
$loader = require __DIR__.'/../app/autoload.php';
1818

1919
$input = new ArgvInput();
20-
$env = $input->getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'dev');
21-
$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(array('--no-debug', '')) && $env !== 'prod';
20+
$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev');
21+
$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(['--no-debug', '']) && $env !== 'prod';
2222

2323
if ($debug) {
2424
Debug::enable();

src/AppBundle/Controller/DefaultController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ class DefaultController extends Controller
1414
public function indexAction(Request $request)
1515
{
1616
// replace this example code with whatever you need
17-
return $this->render('default/index.html.twig', array(
17+
return $this->render('default/index.html.twig', [
1818
'base_dir' => realpath($this->container->getParameter('kernel.root_dir').'/..'),
19-
));
19+
]);
2020
}
2121
}

web/app_dev.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// Feel free to remove this, extend it, or make something more sophisticated.
1313
if (isset($_SERVER['HTTP_CLIENT_IP'])
1414
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
15-
|| !(in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', 'fe80::1', '::1')) || php_sapi_name() === 'cli-server')
15+
|| !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1']) || php_sapi_name() === 'cli-server')
1616
) {
1717
header('HTTP/1.0 403 Forbidden');
1818
exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');

0 commit comments

Comments
 (0)