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

keradus / PHP-CS-Fixer / 19958239208

05 Dec 2025 09:13AM UTC coverage: 93.181% (-1.0%) from 94.158%
19958239208

push

github

keradus
chore: .php-cs-fixer.dist.php - remove no longer needed rule, 'expectedDeprecation' annotation does not exist for long time

28928 of 31045 relevant lines covered (93.18%)

44.49 hits per line

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

44.44
/src/RuleSet/Sets/PERCSRiskySet.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\RuleSet\Sets;
16

17
use PhpCsFixer\RuleSet\AbstractRuleSetDefinition;
18
use PhpCsFixer\RuleSet\DeprecatedRuleSetDefinitionInterface;
19
use PhpCsFixer\RuleSet\RuleSetDefinitionInterface;
20
use PhpCsFixer\RuleSet\RuleSets;
21

22
/**
23
 * @internal
24
 *
25
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
26
 */
27
final class PERCSRiskySet extends AbstractRuleSetDefinition
28
{
29
    public function getName(): string
30
    {
31
        return '@PER-CS:risky';
1✔
32
    }
33

34
    public function getRules(): array
35
    {
36
        return [
1✔
37
            $this->getHighestPerCsSet()->getName() => true,
1✔
38
        ];
1✔
39
    }
40

41
    public function getDescription(): string
42
    {
43
        return 'Rules that follow `PER Coding Style (https://www.php-fig.org/per/coding-style/)`_, Set is an alias for the latest revision of ``PER-CS`` rules - use it if you always want to be in sync with newest ``PER-CS`` standard.';
1✔
44
    }
45

46
    private function getHighestPerCsSet(): RuleSetDefinitionInterface
47
    {
48
        static $set = null;
1✔
49

50
        if (null === $set) {
1✔
51
            $currentSet = $this;
×
52

53
            $sets = array_filter(
×
54
                RuleSets::getSetDefinitions(),
×
55
                static fn (RuleSetDefinitionInterface $set): bool => !($set instanceof DeprecatedRuleSetDefinitionInterface)
×
56
                    && $set->isRisky() === $currentSet->isRisky()
×
57
                    && $set->getName() !== $currentSet->getName()
×
58
                    && str_starts_with($set->getName(), str_replace(':risky', '', $currentSet->getName()))
×
59
            );
×
60

61
            ksort($sets, \SORT_NATURAL);
×
62

63
            $set = array_pop($sets);
×
64
        }
65

66
        return $set;
1✔
67
    }
68
}
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