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

InvalidNotificationException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A invalidColor() 0 4 1
A invalidArray() 0 4 1
1
<?php
2
namespace ker0x\Push\Adapter\Fcm\Message\Exception;
3
4
class InvalidNotificationException extends AbstractException
5
{
6
7
    /**
8
     * Display if the color is not in #rrggbb format.
9
     *
10
     * @return static
11
     */
12
    public static function invalidColor()
13
    {
14
        return new static("The color must be expressed in #rrggbb format.");
15
    }
16
17
    /**
18
     * Display if key `title` is missing.
19
     *
20
     * @return static
21
     */
22
    public static function invalidArray()
23
    {
24
        return new static("Notification array must contain at least a key 'title'.");
25
    }
26
}
27