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

NexusPHP / cs-config / 5878190327

16 Aug 2023 11:28AM UTC coverage: 98.569% (-0.05%) from 98.619%
5878190327

push

github

paulbalandan
Update phpstan

8 of 13 new or added lines in 3 files covered. (61.54%)

2 existing lines in 1 file now uncovered.

2892 of 2934 relevant lines covered (98.57%)

24.22 hits per line

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

22.22
/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, array<string>|bool|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
    /**
43
     * {@inheritDoc}
44
     */
45
    final public function getName(): string
46
    {
47
        if ('' !== $this->name) {
48✔
48
            return $this->name;
48✔
49
        }
50

NEW
51
        if (str_contains(static::class, '\\')) {
×
NEW
52
            $class = str_replace('\\', '/', static::class);
×
53

NEW
54
            return basename($class);
×
55
        }
56

NEW
57
        return static::class;
×
58
    }
59

60
    /**
61
     * {@inheritDoc}
62
     */
63
    final public function getRules(): array
64
    {
65
        return $this->rules;
×
66
    }
67

68
    /**
69
     * {@inheritDoc}
70
     */
71
    final public function getRequiredPHPVersion(): int
72
    {
73
        return $this->requiredPHPVersion;
×
74
    }
75

76
    /**
77
     * {@inheritDoc}
78
     */
79
    final public function willAutoActivateIsRiskyAllowed(): bool
80
    {
81
        return $this->autoActivateIsRiskyAllowed;
×
82
    }
83
}
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