From 95ddffba30b1c63018b6afd2f540060c2cd81897 Mon Sep 17 00:00:00 2001 From: mirzaev Date: Thu, 4 Jan 2024 04:08:44 +0700 Subject: [PATCH] fix postfix public --- mirzaev/minimal/system/controller.php | 4 +--- mirzaev/minimal/system/model.php | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/mirzaev/minimal/system/controller.php b/mirzaev/minimal/system/controller.php index 069df9a..a393e07 100755 --- a/mirzaev/minimal/system/controller.php +++ b/mirzaev/minimal/system/controller.php @@ -21,7 +21,7 @@ class controller /** * Постфикс */ - private const POSTFIX = '_controller'; + public const POSTFIX = '_controller'; /** * Инстанция модели @@ -51,7 +51,6 @@ class controller public function __set(string $name, mixed $value = null): void { match ($name) { - 'POSTFIX' => throw new exception('Запрещено реинициализировать постфикс ($this::POSTFIX)', 500), 'model' => (function () use ($value) { if ($this->__isset('model')) throw new exception('Запрещено реинициализировать свойство с инстанцией модели ($this->model)', 500); else { @@ -84,7 +83,6 @@ class controller public function __get(string $name): mixed { return match ($name) { - 'POSTFIX' => $this::POSTFIX ?? throw new exception("Свойство \"POSTFIX\" не инициализировано", 500), 'model' => $this->model ?? throw new exception("Свойство \"\$model\" не инициализировано", 500), 'view' => $this->view ?? throw new exception("Свойство \"\$view\" не инициализировано", 500), default => throw new exception("Свойство \"\$$name\" не обнаружено", 404) diff --git a/mirzaev/minimal/system/model.php b/mirzaev/minimal/system/model.php index e2ac6ab..c19a65d 100755 --- a/mirzaev/minimal/system/model.php +++ b/mirzaev/minimal/system/model.php @@ -18,7 +18,7 @@ class model /** * Постфикс */ - private const POSTFIX = '_model'; + public const POSTFIX = '_model'; /** * Конструктор @@ -38,7 +38,6 @@ class model public function __set(string $name, mixed $value = null): void { match ($name) { - 'POSTFIX' => throw new exception('Запрещено реинициализировать постфикс ($this::POSTFIX)', 500), default => throw new exception("Свойство \"\$$name\" не найдено", 404) }; } @@ -53,7 +52,6 @@ class model public function __get(string $name): mixed { return match ($name) { - 'POSTFIX' => $this::POSTFIX ?? throw new exception("Свойство \"POSTFIX\" не инициализировано", 500), default => throw new exception("Свойство \"\$$name\" не обнаружено", 404) }; }