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