fix: noverify --fix
This commit is contained in:
parent
5aff28d2b8
commit
117640a755
44 changed files with 174 additions and 174 deletions
|
|
@ -82,7 +82,7 @@ class Component
|
|||
|
||||
$this->before();
|
||||
if (method_exists($this, $action)) {
|
||||
return call_user_func(array($this, $action), $crequest);
|
||||
return call_user_func([$this, $action], $crequest);
|
||||
} else {
|
||||
return $this->actionIndex($crequest);
|
||||
}
|
||||
|
|
@ -180,17 +180,17 @@ class Component
|
|||
}
|
||||
|
||||
public function options($key, $val, $res/*: PDOStatement*/) {
|
||||
$result = array();
|
||||
$result = [];
|
||||
while($res->next()) {
|
||||
$result[] = array('value' => $res->getString($key), 'name' => $res->getString($val));
|
||||
$result[] = ['value' => $res->getString($key), 'name' => $res->getString($val)];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function optionsPair($list, $selected = false) {
|
||||
$result = array();
|
||||
$result = [];
|
||||
foreach ($list as $key => $value) {
|
||||
$result [] = array('value' => $key, 'name' => $value, 'selected' => $key == $selected);
|
||||
$result [] = ['value' => $key, 'name' => $value, 'selected' => $key == $selected];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
|
@ -213,7 +213,7 @@ class Component
|
|||
return $settings;
|
||||
}
|
||||
}
|
||||
return array('parameter' => []);
|
||||
return ['parameter' => []];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -238,7 +238,7 @@ class Component
|
|||
$offset = strpos($expression, '?');
|
||||
$url = parse_url($expression);
|
||||
|
||||
$arguments = array();
|
||||
$arguments = [];
|
||||
if ($offset === false) {
|
||||
$path = $expression;
|
||||
} else if (is_int($offset)) {
|
||||
|
|
@ -259,34 +259,34 @@ class Component
|
|||
// require_once ($path);
|
||||
$component = new $className();
|
||||
|
||||
$component->viewPath = array($config->get('site', 'components') . '/' . $name . '/');
|
||||
$component->webPath = array($config->get('site', 'components.web') . '/' . $name);
|
||||
$component->viewPath = [$config->get('site', 'components') . '/' . $name . '/'];
|
||||
$component->webPath = [$config->get('site', 'components.web') . '/' . $name];
|
||||
$component->COMPONENTS_WEB = $config->get('site', 'web') . '/components/';
|
||||
|
||||
} else {
|
||||
$component = new $className();
|
||||
$template = $component->getTemplateName($site->config);
|
||||
|
||||
$component->viewPath = array(
|
||||
$component->viewPath = [
|
||||
// Сначало ищем локально
|
||||
$config->get('site', 'templates') . '/'. $template . '/_components/' . $name . '/',
|
||||
$config->get('site', 'components') . '/' . $name . '/',
|
||||
// Потом в общем хранилище
|
||||
$config->get('system', 'templates'). '/' . $template . '/_components/' . $name . '/',
|
||||
$config->get('system', 'components') . '/' . $name . '/',
|
||||
);
|
||||
];
|
||||
if (defined('COMPONENTS_WEB')) {
|
||||
$component->webPath = array(
|
||||
$component->webPath = [
|
||||
// Сначало локально
|
||||
$config->get('site', 'templates.web') . '/' . $template . '/_components/' . $name,
|
||||
$config->get('site', 'components.web') . '/' . $name,
|
||||
// Потом в общем хранилище
|
||||
$config->get('system', 'templates.web') . '/' . $template . '/_components/' . $name,
|
||||
$config->get('system', 'components.web') . '/' . $name,
|
||||
);
|
||||
];
|
||||
$component->COMPONENTS_WEB = $config->get('system', 'components.web');
|
||||
} else {
|
||||
$component->webPath = array('', $config->get('site', 'components.web') . '/' . $name, '', '');
|
||||
$component->webPath = ['', $config->get('site', 'components.web') . '/' . $name, '', ''];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -343,13 +343,13 @@ class Component
|
|||
{
|
||||
$arr = $request->r->export('get');
|
||||
|
||||
$param = array();
|
||||
$param = [];
|
||||
$parameter/*: Collection*/ = $this->parameter;
|
||||
foreach($parameter->export() as $key => $value) {
|
||||
$param[$key] = $value;
|
||||
}
|
||||
|
||||
$data = array();
|
||||
$data = [];
|
||||
foreach($arr as $key => $value) {
|
||||
if (is_array($value)) {
|
||||
$data[$key] = Arr::get($value, $this->component_id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue