diff --git a/src/Commands/Generators/UserModelGenerator.php b/src/Commands/Generators/UserModelGenerator.php index 2e9680aa7..3a9b63590 100644 --- a/src/Commands/Generators/UserModelGenerator.php +++ b/src/Commands/Generators/UserModelGenerator.php @@ -73,8 +73,7 @@ public function run(array $params): int $params[0] = $class; - // @TODO execute() is deprecated in CI v4.3.0. - $this->execute($params); // @phpstan-ignore-line suppress deprecated error. + $this->generateClass($params); return 0; } diff --git a/src/Models/CheckQueryReturnTrait.php b/src/Models/CheckQueryReturnTrait.php index 2c21441b1..687d7da96 100644 --- a/src/Models/CheckQueryReturnTrait.php +++ b/src/Models/CheckQueryReturnTrait.php @@ -32,7 +32,7 @@ protected function checkQueryReturn($return): void protected function checkValidationError(): void { - $validationErrors = $this->getValidationErrors(); + $validationErrors = $this->validation->getErrors(); if ($validationErrors !== []) { $message = 'Validation error:'; @@ -45,27 +45,6 @@ protected function checkValidationError(): void } } - /** - * Gets real validation errors that are not saved in the Session. - * - * @return string[] - */ - protected function getValidationErrors(): array - { - // @TODO When CI v4.3 is released, you don't need this hack. - // See https://github.com/codeigniter4/CodeIgniter4/pull/6384 - return $this->getValidationPropertyErrors(); - } - - protected function getValidationPropertyErrors(): array - { - $refClass = new ReflectionObject($this->validation); - $refProperty = $refClass->getProperty('errors'); - $refProperty->setAccessible(true); - - return $refProperty->getValue($this->validation); - } - protected function disableDBDebug(): void { if (! $this->db->DBDebug) {