Passed
Push — master ( 59e1e1...c1229c )
by Ryuichi
03:02
created

Number::isValid()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 2
eloc 1
nc 2
nop 2
crap 2
1
<?php
2
namespace WebStream\Annotation\Attributes\Ext\ValidateRule;
3
4
/**
5
 * Number
6
 * @author Ryuichi TANAKA.
7
 * @since 2015/03/30
8
 * @version 0.4
9
 */
10
class Number implements IValidate
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15 8
    public function isValid($value, $rule)
16
    {
17 8
        return $value === null || is_numeric($value);
18
    }
19
}
20