NumericValidationStrategy::validate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php declare(strict_types=1);
2
3
namespace PerfectApp\Validation;
4
5
/**
6
 *
7
 */
8
class NumericValidationStrategy implements ValidationStrategy
9
{
10
11
    /**
12
     * @param $data
13
     * @return bool
14
     */
15 4
    public function validate($data): bool
16
    {
17
        // Return true if the data is a valid numeric value, false otherwise
18 4
        return is_numeric($data);
19
    }
20
}
21