Browse Source

More short syntax for arrays

tags/2.0.0-beta
Alexander Makarov 11 years ago
parent
commit
71835d977e
  1. 2
      extensions/authclient/OpenId.php
  2. 2
      extensions/gii/components/ActiveField.php
  3. 2
      extensions/twig/ViewRendererStaticClassProxy.php
  4. 2
      tests/unit/data/ar/elasticsearch/CustomerQuery.php
  5. 2
      tests/unit/extensions/elasticsearch/ElasticSearchTestCase.php
  6. 4
      tests/unit/framework/helpers/FileHelperTest.php

2
extensions/authclient/OpenId.php

@ -239,7 +239,7 @@ class OpenId extends BaseClient implements ClientInterface
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
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) {
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, $this->verifyPeer);

2
extensions/gii/components/ActiveField.php

@ -64,7 +64,7 @@ class ActiveField extends \yii\widgets\ActiveField
static $counter = 0;
$this->inputOptions['class'] .= ' typeahead-' . (++$counter);
foreach ($data as &$item) {
$item = array('word' => $item);
$item = ['word' => $item];
}
$this->form->getView()->registerJs("yii.gii.autocomplete($counter, " . Json::encode($data) . ");");
return $this;

2
extensions/twig/ViewRendererStaticClassProxy.php

@ -38,6 +38,6 @@ class ViewRendererStaticClassProxy
public function __call($method, $arguments)
{
return call_user_func_array(array($this->_staticClassName, $method), $arguments);
return call_user_func_array([$this->_staticClassName, $method], $arguments);
}
}

2
tests/unit/data/ar/elasticsearch/CustomerQuery.php

@ -9,7 +9,7 @@ class CustomerQuery extends ActiveQuery
{
public function active()
{
$this->andWhere(array('status' => 1));
$this->andWhere(['status' => 1]);
return $this;
}
}

2
tests/unit/extensions/elasticsearch/ElasticSearchTestCase.php

@ -41,7 +41,7 @@ class ElasticSearchTestCase extends TestCase
public function getConnection($reset = true)
{
$databases = $this->getParam('databases');
$params = isset($databases['elasticsearch']) ? $databases['elasticsearch'] : array();
$params = isset($databases['elasticsearch']) ? $databases['elasticsearch'] : [];
$db = new Connection();
if ($reset) {
$db->open();

4
tests/unit/framework/helpers/FileHelperTest.php

@ -254,12 +254,12 @@ class FileHelperTest extends TestCase
public function testFindFilesExclude()
{
$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');
$tree = $files;
$root = $files;
$flat = array();
$flat = [];
foreach($dirs as $dir) {
foreach($files as $fileName=>$contents) {
$flat[] = rtrim($basePath.$dir,DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$fileName;

Loading…
Cancel
Save