Validator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 29
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A verify() 0 8 2
1
<?php
2
3
namespace Ptondereau\PackMe\Validators;
4
5
use Ptondereau\PackMe\Package;
6
use Ptondereau\PackMe\Validators\Checks\ApplicationExist;
7
use Ptondereau\PackMe\Validators\Checks\GoodAuthor;
8
use Ptondereau\PackMe\Validators\Checks\GoodName;
9
10
class Validator
11
{
12
    /**
13
     * List of checks.
14
     *
15
     * @var string[]
16
     */
17
    protected $checks = [
18
        ApplicationExist::class,
19
        GoodName::class,
20
        GoodAuthor::class,
21
    ];
22
23
    /**
24
     * Ensure all Package's parameters are good.
25
     *
26
     * @param Package $package
27
     *
28
     * @return bool
29
     */
30 15
    public function verify(Package $package)
31
    {
32 15
        foreach ($this->checks as $class) {
33 15
            (new $class())->verify($package);
34 4
        }
35
36 6
        return true;
37
    }
38
}
39