Passed
Push — master ( d3853d...011878 )
by Smoren
02:21
created

BaseRule::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Smoren\Validator\Rules;
6
7
use Smoren\Validator\Exceptions\ValidationSuccessException;
8
use Smoren\Validator\Exceptions\ValidationError;
9
use Smoren\Validator\Interfaces\BaseRuleInterface;
10
use Smoren\Validator\Interfaces\ExecutionResultInterface;
11
use Smoren\Validator\Structs\ExecutionResult;
12
13
abstract class BaseRule implements BaseRuleInterface
14
{
15
    /**
16
     * {@inheritDoc}
17
     */
18 50
    public function validate($value): void
19
    {
20 50
        $this->execute($value);
21
    }
22
23
    /**
24
     * @param mixed $value
25
     *
26
     * @return ExecutionResultInterface
27
     */
28 50
    protected function execute($value): ExecutionResultInterface
29
    {
30 50
        return new ExecutionResult(false);
31
    }
32
}
33