Completed
Push — master ( 72cf95...b4fc03 )
by Artem
08:38
created

AbstractMessage   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setTarget() 0 6 1
A getTarget() 0 4 1
A setOptions() 0 6 1
A getOptions() 0 4 1
getPayload() 0 1 ?
1
<?php
2
/*
3
 * This file is part of the FirebaseCloudMessagingBundle
4
 *
5
 * (c) Artem Henvald <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
declare(strict_types=1);
12
13
namespace Fresh\FirebaseCloudMessagingBundle\Message\Type;
14
15
use Fresh\FirebaseCloudMessagingBundle\Message\Part\Options\OptionsInterface;
16
use Fresh\FirebaseCloudMessagingBundle\Message\Part\Payload\CommonPayloadInterface;
17
use Fresh\FirebaseCloudMessagingBundle\Message\Part\Target\TargetInterface;
18
19
/**
20
 * AbstractMessage.
21
 *
22
 * @author Artem Henvald <[email protected]>
23
 */
24
abstract class AbstractMessage
25
{
26
    /** @var TargetInterface */
27
    protected $target;
28
29
    /** @var OptionsInterface */
30
    protected $options;
31
32
    /** @var CommonPayloadInterface */
33
    protected $payload;
34
35
    /**
36
     * @param TargetInterface $target
37
     *
38
     * @return $this
39
     */
40
    public function setTarget(TargetInterface $target): self
41
    {
42
        $this->target = $target;
43
44
        return $this;
45
    }
46
47
    /**
48
     * @return TargetInterface
49
     */
50
    public function getTarget(): TargetInterface
51
    {
52
        return $this->target;
53
    }
54
55
    /**
56
     * @param OptionsInterface $options
57
     *
58
     * @return $this
59
     */
60
    public function setOptions(OptionsInterface $options): self
61
    {
62
        $this->options = $options;
63
64
        return $this;
65
    }
66
67
    /**
68
     * @return OptionsInterface
69
     */
70
    public function getOptions(): OptionsInterface
71
    {
72
        return $this->options;
73
    }
74
75
    /**
76
     * @return CommonPayloadInterface
77
     */
78
    abstract public function getPayload(): CommonPayloadInterface;
79
}
80