Failed Conditions
Pull Request — experimental/3.1 (#2424)
by chihiro
42:25
created

ValidatableEmptyProcessor::validate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 2
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Plugin\PurchaseProcessors\Processor;
4
5
use Eccube\Entity\ItemInterface;
6
use Eccube\Service\PurchaseFlow\ItemValidateException;
7
use Eccube\Service\PurchaseFlow\PurchaseContext;
8
use Eccube\Service\PurchaseFlow\ValidatableItemProcessor;
9
10
class ValidatableEmptyProcessor extends ValidatableItemProcessor
0 ignored issues
show
introduced by
Missing class doc comment
Loading history...
11
{
12
    protected function validate(ItemInterface $item, PurchaseContext $context)
13
    {
14
        $error = false;
15
        if ($error) {
16
            throw new ItemValidateException('ValidatableEmptyProcessorのエラーです');
17
        }
18
    }
19
20
    protected function handle(ItemInterface $item, PurchaseContext $context)
21
    {
22
        $item->setQuantity(100);
23
    }
24
}
25