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

tempestphp / tempest-framework / 14049246919

24 Mar 2025 09:42PM UTC coverage: 79.353% (-0.04%) from 79.391%
14049246919

push

github

web-flow
feat(support): support array parameters in string manipulations (#1073)

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

735 existing lines in 126 files now uncovered.

10492 of 13222 relevant lines covered (79.35%)

90.78 hits per line

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

18.18
/src/Tempest/Console/src/Exceptions/InvalidEnumArgument.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\Console\Exceptions;
6

7
use BackedEnum;
8
use Tempest\Console\Console;
9

10
use function array_map;
11
use function gettype;
12
use function implode;
13
use function is_string;
14

15
final class InvalidEnumArgument extends ConsoleException
16
{
17
    /**
18
     * @param class-string<BackedEnum> $argumentType
19
     */
20
    public function __construct(
1✔
21
        private string $argumentName,
22
        private string $argumentType,
23
        private mixed $value,
24
    ) {}
1✔
25

UNCOV
26
    public function render(Console $console): void
×
27
    {
UNCOV
28
        if (is_string($this->value) || is_numeric($this->value)) {
×
29
            $value = "`{$this->value}`";
×
30
        } else {
UNCOV
31
            $value = 'of type `' . gettype($this->value) . '`';
×
32
        }
33

UNCOV
34
        $cases = array_map(
×
35
            callback: fn (BackedEnum $case) => $case->value,
×
36
            array: $this->argumentType::cases(),
×
37
        );
×
38
        $console->error("Invalid argument {$value} for `{$this->argumentName}` argument, valid values are: " . implode(', ', $cases));
×
39
    }
40
}
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