Completed
Push — master ( 2aab01...227846 )
by Antonio Oertel
04:04
created

InvalidArgument   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 22
wmc 4
lcom 1
cbo 0
ccs 8
cts 8
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A notEmpty() 0 4 1
A isNotValidCnpj() 0 4 1
A isNotValidCpf() 0 4 1
A isNotValidPispasep() 0 4 1
1
<?php
2
3
namespace Brazanation\Documents\Exception;
4
5
class InvalidArgument extends \InvalidArgumentException
6
{
7 9
    public static function notEmpty($type)
8
    {
9 9
        return new static("The {$type} must not be empty");
10
    }
11
12 4
    public static function isNotValidCnpj($cnpj)
13
    {
14 4
        return new static("The CNPJ({$cnpj}) is not valid number");
15
    }
16
17 4
    public static function isNotValidCpf($cpf)
18
    {
19 4
        return new static("The CPF({$cpf}) is not valid number");
20
    }
21
22 4
    public static function isNotValidPispasep($pispasep)
23
    {
24 4
        return new static("The PisPasep({$pispasep}) is not valid number");
25
    }
26
}
27