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

InvalidSecretWordException::invalidMaxLength()   A

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