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

InvalidOptionsException::invalidTimeToLive()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 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