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

eliashaeussler / php-cs-fixer-config / 16303565736

15 Jul 2025 08:25PM UTC coverage: 100.0%. Remained the same
16303565736

push

github

web-flow
[TASK] Update friendsofphp/php-cs-fixer to v3.84.0

| datasource | package                   | from   | to     |
| ---------- | ------------------------- | ------ | ------ |
| packagist  | friendsofphp/php-cs-fixer | 3.83.0 | 3.84.0 |

137 of 137 relevant lines covered (100.0%)

4.75 hits per line

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

100.0
/src/Rules/RuleSet.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This file is part of the Composer package "eliashaeussler/php-cs-fixer-config".
7
 *
8
 * Copyright (C) 2023-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\PhpCsFixerConfig\Rules;
25

26
use function array_diff_key;
27
use function array_flip;
28
use function array_replace_recursive;
29

30
/**
31
 * RuleSet.
32
 *
33
 * @author Elias Häußler <elias@haeussler.dev>
34
 * @license GPL-3.0-or-later
35
 *
36
 * @phpstan-import-type TRulesArray from Rule
37
 */
38
final class RuleSet implements Rule
39
{
40
    /**
41
     * @phpstan-param TRulesArray $rules
42
     */
43
    public function __construct(
5✔
44
        private array $rules,
45
    ) {}
5✔
46

47
    public static function create(): self
1✔
48
    {
49
        return new self([]);
1✔
50
    }
51

52
    /**
53
     * @phpstan-param TRulesArray $rules
54
     */
55
    public static function fromArray(array $rules): self
5✔
56
    {
57
        return new self($rules);
5✔
58
    }
59

60
    /**
61
     * @phpstan-param TRulesArray $rules
62
     */
63
    public function add(array $rules): self
1✔
64
    {
65
        /** @var TRulesArray $mergedRules */
66
        $mergedRules = array_replace_recursive($this->rules, $rules);
1✔
67

68
        $this->rules = $mergedRules;
1✔
69

70
        return $this;
1✔
71
    }
72

73
    public function remove(string ...$rules): self
1✔
74
    {
75
        $this->rules = array_diff_key($this->rules, array_flip($rules));
1✔
76

77
        return $this;
1✔
78
    }
79

80
    public function get(): array
6✔
81
    {
82
        return $this->rules;
6✔
83
    }
84
}
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