style: Форматирование

This commit is contained in:
origami11@yandex.ru 2024-08-29 11:11:20 +03:00
parent 8941f5f102
commit d692538163
9 changed files with 92 additions and 92 deletions

View file

@ -7,6 +7,7 @@ use Exception,
ctiso\Model\Factory,
ctiso\HttpRequest,
ctiso\Settings,
ctiso\Database,
ctiso\View\Composite,
ctiso\View\View,
App\Controller\State;
@ -31,7 +32,7 @@ class Action
/**
* Соединение с базой данных
*/
public $db;
public Database $db;
// Фильтры
public $access = null; // Обьект хранит параметры доступа

View file

@ -239,9 +239,8 @@ class Component
$url = parse_url($expression);
$arguments = [];
if ($offset === false) {
$path = $expression;
} else if (is_int($offset)) {
if (is_int($offset)) {
$path = substr($expression, 0, $offset);
$query = substr($expression, $offset + 1);
parse_str($query, $arguments);

View file

@ -39,10 +39,10 @@ class Front extends Action
/**
* Создает экземпляр модуля и выполняет действия для него
* @param string $name Имя модуля
* @param Collection $request Имя модуля
* @param HttpRequest $request
* @return string
*/
public function loadModule($name, Collection $request)
public function loadModule($name, HttpRequest $request)
{
if ($this->isLoaded($name)) {
$module = $this->modules[$name];
@ -64,7 +64,7 @@ class Front extends Action
$moduleClass = "Modules\\$ucname\\$ucpart";
$module = new $moduleClass();
if ($module) {
// Инициализация модуля
$modPath = Path::join($moulesPath, $first);
$module->modulePath = $modPath;
@ -88,8 +88,6 @@ class Front extends Action
$result = $module->access->execute($request);
return $result;
}
return null; // throw new FileNotFoundException();
}
public function execute(HttpRequest $request)

View file

@ -153,7 +153,7 @@ class Form extends View {
* Устанавливает значения из масива
*/
function setValues(HttpRequest $request) {
foreach ($this->field as $key => $el) {
foreach ($this->field as $key => $_) {
$value = $request->getRawData($this->method, $key);
$this->field[$key]->setValue($value);
}

View file

@ -25,7 +25,7 @@ class Mail
function __construct() {
$this->setEncoding("UTF-8");
$this->uniqid = strtoupper(uniqid(time())); // Идентефикатор разделителя
$this->uniqid = strtoupper(uniqid((string)time())); // Идентефикатор разделителя
}
/**

View file

@ -146,12 +146,12 @@ class Setup
/**
* Копирования файла
* preserver - Не переписывать файл если он существует
* preserve - Не переписывать файл если он существует
* template Файл является шаблоном подставить параметры до копирования
* src Исходный файл
* dst Новый файл
*
* @param array{preserve: string, template: string, src: string, dst: string} $attributes
* @param array{preserve?: string, template: string, src: string, dst: string} $attributes
*/
public function copyFile(array $attributes)
{

View file

@ -43,6 +43,7 @@ class Drawing
$last_width = 0;
$count = count($words);
$item = '';
for ($i = 0; $i < $count; $i++) {
$item = $words[$i];
$dimensions = imagettfbbox($size, $angle, $font, $current_line . ($first_word ? '' : ' ') . $item);

View file

@ -25,6 +25,7 @@ class Time extends AbstractRule
public function isValid(Collection $container, $status = null)
{
/** @var array[string]|null */
$tmp = explode($this->split, $container->get($this->field), 2);
if ($tmp) {
if (self::checktime ((int)$tmp[0], (int)$tmp[1])) {