InvalidSecretWordException::invalidMaxLength()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Skrill\Exception;
6
7
use Exception;
8
use Skrill\ValueObject\SecretWord;
9
10
/**
11
 * Class InvalidSecretWordException.
12
 */
13
final class InvalidSecretWordException extends Exception implements SkrillException
14
{
15
    /**
16
     * @return InvalidSecretWordException
17
     */
18
    public static function emptySecretWord(): self
19
    {
20
        return new self('Skrill secret word should not be blank.');
21
    }
22
23
    /**
24
     * @return InvalidSecretWordException
25
     */
26
    public static function invalidMaxLength(): self
27
    {
28
        return new self(
29
            sprintf('The length of Skrill secret word should not exceed %d characters.', SecretWord::MAX_LENGTH)
30
        );
31
    }
32
33
    /**
34
     * @return InvalidSecretWordException
35
     */
36
    public static function specialCharacters(): self
37
    {
38
        return new self('Special characters are not permitted in Skrill secret word.');
39
    }
40
}
41