Failed Conditions
Branch feature/refactoring-samurai (8cc7c1)
by Giuliano
03:49
created

InvalidAuthorException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getErrorCode() 0 3 1
A __construct() 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 InvalidAuthorException extends BaseException
8
{
9
    const CODE = '0104';
10
11
    public function __construct($author)
12
    {        
13
        $this->initialize($author);
14
    }
15
16
    /**
17
     * {@inheritDoc}
18
     */
19
    public function getErrorMessage() : string
20
    {
21
        return 'The author name [%s] is an invalid author name. E.g: Name <[email protected]>';
22
    }
23
24
    /**
25
     * {@inheritDoc}
26
     */
27
    public function getErrorCode() : string
28
    {
29
        return self::CODE;
30
    }
31
}
32