AbstractResponseSaveDto   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 56
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setNotification() 0 3 1
A setErrorStatus() 0 3 1
A setMessage() 0 3 1
A getNotification() 0 3 1
A setOkStatus() 0 3 1
A getMessage() 0 3 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: siim
5
 * Date: 6.02.19
6
 * Time: 8:08
7
 */
8
9
namespace Sf4\Api\Dto\Response;
10
11
use Sf4\Api\Entity\Traits\StatusTrait;
12
use Sf4\Api\Notification\NotificationInterface;
13
14
abstract class AbstractResponseSaveDto implements ResponseSaveDtoInterface
15
{
16
    use StatusTrait;
17
18
    public const STATUS_OK = 'OK';
19
    public const STATUS_ERROR = 'ERROR';
20
21
    public const FIELD_STATUS = 'status';
22
    public const FIELD_MESSAGE = 'message';
23
    public const FIELD_NOTIFICATION = 'notification';
24
25
    protected $message;
26
27
    /** @var NotificationInterface */
28
    protected $notification;
29
30
    public function setOkStatus(): void
31
    {
32
        $this->status = static::STATUS_OK;
0 ignored issues
show
Documentation Bug introduced by
It seems like static::STATUS_OK of type string is incompatible with the declared type integer|null of property $status.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
33
    }
34
35
    public function setErrorStatus(): void
36
    {
37
        $this->status = static::STATUS_ERROR;
0 ignored issues
show
Documentation Bug introduced by
It seems like static::STATUS_ERROR of type string is incompatible with the declared type integer|null of property $status.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
38
    }
39
40
    /**
41
     * @return mixed
42
     */
43
    public function getMessage()
44
    {
45
        return $this->message;
46
    }
47
48
    /**
49
     * @param mixed $message
50
     */
51
    public function setMessage($message): void
52
    {
53
        $this->message = $message;
54
    }
55
56
    /**
57
     * @return NotificationInterface
58
     */
59
    public function getNotification(): NotificationInterface
60
    {
61
        return $this->notification;
62
    }
63
64
    /**
65
     * @param NotificationInterface $notification
66
     */
67
    public function setNotification(NotificationInterface $notification): void
68
    {
69
        $this->notification = $notification;
70
    }
71
}
72