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

AbstractCondition::withOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 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