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

move-elevator / composer-translation-validator / 16137064113

08 Jul 2025 07:41AM UTC coverage: 78.302% (-16.2%) from 94.526%
16137064113

Pull #19

github

web-flow
Merge 5f8b3255c into 3e904fb25
Pull Request #19: refactor: improve output style

93 of 278 new or added lines in 7 files covered. (33.45%)

103 existing lines in 7 files now uncovered.

830 of 1060 relevant lines covered (78.3%)

4.18 hits per line

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

45.45
/src/Validator/ResultType.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace MoveElevator\ComposerTranslationValidator\Validator;
6

7
use Symfony\Component\Console\Command\Command;
8

9
enum ResultType: int
10
{
11
    case SUCCESS = 0;
12
    case WARNING = 1;
13
    case ERROR = 2;
14

15
    public function max(self $other): self
3✔
16
    {
17
        return $this->value >= $other->value ? $this : $other;
3✔
18
    }
19

20
    public function notFullySuccessful(): bool
17✔
21
    {
22
        return self::SUCCESS !== $this;
17✔
23
    }
24

25
    public function resolveErrorToCommandExitCode(bool $dryRun, bool $strict): int
29✔
26
    {
27
        if (self::ERROR === $this && !$dryRun) {
29✔
28
            return Command::FAILURE;
11✔
29
        }
30

31
        if (self::WARNING === $this && $strict) {
19✔
32
            return Command::FAILURE;
5✔
33
        }
34

35
        return Command::SUCCESS;
15✔
36
    }
37

NEW
38
    public function toString(): string
×
39
    {
NEW
40
        return match ($this) {
×
NEW
41
            self::SUCCESS => 'Success',
×
NEW
42
            self::WARNING => 'Warning',
×
NEW
43
            self::ERROR => 'Error',
×
NEW
44
        };
×
45
    }
46

NEW
47
    public function toColorString(): string
×
48
    {
NEW
49
        return match ($this) {
×
NEW
50
            self::SUCCESS => 'green',
×
NEW
51
            self::WARNING => 'yellow',
×
NEW
52
            self::ERROR => 'red',
×
NEW
53
        };
×
54
    }
55
}
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