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

keradus / PHP-CS-Fixer / 17252691116

26 Aug 2025 11:09PM UTC coverage: 94.743% (-0.01%) from 94.755%
17252691116

push

github

keradus
chore: apply phpdoc_tag_no_named_arguments

28313 of 29884 relevant lines covered (94.74%)

45.64 hits per line

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

95.0
/src/Cache/Signature.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This file is part of PHP CS Fixer.
7
 *
8
 * (c) Fabien Potencier <fabien@symfony.com>
9
 *     Dariusz Rumiński <dariusz.ruminski@gmail.com>
10
 *
11
 * This source file is subject to the MIT license that is bundled
12
 * with this source code in the file LICENSE.
13
 */
14

15
namespace PhpCsFixer\Cache;
16

17
/**
18
 * @author Andreas Möller <am@localheinz.com>
19
 *
20
 * @readonly
21
 *
22
 * @internal
23
 *
24
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
25
 */
26
final class Signature implements SignatureInterface
27
{
28
    private string $phpVersion;
29

30
    private string $fixerVersion;
31

32
    private string $indent;
33

34
    private string $lineEnding;
35

36
    /**
37
     * @var array<string, array<string, mixed>|bool>
38
     */
39
    private array $rules;
40

41
    /**
42
     * @param array<string, array<string, mixed>|bool> $rules
43
     */
44
    public function __construct(string $phpVersion, string $fixerVersion, string $indent, string $lineEnding, array $rules)
45
    {
46
        $this->phpVersion = $phpVersion;
2✔
47
        $this->fixerVersion = $fixerVersion;
2✔
48
        $this->indent = $indent;
2✔
49
        $this->lineEnding = $lineEnding;
2✔
50
        $this->rules = self::makeJsonEncodable($rules);
2✔
51
    }
52

53
    public function getPhpVersion(): string
54
    {
55
        return $this->phpVersion;
7✔
56
    }
57

58
    public function getFixerVersion(): string
59
    {
60
        return $this->fixerVersion;
6✔
61
    }
62

63
    public function getIndent(): string
64
    {
65
        return $this->indent;
5✔
66
    }
67

68
    public function getLineEnding(): string
69
    {
70
        return $this->lineEnding;
4✔
71
    }
72

73
    public function getRules(): array
74
    {
75
        return $this->rules;
3✔
76
    }
77

78
    public function equals(SignatureInterface $signature): bool
79
    {
80
        return $this->phpVersion === $signature->getPhpVersion()
6✔
81
            && $this->fixerVersion === $signature->getFixerVersion()
6✔
82
            && $this->indent === $signature->getIndent()
6✔
83
            && $this->lineEnding === $signature->getLineEnding()
6✔
84
            && $this->rules === $signature->getRules();
6✔
85
    }
86

87
    /**
88
     * @param array<string, array<string, mixed>|bool> $data
89
     *
90
     * @return array<string, array<string, mixed>|bool>
91
     */
92
    private static function makeJsonEncodable(array $data): array
93
    {
94
        array_walk_recursive($data, static function (&$item): void {
2✔
95
            if (\is_string($item) && false === mb_detect_encoding($item, 'utf-8', true)) {
2✔
96
                $item = base64_encode($item);
×
97
            }
98
        });
2✔
99

100
        return $data;
2✔
101
    }
102
}
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