SimpleErrorMessage   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 27
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getMessage() 0 1 1
A setMessage() 0 1 1
A __construct() 0 4 1
A jsonSerialize() 0 4 1
1
<?php
2
namespace MetaHydrator\ErrorMessage;
3
4
/**
5
 * A simple descriptor for a specific failure in form data parsing/validation.
6
 *
7
 * Class SimpleErrorMessage
8
 * @package MetaHydrator\ErrorMessage
9
 */
10
class SimpleErrorMessage implements \JsonSerializable
11
{
12
    /** @var string */
13
    private $message = "";
14
    /** @return string */
15
    public function getMessage() { return $this->message; }
16
    /** @param string $message */
17
    public function setMessage($message) { $this->message = $message; }
18
19
    /**
20
     * FieldError constructor.
21
     * @Important
22
     * @param string $message
23
     */
24
    public function __construct($message = '')
25
    {
26
        $this->message = $message;
27
    }
28
29
    /**
30
     * @return string
31
     */
32
    function jsonSerialize()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
33
    {
34
        return $this->message;
35
    }
36
}
37