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

This commit is contained in:
origami11@yandex.ru 2025-10-29 20:43:32 +03:00
parent 0267d3081f
commit 5e8958969f
3 changed files with 22 additions and 8 deletions

View file

@ -6,6 +6,10 @@ use ctiso\Database;
use ctiso\HttpRequest;
interface ActionInterface {
/**
* @param HttpRequest $request
* @return mixed
*/
function execute(HttpRequest $request);
function getConnection(): Database;
/**
@ -17,5 +21,5 @@ interface ActionInterface {
* @param string $key
* @param string $value
*/
function addUrlPart($key, $value);
function addUrlPart($key, $value): void;
}

View file

@ -19,12 +19,21 @@ use ctiso\Role\User;
class Front extends Action
{
protected $_param; // Параметр по которому выбирается модуль
protected $default; // Значение параметра по умолчанию
/**
* Параметр по которому выбирается модуль
* @var string
*/
protected $_param;
/**
* Значение параметра по умолчанию
* @var string
*/
protected $default;
/** @var array */
/** @var array<string, Action> */
protected $modules = [];
public function __construct(Database $db, Registry $config, User $user, $default) {
parent::__construct();
$this->config = $config;

View file

@ -7,14 +7,15 @@ namespace ctiso\Filter;
use ctiso\Database;
use ctiso\HttpRequest;
use ctiso\Controller\ActionInterface;
class Filter implements \ctiso\Controller\ActionInterface
class Filter implements ActionInterface
{
/** @var \ctiso\Controller\ActionInterface */
/** @var ActionInterface */
public $processor;
/**
* @param \ctiso\Controller\ActionInterface $processor
* @param ActionInterface $processor
*/
public function __construct($processor)
{
@ -41,7 +42,7 @@ class Filter implements \ctiso\Controller\ActionInterface
return $this->processor->getConnection();
}
public function addUrlPart($key, $value) {
public function addUrlPart($key, $value): void {
$this->processor->addUrlPart($key, $value);
}
}