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

NexusPHP / cs-config / 14655342589

23 Feb 2025 03:16PM UTC coverage: 95.644%. Remained the same
14655342589

push

github

paulbalandan
Update build badge

1076 of 1125 relevant lines covered (95.64%)

63.51 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 RulesetInterface
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
     * @phpstan-var int<0, max>
34
     */
35
    protected int $requiredPHPVersion = 0;
36

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

42
    final public function getName(): string
43
    {
44
        if ('' !== $this->name) {
64✔
45
            return $this->name;
64✔
46
        }
47

48
        if (str_contains(static::class, '\\')) {
×
49
            $class = str_replace('\\', '/', static::class);
×
50

51
            return basename($class);
×
52
        }
53

54
        return static::class;
×
55
    }
56

57
    final public function getRules(): array
58
    {
59
        return $this->rules;
48✔
60
    }
61

62
    final public function getRequiredPHPVersion(): int
63
    {
64
        return $this->requiredPHPVersion;
×
65
    }
66

67
    final public function willAutoActivateIsRiskyAllowed(): bool
68
    {
69
        return $this->autoActivateIsRiskyAllowed;
×
70
    }
71
}
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