Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/Commands/Generators/UserModelGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
23 changes: 1 addition & 22 deletions src/Models/CheckQueryReturnTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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:';
Expand All @@ -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) {
Expand Down