AbstractRuleFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 3 1
1
<?php
2
3
namespace FigTree\Validation;
4
5
use Closure;
6
use FigTree\Validation\Contracts\{
7
	RuleInterface,
8
	RuleFactoryInterface
9
};
10
11
abstract class AbstractRuleFactory implements RuleFactoryInterface
12
{
13
	/**
14
	 * Create a new Rule.
15
	 *
16
	 * @param int $filterType The filter type.
17
	 * @param int $flags Bitewise set of filter flags.
18
	 * @param array $options Filter options.
19
	 * @param \Closure|null Callback method.
20
	 *
21
	 * @return \FigTree\Validation\Contracts\RuleInterface
22
	 *
23
	 * @see https://www.php.net/manual/en/filter.filters.php
24
	 * @see https://www.php.net/manual/en/filter.filters.flags.php
25
	 */
26
	public function create(int $filterType, int $flags = 0, array $options = [], ?Closure $callback = null): RuleInterface
27
	{
28
		return new Rule($filterType, $flags, $options, $callback);
29
	}
30
}
31