TimerPrecisionValidator::check()   A
last analyzed

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
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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