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

ValidatableEmptyProcessor   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A validate() 0 7 2
A handle() 0 4 1
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