Compare commits
	
		
			1 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 24fe47f1e7 | 
@@ -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
 | 
					  public function __set(string $name, mixed $value = null): void
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    match ($name) {
 | 
					    match ($name) {
 | 
				
			||||||
      'POSTFIX' => throw new exception('Запрещено реинициализировать постфикс ($this::POSTFIX)', 500),
 | 
					 | 
				
			||||||
      'model' => (function () use ($value) {
 | 
					      'model' => (function () use ($value) {
 | 
				
			||||||
        if ($this->__isset('model')) throw new exception('Запрещено реинициализировать свойство с инстанцией модели ($this->model)', 500);
 | 
					        if ($this->__isset('model')) throw new exception('Запрещено реинициализировать свойство с инстанцией модели ($this->model)', 500);
 | 
				
			||||||
        else {
 | 
					        else {
 | 
				
			||||||
@@ -84,7 +83,6 @@ class controller
 | 
				
			|||||||
  public function __get(string $name): mixed
 | 
					  public function __get(string $name): mixed
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    return match ($name) {
 | 
					    return match ($name) {
 | 
				
			||||||
      'POSTFIX' => $this::POSTFIX ?? throw new exception("Свойство \"POSTFIX\" не инициализировано", 500),
 | 
					 | 
				
			||||||
      'model' => $this->model ?? throw new exception("Свойство \"\$model\" не инициализировано", 500),
 | 
					      'model' => $this->model ?? throw new exception("Свойство \"\$model\" не инициализировано", 500),
 | 
				
			||||||
      'view' => $this->view ?? throw new exception("Свойство \"\$view\" не инициализировано", 500),
 | 
					      'view' => $this->view ?? throw new exception("Свойство \"\$view\" не инициализировано", 500),
 | 
				
			||||||
      default => throw new exception("Свойство \"\$$name\" не обнаружено", 404)
 | 
					      default => throw new exception("Свойство \"\$$name\" не обнаружено", 404)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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
 | 
					  public function __set(string $name, mixed $value = null): void
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    match ($name) {
 | 
					    match ($name) {
 | 
				
			||||||
      'POSTFIX' => throw new exception('Запрещено реинициализировать постфикс ($this::POSTFIX)', 500),
 | 
					 | 
				
			||||||
      default => throw new exception("Свойство \"\$$name\" не найдено", 404)
 | 
					      default => throw new exception("Свойство \"\$$name\" не найдено", 404)
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@@ -53,7 +52,6 @@ class model
 | 
				
			|||||||
  public function __get(string $name): mixed
 | 
					  public function __get(string $name): mixed
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    return match ($name) {
 | 
					    return match ($name) {
 | 
				
			||||||
      'POSTFIX' => $this::POSTFIX ?? throw new exception("Свойство \"POSTFIX\" не инициализировано", 500),
 | 
					 | 
				
			||||||
      default => throw new exception("Свойство \"\$$name\" не обнаружено", 404)
 | 
					      default => throw new exception("Свойство \"\$$name\" не обнаружено", 404)
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user