ManufacturersScrappedValidator::validate()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 1
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 2
rs 10
c 0
b 0
f 0
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