Skip to content

Commit bac1162

Browse files
author
Samuel Akopyan
committed
Redo array() to []
1 parent c8f52c9 commit bac1162

File tree

43 files changed

+397
-372
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+397
-372
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
return array(
4-
// Module classes
5-
'classes' => array(
6-
'Modules\Setup\Controllers\Setup'
7-
)
8-
);
3+
return [
4+
// Module classes
5+
'classes' => [
6+
'Modules\Setup\Controllers\Setup'
7+
]
8+
];

demos/login-system/protected/modules/setup/controllers/SetupController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function indexAction()
8383

8484
$this->_view->formFields = array(
8585
'act' => array('type' => 'hidden', 'value' => 'send'),
86-
'language' => array('type' => 'dropdownlist', 'value' => $language, 'title' => A::t('setup', 'Language'), 'mandatoryStar' => false, 'data' => $this->_languages, 'htmlOptions' => array(), 'validation' => array('required' => true, 'type' => 'set', 'source' => array_keys($this->_languages))),
86+
'language' => array('type' => 'dropdownlist', 'value' => $language, 'title' => A::t('setup', 'Language'), 'mandatoryStar' => false, 'data' => $this->_languages, 'htmlOptions' => [], 'validation' => array('required' => true, 'type' => 'set', 'source' => array_keys($this->_languages))),
8787
);
8888

8989
if ($this->_cRequest->getPost('act') == 'send') {
@@ -254,7 +254,7 @@ public function databaseAction()
254254

255255
$separatorGeneralFields = array(
256256
'separatorInfo' => array('legend' => 'General Settings'),
257-
'setupType' => array('type' => 'dropdownlist', 'value' => $this->_view->setupType, 'title' => A::t('setup', 'Setup Type'), 'mandatoryStar' => false, 'data' => array('install' => A::t('setup', 'New Installation'), 'update' => A::t('setup', 'Update')), 'htmlOptions' => array(), 'validation' => array('required' => true, 'type' => 'text', 'source' => array('install'))),
257+
'setupType' => array('type' => 'dropdownlist', 'value' => $this->_view->setupType, 'title' => A::t('setup', 'Setup Type'), 'mandatoryStar' => false, 'data' => array('install' => A::t('setup', 'New Installation'), 'update' => A::t('setup', 'Update')), 'htmlOptions' => [], 'validation' => array('required' => true, 'type' => 'text', 'source' => array('install'))),
258258
'dbDriver' => array('type' => 'dropdownlist', 'value' => $this->_view->dbDriver, 'title' => A::t('setup', 'Database Driver'), 'mandatoryStar' => true, 'data' => $dbDrivers, 'htmlOptions' => array('style' => 'width:85px'), 'validation' => array('required' => true, 'type' => 'text', 'source' => array_keys($dbDrivers))),
259259
'dbPrefix' => array('type' => 'textbox', 'value' => $this->_view->dbPrefix, 'title' => A::t('setup', 'Database (tables) Prefix'), 'mandatoryStar' => false, 'htmlOptions' => array('maxLength' => '10', 'autocomplete' => 'off'), 'validation' => array('required' => false, 'type' => 'variable')),
260260
);
@@ -641,13 +641,13 @@ private function _getPhpInfo()
641641
{
642642
ob_start();
643643
if (function_exists('phpinfo')) @phpinfo(-1);
644-
$phpInfo = array('phpinfo' => array());
644+
$phpInfo = array('phpinfo' => []);
645645
if (preg_match_all('#(?:<h2>(?:<a name=".*?">)?(.*?)(?:</a>)?</h2>)|(?:<tr(?: class=".*?")?><t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>)?)?</tr>)#s', ob_get_clean(), $matches, PREG_SET_ORDER))
646646
foreach ($matches as $match) {
647647
$arrayKeys = array_keys($phpInfo);
648648
$endArrayKeys = end($arrayKeys);
649649
if (strlen($match[1])) {
650-
$phpInfo[$match[1]] = array();
650+
$phpInfo[$match[1]] = [];
651651
} elseif (isset($match[3])) {
652652
$phpInfo[$endArrayKeys][$match[2]] = isset($match[4]) ? array($match[3], $match[4]) : $match[3];
653653
} else {

demos/login-system/protected/modules/setup/models/Setup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
class Setup extends CModel
2424
{
2525

26-
public function __construct($params = array())
26+
public function __construct($params = [])
2727
{
2828
parent::__construct($params);
2929
}

demos/login-system/protected/modules/setup/views/setup/database.php

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,27 @@
1212
<br>
1313

1414
<?php
15-
echo CWidget::create('CFormView', array(
16-
'action' => 'setup/database',
17-
'method' => 'post',
18-
'htmlOptions' => array(
19-
'name' => 'frmSetup',
20-
'id' => 'frmSetup'
21-
),
22-
'fields' => $formFields,
23-
'buttons' => array(
24-
'back' => array('type' => 'button', 'value' => A::t('setup', 'Previous'), 'htmlOptions' => array('name' => '', 'onclick' => "$(location).attr('href','setup/requirements');")),
25-
'submit' => array('type' => 'submit', 'value' => A::t('setup', 'Next'), 'htmlOptions' => array('name' => ''))
26-
),
27-
'events' => array(
28-
'focus' => array('field' => $errorField)
29-
),
30-
'return' => true,
31-
));
15+
echo CWidget::create(
16+
'CFormView', [
17+
'action' => 'setup/database',
18+
'method' => 'post',
19+
'htmlOptions' => [
20+
'name' => 'frmSetup',
21+
'id' => 'frmSetup'
22+
],
23+
'fields' => $formFields,
24+
'buttons' => [
25+
'back' => [
26+
'type' => 'button',
27+
'value' => A::t('setup', 'Previous'),
28+
'htmlOptions' => ['name' => '', 'onclick' => "$(location).attr('href','setup/requirements');"]
29+
],
30+
'submit' => ['type' => 'submit', 'value' => A::t('setup', 'Next'), 'htmlOptions' => ['name' => '']]
31+
],
32+
'events' => [
33+
'focus' => ['field' => $errorField]
34+
],
35+
'return' => true,
36+
]);
3237
?>
3338
<br>

demos/login-system/protected/modules/setup/views/setup/index.php

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,21 @@
1010
<?= $actionMessage; ?>
1111
<br>
1212
<?php
13-
echo CWidget::create('CFormView', array(
14-
'action' => 'setup/index',
15-
'method' => 'post',
16-
'htmlOptions' => array(
17-
'name' => 'frmSetup',
18-
),
19-
'fields' => $formFields,
20-
'buttons' => array(
21-
'submit' => array('type' => 'submit', 'value' => A::t('setup', 'Next'), 'htmlOptions' => array('name' => ''))
22-
),
23-
'return' => true,
24-
));
13+
14+
echo CWidget::create(
15+
'CFormView',
16+
[
17+
'action' => 'setup/index',
18+
'method' => 'post',
19+
'htmlOptions' => [
20+
'name' => 'frmSetup',
21+
],
22+
'fields' => $formFields,
23+
'buttons' => [
24+
'submit' => ['type' => 'submit', 'value' => A::t('setup', 'Next'), 'htmlOptions' => ['name' => '']]
25+
],
26+
'return' => true,
27+
]
28+
);
2529
?>
2630
<br>

demos/simple-blog/protected/entities/PostEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class PostEntity extends CRecordEntity
1515
protected $_pkValue = 0;
1616

1717
/** @var */
18-
protected $_fillable = array();
18+
protected $_fillable = [];
1919
/** @var */
2020
protected $_guarded = array('post_datetime');
2121

demos/simple-blog/protected/models/Posts.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,6 @@ private function _updatePostsCount($pKey)
8080
{
8181
// update total count of posts in categories table
8282
$totalPosts = self::model()->count('category_id = :category_id', [':category_id' => $pKey]);
83-
$this->_db->update('categories', array('posts_count' => $totalPosts), 'id = ' . (int)$pKey);
84-
}
83+
$this->_db->update('categories', ['posts_count' => $totalPosts], 'id = '.(int)$pKey);
84+
}
8585
}

demos/simple-blog/protected/modules/setup/controllers/SetupController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function indexAction()
8383

8484
$this->_view->formFields = array(
8585
'act' => array('type' => 'hidden', 'value' => 'send'),
86-
'language' => array('type' => 'dropdownlist', 'value' => $language, 'title' => A::t('setup', 'Language'), 'mandatoryStar' => false, 'data' => $this->_languages, 'htmlOptions' => array(), 'validation' => array('required' => true, 'type' => 'set', 'source' => array_keys($this->_languages))),
86+
'language' => array('type' => 'dropdownlist', 'value' => $language, 'title' => A::t('setup', 'Language'), 'mandatoryStar' => false, 'data' => $this->_languages, 'htmlOptions' => [], 'validation' => array('required' => true, 'type' => 'set', 'source' => array_keys($this->_languages))),
8787
);
8888

8989
if ($this->_cRequest->getPost('act') == 'send') {
@@ -254,7 +254,7 @@ public function databaseAction()
254254

255255
$separatorGeneralFields = array(
256256
'separatorInfo' => array('legend' => 'General Settings'),
257-
'setupType' => array('type' => 'dropdownlist', 'value' => $this->_view->setupType, 'title' => A::t('setup', 'Setup Type'), 'mandatoryStar' => false, 'data' => array('install' => A::t('setup', 'New Installation'), 'update' => A::t('setup', 'Update')), 'htmlOptions' => array(), 'validation' => array('required' => true, 'type' => 'text', 'source' => array('install'))),
257+
'setupType' => array('type' => 'dropdownlist', 'value' => $this->_view->setupType, 'title' => A::t('setup', 'Setup Type'), 'mandatoryStar' => false, 'data' => array('install' => A::t('setup', 'New Installation'), 'update' => A::t('setup', 'Update')), 'htmlOptions' => [], 'validation' => array('required' => true, 'type' => 'text', 'source' => array('install'))),
258258
'dbDriver' => array('type' => 'dropdownlist', 'value' => $this->_view->dbDriver, 'title' => A::t('setup', 'Database Driver'), 'mandatoryStar' => true, 'data' => $dbDrivers, 'htmlOptions' => array('style' => 'width:85px'), 'validation' => array('required' => true, 'type' => 'text', 'source' => array_keys($dbDrivers))),
259259
'dbPrefix' => array('type' => 'textbox', 'value' => $this->_view->dbPrefix, 'title' => A::t('setup', 'Database (tables) Prefix'), 'mandatoryStar' => false, 'htmlOptions' => array('maxLength' => '10', 'autocomplete' => 'off'), 'validation' => array('required' => false, 'type' => 'variable')),
260260
);
@@ -641,13 +641,13 @@ private function _getPhpInfo()
641641
{
642642
ob_start();
643643
if (function_exists('phpinfo')) @phpinfo(-1);
644-
$phpInfo = array('phpinfo' => array());
644+
$phpInfo = array('phpinfo' => []);
645645
if (preg_match_all('#(?:<h2>(?:<a name=".*?">)?(.*?)(?:</a>)?</h2>)|(?:<tr(?: class=".*?")?><t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>)?)?</tr>)#s', ob_get_clean(), $matches, PREG_SET_ORDER))
646646
foreach ($matches as $match) {
647647
$arrayKeys = array_keys($phpInfo);
648648
$endArrayKeys = end($arrayKeys);
649649
if (strlen($match[1])) {
650-
$phpInfo[$match[1]] = array();
650+
$phpInfo[$match[1]] = [];
651651
} elseif (isset($match[3])) {
652652
$phpInfo[$endArrayKeys][$match[2]] = isset($match[4]) ? array($match[3], $match[4]) : $match[3];
653653
} else {

demos/simple-blog/protected/modules/setup/models/Setup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
class Setup extends CModel
2424
{
2525

26-
public function __construct($params = array())
26+
public function __construct($params = [])
2727
{
2828
parent::__construct($params);
2929
}

demos/simple-blog/protected/modules/setup/views/error/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
<h2><?= $header; ?></h2>
77

88
<p>
9-
<?= CWidget::create('CMessage', array('error', $text)) . '<br>'; ?>
9+
<?= CWidget::create('CMessage', ['error', $text]).'<br>'; ?>
1010
</p>

0 commit comments

Comments
 (0)