Failed Conditions
Push — experimental/3.1 ( 965511...751c7a )
by chihiro
21s
created

ValidatableItemHolderProcessor::validate()

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
nc 1
dl 0
loc 1
c 0
b 0
f 0
1
<?php
2
3
namespace Eccube\Service\PurchaseFlow;
4
5
use Eccube\Entity\ItemHolderInterface;
6
7
abstract class ValidatableItemHolderProcessor implements ItemHolderProcessor
0 ignored issues
show
introduced by
Abstract class name is not prefixed with "Abstract"
Loading history...
introduced by
Missing class doc comment
Loading history...
8
{
9
    /**
10
     * @param ItemHolderInterface $itemHolder
11
     * @param PurchaseContext     $context
12
     *
13
     * @return ProcessResult
14
     */
15
    final public function process(ItemHolderInterface $itemHolder, PurchaseContext $context)
16
    {
17
        try {
18
            $this->validate($itemHolder, $context);
19
20
            return ProcessResult::success();
21
        } catch (ItemValidateException $e) {
22
            return ProcessResult::error($e->getMessage());
23
        }
24
    }
25
26
    abstract protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context);
27
28
    protected function handle(ItemHolderInterface $itemHolder)
0 ignored issues
show
Unused Code introduced by
The parameter $itemHolder is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
29
    {
30
    }
31
}
32