chore: Добавлены аннотации к типам
This commit is contained in:
parent
48269bd424
commit
ad920f656c
14 changed files with 127 additions and 127 deletions
|
|
@ -6,10 +6,10 @@ use ctiso\View\View,
|
|||
|
||||
class Composite extends View
|
||||
{
|
||||
private $tal;
|
||||
private PHPTAL $tal;
|
||||
public $config;
|
||||
|
||||
function __construct($file)
|
||||
function __construct(string $file)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
|
|
@ -29,17 +29,17 @@ class Composite extends View
|
|||
$this->tal->set($key, $val);
|
||||
}
|
||||
|
||||
function __set($key, $val) {
|
||||
function __set(string $key, mixed $val) {
|
||||
$this->tal->set($key, $val);
|
||||
}
|
||||
|
||||
function execute()
|
||||
function execute(): string
|
||||
{
|
||||
$this->processChild();
|
||||
return $this->tal->execute();
|
||||
}
|
||||
|
||||
function setTranslator($t) {
|
||||
function setTranslator($t): void {
|
||||
$this->tal->setTranslator($t);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,10 +7,15 @@ class View extends \stdClass
|
|||
{
|
||||
protected array $_section = []; // Вложенные шаблоны
|
||||
// Блоки
|
||||
/** @var string[] $_stylesheet */
|
||||
protected array $_stylesheet = []; // Массив стилей текущего шаблона
|
||||
/** @var string[] $_script */
|
||||
protected array $_script = []; // Массив скриптов текущего шаблона
|
||||
/** @var string[] $_scriptstring */
|
||||
public array $_scriptstring = [];
|
||||
/** @var string[] $_startup */
|
||||
protected array $_startup = [];
|
||||
|
||||
protected array $_values = [];
|
||||
|
||||
protected ?string $_title = null; // Заголовок текущего шаблона
|
||||
|
|
@ -94,7 +99,7 @@ class View extends \stdClass
|
|||
* @param string $list Имя свойства
|
||||
* @param bool $flatten
|
||||
*/
|
||||
protected function doTree($list, bool $flatten = true)
|
||||
protected function doTree($list, bool $flatten = true): array
|
||||
{
|
||||
$result = ($flatten == true) ? $this->$list : [$this->$list];
|
||||
foreach ($this->_section as $value) {
|
||||
|
|
@ -131,7 +136,7 @@ class View extends \stdClass
|
|||
$this->_title = $title;
|
||||
}
|
||||
|
||||
protected function isNotNull($title): bool
|
||||
protected function isNotNull(?string $title): bool
|
||||
{
|
||||
return $title !== null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue