Code Duplication    Length = 49-51 lines in 2 locations

src/Model/Domain/DeleteResponse.php 1 location

@@ 19-69 (lines=51) @@
16
/**
17
 * @author Tobias Nyholm <[email protected]>
18
 */
19
final class DeleteResponse implements ApiResponse
20
{
21
    /**
22
     * @var string
23
     */
24
    private $message;
25
26
    /**
27
     * @var string
28
     */
29
    private $error;
30
31
    /**
32
     * @param string $message
33
     * @param string $error
34
     */
35
    private function __construct($message, $error)
36
    {
37
        $this->message = $message;
38
        $this->error = $error;
39
    }
40
41
    /**
42
     * @return self
43
     */
44
    public static function create(array $data)
45
    {
46
        return new self(
47
            isset($data['message']) ? $data['message'] : null,
48
            isset($data['error']) ? $data['error'] : null
49
        );
50
    }
51
52
    /**
53
     * @return string
54
     */
55
    public function getMessage()
56
    {
57
        return $this->message;
58
    }
59
60
    /**
61
     * @return string
62
     */
63
    public function getError()
64
    {
65
        return $this->error;
66
    }
67
}
68

src/Model/Route/DeleteResponse.php 1 location

@@ 19-67 (lines=49) @@
16
/**
17
 * @author David Garcia <[email protected]>
18
 */
19
final class DeleteResponse implements ApiResponse
20
{
21
    /**
22
     * @var string
23
     */
24
    private $message;
25
26
    /**
27
     * @var string
28
     */
29
    private $error;
30
31
    /**
32
     * @return self
33
     */
34
    public static function create(array $data)
35
    {
36
        return new self(
37
            isset($data['message']) ? $data['message'] : null,
38
            isset($data['error']) ? $data['error'] : null
39
        );
40
    }
41
42
    /**
43
     * @param string $message
44
     * @param string $error
45
     */
46
    private function __construct($message, $error)
47
    {
48
        $this->message = $message;
49
        $this->error = $error;
50
    }
51
52
    /**
53
     * @return string
54
     */
55
    public function getMessage()
56
    {
57
        return $this->message;
58
    }
59
60
    /**
61
     * @return string
62
     */
63
    public function getError()
64
    {
65
        return $this->error;
66
    }
67
}
68