SimpleErrorMessage::jsonSerialize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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