GcmReceiver::setToken()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
/**
3
 * Push notification services abstraction (http://github.com/juliangut/tify)
4
 *
5
 * @link https://github.com/juliangut/tify for the canonical source repository
6
 *
7
 * @license https://github.com/juliangut/tify/blob/master/LICENSE
8
 */
9
10
namespace Jgut\Tify\Receiver;
11
12
/**
13
 * Class GcmReceiver
14
 */
15
class GcmReceiver extends AbstractReceiver
16
{
17
    /**
18
     * {@inheritdoc}
19
     *
20
     * @throws \InvalidArgumentException
21
     *
22
     * @return $this
23
     */
24
    public function setToken($token)
25
    {
26
        if (trim($token) === '') {
27
            throw new \InvalidArgumentException('GCM token can not be empty');
28
        }
29
30
        $this->token = trim($token);
31
32
        return $this;
33
    }
34
}
35