chore: Аннотации к типам

This commit is contained in:
origami11@yandex.ru 2025-10-21 12:00:06 +03:00
parent 09a61244ca
commit 1e27648a12
17 changed files with 217 additions and 81 deletions

View file

@ -184,9 +184,9 @@ class Login extends Filter
return $text; return $text;
} }
/* --------------------- /**
* Проверка на попадание реквеста в белый список * Проверка на попадание реквеста в белый список
*/ */
public function requestIsWhite(Collection $request) { public function requestIsWhite(Collection $request) {
$module = $request->get('module'); $module = $request->get('module');
$action = $request->get('action'); $action = $request->get('action');

View file

@ -14,8 +14,9 @@ use Exception,
*/ */
class HttpRequest extends Collection class HttpRequest extends Collection
{ {
/** @var Session */
public $_session; public $_session;
/** /**
* Constructor * Constructor
* Stores "request data" in GPC order. * Stores "request data" in GPC order.
@ -94,6 +95,12 @@ class HttpRequest extends Collection
return null; return null;
} }
/**
* @param string $var
* @param string $key
* @param mixed $val
* @return mixed
*/
public function setRawData($var, $key, $val) public function setRawData($var, $key, $val)
{ {
$data = parent::get(strtolower($var)); $data = parent::get(strtolower($var));
@ -102,28 +109,31 @@ class HttpRequest extends Collection
} }
} }
public function setAction($name) /**
* @param string $name
*/
public function setAction($name): void
{ {
$this->setRawData('get', 'action', $name); $this->setRawData('get', 'action', $name);
} }
public function getAction() public function getAction(): string
{ {
$result = $this->getRawData('get', 'action'); $result = $this->getRawData('get', 'action');
return ($result) ? $result : 'index'; return ($result) ? $result : 'index';
} }
public function isAjax() public function isAjax(): bool
{ {
return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'); return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest');
} }
public function redirect($url) { public function redirect($url): void {
header('location: ' . $url); header('location: ' . $url);
exit(); exit();
} }
static function getProtocol() { static function getProtocol(): string {
return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
} }
} }

View file

@ -12,17 +12,27 @@ use ctiso\Path,
class Mail class Mail
{ {
/** @var string */
public $_from; public $_from;
/** @var string */
public $_to; public $_to;
/** @var string */
public $_subject; public $_subject;
/** @var string */
public $content; public $content;
/** @var string */
public $copy; public $copy;
/** @var string */
private $encoding; private $encoding;
/** @var string */
private $_notify = null; private $_notify = null;
/** @var array */
protected $attachment = array(); protected $attachment = array();
/** @var string */
protected $uniqid; protected $uniqid;
/** @var string */
protected $type = "text/plain"; protected $type = "text/plain";
function __construct() function __construct()
@ -34,7 +44,7 @@ class Mail
/** /**
* Установка отправителя * Установка отправителя
*/ */
function from(string $name) function from(string $name): void
{ {
// filter_var($name, FILTER_VALIDATE_EMAIL); // filter_var($name, FILTER_VALIDATE_EMAIL);
$this->_from = $name; $this->_from = $name;
@ -43,23 +53,23 @@ class Mail
/** /**
* Установка получателя * Установка получателя
*/ */
function to(string $name) // recipient function to(string $name): void // recipient
{ {
$this->_to = $name; $this->_to = $name;
} }
function replyTo($name) // recipient function replyTo($name): void // recipient
{} {}
/** /**
* Установка получателей копии * Установка получателей копии
*/ */
function copy(string $name) // recipient cc function copy(string $name): void // recipient cc
{ {
$this->copy = $name; $this->copy = $name;
} }
function notify(string $notify) function notify(string $notify): void
{ {
$this->_notify = $notify; $this->_notify = $notify;
} }
@ -67,7 +77,7 @@ class Mail
/** /**
* Тема письма * Тема письма
*/ */
function subject(string $subject) function subject(string $subject): void
{ {
$this->_subject = $subject; $this->_subject = $subject;
} }
@ -75,7 +85,7 @@ class Mail
/** /**
* Текст письма * Текст письма
*/ */
function setContent(string $text) function setContent(string $text): void
{ {
$this->content = $text; $this->content = $text;
} }
@ -83,7 +93,7 @@ class Mail
/** /**
* Кодировка текста в письме * Кодировка текста в письме
*/ */
function setEncoding(string $encoding) function setEncoding(string $encoding): void
{ {
$this->encoding = $encoding; $this->encoding = $encoding;
} }
@ -91,7 +101,7 @@ class Mail
/** /**
* Добавление вложения из файла * Добавление вложения из файла
*/ */
function addAttachment(string $filename, $name = false) function addAttachment(string $filename, $name = false): void
{ {
if (file_exists($filename)) { // assert ?? if (file_exists($filename)) { // assert ??
$file = fopen($filename, "rb"); $file = fopen($filename, "rb");
@ -102,7 +112,7 @@ class Mail
} }
} }
function setType($type) function setType($type): void
{ {
$this->type = $type; $this->type = $type;
} }
@ -110,12 +120,16 @@ class Mail
/** /**
* Добавление вложения из строки с указанием имени файла * Добавление вложения из строки с указанием имени файла
*/ */
function addAttachmentRaw($data, string $name) function addAttachmentRaw($data, string $name): void
{ {
$this->attachment[] = [$data, $name]; $this->attachment[] = [$data, $name];
} }
function quote($var, $val) /**
* @param string $var
* @param string $val
*/
function quote($var, $val): string
{ {
return ";" . PHP_EOL . "\t" . $var . "=\"" . $val . "\""; return ";" . PHP_EOL . "\t" . $var . "=\"" . $val . "\"";
} }
@ -123,8 +137,12 @@ class Mail
/** /**
* Общий формат тегов MIME * Общий формат тегов MIME
* @see http://tools.ietf.org/html/rfc2045 * @see http://tools.ietf.org/html/rfc2045
*
* @param string $name
* @param string $value
* @param array $args
*/ */
function mimeTag($name, $value, array $args = []) function mimeTag($name, $value, array $args = []): string
{ {
assert(is_string($name)); assert(is_string($name));
assert(is_string($value)); assert(is_string($value));
@ -136,7 +154,7 @@ class Mail
* *
* @see http://tools.ietf.org/html/rfc2047 * @see http://tools.ietf.org/html/rfc2047
*/ */
function encodedWord(string $text, string $encoding = 'B') function encodedWord(string $text, string $encoding = 'B'): string
{ {
return "=?{$this->encoding}?$encoding?" . base64_encode($text) . "?="; return "=?{$this->encoding}?$encoding?" . base64_encode($text) . "?=";
} }

View file

@ -5,8 +5,11 @@ use PHPMailer\PHPMailer\PHPMailer;
class MailAlt class MailAlt
{ {
/** @var PHPMailer */
public $mailer; public $mailer;
/** @var string */
public $_notify; public $_notify;
/** @var string */
public $encoding; public $encoding;
function __construct() { function __construct() {
@ -17,7 +20,7 @@ class MailAlt
/** /**
* Установка отправителя * Установка отправителя
*/ */
function from(string $name) function from(string $name): void
{ {
$this->mailer->setFrom($name); $this->mailer->setFrom($name);
} }
@ -25,26 +28,26 @@ class MailAlt
/** /**
* Установка получателя * Установка получателя
*/ */
function to(string $name) // recipient function to(string $name): void // recipient
{ {
$this->mailer->addAddress($name); $this->mailer->addAddress($name);
} }
function replyTo(string $name) // recipient function replyTo(string $name): void // recipient
{ {
$this->mailer->AddReplyTo($name); $this->mailer->addReplyTo($name);
} }
/** /**
* Установка получателей копии * Установка получателей копии
* @param string $name * @param string $name
*/ */
function copy(string $name) // recipient cc function copy(string $name): void // recipient cc
{ {
$this->mailer->addCC($name); $this->mailer->addCC($name);
} }
function notify(string $notify) function notify(string $notify): void
{ {
$this->_notify = $notify; $this->_notify = $notify;
} }
@ -53,7 +56,7 @@ class MailAlt
* Тема письма * Тема письма
* @param string $subject * @param string $subject
*/ */
function subject(string $subject) function subject(string $subject): void
{ {
$this->mailer->Subject = $subject; $this->mailer->Subject = $subject;
} }
@ -62,12 +65,12 @@ class MailAlt
* Текст письма * Текст письма
* @param string $text * @param string $text
*/ */
function setContent(string $text) function setContent(string $text): void
{ {
$this->mailer->Body = $text; $this->mailer->Body = $text;
} }
function setType(string $text) function setType(string $text): void
{ {
$this->mailer->isHTML($text == 'text/html'); $this->mailer->isHTML($text == 'text/html');
} }
@ -75,7 +78,7 @@ class MailAlt
/** /**
* Кодировка текста в письме * Кодировка текста в письме
*/ */
function setEncoding(string $encoding) function setEncoding(string $encoding): void
{ {
$this->encoding = $encoding; $this->encoding = $encoding;
} }
@ -83,7 +86,7 @@ class MailAlt
/** /**
* Добавление вложения из файла * Добавление вложения из файла
*/ */
function addAttachment(string $filename, ?string $name = null) function addAttachment(string $filename, ?string $name = null): void
{ {
$this->mailer->addAttachment($filename, $name); $this->mailer->addAttachment($filename, $name);
} }

View file

@ -24,4 +24,3 @@ class Numbers
return $result; return $result;
} }
} }

View file

@ -217,7 +217,6 @@ class Path
* Находит путь относительно текущего путя * Находит путь относительно текущего путя
* *
* @param string $name Полный путь к файлу * @param string $name Полный путь к файлу
*
* @return string Относительный путь к файлу * @return string Относительный путь к файлу
*/ */
public function relPath($name) public function relPath($name)
@ -258,6 +257,9 @@ class Path
return implode("/", $result); return implode("/", $result);
} }
/**
* @param string $path
*/
public function append($path) public function append($path)
{ {
$base = $this->__toString(); $base = $this->__toString();
@ -270,7 +272,7 @@ class Path
* @param string ...$args * @param string ...$args
* @return string * @return string
*/ */
static function fromJoin(string ...$args) { static function fromJoin(...$args) {
$result = []; $result = [];
$parts0 = new Path(array_shift($args)); $parts0 = new Path(array_shift($args));
$result [] = $parts0->getParts(); $result [] = $parts0->getParts();
@ -291,7 +293,7 @@ class Path
* @param string ...$args * @param string ...$args
* @return string * @return string
*/ */
static function join(string ...$args) static function join(...$args)
{ {
$path = call_user_func_array([self::class, "fromJoin"], $args); $path = call_user_func_array([self::class, "fromJoin"], $args);
return self::makeUrl($path->url); return self::makeUrl($path->url);

View file

@ -2,25 +2,39 @@
namespace ctiso; namespace ctiso;
if (!function_exists('str_getcsv')) { /**
function str_getcsv($input, $delimiter = ",", $enclosure = '"', $escape = "\\") { * str_getcsv
$fiveMBs = 1024; * @param string $input
$fp = fopen("php://temp/maxmemory:$fiveMBs", 'r+'); * @param string $delimiter
$data = ''; * @param string $enclosure
if (is_resource($fp)) { * @param string $escape
fputs($fp, $input); * @return array
rewind($fp); */
$data = fgetcsv($fp, 1000, $delimiter, $enclosure); function str_getcsv($input, $delimiter = ",", $enclosure = '"', $escape = "\\")
fclose($fp); {
} $fiveMBs = 1024;
return $data; $fp = fopen("php://temp/maxmemory:$fiveMBs", 'r+');
} $data = '';
if (is_resource($fp)) {
fputs($fp, $input);
rewind($fp);
$data = fgetcsv($fp, 1000, $delimiter, $enclosure);
fclose($fp);
}
return $data;
} }
function process_exists($pid) {
/**
* process_exists
* @param int $pid
* @return bool
*/
function process_exists($pid)
{
if (PHP_OS == 'WINNT') { if (PHP_OS == 'WINNT') {
$processes = explode("\n", shell_exec("tasklist.exe /NH /FO CSV")); $processes = explode("\n", shell_exec("tasklist.exe /NH /FO CSV"));
foreach($processes as $process) { foreach ($processes as $process) {
if ($process != "") { if ($process != "") {
$csv = str_getcsv($process); $csv = str_getcsv($process);
if ($pid == $csv[1]) return true; if ($pid == $csv[1]) return true;
@ -32,13 +46,19 @@ function process_exists($pid) {
} }
} }
function create_single_proces($fpid, $fn) { /**
* create_single_proces
* @param string $fpid
* @param callable $fn
* @return int
*/
function create_single_process($fpid, $fn)
{
if (file_exists($fpid)) { if (file_exists($fpid)) {
print_r(realpath($fpid)); if (process_exists((int)file_get_contents($fpid))) {
if (process_exists(file_get_contents($fpid))) { return 1;
return 1;
} }
} }
call_user_func($fn); call_user_func($fn);
return 0; return 0;
} }

View file

@ -5,21 +5,30 @@ use ctiso\File,
Exception; Exception;
/** /**
* Класс реестра * Класс реестра
* Реестр организован как ассоциативный многомерный массив * Реестр организован как ассоциативный многомерный массив
* array( 'name1' => parameters1, 'name2' => parameters1, ... ) * array( 'name1' => parameters1, 'name2' => parameters1, ... )
* *
* name1, name2 ... - Имена модулей * name1, name2 ... - Имена модулей
* parameters1, parameters1 - Массивы с параметрами модуля * parameters1, parameters1 - Массивы с параметрами модуля
* Имя необходимо чтобы потом легко было удалить ненужные ветки дерева * Имя необходимо чтобы потом легко было удалить ненужные ветки дерева
*/ */
class Settings class Settings
{ {
/** @var array */
public $data = []; public $data = [];
/** @var string */
protected $file; protected $file;
/** @var string */
protected $format = 'php'; protected $format = 'php';
/** @var bool */
protected $is_read = false; protected $is_read = false;
/**
* Конструктор
* @param string $file Путь к файлу
* @param 'php'|'json'|false $format Формат файла
*/
public function __construct ($file = null, $format = false) public function __construct ($file = null, $format = false)
{ {
$fileFormat = ['theme' => 'json']; $fileFormat = ['theme' => 'json'];
@ -33,7 +42,7 @@ class Settings
* Чтение настроек из файла * Чтение настроек из файла
* @return Boolean * @return Boolean
*/ */
public function read() public function read(): bool
{ {
if (!file_exists ($this->file)) { if (!file_exists ($this->file)) {
$this->is_read = true; $this->is_read = true;
@ -59,7 +68,7 @@ class Settings
/** /**
* Запись ключа в реестр (Реестр это многомерный массив) * Запись ключа в реестр (Реестр это многомерный массив)
*/ */
public function writeKey(array $key, $value) public function writeKey(array $key, $value)
{ {
// assert(count($key) >= 1); // assert(count($key) >= 1);
$data = &$this->data; $data = &$this->data;
@ -67,8 +76,8 @@ class Settings
while (count($key) > 1) { while (count($key) > 1) {
$name = array_shift($key); $name = array_shift($key);
$data = &$data[$name]; $data = &$data[$name];
} }
// assert(count($key) == 1); // assert(count($key) == 1);
$name = array_shift($key); $name = array_shift($key);
if (is_array($value)) { if (is_array($value)) {
@ -97,14 +106,20 @@ class Settings
} }
/** /**
* Чтение ключа из реестра * Чтение ключа из реестра
* @param array $key Путь к значению ключа * @param array $key Путь к значению ключа
* @return mixed
*/ */
public function readKey(array $key) public function readKey(array $key)
{ {
return $this->readKeyData($key, $this->data); return $this->readKeyData($key, $this->data);
} }
/**
* Чтение ключа из реестра
* @param array $key Путь к значению ключа
* @return mixed
*/
protected function readKeyData(array $key, $data) protected function readKeyData(array $key, $data)
{ {
// assert(count($key) >= 1); // assert(count($key) >= 1);
@ -115,8 +130,8 @@ class Settings
} else { } else {
return null; return null;
} }
} }
// assert(count($key) == 1); // assert(count($key) == 1);
$name = array_shift($key); $name = array_shift($key);
if (isset($data[$name])) { if (isset($data[$name])) {
@ -131,7 +146,7 @@ class Settings
* @param mixed $key Путь к значению ключа внутри модуля * @param mixed $key Путь к значению ключа внутри модуля
*/ */
public function readKeyList(...$key) public function readKeyList(...$key)
{ {
$result = []; $result = [];
foreach ($this->data as $name => $value) { foreach ($this->data as $name => $value) {
$output = $this->readKeyData($key, $value); $output = $this->readKeyData($key, $value);
@ -142,13 +157,17 @@ class Settings
return $result; return $result;
} }
public function removeKey($name) /**
* Удаление ключа из реестра
* @param string $name Имя ключа
*/
public function removeKey($name): void
{ {
unset($this->data[$name]); unset($this->data[$name]);
} }
public function removeNode(array $key) public function removeNode(array $key): void
{ {
$data = &$this->data; $data = &$this->data;
while (count($key) > 1) { while (count($key) > 1) {
@ -158,11 +177,11 @@ class Settings
$name = array_shift($key); $name = array_shift($key);
unset($data[$name]); unset($data[$name]);
} }
/** /**
* Запись настроек в файл (Может переименовать в store) * Запись настроек в файл (Может переименовать в store)
* *
* @param File $file * @param File $file
* @return void * @return void
*/ */
public function write($file = null) public function write($file = null)
@ -198,7 +217,7 @@ class Settings
} }
/** /**
* Список модулей/ключей * Список модулей/ключей
*/ */
public function getKeys() public function getKeys()
{ {

View file

@ -6,6 +6,10 @@ use GdImage;
class Image class Image
{ {
/**
* @param $uri
* @return GdImage|false
*/
static function load($uri): GdImage|false static function load($uri): GdImage|false
{ {
$e = strtolower(pathinfo($uri, PATHINFO_EXTENSION)); $e = strtolower(pathinfo($uri, PATHINFO_EXTENSION));
@ -32,6 +36,11 @@ class Image
return $image_p; return $image_p;
} }
/**
* @param GdImage $image
* @param string $uri
* @return bool
*/
static function save($image, $uri): bool static function save($image, $uri): bool
{ {
$e = strtolower(pathinfo($uri, PATHINFO_EXTENSION)); $e = strtolower(pathinfo($uri, PATHINFO_EXTENSION));

View file

@ -51,11 +51,10 @@ class StringUtil {
} }
//Проверка равенства двух строк на русском языке. //Проверка равенства двух строк на русском языке.
static function equalRussianCheck($str1,$str2) { static function equalRussianCheck($str1,$str2): bool {
return self::normalizeRussian($str1) == self::normalizeRussian($str2); return self::normalizeRussian($str1) == self::normalizeRussian($str2);
} }
/** /**
* Попадает ли строка в список вариантов * Попадает ли строка в список вариантов
* input: $str="foo1" $variants="foo1|foo2|foo3" * input: $str="foo1" $variants="foo1|foo2|foo3"

View file

@ -32,12 +32,15 @@ class TemplateImage
); );
/** @var string */
protected $src; protected $src;
protected array $context = []; protected array $context = [];
protected array $data = []; protected array $data = [];
protected string $base = "c:\\windows\\fonts\\"; protected string $base = "c:\\windows\\fonts\\";
protected GdImage $image; protected GdImage $image;
/** @var bool */
protected $_prepare = true; protected $_prepare = true;
/** @var bool */
public $debug = false; public $debug = false;
public string $resource; public string $resource;
public string $filename; public string $filename;

View file

@ -21,7 +21,7 @@ abstract class AbstractRule
return $this; return $this;
} }
public function setErrorMsg($errorMsg): self public function setErrorMsg(?string $errorMsg): self
{ {
$this->errorMsg = $errorMsg; $this->errorMsg = $errorMsg;
return $this; return $this;

View file

@ -55,7 +55,7 @@ class Validator
* fieldname - Имя переменой для проверки * fieldname - Имя переменой для проверки
* ruletext - Описание правила см. формат правила ниже * ruletext - Описание правила см. формат правила ниже
*/ */
public function addRuleList(array $input) public function addRuleList(array $input): void
{ {
// Разбор правила проверки // Разбор правила проверки
// Формат правила 'rule1|rule2,param1=value1|rule3,param1=value1,param2=value2' // Формат правила 'rule1|rule2,param1=value1|rule3,param1=value1,param2=value2'

View file

@ -8,6 +8,14 @@ namespace ctiso\View;
class Pages class Pages
{ {
static int $range = 5; static int $range = 5;
/**
* @param int $page номер страницы
* @param int $onpage количество страниц на странице
* @param int $count количество всех страниц
* @param string $prefix префикс
* @return array{'all': bool, 'list': array, 'first': string, 'last': string, 'next': string, 'prev': string}
*/
static function getPages($page, $onpage, $count, $prefix = '?') static function getPages($page, $onpage, $count, $prefix = '?')
{ {
$n = ceil($count / $onpage); $n = ceil($count / $onpage);
@ -51,6 +59,11 @@ class Pages
]; ];
} }
/**
* @param string $prefix префикс
* @param string $x строка
* @return string
*/
static function href($prefix, $x) { static function href($prefix, $x) {
return $prefix . $x; return $prefix . $x;
} }

View file

@ -7,35 +7,60 @@ namespace ctiso\View;
*/ */
class Plain extends \stdClass class Plain extends \stdClass
{ {
/** @var string */
protected $document; protected $document;
/** @var array */
protected $values = []; protected $values = [];
/**
* Конструктор
* @param string $document шаблон
*/
public function __construct ($document) public function __construct ($document)
{ {
$this->document = $document; $this->document = $document;
} }
/**
* Установка значения
* @param string $key ключ
* @param mixed $value значение
*/
public function set($key, $value) public function set($key, $value)
{ {
$this->values[$key] = $value; $this->values[$key] = $value;
} }
public function import($list) /**
* Импорт значений
* @param array $list список значений
*/
public function import($list): void
{ {
$this->values = array_merge($this->values, $list); $this->values = array_merge($this->values, $list);
} }
public function __set($key, $value) public function __set($key, $value): void
{ {
$this->set($key, $value); $this->set($key, $value);
} }
/**
* Выполнение шаблона
* @return string
*/
public function execute() public function execute()
{ {
$result = $this->values; $result = $this->values;
return self::getTemplateContent ($this->document, $result); return self::getTemplateContent ($this->document, $result);
} }
/**
* Получение содержимого шаблона
* @param string $document шаблон
* @param array $result результат
* @return string содержимое шаблона
*/
static function getTemplateContent(string $document, $result): string static function getTemplateContent(string $document, $result): string
{ {
ob_start (); ob_start ();

View file

@ -13,11 +13,22 @@ class Top extends Composite
public $require = array(); public $require = array();
public $deps = array(); public $deps = array();
/**
* Заголовок страницы
*
* @return string
*/
public function getTitle() public function getTitle()
{ {
return implode(" - ", array_filter($this->doTree('_title', false), [$this, 'isNotNull'])); return implode(" - ", array_filter($this->doTree('_title', false), [$this, 'isNotNull']));
} }
/**
* Идентификатор
*
* @param string $pref
* @return string
*/
function getId($pref) function getId($pref)
{ {
$this->mid++; $this->mid++;
@ -97,7 +108,7 @@ class Top extends Composite
/** /**
* Массив имен файлов скриптов * Массив имен файлов скриптов
* *
* return array * @return array
*/ */
public function getScripts() public function getScripts()
{ {
@ -114,6 +125,11 @@ class Top extends Composite
return implode("\n", $this->doTree('_scriptstring')); return implode("\n", $this->doTree('_scriptstring'));
} }
/**
* Строка со скриптом
*
* @return string
*/
public function getScriptStartup() public function getScriptStartup()
{ {
return implode("\n", $this->doTree('_startup')); return implode("\n", $this->doTree('_startup'));
@ -122,7 +138,7 @@ class Top extends Composite
/** /**
* Массив имен файлов стилей * Массив имен файлов стилей
* *
* return array * @return array
*/ */
public function getStyleSheet() public function getStyleSheet()
{ {

View file

@ -39,7 +39,7 @@ class View extends \stdClass
* @param string $section переменная шаблона * @param string $section переменная шаблона
* @param View|string $view вложенный шаблон * @param View|string $view вложенный шаблон
*/ */
public function setView($section, $view) public function setView($section, $view): void
{ {
$this->_section [$section] = $view; $this->_section [$section] = $view;
if (is_object($view)) { if (is_object($view)) {