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

move-elevator / composer-translation-validator / 16135834016

08 Jul 2025 06:36AM UTC coverage: 78.302% (-2.8%) from 81.058%
16135834016

push

github

jackd248
refactor: streamline issue handling in validators by introducing distribution and formatting methods

26 of 198 new or added lines in 7 files covered. (13.13%)

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 TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc