Passed
Push — master ( 9be0c8...8c1bed )
by Chris
02:56
created

ValidateBasket::validate()   A

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
rs 10
c 0
b 0
f 0
ccs 3
cts 3
cp 1
crap 2
1
<?php
2
3
namespace ConferenceTools\Tickets\Domain\Service\Basket;
4
5
use ConferenceTools\Tickets\Domain\ValueObject\Basket;
6
7
class ValidateBasket implements BasketValidator
8
{
9 2
    public function validate(Basket $basket): void
10
    {
11 2
        if (count($basket->getTickets()) === 0) {
12 1
            throw new \DomainException('You must choose at least 1 ticket to purchase');
13
        }
14 1
    }
15
}
16