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

ApplicationExist   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

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