TimerPrecisionValidator   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 12
ccs 2
cts 2
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A check() 0 3 1
1
<?php
2
/**
3
 * Validator for Timer precision values
4
 *
5
 * @file      TimerPrecisionValidator.php
6
 *
7
 * PHP version 8.0+
8
 *
9
 * @author    Yancharuk Alexander <alex at itvault dot info>
10
 * @copyright © 2012-2021 Alexander Yancharuk <alex at itvault at info>
11
 * @date      2018-03-05 20:32
12
 * @license   The BSD 3-Clause License
13
 *            <https://tldrlegal.com/license/bsd-3-clause-license-(revised)>
14
 */
15
16
namespace Veles\Validators;
17
18
use Veles\Tools\Precision;
19
20
class TimerPrecisionValidator implements ValidatorInterface
21
{
22
	/**
23
	 * Validation
24
	 *
25
	 * @param mixed $value Values for checking
26
	 *
27
	 * @return bool
28
	 */
29 17
	public function check($value)
30
	{
31 17
		return in_array($value, (new Precision)->getValues(), true);
32
	}
33
}
34