Completed
Pull Request — master (#8)
by Romain
04:20
created

InvalidOptionsException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A invalidTimeToLive() 0 4 1
A invalidPriority() 0 4 1
1
<?php
2
namespace ker0x\Push\Adapter\Fcm\Message\Exception;
3
4
class InvalidOptionsException extends AbstractException
5
{
6
7
    /**
8
     * Display if the TTL is incorrect
9
     *
10
     * @param string $value The value that is wrong.
11
     * @return static
12
     */
13
    public static function invalidTimeToLive($value)
14
    {
15
        return new static(sprintf("Time to live must be between 0 and 2419200. Current value is: %s.", $value));
16
    }
17
18
    /**
19
     * Display if the priority is incorrect.
20
     *
21
     * @return static
22
     */
23
    public static function invalidPriority()
24
    {
25
        return new static("Priority can be either 'normal' or 'high'.");
26
    }
27
}
28