Passed
Push — master ( 3949e5...920751 )
by Maurício
08:08
created

InvalidTriggerName::fromNameWithTrailingSpace()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpMyAdmin\Triggers;
6
7
use PhpMyAdmin\Dbal\InvalidIdentifierName;
8
9
use function __;
10
use function sprintf;
11
12
final class InvalidTriggerName extends InvalidIdentifierName
13
{
14 16
    public static function fromEmptyName(): self
15
    {
16 16
        return new self(__('The trigger name must not be empty.'));
17
    }
18
19
    /** @psalm-param positive-int $length */
20 4
    public static function fromLongName(int $length): self
21
    {
22 4
        return new self(sprintf(__('The trigger name cannot be longer than %d characters.'), $length));
23
    }
24
25 4
    public static function fromNameWithTrailingSpace(): self
26
    {
27 4
        return new self(__('The trigger name cannot end with a space character.'));
28
    }
29
}
30