ManufacturersScrappedValidator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 11
rs 10
c 0
b 0
f 0
ccs 3
cts 3
cp 1
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A validate() 0 4 2
1
<?php
2
/**
3
 * File: ManufacturersScrappedValidator.php
4
 *
5
 * @author      Maciej Sławik <[email protected]>
6
 * Github:      https://github.com/maciejslawik
7
 */
8
9
namespace MSlwk\Otomoto\App\Manufacturer\Validator;
10
11
use MSlwk\Otomoto\App\Exception\ManufacturersNotFoundException;
12
use MSlwk\Otomoto\App\Manufacturer\Data\ManufacturerDTOArray;
13
14
/**
15
 * Class ManufacturersScrappedValidator
16
 * @package MSlwk\Otomoto\App\Manufacturer\Validator
17
 */
18
class ManufacturersScrappedValidator implements ManufacturersScrappedValidatorInterface
19
{
20
    /**
21
     * @param ManufacturerDTOArray $manufacturerDTOArray
22
     * @return void
23
     * @throws ManufacturersNotFoundException
24
     */
25 2
    public function validate(ManufacturerDTOArray $manufacturerDTOArray): void
26
    {
27 2
        if ($manufacturerDTOArray->count() < 1) {
28 1
            throw new ManufacturersNotFoundException('No manufacturers were found');
29
        }
30 1
    }
31
}
32