• 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

81.25
/src/Commands/BaseCommand.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\Commands;
15

16
use CodeIgniter\CLI\BaseCommand as FrameworkBaseCommand;
17
use CodeIgniter\CLI\Commands;
18
use Daycry\Auth\Commands\Utils\InputOutput;
19
use Psr\Log\LoggerInterface;
20

21
abstract class BaseCommand extends FrameworkBaseCommand
22
{
23
    protected static ?InputOutput $io = null;
24

25
    /**
26
     * The group the command is lumped under
27
     * when listing commands.
28
     *
29
     * @var string
30
     */
31
    protected $group = 'Auth';
32

33
    public function __construct(LoggerInterface $logger, Commands $commands)
24✔
34
    {
35
        parent::__construct($logger, $commands);
24✔
36

37
        $this->ensureInputOutput();
24✔
38
    }
39

40
    /**
41
     * Asks the user for input.
42
     *
43
     * @param string       $field      Output "field" question
44
     * @param array|string $options    String to a default value, array to a list of options (the first option will be the default value)
45
     * @param array|string $validation Validation rules
46
     *
47
     * @return string The user input
48
     */
49
    protected function prompt(string $field, $options = null, $validation = null, ?string $DBGroup = null): string
16✔
50
    {
51
        return self::$io->prompt($field, $options, $validation, $DBGroup);
16✔
52
    }
53

54
    /**
55
     * Outputs a string to the cli on its own line.
56
     */
57
    protected function write(
24✔
58
        string $text = '',
59
        ?string $foreground = null,
60
        ?string $background = null,
61
    ): void {
62
        self::$io->write($text, $foreground, $background);
24✔
63
    }
64

65
    /**
66
     * Outputs an error to the CLI using STDERR instead of STDOUT
67
     */
68
    protected function error(
×
69
        string $text,
70
        string $foreground = 'light_red',
71
        ?string $background = null,
72
    ): void {
73
        self::$io->error($text, $foreground, $background);
×
74
    }
75

76
    protected function ensureInputOutput(): void
24✔
77
    {
78
        if (self::$io === null) {
24✔
79
            self::$io = new InputOutput();
×
80
        }
81
    }
82

83
    /**
84
     * @internal Testing purpose only
85
     */
86
    public static function setInputOutput(InputOutput $io): void
24✔
87
    {
88
        self::$io = $io;
24✔
89
    }
90

91
    /**
92
     * @internal Testing purpose only
93
     */
94
    public static function resetInputOutput(): void
24✔
95
    {
96
        self::$io = null;
24✔
97
    }
98
}
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