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

codeigniter4 / shield / 13173436689

06 Feb 2025 06:54AM UTC coverage: 92.833%. First build
13173436689

Pull #1243

github

web-flow
Merge 0ec620e68 into 492365d93
Pull Request #1243: chore: update dependencies to support PHP 8.1 - 8.4

83 of 96 new or added lines in 23 files covered. (86.46%)

2785 of 3000 relevant lines covered (92.83%)

147.04 hits per line

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

0.0
/src/Commands/Utils/InputOutput.php
1
<?php
2

3
declare(strict_types=1);
4

5
/**
6
 * This file is part of CodeIgniter Shield.
7
 *
8
 * (c) CodeIgniter Foundation <admin@codeigniter.com>
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 CodeIgniter\Shield\Commands\Utils;
15

16
use CodeIgniter\CLI\CLI;
17

18
class InputOutput
19
{
20
    /**
21
     * Asks the user for input.
22
     *
23
     * @param string       $field      Output "field" question
24
     * @param array|string $options    String to a default value, array to a list of options (the first option will be the default value)
25
     * @param array|string $validation Validation rules
26
     *
27
     * @return string The user input
28
     */
29
    public function prompt(string $field, $options = null, $validation = null): string
30
    {
31
        return CLI::prompt($field, $options, $validation);
×
32
    }
33

34
    /**
35
     * Outputs a string to the cli on its own line.
36
     */
37
    public function write(
38
        string $text = '',
39
        ?string $foreground = null,
40
        ?string $background = null,
41
    ): void {
42
        CLI::write($text, $foreground, $background);
×
43
    }
44

45
    /**
46
     * Outputs an error to the CLI using STDERR instead of STDOUT
47
     */
48
    public function error(string $text, string $foreground = 'light_red', ?string $background = null): void
49
    {
50
        CLI::error($text, $foreground, $background);
×
51
    }
52
}
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

© 2025 Coveralls, Inc