Conditions | 3 |
Paths | 4 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
31 | public function __construct($value = null) |
||
32 | { |
||
33 | // Use the default value when no value is supplied, this cannot be omitted due to |
||
34 | // non-strict comparison null == 0, resulting in the integer 0. |
||
35 | if (is_null($value)) { |
||
36 | $value = static::__default; |
||
37 | } |
||
38 | |||
39 | // Verify the supplied value is present when we don't check for the type. |
||
40 | if (\in_array($value, static::toArray(), false)) { |
||
41 | $value = (int) $value; |
||
42 | } |
||
43 | |||
44 | parent::__construct($value); |
||
45 | } |
||
46 | } |
||
47 |