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

NexusPHP / cs-config / 23224273382

14 Mar 2026 06:12PM UTC coverage: 98.593% (-0.3%) from 98.859%
23224273382

push

github

paulbalandan
Enforce security hardening for workflows

981 of 995 relevant lines covered (98.59%)

63.21 hits per line

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

33.33
/src/Ruleset/AbstractRuleset.php
1
<?php
2

3
declare(strict_types=1);
4

5
/**
6
 * This file is part of Nexus CS Config.
7
 *
8
 * (c) 2020 John Paul E. Balandan, CPA <paulbalandan@gmail.com>
9
 *
10
 * For the full copyright and license information, please view
11
 * the LICENSE file that was distributed with this source code.
12
 */
13

14
namespace Nexus\CsConfig\Ruleset;
15

16
abstract class AbstractRuleset implements ConfigurableAllowedUnsupportedPhpVersionRulesetInterface
17
{
18
    /**
19
     * Name of the ruleset.
20
     */
21
    protected string $name = '';
22

23
    /**
24
     * Rules for the ruleset.
25
     *
26
     * @var array<string, array<string, bool|list<string>|string>|bool>
27
     */
28
    protected array $rules = [];
29

30
    /**
31
     * Minimum PHP version.
32
     *
33
     * @var int<80100, 90000>
34
     */
35
    protected int $requiredPHPVersion = 8_01_00;
36

37
    /**
38
     * Have this ruleset turn on `$isRiskyAllowed` flag?
39
     */
40
    protected bool $autoActivateIsRiskyAllowed = false;
41

42
    /**
43
     * Allow unsupported PHP versions.
44
     */
45
    protected bool $isUnsupportedPhpVersionAllowed = \PHP_VERSION_ID > self::PHP_CS_FIXER_MAX_SUPPORTED_PHP_VERSION_ID;
46

47
    final public function getName(): string
48✔
48
    {
49
        if ('' !== $this->name) {
48✔
50
            return $this->name;
48✔
51
        }
52

53
        if (str_contains(static::class, '\\')) {
×
54
            $class = str_replace('\\', '/', static::class);
×
55

56
            return basename($class);
×
57
        }
58

59
        return static::class;
×
60
    }
61

62
    final public function getRules(): array
40✔
63
    {
64
        return $this->rules;
40✔
65
    }
66

67
    final public function getRequiredPHPVersion(): int
×
68
    {
69
        return $this->requiredPHPVersion;
×
70
    }
71

72
    final public function willAutoActivateIsRiskyAllowed(): bool
×
73
    {
74
        return $this->autoActivateIsRiskyAllowed;
×
75
    }
76

77
    final public function isUnsupportedPhpVersionAllowed(): bool
×
78
    {
79
        return $this->isUnsupportedPhpVersionAllowed;
×
80
    }
81
}
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