Skip to content

Commit c78caad

Browse files
authored
Merge pull request #877 from kenjis/remove-old-code-for-CI-4.2
refactor: remove outdated code for CI 4.2 or before
2 parents 70e49c5 + a7481fc commit c78caad

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

src/Commands/Generators/UserModelGenerator.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ public function run(array $params): int
7373

7474
$params[0] = $class;
7575

76-
// @TODO execute() is deprecated in CI v4.3.0.
77-
$this->execute($params); // @phpstan-ignore-line suppress deprecated error.
76+
$this->generateClass($params);
7877

7978
return 0;
8079
}

src/Models/CheckQueryReturnTrait.php

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ protected function checkQueryReturn($return): void
3232

3333
protected function checkValidationError(): void
3434
{
35-
$validationErrors = $this->getValidationErrors();
35+
$validationErrors = $this->validation->getErrors();
3636

3737
if ($validationErrors !== []) {
3838
$message = 'Validation error:';
@@ -45,27 +45,6 @@ protected function checkValidationError(): void
4545
}
4646
}
4747

48-
/**
49-
* Gets real validation errors that are not saved in the Session.
50-
*
51-
* @return string[]
52-
*/
53-
protected function getValidationErrors(): array
54-
{
55-
// @TODO When CI v4.3 is released, you don't need this hack.
56-
// See https://github.com/codeigniter4/CodeIgniter4/pull/6384
57-
return $this->getValidationPropertyErrors();
58-
}
59-
60-
protected function getValidationPropertyErrors(): array
61-
{
62-
$refClass = new ReflectionObject($this->validation);
63-
$refProperty = $refClass->getProperty('errors');
64-
$refProperty->setAccessible(true);
65-
66-
return $refProperty->getValue($this->validation);
67-
}
68-
6948
protected function disableDBDebug(): void
7049
{
7150
if (! $this->db->DBDebug) {

0 commit comments

Comments
 (0)