Completed
Branch feature/pre-split (a42d1e)
by Anton
03:22
created

IntegerArray   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 14
rs 10
c 1
b 0
f 1
wmc 2
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A filterValue() 0 8 2
1
<?php
2
/**
3
 * components
4
 *
5
 * @author    Wolfy-J
6
 */
7
namespace Spiral\ODM\Accessors;
8
9
/**
10
 * Allows to store only integer values.
11
 */
12
class IntegerArray extends AbstractArray
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    protected function filterValue($value)
18
    {
19
        if (!is_numeric($value)) {
20
            return null;
21
        }
22
23
        return intval($value);
24
    }
25
}