Passed
Push — master ( 893d1e...31005e )
by Kirill
03:35
created

AbstractCondition   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 1
b 0
f 0
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A withOptions() 0 6 1
1
<?php
2
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Spiral\Validation;
13
14
abstract class AbstractCondition implements ConditionInterface
15
{
16
    /** @var array */
17
    protected $options;
18
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function withOptions(?array $options): ConditionInterface
23
    {
24
        $condition = clone $this;
25
        $condition->options = $options ?? [];
26
27
        return $condition;
28
    }
29
}
30