Completed
Branch develop (f935f6)
by Romain
01:43
created

AbstractException   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 22
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A mustBeString() 0 4 1
A mustBeBool() 0 4 1
A mustBeInt() 0 4 1
A arrayEmpty() 0 4 1
1
<?php
2
namespace ker0x\Push\Adapter\Fcm\Message\Exception;
3
4
use Exception;
5
6
abstract class AbstractException extends Exception
7
{
8
    public static function mustBeString($key)
9
    {
10
        return new static("{$key} must be a string.");
11
    }
12
13
    public static function mustBeBool($key)
14
    {
15
        return new static("{$key} must be a boolean.");
16
    }
17
18
    public static function mustBeInt($key)
19
    {
20
        return new static("{$key} must be a integer.");
21
    }
22
23
    public static function arrayEmpty()
24
    {
25
        return new static("Array can not be empty.");
26
    }
27
}