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

eliashaeussler / composer-update-check / 20741612169

06 Jan 2026 07:40AM UTC coverage: 20.902% (+0.2%) from 20.675%
20741612169

Pull #210

github

eliashaeussler
[BUGFIX] Include source/dist reference in package version comparison
Pull Request #210: [BUGFIX] Include source/dist reference in package version comparison

14 of 26 new or added lines in 5 files covered. (53.85%)

2 existing lines in 1 file now uncovered.

394 of 1885 relevant lines covered (20.9%)

1.11 hits per line

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

0.0
/src/Entity/Version.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This file is part of the Composer package "eliashaeussler/composer-update-check".
7
 *
8
 * Copyright (C) 2020-2026 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\ComposerUpdateCheck\Entity;
25

26
use Stringable;
27

28
use function sprintf;
29

30
/**
31
 * Version.
32
 *
33
 * @author Elias Häußler <elias@haeussler.dev>
34
 * @license GPL-3.0-or-later
35
 */
36
final class Version implements Stringable
37
{
38
    public function __construct(
×
39
        private readonly string $version,
40
        private readonly ?string $sha1 = null,
UNCOV
41
    ) {}
×
42

NEW
43
    public function prettyVersion(): string
×
44
    {
45
        return $this->version;
×
46
    }
47

NEW
48
    public function toString(): string
×
49
    {
NEW
50
        $versionString = $this->version;
×
51

NEW
52
        if ('' !== (string) $this->sha1) {
×
NEW
53
            $versionString .= sprintf(' (%s)', $this->sha1);
×
54
        }
55

NEW
56
        return $versionString;
×
57
    }
58

UNCOV
59
    public function __toString(): string
×
60
    {
NEW
61
        return $this->toString();
×
62
    }
63
}
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