fix: noverify --fix
This commit is contained in:
parent
5aff28d2b8
commit
117640a755
44 changed files with 174 additions and 174 deletions
|
|
@ -7,7 +7,7 @@ class ListView extends View
|
|||
{
|
||||
function execute()
|
||||
{
|
||||
$result = array();
|
||||
$result = [];
|
||||
foreach ($this->_section as $key => $value) {
|
||||
$result [] = $value->execute();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,17 +14,17 @@ class Pages
|
|||
if ($page > $n) $page = $n;
|
||||
if ($page < 1) $page = 1;
|
||||
$url = 'page=';
|
||||
$result = array();
|
||||
$result = [];
|
||||
for ($i = max($page - self::$range, 1); $i <= min($n, $page + self::$range); $i++) {
|
||||
$result [] = array('page' => $i, 'href' => ($i != $page) ? self::href($prefix, $url . $i) : false);
|
||||
$result [] = ['page' => $i, 'href' => ($i != $page) ? self::href($prefix, $url . $i) : false];
|
||||
}
|
||||
return array(
|
||||
return [
|
||||
'all' => ($n > 1),
|
||||
'list' => $result,
|
||||
'first' => self::href($prefix, $url . 1),
|
||||
'last' => self::href($prefix, $url . $n),
|
||||
'next' => ($page == $n)? false : self::href($prefix, $url . ($page + 1)) ,
|
||||
'prev' => ($page == 1)? false : self::href($prefix, $url . ($page - 1)));
|
||||
'prev' => ($page == 1)? false : self::href($prefix, $url . ($page - 1))];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -45,10 +45,10 @@ class Pages
|
|||
*/
|
||||
static function _getLimit($page, $onpage) {
|
||||
if ($page <= 0) { $page = 1; }
|
||||
return array(
|
||||
return [
|
||||
'count' => $onpage,
|
||||
'start' => ($page - 1) * $onpage,
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
static function href($prefix, $x) {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class Top extends Composite
|
|||
|
||||
public function getTitle()
|
||||
{
|
||||
return implode(" - ", array_filter($this->doTree('_title', false), array($this, 'isNotNull')));
|
||||
return implode(" - ", array_filter($this->doTree('_title', false), [$this, 'isNotNull']));
|
||||
}
|
||||
|
||||
function getId($pref)
|
||||
|
|
@ -39,10 +39,10 @@ class Top extends Composite
|
|||
$this->set('scripts', array_unique($this->getScripts()));
|
||||
$this->set('stylesheet', array_unique($this->getStyleSheet()));
|
||||
|
||||
$this->require = array('admin' => 'ma');
|
||||
$this->deps = array();
|
||||
$this->require = ['admin' => 'ma'];
|
||||
$this->deps = [];
|
||||
|
||||
$startup = array();
|
||||
$startup = [];
|
||||
foreach ($this->_section as $s) {
|
||||
if (is_string($s)) {
|
||||
continue;
|
||||
|
|
@ -67,7 +67,7 @@ class Top extends Composite
|
|||
$script .= $value . "." . $key . " = " . json_encode($v /*, JSON_PRETTY_PRINT*/) . ";\n";
|
||||
}
|
||||
|
||||
$init = array();
|
||||
$init = [];
|
||||
foreach ($s->_section as $key => $item) {
|
||||
$ss /*: View*/= $item;
|
||||
if ($ss->codeGenerator !== null) {
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class View extends \stdClass
|
|||
*/
|
||||
protected function doTree($list, $flatten = true)
|
||||
{
|
||||
$result = ($flatten == true) ? $this->$list : array($this->$list);
|
||||
$result = ($flatten == true) ? $this->$list : [$this->$list];
|
||||
foreach ($this->_section as $value) {
|
||||
if (is_object($value)) {
|
||||
if ($list == '_script' || $list == '_stylesheet') {
|
||||
|
|
@ -182,10 +182,10 @@ class View extends \stdClass
|
|||
|
||||
function loadImports($importFile)
|
||||
{
|
||||
$types = array(
|
||||
$types = [
|
||||
'js' => array($this, 'addScript'),
|
||||
'css' => array($this, 'addStyleSheet')
|
||||
);
|
||||
];
|
||||
// Подключение стилей и скриптов
|
||||
if (file_exists($importFile)) {
|
||||
$files = file($importFile);
|
||||
|
|
@ -201,7 +201,7 @@ class View extends \stdClass
|
|||
}
|
||||
|
||||
public function resolveAllNames($alias, $list) {
|
||||
$result = array();
|
||||
$result = [];
|
||||
foreach($list as $item) {
|
||||
$result [] = $this->resolveName($alias, $item);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue