Completed
Push — master ( b93c78...0ed572 )
by Julián
02:22
created

ApnsMessage   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
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 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A setParameter() 0 12 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\Message;
11
12
class ApnsMessage extends AbstractMessage
13
{
14
    /**
15
     * {@inheritdoc}
16
     *
17
     * @throws \InvalidArgumentException
18
     */
19
    public function setParameter($parameter, $value)
20
    {
21
        $parameter = trim($parameter);
22
23
        if ($parameter === 'apc') {
24
            throw new \InvalidArgumentException('"apc" can not be used as a custom parameter as it is reserved');
25
        }
26
27
        $this->parameters[$parameter] = $value;
28
29
        return $value;
30
    }
31
}
32