Completed
Push — master ( 56557e...bc0eb2 )
by Julián
02:54
created

Gcm   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A setToken() 0 11 2
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\Recipient;
11
12
class Gcm extends AbstractRecipient
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    public function setToken($token)
18
    {
19
        $token = trim($token);
20
        if ($token === '') {
21
            throw new \InvalidArgumentException('GCM token can not be empty');
22
        }
23
24
        $this->token = $token;
25
26
        return $this;
27
    }
28
}
29