Selaa lähdekoodia

Up min PHP version from 7.3 to 8.0 - 2

Visman 2 vuotta sitten
vanhempi
commit
a191fbf789
54 muutettua tiedostoa jossa 127 lisäystä ja 236 poistoa
  1. 2 13
      app/Models/Action.php
  2. 1 2
      app/Models/AdminList/AdminList.php
  3. 1 2
      app/Models/BBCodeList/BBCodeList.php
  4. 5 6
      app/Models/BBCodeList/Structure.php
  5. 1 2
      app/Models/BanList/BanList.php
  6. 2 4
      app/Models/Category/Categories.php
  7. 1 2
      app/Models/Censorship/Censorship.php
  8. 1 2
      app/Models/Config/Config.php
  9. 4 6
      app/Models/Cookie/Cookie.php
  10. 1 2
      app/Models/DBMap/DBMap.php
  11. 5 7
      app/Models/DataModel.php
  12. 1 2
      app/Models/Forum/Forum.php
  13. 2 4
      app/Models/Forum/Forums.php
  14. 1 4
      app/Models/Forum/Refresh.php
  15. 1 2
      app/Models/Group/Group.php
  16. 2 4
      app/Models/Group/Groups.php
  17. 1 4
      app/Models/Group/Perm.php
  18. 8 19
      app/Models/Manager.php
  19. 2 13
      app/Models/Method.php
  20. 13 24
      app/Models/Model.php
  21. 4 6
      app/Models/Online/Online.php
  22. 4 9
      app/Models/PM/PBlock.php
  23. 4 8
      app/Models/PM/PM.php
  24. 1 2
      app/Models/PM/PPost.php
  25. 1 2
      app/Models/PM/PTopic.php
  26. 4 6
      app/Models/Page.php
  27. 1 2
      app/Models/Poll/Poll.php
  28. 1 2
      app/Models/Poll/Polls.php
  29. 5 5
      app/Models/Poll/Revision.php
  30. 1 2
      app/Models/Post/Post.php
  31. 1 2
      app/Models/Post/Posts.php
  32. 1 1
      app/Models/Post/View.php
  33. 1 2
      app/Models/Report/Report.php
  34. 1 2
      app/Models/Report/Reports.php
  35. 2 3
      app/Models/Rules.php
  36. 2 3
      app/Models/Rules/Profile.php
  37. 2 1
      app/Models/Search/ActionF.php
  38. 2 1
      app/Models/Search/ActionP.php
  39. 2 1
      app/Models/Search/ActionT.php
  40. 7 6
      app/Models/Search/Execute.php
  41. 1 2
      app/Models/Search/Search.php
  42. 1 2
      app/Models/SmileyList/SmileyList.php
  43. 1 2
      app/Models/Stats/Stats.php
  44. 1 2
      app/Models/StopwordList/StopwordList.php
  45. 8 20
      app/Models/Subscription/Subscription.php
  46. 3 4
      app/Models/Topic/Topic.php
  47. 1 2
      app/Models/Topic/Topics.php
  48. 1 1
      app/Models/Topic/View.php
  49. 3 3
      app/Models/User/Current.php
  50. 1 2
      app/Models/User/NormUsername.php
  51. 1 2
      app/Models/User/User.php
  52. 1 2
      app/Models/User/Users.php
  53. 1 1
      app/Models/Validators/Email.php
  54. 1 1
      app/Models/Validators/Username.php

+ 2 - 13
app/Models/Action.php

@@ -15,21 +15,10 @@ use ForkBB\Models\Manager;
 
 class Action
 {
-    /**
-     * Контейнер
-     * @var Container
-     */
-    protected $c;
-
-    /**
-     * Модель
-     * @var Manager
-     */
-    protected $manager;
+    protected Manager $manager;
 
-    public function __construct(Container $container)
+    public function __construct(protected Container $c)
     {
-        $this->c = $container;
     }
 
     /**

+ 1 - 2
app/Models/AdminList/AdminList.php

@@ -17,9 +17,8 @@ class AdminList extends Model
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'AdminList';
+    protected string $cKey = 'AdminList';
 
     /**
      * Загружает список id админов из кеша/БД

+ 1 - 2
app/Models/BBCodeList/BBCodeList.php

@@ -18,9 +18,8 @@ class BBCodeList extends Model
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'BBCodeList';
+    protected string $cKey = 'BBCodeList';
 
     public function __construct(string $file, Container $container)
     {

+ 5 - 6
app/Models/BBCodeList/Structure.php

@@ -24,9 +24,8 @@ class Structure extends Model
 
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'BBStructure';
+    protected string $cKey = 'BBStructure';
 
     public function __construct(Container $container)
     {
@@ -218,7 +217,7 @@ class Structure extends Model
         $this->setAttr('self_nesting', $value);
     }
 
-    protected function getBBAttr(string $name, array $fields) /* : mixed */
+    protected function getBBAttr(string $name, array $fields): mixed
     {
         if (empty($this->attrs[$name])) {
             return null;
@@ -254,7 +253,7 @@ class Structure extends Model
         }
     }
 
-    protected function setBBAttr(string $name, /* mixed */ $data, array $fields): void
+    protected function setBBAttr(string $name, mixed $data, array $fields): void
     {
         $attrs = $this->getAttr('attrs');
 
@@ -290,7 +289,7 @@ class Structure extends Model
         $this->setAttr('attrs', $attrs);
     }
 
-    protected function getno_attr() /* : mixed */
+    protected function getno_attr(): mixed
     {
         return $this->getBBAttr('No_attr', ['body_format', 'text_only']);
     }
@@ -300,7 +299,7 @@ class Structure extends Model
         $this->setBBAttr('No_attr', $value, ['body_format', 'text_only']);
     }
 
-    protected function getdef_attr() /* : mixed */
+    protected function getdef_attr(): mixed
     {
         return $this->getBBAttr('Def', ['required', 'format', 'body_format', 'text_only']);
     }

+ 1 - 2
app/Models/BanList/BanList.php

@@ -18,9 +18,8 @@ class BanList extends Model
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'BanList';
+    protected string $cKey = 'BanList';
 
     /**
      * Загружает список банов из кеша/БД

+ 2 - 4
app/Models/Category/Categories.php

@@ -19,15 +19,13 @@ class Categories extends Manager
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'Categories';
+    protected string $cKey = 'Categories';
 
     /**
      * Массив флагов измененных категорий
-     * @var array
      */
-    protected $modified = [];
+    protected array $modified = [];
 
     /**
      * Загрузка категорий из БД

+ 1 - 2
app/Models/Censorship/Censorship.php

@@ -17,9 +17,8 @@ class Censorship extends Model
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'Censorship';
+    protected string $cKey = 'Censorship';
 
     /**
      * Загружает список цензуры из кеша/БД

+ 1 - 2
app/Models/Config/Config.php

@@ -17,9 +17,8 @@ class Config extends DataModel
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'Config';
+    protected string $cKey = 'Config';
 
     /**
      * Заполняет модель данными из кеша/БД

+ 4 - 6
app/Models/Cookie/Cookie.php

@@ -21,15 +21,13 @@ class Cookie extends Model
 
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'Cookie';
+    protected string $cKey = 'Cookie';
 
     /**
      * Флаг запрета записи свойств
-     * @var bool
      */
-    protected $noSet = false;
+    protected bool $noSet = false;
 
     public function __construct(array $options, Container $container)
     {
@@ -86,7 +84,7 @@ class Cookie extends Model
     /**
      * Получает значение куки
      */
-    public function get(string $name, /* mixed */ $default = null) /* : mixed */
+    public function get(string $name, mixed $default = null): mixed
     {
         $name = $this->prefix . $name;
 
@@ -200,7 +198,7 @@ class Cookie extends Model
     /**
      * Устанавливает значение для свойства модели
      */
-    public function __set(string $name, /* mixed */ $val): void
+    public function __set(string $name, mixed $val): void
     {
         if ($this->noSet) {
             throw new RuntimeException('Model attributes in read-only mode');

+ 1 - 2
app/Models/DBMap/DBMap.php

@@ -17,9 +17,8 @@ class DBMap extends Model
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'DBMap';
+    protected string $cKey = 'DBMap';
 
     /**
      * Загружает карту БД из кеша/БД

+ 5 - 7
app/Models/DataModel.php

@@ -16,15 +16,13 @@ class DataModel extends Model
 {
     /**
      * Массив флагов измененных свойств модели
-     * @var array
      */
-    protected $zModFlags = [];
+    protected array $zModFlags = [];
 
     /**
      * Массив состояний отслеживания изменений в свойствах модели
-     * @var array
      */
-    protected $zTrackFlags = [];
+    protected array $zTrackFlags = [];
 
     /**
      * Устанавливает значения для свойств
@@ -92,7 +90,7 @@ class DataModel extends Model
     /**
      * Устанавливает значение для свойства
      */
-    public function __set(string $name, /* mixed */ $value): void
+    public function __set(string $name, mixed $value): void
     {
         // без отслеживания
         if (0 === \strpos($name, '__')) {
@@ -148,7 +146,7 @@ class DataModel extends Model
     /**
      * Возвращает значение свойства
      */
-    public function __get(string $name) /* : mixed */
+    public function __get(string $name): mixed
     {
         // без вычисления
         if (0 === \strpos($name, '__')) {
@@ -162,7 +160,7 @@ class DataModel extends Model
     /**
      * Удаляет свойство ????
      */
-    public function __unset(/* mixed */ $name): void
+    public function __unset(string $name): void
     {
         $this->zModFlags[$name] = false;
 

+ 1 - 2
app/Models/Forum/Forum.php

@@ -20,9 +20,8 @@ class Forum extends DataModel
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'Forum';
+    protected string $cKey = 'Forum';
 
     /**
      * Получение родительского раздела

+ 2 - 4
app/Models/Forum/Forums.php

@@ -19,15 +19,13 @@ class Forums extends Manager
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'Forums';
+    protected string $cKey = 'Forums';
 
     /**
      * Закешированные данные по разделам
-     * @var array
      */
-    protected $forumList = [];
+    protected array $forumList = [];
 
     /**
      * Создает новую модель раздела

+ 1 - 4
app/Models/Forum/Refresh.php

@@ -15,10 +15,7 @@ use ForkBB\Models\Group\Group;
 
 class Refresh extends Action
 {
-    /**
-     * @var array
-     */
-    protected $list = [];
+    protected array $list = [];
 
     /**
      * Возвращает список доступных разделов для группы

+ 1 - 2
app/Models/Group/Group.php

@@ -16,9 +16,8 @@ class Group extends DataModel
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'Group';
+    protected string $cKey = 'Group';
 
     /**
      * Ссылка на страницу редактирования

+ 2 - 4
app/Models/Group/Groups.php

@@ -17,15 +17,13 @@ class Groups extends Manager
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'Groups';
+    protected string $cKey = 'Groups';
 
     /**
      * Флаг загрузки групп
-     * @var bool
      */
-    protected $flag;
+    protected bool $flag = false;
 
     /**
      * Создает новую модель раздела

+ 1 - 4
app/Models/Group/Perm.php

@@ -18,10 +18,7 @@ use RuntimeException;
 
 class Perm extends Action
 {
-    /**
-     * @var array
-     */
-    protected $fields;
+    protected array $fields;
 
     /**
      * Получение таблицы разрешений для раздела

+ 8 - 19
app/Models/Manager.php

@@ -14,41 +14,30 @@ use ForkBB\Core\Container;
 
 class Manager
 {
-    /**
-     * Контейнер
-     * @var Container
-     */
-    protected $c;
-
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'unknown';
+    protected string $cKey = 'unknown';
 
-    /**
-     * @var array
-     */
-    protected $repository = [];
+    protected array $repository = [];
 
-    public function __construct(Container $container)
+    public function __construct(protected Container $c)
     {
-        $this->c = $container;
     }
 
-    public function get($key)
+    public function get(int|string $key)
     {
         return $this->repository[$key] ?? null;
     }
 
-    public function set($key, /* mixed */ $value): self
+    public function set(int|string $key, mixed $value): self
     {
         $this->repository[$key] = $value;
 
         return $this;
     }
 
-    public function isset($key): bool
+    public function isset(int|string $key): bool
     {
         return \array_key_exists($key, $this->repository);
     }
@@ -56,7 +45,7 @@ class Manager
     /**
      * Возвращает action по его имени
      */
-    public function __get(string $name) /* : mixed */
+    public function __get(string $name): mixed
     {
         $x = \ord($name);
 
@@ -72,7 +61,7 @@ class Manager
     /**
      * Выполняет подгружаемый метод при его наличии
      */
-    public function __call(string $name, array $args) /* : mixed */
+    public function __call(string $name, array $args): mixed
     {
         $key = $this->cKey . '/' . $name;
 

+ 2 - 13
app/Models/Method.php

@@ -15,21 +15,10 @@ use ForkBB\Models\Model;
 
 class Method
 {
-    /**
-     * Контейнер
-     * @var Container
-     */
-    protected $c;
-
-    /**
-     * Модель
-     * @var Model
-     */
-    protected $model;
+    protected Model $model;
 
-    public function __construct(Container $container)
+    public function __construct(protected Container $c)
     {
-        $this->c = $container;
     }
 
     /**

+ 13 - 24
app/Models/Model.php

@@ -14,45 +14,34 @@ use ForkBB\Core\Container;
 
 class Model
 {
-    /**
-     * Контейнер
-     * @var Container
-     */
-    protected $c;
-
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'unknown';
+    protected string $cKey = 'unknown';
 
     /**
      * Данные модели
-     * @var array
      */
-    protected $zAttrs = [];
+    protected array $zAttrs = [];
 
     /**
      * Вычисленные данные модели
-     * @var array
      */
-    protected $zAttrsCalc = [];
+    protected array $zAttrsCalc = [];
 
     /**
      * Зависимости свойств
-     * @var array
      */
-    protected $zDepend = [];
+    protected array $zDepend = [];
 
-    public function __construct(Container $container)
+    public function __construct(protected Container $c)
     {
-        $this->c = $container;
     }
 
     /**
      * Проверяет наличие свойства
      */
-    public function __isset(/* mixed */ $name): bool
+    public function __isset(string $name): bool
     {
         return \array_key_exists($name, $this->zAttrs)
             || \array_key_exists($name, $this->zAttrsCalc)
@@ -62,7 +51,7 @@ class Model
     /**
      * Удаляет свойство
      */
-    public function __unset(/* mixed */ $name): void
+    public function __unset(string $name): void
     {
         unset($this->zAttrs[$name]);
         $this->unsetCalc($name);
@@ -71,7 +60,7 @@ class Model
     /**
      * Удаляет вычисленные зависимые свойства
      */
-    protected function unsetCalc(/* mixed */ $name): void
+    protected function unsetCalc(string $name): void
     {
         unset($this->zAttrsCalc[$name]);
         unset($this->zAttrsCalc['censor' . \ucfirst($name)]);
@@ -84,7 +73,7 @@ class Model
     /**
      * Устанавливает значение для свойства
      */
-    public function __set(string $name, /* mixed */ $value): void
+    public function __set(string $name, mixed $value): void
     {
         $this->unsetCalc($name);
 
@@ -99,7 +88,7 @@ class Model
      * Устанавливает значение для свойства
      * Без вычислений, но со сбросом зависимых свойст и вычисленного значения
      */
-    public function setAttr(string $name, /* mixed */ $value): Model
+    public function setAttr(string $name, mixed $value): Model
     {
         $this->unsetCalc($name);
         $this->zAttrs[$name] = $value;
@@ -123,7 +112,7 @@ class Model
      * Возвращает значение свойства
      * Или возвращает внешний метод Models\Method
      */
-    public function __get(string $name) /* : mixed */
+    public function __get(string $name): mixed
     {
         if (\array_key_exists($name, $this->zAttrsCalc)) {
             return $this->zAttrsCalc[$name];
@@ -153,7 +142,7 @@ class Model
      * Возвращает значение свойства
      * Без вычислений
      */
-    public function getAttr(string $name, /* mixed */ $default = null) /* : mixed */
+    public function getAttr(string $name, mixed $default = null): mixed
     {
         return \array_key_exists($name, $this->zAttrs) ? $this->zAttrs[$name] : $default;
     }
@@ -161,7 +150,7 @@ class Model
     /**
      * Выполняет подгружаемый метод при его наличии
      */
-    public function __call(string $name, array $args) /* : mixed */
+    public function __call(string $name, array $args): mixed
     {
         $key = $this->cKey . '/' . $name;
 

+ 4 - 6
app/Models/Online/Online.php

@@ -19,18 +19,16 @@ class Online extends Model
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'Online';
+    protected string $cKey = 'Online';
 
-    protected $visits = [];
-    protected $online = [];
+    protected array $visits = [];
+    protected array $online = [];
 
     /**
      * Флаг выполнения
-     * @var int
      */
-    protected $done = 0;
+    protected int $done = 0;
 
     protected function isReady(): void
     {

+ 4 - 9
app/Models/PM/PBlock.php

@@ -21,20 +21,15 @@ class PBlock extends Model
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'PBlock';
-
-    /**
-     * @var array
-     */
-    protected $repository;
+    protected string $cKey = 'PBlock';
 
     /**
      * Текущий пользователь установленный в методе init()
-     * @var User
      */
-    protected $user;
+    protected User $user;
+
+    protected array $repository;
 
     public function __construct(Container $container)
     {

+ 4 - 8
app/Models/PM/PM.php

@@ -25,14 +25,10 @@ class PM extends Model
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'PMS';
+    protected string $cKey = 'PMS';
 
-    /**
-     * @var array
-     */
-    protected $repository;
+    protected array $repository;
 
     public function __construct(Container $container)
     {
@@ -232,7 +228,7 @@ class PM extends Model
      * Инициализирует число приватных тем без фильтра
      * Может использовать фильтр по второму пользователю: id или "username" (именно в кавычках)
      */
-    public function init(/* null|int|string */ $second = null): self
+    public function init(int|string|null $second = null): self
     {
         list(
             $this->idsNew,
@@ -254,7 +250,7 @@ class PM extends Model
     /**
      * Возвращает данные по приватным темам (индексы) любого пользователя
      */
-    public function infoForUser(User $user, /* null|int|string */ $second = null): array
+    public function infoForUser(User $user, int|string|null $second = null): array
     {
         // deleted      // pt_status = PT_DELETED
         // unsent       // pt_status = PT_NOTSENT

+ 1 - 2
app/Models/PM/PPost.php

@@ -22,9 +22,8 @@ class PPost extends DataModel
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'PPost';
+    protected string $cKey = 'PPost';
 
     public function __construct(Container $container)
     {

+ 1 - 2
app/Models/PM/PTopic.php

@@ -21,9 +21,8 @@ class PTopic extends DataModel
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'PTopic';
+    protected string $cKey = 'PTopic';
 
     public function __construct(Container $container)
     {

+ 4 - 6
app/Models/Page.php

@@ -29,15 +29,13 @@ abstract class Page extends Model
 
     /**
      * Заголовки страницы
-     * @var array
      */
-    protected $pageHeaders = [];
+    protected array $pageHeaders = [];
 
     /**
      * Http заголовки
-     * @var array
      */
-    protected $httpHeaders = [];
+    protected array $httpHeaders = [];
 
     public function __construct(Container $container)
     {
@@ -311,7 +309,7 @@ abstract class Page extends Model
     /**
      * Задает/получает заголовок страницы
      */
-    public function pageHeader(string $name, string $type, int $weight = 0, array $values = null) /* : mixed */
+    public function pageHeader(string $name, string $type, int $weight = 0, array $values = null): mixed
     {
         if (null === $values) {
             return $this->pageHeaders["{$name}_{$type}"] ?? null;
@@ -434,7 +432,7 @@ abstract class Page extends Model
      * Дописывает в массив титула страницы новый элемент
      * $this->titles = ...
      */
-    public function settitles(/* string|array */ $value): void
+    public function settitles(string|array $value): void
     {
         $attr = $this->getAttr('titles', []);
         $attr[] = $value;

+ 1 - 2
app/Models/Poll/Poll.php

@@ -23,9 +23,8 @@ class Poll extends DataModel
 
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'Poll';
+    protected string $cKey = 'Poll';
 
     /**
      * Возвращает родительскую тему

+ 1 - 2
app/Models/Poll/Polls.php

@@ -18,9 +18,8 @@ class Polls extends Manager
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'Polls';
+    protected string $cKey = 'Polls';
 
     /**
      * Создает новый опрос

+ 5 - 5
app/Models/Poll/Revision.php

@@ -17,15 +17,15 @@ use function \ForkBB\__;
 
 class Revision extends Action
 {
-    protected $error;
-    protected $question;
-    protected $answer;
-    protected $type;
+    protected ?string $error;
+    protected array $question;
+    protected array $answer;
+    protected array $type;
 
     /**
      * Проверяет/нормализует опрос
      */
-    public function revision(Poll $poll, bool $normalize = false) /* : true|string */
+    public function revision(Poll $poll, bool $normalize = false): string|true
     {
         $this->error    = null;
         $this->question = [];

+ 1 - 2
app/Models/Post/Post.php

@@ -20,9 +20,8 @@ class Post extends DataModel
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'Post';
+    protected string $cKey = 'Post';
 
     /**
      * Получение родительской темы

+ 1 - 2
app/Models/Post/Posts.php

@@ -17,9 +17,8 @@ class Posts extends Manager
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'Posts';
+    protected string $cKey = 'Posts';
 
     /**
      * Создает новую модель сообщения

+ 1 - 1
app/Models/Post/View.php

@@ -23,7 +23,7 @@ class View extends Action
     /**
      * Возвращает список сообщений
      */
-    public function view(/* mixed */ $arg, bool $review = false): array
+    public function view(mixed $arg, bool $review = false): array
     {
         if (
             ! $arg instanceof Topic

+ 1 - 2
app/Models/Report/Report.php

@@ -19,9 +19,8 @@ class Report extends DataModel
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'Report';
+    protected string $cKey = 'Report';
 
     /**
      * Устанавливает автора

+ 1 - 2
app/Models/Report/Reports.php

@@ -19,9 +19,8 @@ class Reports extends Manager
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'Reports';
+    protected string $cKey = 'Reports';
 
     /**
      * Создает новую модель сигнала

+ 2 - 3
app/Models/Rules.php

@@ -17,14 +17,13 @@ class Rules extends Model
 {
     /**
      * Флаг готовности
-     * @var bool
      */
-    protected $ready = false;
+    protected bool $ready = false;
 
     /**
      * Возвращает значение свойства
      */
-    public function __get(string $name) /* : mixed */
+    public function __get(string $name): mixed
     {
         if (true === $this->ready) {
             return parent::__get($name);

+ 2 - 3
app/Models/Rules/Profile.php

@@ -16,9 +16,8 @@ use ForkBB\Models\User\User;
 
 class Profile extends Rules
 {
-    protected $curUser;
-
-    protected $user;
+    protected User $curUser;
+    protected User $user;
 
     /**
      * Задает профиль пользователя для применения правил

+ 2 - 1
app/Models/Search/ActionF.php

@@ -20,9 +20,10 @@ class ActionF extends Method
     /**
      * Поисковые действия по разделам (подписка на разделы)
      */
-    public function actionF(string $action, Forum $root, int $uid = null) /* : array|false */
+    public function actionF(string $action, Forum $root, int $uid = null): array|false
     {
         $forums = \array_keys($root->descendants);
+
         if ($root->id) {
             $forums[] = $root->id;
         }

+ 2 - 1
app/Models/Search/ActionP.php

@@ -20,9 +20,10 @@ class ActionP extends Method
     /**
      * Поисковые действия по сообщениям
      */
-    public function actionP(string $action, Forum $root, int $uid = null) /* : array|false */
+    public function actionP(string $action, Forum $root, int $uid = null): array|false
     {
         $forums = \array_keys($root->descendants);
+
         if ($root->id) {
             $forums[] = $root->id;
         }

+ 2 - 1
app/Models/Search/ActionT.php

@@ -20,9 +20,10 @@ class ActionT extends Method
     /**
      * Поисковые действия по темам
      */
-    public function actionT(string $action, Forum $root, int $uid = null) /* : array|false */
+    public function actionT(string $action, Forum $root, int $uid = null): array|false
     {
         $forums = \array_keys($root->descendants);
+
         if ($root->id) {
             $forums[] = $root->id;
         }

+ 7 - 6
app/Models/Search/Execute.php

@@ -15,16 +15,17 @@ use ForkBB\Models\Method;
 use ForkBB\Models\Forum\Forum;
 use ForkBB\Models\Post\Post;
 use PDO;
+use PDOStatement;
 use RuntimeException;
 
 class Execute extends Method
 {
-    protected $queryIdx;
-    protected $queryCJK;
-    protected $sortType;
-    protected $words;
-    protected $stmtIdx;
-    protected $stmtCJK;
+    protected string $queryIdx;
+    protected string $queryCJK;
+    protected int $sortType;
+    protected array $words;
+    protected ?PDOStatement $stmtIdx;
+    protected ?PDOStatement $stmtCJK;
 
     /**
      * Поиск тем/сообщений в соответствии с поисковым запросом

+ 1 - 2
app/Models/Search/Search.php

@@ -40,9 +40,8 @@ class Search extends Model
 
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'Search';
+    protected string $cKey = 'Search';
 
     /**
      * Ссылка на результат поиска

+ 1 - 2
app/Models/SmileyList/SmileyList.php

@@ -17,9 +17,8 @@ class SmileyList extends Model
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'SmileyList';
+    protected string $cKey = 'SmileyList';
 
     /**
      * Загружает список смайлов из кеша/БД

+ 1 - 2
app/Models/Stats/Stats.php

@@ -18,9 +18,8 @@ class Stats extends Model
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'Stats';
+    protected string $cKey = 'Stats';
 
     /**
      * Загружает статистику из кеша/БД

+ 1 - 2
app/Models/StopwordList/StopwordList.php

@@ -17,9 +17,8 @@ class StopwordList extends Model
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'StopwordList';
+    protected string $cKey = 'StopwordList';
 
     /**
      * Загружает список игнорируемых при индексации слов из кеша/БД

+ 8 - 20
app/Models/Subscription/Subscription.php

@@ -20,26 +20,18 @@ use InvalidArgumentException;
 
 class Subscription extends Model
 {
-    /**
-     * Ключ модели для контейнера
-     * @var string
-     */
-    protected $cKey = 'Subscription';
-
-    /**
-     * @var array
-     */
-    protected $forums;
+    const FORUMS_DATA = 1;
+    const TOPICS_DATA = 2;
+    const ALL_DATA    = 3;
 
     /**
-     * @var array
+     * Ключ модели для контейнера
      */
-    protected $topics;
+    protected string $cKey = 'Subscription';
 
-    /**
-     * @var array
-     */
-    protected $users;
+    protected array $forums;
+    protected array $topics;
+    protected array $users;
 
     /**
      * Проверяет список моделей на форумы/темы
@@ -199,10 +191,6 @@ class Subscription extends Model
         return true;
     }
 
-    const FORUMS_DATA = 1;
-    const TOPICS_DATA = 2;
-    const ALL_DATA    = 3;
-
     /**
      * Возвращает информацию по подпискам
      */

+ 3 - 4
app/Models/Topic/Topic.php

@@ -21,9 +21,8 @@ class Topic extends DataModel
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'Topic';
+    protected string $cKey = 'Topic';
 
     /**
      * Получение родительского раздела
@@ -197,7 +196,7 @@ class Topic extends DataModel
     /**
      * Статус наличия новых сообщений в теме
      */
-    protected function gethasNew() /* : int|false */
+    protected function gethasNew(): int|false
     {
         if (
             $this->c->user->isGuest
@@ -219,7 +218,7 @@ class Topic extends DataModel
     /**
      * Статус наличия непрочитанных сообщений в теме
      */
-    protected function gethasUnread() /* int|false */
+    protected function gethasUnread(): int|false
     {
         if (
             $this->c->user->isGuest

+ 1 - 2
app/Models/Topic/Topics.php

@@ -17,9 +17,8 @@ class Topics extends Manager
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'Topics';
+    protected string $cKey = 'Topics';
 
     /**
      * Создает новую модель темы

+ 1 - 1
app/Models/Topic/View.php

@@ -23,7 +23,7 @@ class View extends Action
     /**
      * Возвращает список тем
      */
-    public function view(/* mixed */ $arg): array
+    public function view(mixed $arg): array
     {
         if ($arg instanceof Forum) {
             $full = false;

+ 3 - 3
app/Models/User/Current.php

@@ -115,8 +115,8 @@ class Current extends Action
         return \trim($this->c->Secury->replInvalidChars($_SERVER['HTTP_USER_AGENT'] ?? ''));
     }
 
-    protected $defRegex = '%(?:^|[ ()])\b([\w .-]*{}[\w/.!-]*)%i';
-    protected $botSearchList = [
+    protected string $defRegex = '%(?:^|[ ()])\b([\w .-]*{}[\w/.!-]*)%i';
+    protected array $botSearchList = [
         'bot'        => ['%(?<!cu)bot(?!tle)%'],
         'crawl'      => [''],
         'spider'     => ['%spider(?![\w ]*build/)%'],
@@ -129,7 +129,7 @@ class Current extends Action
      * Пытается по юзерагентуопределить робота
      * Если робот, то возвращает вычисленное имя
      */
-    protected function isBot(string $agent) /* : string|false */
+    protected function isBot(string $agent): string|false
     {
         if ('' == $agent) {
             return false;

+ 1 - 2
app/Models/User/NormUsername.php

@@ -16,9 +16,8 @@ class NormUsername extends Action
 {
     /**
      * https://www.unicode.org/Public/security/latest/confusables.txt
-     * @var array
      */
-    protected $confusables = [
+    protected array $confusables = [
         "\u{05AD}" => "\u{0596}",
         "\u{05AE}" => "\u{0598}",
         "\u{05A8}" => "\u{0599}",

+ 1 - 2
app/Models/User/User.php

@@ -22,9 +22,8 @@ class User extends DataModel
 {
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'User';
+    protected string $cKey = 'User';
 
     public function __construct(Container $container)
     {

+ 1 - 2
app/Models/User/Users.php

@@ -20,9 +20,8 @@ class Users extends Manager
 
     /**
      * Ключ модели для контейнера
-     * @var string
      */
-    protected $cKey = 'Users';
+    protected string $cKey = 'Users';
 
     /**
      * Создает новую модель пользователя

+ 1 - 1
app/Models/Validators/Email.php

@@ -19,7 +19,7 @@ class Email extends RulesValidator
     /**
      * Проверяет email
      */
-    public function email(Validator $v, string $email, string $attrs, /* mixed */ $originalUser): ?string
+    public function email(Validator $v, string $email, string $attrs, mixed $originalUser): ?string
     {
         // поле отсутствует
         if ($v->noValue($email)) {

+ 1 - 1
app/Models/Validators/Username.php

@@ -19,7 +19,7 @@ class Username extends RulesValidator
     /**
      * Проверяет имя пользователя
      */
-    public function username(Validator $v, string $username, /* mixed */  $attrs, /* mixed */ $originalUser): string
+    public function username(Validator $v, string $username, mixed  $attrs, mixed $originalUser): string
     {
         if ($originalUser instanceof User) {
             $id   = $originalUser->id;