fix: Аннотация типов
This commit is contained in:
parent
540805ae35
commit
87fc94d700
3 changed files with 9 additions and 11 deletions
|
|
@ -5,8 +5,8 @@ namespace ctiso;
|
||||||
|
|
||||||
class Arr {
|
class Arr {
|
||||||
/**
|
/**
|
||||||
* @param array<mixed> $data
|
* @param array<string|int, mixed> $data
|
||||||
* @param string $key
|
* @param string|int $key
|
||||||
* @param mixed $default
|
* @param mixed $default
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
namespace ctiso;
|
namespace ctiso;
|
||||||
|
|
||||||
use ctiso\HttpRequest,
|
use ctiso\HttpRequest;
|
||||||
ctiso\Arr;
|
use ctiso\Arr;
|
||||||
|
|
||||||
class ComponentRequest {
|
class ComponentRequest {
|
||||||
/** @var string */
|
/** @var int */
|
||||||
public $component_id;
|
public $component_id;
|
||||||
/** @var string */
|
/** @var string */
|
||||||
public $component_title;
|
public $component_title;
|
||||||
|
|
@ -14,7 +14,7 @@ class ComponentRequest {
|
||||||
public $r;
|
public $r;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $c
|
* @param int $c
|
||||||
* @param HttpRequest $r
|
* @param HttpRequest $r
|
||||||
*/
|
*/
|
||||||
function __construct($c, HttpRequest $r) {
|
function __construct($c, HttpRequest $r) {
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ class Component
|
||||||
public $template = null;
|
public $template = null;
|
||||||
public string $templatePath;
|
public string $templatePath;
|
||||||
|
|
||||||
/** @var string */
|
/** @var int */
|
||||||
public $component_id;
|
public $component_id;
|
||||||
/** @var string */
|
/** @var string */
|
||||||
public $component_title;
|
public $component_title;
|
||||||
|
|
@ -359,12 +359,9 @@ class Component
|
||||||
$path = Path::join ($config->get('site', 'components'), $name, $filename . '.php');
|
$path = Path::join ($config->get('site', 'components'), $name, $filename . '.php');
|
||||||
$className = implode("\\", ['Components', ucfirst($name), $filename]);
|
$className = implode("\\", ['Components', ucfirst($name), $filename]);
|
||||||
|
|
||||||
/**
|
|
||||||
* @var ?Component $component
|
|
||||||
*/
|
|
||||||
$component = null;
|
$component = null;
|
||||||
|
|
||||||
if (file_exists($path)) {
|
if (file_exists($path)) {
|
||||||
|
/** @var Component $component */
|
||||||
$component = new $className();
|
$component = new $className();
|
||||||
|
|
||||||
$component->viewPath = [$config->get('site', 'components') . '/' . $name . '/'];
|
$component->viewPath = [$config->get('site', 'components') . '/' . $name . '/'];
|
||||||
|
|
@ -372,6 +369,7 @@ class Component
|
||||||
$component->COMPONENTS_WEB = $config->get('site', 'web') . '/components/';
|
$component->COMPONENTS_WEB = $config->get('site', 'web') . '/components/';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
/** @var Component $component */
|
||||||
$component = new $className();
|
$component = new $className();
|
||||||
$template = $component->getTemplateName($site->getConfig());
|
$template = $component->getTemplateName($site->getConfig());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue