Standardise use of [] vs array() (#4548)

Credit to @DanHarrin
This commit is contained in:
Dan Harrin 2019-08-15 03:46:36 +01:00 committed by Luke Towers
parent 36ab42aa24
commit 67c9decb20
14 changed files with 31 additions and 31 deletions

View File

@ -797,10 +797,10 @@ class MediaManager extends WidgetBase
$path = Input::get('path');
$path = MediaLibrary::validatePath($path);
$params = array(
$params = [
'width' => $width,
'height' => $height
);
];
return $this->getCropEditImageUrlAndSize($path, $cropSessionKey, $params);
}

View File

@ -715,7 +715,7 @@ class Index extends Controller
/**
* @event cms.template.processSettingsBeforeSave
* Fires before a CMS template (page|partial|layout|content|asset) is saved and provides an opportunity to interact with the settings data. `$dataHolder` = {settings: array()}
* Fires before a CMS template (page|partial|layout|content|asset) is saved and provides an opportunity to interact with the settings data. `$dataHolder` = {settings: []}
*
* Example usage:
*

View File

@ -544,6 +544,6 @@ class VersionManager
$scripts = [];
}
return array($comments, $scripts);
return [$comments, $scripts];
}
}

View File

@ -80,7 +80,7 @@ return [
|
*/
'custom' => array(),
'custom' => [],
/*
|--------------------------------------------------------------------------
@ -93,6 +93,6 @@ return [
|
*/
'attributes' => array(),
'attributes' => [],
];

View File

@ -80,7 +80,7 @@ return [
|
*/
'custom' => array(),
'custom' => [],
/*
|--------------------------------------------------------------------------
@ -93,6 +93,6 @@ return [
|
*/
'attributes' => array(),
'attributes' => [],
];

View File

@ -83,7 +83,7 @@ return [
|
*/
'custom' => array(),
'custom' => [],
/*
|--------------------------------------------------------------------------
@ -96,6 +96,6 @@ return [
|
*/
'attributes' => array(),
'attributes' => [],
];

View File

@ -81,7 +81,7 @@ return [
|
*/
'custom' => array(),
'custom' => [],
/*
|--------------------------------------------------------------------------
@ -94,6 +94,6 @@ return [
|
*/
'attributes' => array(),
'attributes' => [],
];

View File

@ -80,7 +80,7 @@ return [
|
*/
'custom' => array(),
'custom' => [],
/*
|--------------------------------------------------------------------------
@ -93,6 +93,6 @@ return [
|
*/
'attributes' => array(),
'attributes' => [],
];

View File

@ -81,7 +81,7 @@ return [
|
*/
'custom' => array(),
'custom' => [],
/*
|--------------------------------------------------------------------------
@ -94,6 +94,6 @@ return [
|
*/
'attributes' => array(),
'attributes' => [],
];

View File

@ -81,7 +81,7 @@ return [
|
*/
'custom' => array(),
'custom' => [],
/*
|--------------------------------------------------------------------------
@ -94,6 +94,6 @@ return [
|
*/
'attributes' => array(),
'attributes' => [],
];

View File

@ -80,7 +80,7 @@ return [
|
*/
'custom' => array(),
'custom' => [],
/*
|--------------------------------------------------------------------------
@ -93,6 +93,6 @@ return [
|
*/
'attributes' => array(),
'attributes' => [],
];

View File

@ -170,13 +170,13 @@ class ControllerTest extends TestCase
$requestMock = $this
->getMockBuilder('Illuminate\Http\Request')
->disableOriginalConstructor()
->setMethods(array('ajax', 'method', 'header'))
->setMethods(['ajax', 'method', 'header'])
->getMock();
$map = array(
array('X_OCTOBER_REQUEST_HANDLER', null, $handler),
array('X_OCTOBER_REQUEST_PARTIALS', null, $partials),
);
$map = [
['X_OCTOBER_REQUEST_HANDLER', null, $handler],
['X_OCTOBER_REQUEST_PARTIALS', null, $partials],
];
$requestMock->expects($this->any())
->method('ajax')

View File

@ -60,12 +60,12 @@ class RouterTest extends TestCase
{
$router = new Router(self::$theme);
$method = self::getMethod('getCachedUrlFileName');
$urlList = array();
$urlList = [];
/*
* The first time the page should be loaded from the disk.
*/
$result = $method->invokeArgs($router, array('/', &$urlList));
$result = $method->invokeArgs($router, ['/', &$urlList]);
$this->assertNull($result);
/*
@ -78,14 +78,14 @@ class RouterTest extends TestCase
/*
* The second time the page should be loaded from the cache.
*/
$result = $method->invokeArgs($router, array('/', &$urlList));
$result = $method->invokeArgs($router, ['/', &$urlList]);
$this->assertEquals('index.htm', $result);
/*
* Clear the cache
*/
$router->clearCache();
$result = $method->invokeArgs($router, array('/', &$urlList));
$result = $method->invokeArgs($router, ['/', &$urlList]);
$this->assertNull($result);
}

View File

@ -10,8 +10,8 @@ class CoreLangTest extends TestCase
$translator->setLocale('en');
$validator = Validator::make(
array('name' => 'me'),
array('name' => 'required|min:5')
['name' => 'me'],
['name' => 'required|min:5']
);
$this->assertTrue($validator->fails());