• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

daycry / auth / 22527357078

28 Feb 2026 07:22PM UTC coverage: 63.267% (+0.7%) from 62.568%
22527357078

push

github

daycry
Remove PHP 8.1 from PHPUnit CI matrix

Update .github/workflows/phpunit.yml to drop PHP 8.1 from the test matrix. CI will now run PHPUnit only on PHP 8.2 and 8.3, reducing the matrix to current supported versions.

3064 of 4843 relevant lines covered (63.27%)

41.52 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Traits/Validation.php
1
<?php
2

3
declare(strict_types=1);
4

5
/**
6
 * This file is part of Daycry Auth.
7
 *
8
 * (c) Daycry <daycry9@proton.me>
9
 *
10
 * For the full copyright and license information, please view
11
 * the LICENSE file that was distributed with this source code.
12
 */
13

14
namespace Daycry\Auth\Traits;
15

16
use CodeIgniter\Validation\ValidationInterface;
17
use Config\Services;
18
use Config\Validation as ValidationConfig;
19
use Daycry\Auth\Exceptions\ValidationException;
20

21
trait Validation
22
{
23
    /**
24
     * Once validation has been run, will hold the Validation instance.
25
     *
26
     * @var ValidationInterface|null
27
     */
28
    protected $validator;
29

30
    protected function dataValidation(array|string $rules, array|object $data, ?ValidationConfig $config = null, bool $getShared = true, ?string $dbGroup = null): array
×
31
    {
32
        $config ??= config('Validation');
×
33

34
        $this->validator = Services::validation($config, $getShared);
×
35

36
        return $this->runValidate($rules, $data, $dbGroup);
×
37
    }
38

39
    protected function requestValidation(array|string $rules, ?ValidationConfig $config = null, bool $getShared = true, ?string $dbGroup = null): array
×
40
    {
41
        $config ??= config('Validation');
×
42

43
        $this->validator = Services::validation($config, $getShared)->withRequest(Services::request());
×
44

45
        return $this->runValidate($rules, null, $dbGroup);
×
46
    }
47

48
    private function runValidate(array|string $rules, array|object|null $data = null, ?string $dbGroup = null)
×
49
    {
50
        if ($data !== null && is_object($data)) {
×
51
            $data = get_object_vars($data);
×
52
        }
53

54
        if (is_string($rules)) {
×
55
            $this->validator->setRuleGroup($rules);
×
56
        } else {
57
            $this->validator->setRules($rules);
×
58
        }
59

60
        if (! $this->validator->run($data, null, $dbGroup)) {
×
61
            throw ValidationException::validationData();
×
62
        }
63

64
        return $this->validator->getValidated();
×
65
    }
66
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc