InvalidDirectiveNameException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 28
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getErrorCode() 0 3 1
A getErrorMessage() 0 3 1
1
<?php
2
3
namespace Maestriam\Samurai\Exceptions;
4
5
use Maestriam\Samurai\Exceptions\BaseException;
6
7
class InvalidDirectiveNameException extends BaseException
8
{
9
    const CODE = '0201';
10
11
    /**
12
     * Define as configuração para enviar o exception
13
     *
14
     * @param string $name
15
     */
16
    public function __construct(string $name)
17
    {
18
        $this->initialize($name);
19
    }
20
21
    /**
22
     * {@inheritDoc}
23
     */
24
    public function getErrorMessage() : string
25
    {
26
        return 'The [%s] is an invalid name. Its not possible to create an directive with special characters and start number.';
27
    }
28
29
    /**
30
     * {@inheritDoc}
31
     */
32
    public function getErrorCode() : string
33
    {
34
        return self::CODE;
35
    }
36
}
37