Passed
Push — develop ( b6c667...c88fc5 )
by Yasunori
02:02
created

IsNumericTrait   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 7
c 1
b 0
f 1
dl 0
loc 15
rs 10
wmc 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A is_numeric() 0 13 4
1
<?php
2
3
namespace devfym\IntelliPHP\Traits;
4
5
trait IsNumericTrait
6
{
7
    function is_numeric($inputs)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
8
    {
9
        $DataType = 'Numeric';
10
11
        foreach ($inputs as $i) {
12
            if (!is_numeric($i)) {
13
                if (!is_null($i)) {
14
                    $DataType = 'Object';
15
                }
16
            }
17
        }
18
19
        return $DataType;
20
    }
21
}