Completed
Push — master ( 9ab068...67c411 )
by Pierre
04:25
created

GoodName   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A verify() 0 6 3
1
<?php
2
3
namespace Ptondereau\PackMe\Validators\Checks;
4
5
use Ptondereau\PackMe\Package;
6
use Ptondereau\PackMe\Validators\ValidatorException;
7
8
/**
9
 * Class GoodName.
10
 */
11
class GoodName implements CheckInterface
12
{
13
    /**
14
     * Make a verification.
15
     *
16
     * @param Package $package
17
     *
18
     * @throws ValidatorException
19
     *
20
     * @return void
21
     */
22 12
    public function verify(Package $package)
23
    {
24 12
        if (null === $package->getName() || empty($package->getName())) {
25 3
            throw new ValidatorException('Package name is not defined!');
26
        }
27 9
    }
28
}
29