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

GoodAuthor::verify()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 3

Importance

Changes 2
Bugs 1 Features 0
Metric Value
c 2
b 1
f 0
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
cc 3
eloc 3
nc 2
nop 1
crap 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 GoodAuthor.
10
 */
11
class GoodAuthor implements CheckInterface
12
{
13
    /**
14
     * Make a verification.
15
     *
16
     * @param Package $package
17
     *
18
     * @throws ValidatorException
19
     *
20
     * @return mixed|void
21
     */
22 9
    public function verify(Package $package)
23
    {
24 9
        if (null === $package->getAuthor() || empty($package->getAuthor())) {
25 3
            throw new ValidatorException('Author is not defined!');
26
        }
27 6
    }
28
}
29