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

tempestphp / tempest-framework / 14024978163

23 Mar 2025 05:55PM UTC coverage: 79.391% (-0.05%) from 79.441%
14024978163

push

github

web-flow
feat(view): cache Blade and Twig templates in internal storage (#1061)

2 of 2 new or added lines in 2 files covered. (100.0%)

912 existing lines in 110 files now uncovered.

10478 of 13198 relevant lines covered (79.39%)

91.09 hits per line

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

42.86
/src/Tempest/Console/src/HasConsole.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\Console;
6

7
use Closure;
8
use Stringable;
9
use Symfony\Component\Process\Process;
10
use Tempest\Container\Inject;
11
use UnitEnum;
12

13
trait HasConsole
14
{
15
    #[Inject]
16
    private readonly Console $console;
17

UNCOV
18
    public function readln(): string
×
19
    {
20
        return $this->console->readln();
×
21
    }
22

UNCOV
23
    public function read(int $bytes): string
×
24
    {
25
        return $this->console->read($bytes);
×
26
    }
27

UNCOV
28
    public function write(string $contents): self
×
29
    {
UNCOV
30
        $this->console->write($contents);
×
31

UNCOV
32
        return $this;
×
33
    }
34

35
    public function writeln(string $line = ''): self
12✔
36
    {
37
        $this->console->writeln($line);
12✔
38

39
        return $this;
12✔
40
    }
41

42
    /**
43
     * @param mixed|null $default
44
     * @param \Tempest\Validation\Rule[] $validation
45
     */
46
    public function ask(
1✔
47
        string $question,
48
        null|iterable|string $options = null,
49
        mixed $default = null,
50
        bool $multiple = false,
51
        bool $multiline = false,
52
        ?string $placeholder = null,
53
        ?string $hint = null,
54
        array $validation = [],
55
    ): null|int|string|Stringable|UnitEnum|array {
56
        return $this->console->ask(
1✔
57
            question: $question,
1✔
58
            options: $options,
1✔
59
            default: $default,
1✔
60
            multiple: $multiple,
1✔
61
            multiline: $multiline,
1✔
62
            placeholder: $placeholder,
1✔
63
            hint: $hint,
1✔
64
            validation: $validation,
1✔
65
        );
1✔
66
    }
67

68
    public function confirm(
6✔
69
        string $question,
70
        bool $default = false,
71
        ?string $yes = null,
72
        ?string $no = null,
73
    ): bool {
74
        return $this->console->confirm(
6✔
75
            question: $question,
6✔
76
            default: $default,
6✔
77
            yes: $yes,
6✔
78
            no: $no,
6✔
79
        );
6✔
80
    }
81

82
    public function password(string $label = 'Password', bool $confirm = false, array $validation = []): string
×
83
    {
UNCOV
84
        return $this->console->password(
×
UNCOV
85
            label: $label,
×
UNCOV
86
            confirm: $confirm,
×
UNCOV
87
            validation: $validation,
×
88
        );
×
89
    }
90

91
    public function progressBar(iterable $data, Closure $handler): array
×
92
    {
93
        return $this->console->progressBar(
×
UNCOV
94
            data: $data,
×
UNCOV
95
            handler: $handler,
×
UNCOV
96
        );
×
97
    }
98

99
    /**
100
     * @param Closure(string $search): array $search
101
     */
UNCOV
102
    public function search(string $label, Closure $search, bool $multiple = false, null|string|array $default = null): mixed
×
103
    {
UNCOV
104
        return $this->console->search(
×
105
            label: $label,
×
UNCOV
106
            search: $search,
×
107
            multiple: $multiple,
×
UNCOV
108
            default: $default,
×
UNCOV
109
        );
×
110
    }
111

112
    public function info(string $contents, ?string $title = null): self
2✔
113
    {
114
        $this->console->info($contents, $title);
2✔
115

116
        return $this;
2✔
117
    }
118

UNCOV
119
    public function error(string $contents, ?string $title = null): self
×
120
    {
UNCOV
121
        $this->console->error($contents, $title);
×
122

UNCOV
123
        return $this;
×
124
    }
125

UNCOV
126
    public function warning(string $contents, ?string $title = null): self
×
127
    {
UNCOV
128
        $this->console->warning($contents, $title);
×
129

UNCOV
130
        return $this;
×
131
    }
132

133
    public function success(string $contents, ?string $title = null): self
12✔
134
    {
135
        $this->console->success($contents, $title);
12✔
136

137
        return $this;
12✔
138
    }
139

UNCOV
140
    public function keyValue(string $key, ?string $value = null): self
×
141
    {
UNCOV
142
        $this->console->keyValue($key, $value);
×
143

UNCOV
144
        return $this;
×
145
    }
146

UNCOV
147
    public function task(string $label, null|Process|Closure $handler): bool
×
148
    {
UNCOV
149
        return $this->console->task($label, $handler);
×
150
    }
151
}
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