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

eliashaeussler / version-bumper / 19470488180

18 Nov 2025 02:55PM UTC coverage: 88.577% (-0.1%) from 88.7%
19470488180

push

github

web-flow
Merge pull request #104 from eliashaeussler/task/codeclimate

[TASK] Drop CodeClimate integration

884 of 998 relevant lines covered (88.58%)

4.9 hits per line

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

76.92
/src/Result/VersionBumpResult.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This file is part of the Composer package "eliashaeussler/version-bumper".
7
 *
8
 * Copyright (C) 2024-2025 Elias Häußler <elias@haeussler.dev>
9
 *
10
 * This program is free software: you can redistribute it and/or modify
11
 * it under the terms of the GNU General Public License as published by
12
 * the Free Software Foundation, either version 3 of the License, or
13
 * (at your option) any later version.
14
 *
15
 * This program is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
 * GNU General Public License for more details.
19
 *
20
 * You should have received a copy of the GNU General Public License
21
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22
 */
23

24
namespace EliasHaeussler\VersionBumper\Result;
25

26
use EliasHaeussler\VersionBumper\Config;
27
use EliasHaeussler\VersionBumper\Enum;
28

29
use function array_values;
30

31
/**
32
 * VersionBumpResult.
33
 *
34
 * @author Elias Häußler <elias@haeussler.dev>
35
 * @license GPL-3.0-or-later
36
 */
37
final readonly class VersionBumpResult
38
{
39
    /**
40
     * @param list<WriteOperation> $operations
41
     */
42
    public function __construct(
2✔
43
        private Config\FileToModify $file,
44
        private array $operations,
45
    ) {}
2✔
46

47
    public function file(): Config\FileToModify
×
48
    {
49
        return $this->file;
×
50
    }
51

52
    /**
53
     * @return list<WriteOperation>
54
     */
55
    public function operations(): array
×
56
    {
57
        return $this->operations;
×
58
    }
59

60
    public function hasOperations(): bool
×
61
    {
62
        return [] !== $this->operations;
×
63
    }
64

65
    /**
66
     * @return list<non-empty-list<WriteOperation>>
67
     */
68
    public function groupedOperations(): array
1✔
69
    {
70
        $operations = [];
1✔
71

72
        foreach ($this->operations as $operation) {
1✔
73
            $identifier = implode('_', [
1✔
74
                $operation->source()?->full(),
1✔
75
                $operation->target()?->full(),
1✔
76
                $operation->state()->name,
1✔
77
                Enum\OperationState::Unmatched === $operation->state() ? $operation->pattern()->original() : '',
1✔
78
            ]);
1✔
79

80
            if (!isset($operations[$identifier])) {
1✔
81
                $operations[$identifier] = [];
1✔
82
            }
83

84
            $operations[$identifier][] = $operation;
1✔
85
        }
86

87
        return array_values($operations);
1✔
88
    }
89

90
    public function hasUnmatchedReports(): bool
1✔
91
    {
92
        foreach ($this->operations as $operation) {
1✔
93
            if (Enum\OperationState::Unmatched === $operation->state()) {
1✔
94
                return true;
1✔
95
            }
96
        }
97

98
        return false;
1✔
99
    }
100
}
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