Use short array declaration

This commit is contained in:
Romain Neutron
2013-11-18 11:58:12 +01:00
parent 2898b317c4
commit 56b373ee6e
723 changed files with 8350 additions and 8352 deletions

View File

@@ -54,7 +54,7 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
* @desc le tableau qui contien les resultats
* @var <array>
*/
public $report = array();
public $report = [];
private $app;
/**
@@ -242,9 +242,9 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
public function __sleep()
{
$vars = array();
$vars = [];
foreach ($this as $key => $value) {
if (in_array($key, array('app')))
if (in_array($key, ['app']))
continue;
$vars[] = $key;
}

View File

@@ -12,7 +12,7 @@
class module_report_dashboard_group implements module_report_dashboard_componentInterface
{
public $group_dash;
public $dashboard = array();
public $dashboard = [];
private $valid = false;
/**
@@ -35,7 +35,7 @@ class module_report_dashboard_group implements module_report_dashboard_component
{
if ($this->valid) {
if (is_null($this->group_dash))
$this->group_dash = array();
$this->group_dash = [];
foreach ($this->dashboard as $key => $dash) {
if (is_object($dash) &&
$dash instanceof module_report_dashboard_feed &&

View File

@@ -11,8 +11,8 @@
class module_report_dashboard_merge implements module_report_dashboard_componentInterface
{
public $sort = array();
public $sorted = array();
public $sort = [];
public $sorted = [];
private $currentkey;
private $valid = false;

View File

@@ -11,8 +11,8 @@
class module_report_dashboard_sort implements module_report_dashboard_componentInterface
{
public $arrayToSort = array();
public $arraySorted = array();
public $arrayToSort = [];
public $arraySorted = [];
public function __construct(module_report_dashboard_merge $tridash)
{
@@ -99,7 +99,7 @@ class module_report_dashboard_sort implements module_report_dashboard_componentI
foreach ($args as $n => $field) {
if (is_string($field)) { // = clef
$tmp = array();
$tmp = [];
foreach ($data as $key => $row)
$tmp[$key] = $row[$field];
$args[$n] = &$tmp;
@@ -130,15 +130,15 @@ class module_report_dashboard_sort implements module_report_dashboard_componentI
public function getTop($nbtop)
{
if ( ! is_int($nbtop)) {
return array();
return [];
}
$tmp = array();
$tmp = [];
if ($this->isValid()) {
foreach ($this->arraySorted as $k => $v) {
$i = 0;
$tmp[$k] = array();
$tmp[$k] = [];
foreach ($v as $a) {
if ($i < $nbtop)
array_push($tmp[$k], $a);