SimpleArrayLibrary::isLogicallyCastableToInt()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 2
eloc 2
nc 2
nop 1
1
<?php
2
3
namespace SimpleArrayLibrary;
4
5
use SimpleArrayLibrary\Categories\Changers;
6
use SimpleArrayLibrary\Categories\Checkers;
7
use SimpleArrayLibrary\Categories\Counters;
8
use SimpleArrayLibrary\Categories\Getters;
9
use SimpleArrayLibrary\Categories\Inspectors;
10
11
class SimpleArrayLibrary
12
{
13
    use Changers, Checkers, Counters, Getters, Inspectors;
14
15
    const TYPE_INT = 'int';
16
    const TYPE_STRING = 'string';
17
    const TYPE_FLOAT = 'float';
18
    const TYPE_BOOL = 'bool';
19
    const TYPE_ARRAY = 'array';
20
    const TYPE_OBJECT = 'object';
21
22
    /**
23
     * Check whether casting a variable to int would conway useful information
24
     *
25
     * @param mixed $input
26
     *
27
     * @return bool
28
     */
29
    private static function isLogicallyCastableToInt($input)
0 ignored issues
show
Unused Code introduced by
This method is not used, and could be removed.
Loading history...
30
    {
31
        return !is_bool($input) && filter_var($input, FILTER_VALIDATE_INT) !== false;
32
    }
33
}