Commit 71835d97 by Alexander Makarov

More short syntax for arrays

parent 2c1bd7f2
...@@ -239,7 +239,7 @@ class OpenId extends BaseClient implements ClientInterface ...@@ -239,7 +239,7 @@ class OpenId extends BaseClient implements ClientInterface
curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Accept: application/xrds+xml, */*')); curl_setopt($curl, CURLOPT_HTTPHEADER, ['Accept: application/xrds+xml, */*']);
if ($this->verifyPeer !== null) { if ($this->verifyPeer !== null) {
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, $this->verifyPeer); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, $this->verifyPeer);
......
...@@ -64,7 +64,7 @@ class ActiveField extends \yii\widgets\ActiveField ...@@ -64,7 +64,7 @@ class ActiveField extends \yii\widgets\ActiveField
static $counter = 0; static $counter = 0;
$this->inputOptions['class'] .= ' typeahead-' . (++$counter); $this->inputOptions['class'] .= ' typeahead-' . (++$counter);
foreach ($data as &$item) { foreach ($data as &$item) {
$item = array('word' => $item); $item = ['word' => $item];
} }
$this->form->getView()->registerJs("yii.gii.autocomplete($counter, " . Json::encode($data) . ");"); $this->form->getView()->registerJs("yii.gii.autocomplete($counter, " . Json::encode($data) . ");");
return $this; return $this;
......
...@@ -38,6 +38,6 @@ class ViewRendererStaticClassProxy ...@@ -38,6 +38,6 @@ class ViewRendererStaticClassProxy
public function __call($method, $arguments) public function __call($method, $arguments)
{ {
return call_user_func_array(array($this->_staticClassName, $method), $arguments); return call_user_func_array([$this->_staticClassName, $method], $arguments);
} }
} }
\ No newline at end of file
...@@ -9,7 +9,7 @@ class CustomerQuery extends ActiveQuery ...@@ -9,7 +9,7 @@ class CustomerQuery extends ActiveQuery
{ {
public function active() public function active()
{ {
$this->andWhere(array('status' => 1)); $this->andWhere(['status' => 1]);
return $this; return $this;
} }
} }
...@@ -41,7 +41,7 @@ class ElasticSearchTestCase extends TestCase ...@@ -41,7 +41,7 @@ class ElasticSearchTestCase extends TestCase
public function getConnection($reset = true) public function getConnection($reset = true)
{ {
$databases = $this->getParam('databases'); $databases = $this->getParam('databases');
$params = isset($databases['elasticsearch']) ? $databases['elasticsearch'] : array(); $params = isset($databases['elasticsearch']) ? $databases['elasticsearch'] : [];
$db = new Connection(); $db = new Connection();
if ($reset) { if ($reset) {
$db->open(); $db->open();
......
...@@ -254,12 +254,12 @@ class FileHelperTest extends TestCase ...@@ -254,12 +254,12 @@ class FileHelperTest extends TestCase
public function testFindFilesExclude() public function testFindFilesExclude()
{ {
$basePath = $this->testFilePath . DIRECTORY_SEPARATOR; $basePath = $this->testFilePath . DIRECTORY_SEPARATOR;
$dirs = array('', 'one', 'one'.DIRECTORY_SEPARATOR.'two', 'three'); $dirs = ['', 'one', 'one'.DIRECTORY_SEPARATOR.'two', 'three'];
$files = array_fill_keys(array_map(function($n){return "a.$n";}, range(1,8)), 'file contents'); $files = array_fill_keys(array_map(function($n){return "a.$n";}, range(1,8)), 'file contents');
$tree = $files; $tree = $files;
$root = $files; $root = $files;
$flat = array(); $flat = [];
foreach($dirs as $dir) { foreach($dirs as $dir) {
foreach($files as $fileName=>$contents) { foreach($files as $fileName=>$contents) {
$flat[] = rtrim($basePath.$dir,DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$fileName; $flat[] = rtrim($basePath.$dir,DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$fileName;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment