Passed
Pull Request — master (#13)
by
unknown
02:29
created

InvalidSecretWordException::specialCharacters()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
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 invalidMinLength(): self
27
    {
28
        return new self(sprintf('The length of Skrill Secret Word is too short. It should have %d characters or more.', SecretWord::MIN_LENGTH));
29
    }
30
31
    /**
32
     * @return InvalidSecretWordException
33
     */
34
    public static function missingLetters(): self
35
    {
36
        return new self('Skrill Secret Word must include at least one letter.');
37
    }
38
39
    /**
40
     * @return InvalidSecretWordException
41
     */
42
    public static function missingNonAlphabetic(): self
43
    {
44
        return new self('Skrill Secret Word must include at least one non-alphabetic character.');
45
    }
46
}
47