Error   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 0
cbo 1
dl 0
loc 26
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
A getMessage() 0 4 1
1
<?php
2
namespace PhpDDD\Notification;
3
4
/**
5
 * This class is for internal purpose only
6
 */
7
class Error
8
{
9
    /**
10
     * @var string
11
     */
12
    private $message;
13
14
    /**
15
     * @param string $message
16
     */
17
    public function __construct($message)
18
    {
19
        if (!is_string($message)) {
20
            throw new InvalidArgumentException('The first parameter of Error must be a string.');
21
        }
22
        $this->message = $message;
23
    }
24
25
    /**
26
     * @return string
27
     */
28
    public function getMessage()
29
    {
30
        return $this->message;
31
    }
32
}
33