• 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

53.85
/src/RuleSet/RuleSets.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;
16

17
use Symfony\Component\Finder\Finder;
18

19
/**
20
 * Set of rule sets to be used by fixer.
21
 *
22
 * @internal
23
 *
24
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
25
 */
26
final class RuleSets
27
{
28
    /**
29
     * @var null|array<string, RuleSetDescriptionInterface>
30
     */
31
    private static ?array $setDefinitions = null;
32

33
    /**
34
     * @return array<string, RuleSetDescriptionInterface>
35
     */
36
    public static function getSetDefinitions(): array
37
    {
38
        if (null === self::$setDefinitions) {
72✔
39
            self::$setDefinitions = [];
×
40

41
            foreach (Finder::create()->files()->in(__DIR__.'/Sets') as $file) {
×
42
                $class = 'PhpCsFixer\RuleSet\Sets\\'.$file->getBasename('.php');
×
43

44
                /** @var RuleSetDescriptionInterface */
45
                $set = new $class();
×
46

47
                self::$setDefinitions[$set->getName()] = $set;
×
48
            }
49

50
            uksort(self::$setDefinitions, static fn (string $x, string $y): int => strnatcmp($x, $y));
×
51
        }
52

53
        return self::$setDefinitions;
72✔
54
    }
55

56
    /**
57
     * @return list<string>
58
     */
59
    public static function getSetDefinitionNames(): array
60
    {
61
        return array_keys(self::getSetDefinitions());
1✔
62
    }
63

64
    public static function getSetDefinition(string $name): RuleSetDescriptionInterface
65
    {
66
        $definitions = self::getSetDefinitions();
18✔
67

68
        if (!isset($definitions[$name])) {
18✔
69
            throw new \InvalidArgumentException(\sprintf('Set "%s" does not exist.', $name));
1✔
70
        }
71

72
        return $definitions[$name];
17✔
73
    }
74
}
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