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

systemsdk / phpcpd / #4

30 Dec 2024 04:42PM UTC coverage: 75.789%. Remained the same
#4

push

DKravtsov
phpcpd 8.0.0 release. Made codebase refactoring. Updated requirements php 8.3, updated composer dependencies, updated tests to the PHPUnit 11. Updated dev environment to the php 8.4, Phing 3.0, added code quality tools: ecs, phpstan.

271 of 379 new or added lines in 20 files covered. (71.5%)

65 existing lines in 13 files now uncovered.

648 of 855 relevant lines covered (75.79%)

2.18 hits per line

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

88.89
/src/Detector/Strategy/SuffixTree/Sentinel.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Systemsdk\PhpCPD\Detector\Strategy\SuffixTree;
6

7
use function random_int;
8

9
/**
10
 * A sentinel character which can be used to produce explicit leaves for all
11
 * suffixes. The sentinel just has to be appended to the list before handing
12
 * it to the suffix tree. For the sentinel equality and object identity are
13
 * the same!
14
 */
15
class Sentinel extends AbstractToken
16
{
17
    /**
18
     * @var int The hash value used.
19
     */
20
    private $hash;
21

22
    public function __construct()
23
    {
24
        $this->hash = random_int(0, PHP_INT_MAX);
1✔
25
        $this->tokenCode = -1;
1✔
26
        $this->line = -1;
1✔
27
        $this->file = '<no file>';
1✔
28
        $this->tokenName = '<no token name>';
1✔
29
        $this->content = '<no token content>';
1✔
30
    }
31

32
    public function __toString(): string
33
    {
UNCOV
34
        return '$';
×
35
    }
36

37
    public function hashCode(): int
38
    {
39
        return $this->hash;
1✔
40
    }
41

42
    public function equals(AbstractToken $other): bool
43
    {
44
        // Original code uses physical object equality, not present in PHP.
45
        return $other instanceof self;
1✔
46
    }
47
}
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