@@ -32,9 +32,9 @@ |
||
32 | 32 | * |
33 | 33 | * @throws \UnexpectedValueException if incompatible type is given. |
34 | 34 | */ |
35 | - public function __construct($initial_value, $strict=null) { |
|
35 | + public function __construct($initial_value, $strict = null) { |
|
36 | 36 | $class = new \ReflectionClass($this); |
37 | - if(!is_string($initial_value)) { |
|
37 | + if (!is_string($initial_value)) { |
|
38 | 38 | throw new \UnexpectedValueException('Value not a string'); |
39 | 39 | } |
40 | 40 | $this->__default = $initial_value; |
@@ -32,9 +32,9 @@ |
||
32 | 32 | * |
33 | 33 | * @throws \UnexpectedValueException if incompatible type is given. |
34 | 34 | */ |
35 | - public function __construct($initial_value, $strict=null) { |
|
35 | + public function __construct($initial_value, $strict = null) { |
|
36 | 36 | $class = new \ReflectionClass($this); |
37 | - if(!is_float($initial_value) && !is_int($initial_value)) { |
|
37 | + if (!is_float($initial_value) && !is_int($initial_value)) { |
|
38 | 38 | throw new \UnexpectedValueException('Value not a float'); |
39 | 39 | } |
40 | 40 | $this->__default = $initial_value; |
@@ -37,13 +37,13 @@ discard block |
||
37 | 37 | * |
38 | 38 | * @throws \UnexpectedValueException if incompatible type is given. |
39 | 39 | */ |
40 | - public function __construct($initial_value=null, $strict=null) { |
|
40 | + public function __construct($initial_value = null, $strict = null) { |
|
41 | 41 | if ($initial_value === null) { |
42 | 42 | $initial_value = static::__default; |
43 | 43 | } |
44 | 44 | $class = new \ReflectionClass($this); |
45 | - if(!in_array($initial_value, $class->getConstants())) { |
|
46 | - throw new \UnexpectedValueException('Value not a const in enum '.$class->getShortName()); |
|
45 | + if (!in_array($initial_value, $class->getConstants())) { |
|
46 | + throw new \UnexpectedValueException('Value not a const in enum ' . $class->getShortName()); |
|
47 | 47 | } |
48 | 48 | $this->__default = $initial_value; |
49 | 49 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * @return array |
73 | 73 | */ |
74 | 74 | final public function __debugInfo() { |
75 | - return array( '__default' => $this->__default); |
|
75 | + return array('__default' => $this->__default); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | } |
@@ -32,9 +32,9 @@ |
||
32 | 32 | * |
33 | 33 | * @throws \UnexpectedValueException if incompatible type is given. |
34 | 34 | */ |
35 | - public function __construct($initial_value, $strict=null) { |
|
35 | + public function __construct($initial_value, $strict = null) { |
|
36 | 36 | $class = new \ReflectionClass($this); |
37 | - if(!is_int($initial_value)) { |
|
37 | + if (!is_int($initial_value)) { |
|
38 | 38 | throw new \UnexpectedValueException('Value not an integer'); |
39 | 39 | } |
40 | 40 | $this->__default = $initial_value; |
@@ -24,7 +24,7 @@ |
||
24 | 24 | * @param bool $include_default Whether to include __default property. |
25 | 25 | * @return array |
26 | 26 | */ |
27 | - final public function getConstList( $include_default=false ) { |
|
27 | + final public function getConstList($include_default = false) { |
|
28 | 28 | $class = new \ReflectionClass($this); |
29 | 29 | $constants = $class->getConstants(); |
30 | 30 | if (!$include_default) { |