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

MulticastMessageResponseTrait   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 94
Duplicated Lines 0 %

Coupling/Cohesion

Components 3
Dependencies 0

Importance

Changes 0
Metric Value
wmc 10
lcom 3
cbo 0
dl 0
loc 94
rs 10
c 0
b 0
f 0

10 Methods

Rating   Name   Duplication   Size   Complexity  
A getMulticastId() 0 4 1
A getSuccessfulMessageResults() 0 4 1
A getNumberOfSuccessfulMessageResults() 0 4 1
A hasSuccessfulMessageResults() 0 4 1
A getFailedMessageResults() 0 4 1
A getNumberOfFailedMessageResults() 0 4 1
A hasFailedMessageResults() 0 4 1
A getCanonicalTokenMessageResults() 0 4 1
A getNumberOfCanonicalTokenMessageResults() 0 4 1
A hasCanonicalTokenMessageResults() 0 4 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\Response;
14
15
use Fresh\FirebaseCloudMessagingBundle\Response\MessageResult\CanonicalTokenMessageResult;
16
use Fresh\FirebaseCloudMessagingBundle\Response\MessageResult\Collection\CanonicalTokenMessageResultCollection;
17
use Fresh\FirebaseCloudMessagingBundle\Response\MessageResult\Collection\FailedMessageResultCollection;
18
use Fresh\FirebaseCloudMessagingBundle\Response\MessageResult\Collection\SuccessfulMessageResultCollection;
19
use Fresh\FirebaseCloudMessagingBundle\Response\MessageResult\FailedMessageResult;
20
use Fresh\FirebaseCloudMessagingBundle\Response\MessageResult\SuccessfulMessageResult;
21
22
/**
23
 * MulticastMessageResponseTrait.
24
 *
25
 * @author Artem Henvald <[email protected]>
26
 */
27
trait MulticastMessageResponseTrait
28
{
29
    /** @var int */
30
    private $multicastId;
31
32
    /** @var SuccessfulMessageResultCollection */
33
    private $successfulMessageResults;
34
35
    /** @var FailedMessageResultCollection */
36
    private $failedMessageResults;
37
38
    /** @var CanonicalTokenMessageResultCollection */
39
    private $canonicalTokenMessageResults;
40
41
    /**
42
     * @return int
43
     */
44
    public function getMulticastId(): int
45
    {
46
        return $this->multicastId;
47
    }
48
49
    /**
50
     * @return SuccessfulMessageResultCollection|SuccessfulMessageResult[]
51
     */
52
    public function getSuccessfulMessageResults(): SuccessfulMessageResultCollection
53
    {
54
        return $this->successfulMessageResults;
55
    }
56
57
    /**
58
     * @return int
59
     */
60
    public function getNumberOfSuccessfulMessageResults(): int
61
    {
62
        return \count($this->successfulMessageResults);
63
    }
64
65
    /**
66
     * @return bool
67
     */
68
    public function hasSuccessfulMessageResults(): bool
69
    {
70
        return $this->getNumberOfSuccessfulMessageResults() > 0;
71
    }
72
73
    /**
74
     * @return FailedMessageResultCollection|FailedMessageResult[]
75
     */
76
    public function getFailedMessageResults(): FailedMessageResultCollection
77
    {
78
        return $this->failedMessageResults;
79
    }
80
81
    /**
82
     * @return int
83
     */
84
    public function getNumberOfFailedMessageResults(): int
85
    {
86
        return \count($this->failedMessageResults);
87
    }
88
89
    /**
90
     * @return bool
91
     */
92
    public function hasFailedMessageResults(): bool
93
    {
94
        return $this->getNumberOfFailedMessageResults() > 0;
95
    }
96
97
    /**
98
     * @return CanonicalTokenMessageResultCollection|CanonicalTokenMessageResult[]
99
     */
100
    public function getCanonicalTokenMessageResults(): CanonicalTokenMessageResultCollection
101
    {
102
        return $this->canonicalTokenMessageResults;
103
    }
104
105
    /**
106
     * @return int
107
     */
108
    public function getNumberOfCanonicalTokenMessageResults(): int
109
    {
110
        return \count($this->canonicalTokenMessageResults);
111
    }
112
113
    /**
114
     * @return bool
115
     */
116
    public function hasCanonicalTokenMessageResults(): bool
117
    {
118
        return $this->getNumberOfCanonicalTokenMessageResults() > 0;
119
    }
120
}
121