@@ -50,8 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | if($reflectionType->isInterface() && !$reflectionClass->implementsInterface($type)){ |
| 52 | 52 | trigger_error($class.' does not implement '.$type); |
| 53 | - } |
|
| 54 | - elseif(!$reflectionClass->isSubclassOf($type)) { |
|
| 53 | + } elseif(!$reflectionClass->isSubclassOf($type)) { |
|
| 55 | 54 | trigger_error($class.' does not inherit '.$type); |
| 56 | 55 | } |
| 57 | 56 | |
@@ -64,8 +63,7 @@ discard block |
||
| 64 | 63 | } |
| 65 | 64 | |
| 66 | 65 | return $object; |
| 67 | - } |
|
| 68 | - catch(Exception $e){ |
|
| 66 | + } catch(Exception $e){ |
|
| 69 | 67 | throw new TraitException('ClassLoader: '.$e->getMessage()); |
| 70 | 68 | } |
| 71 | 69 | |
@@ -56,8 +56,7 @@ |
||
| 56 | 56 | |
| 57 | 57 | if(array_key_exists($var, $_ENV)){ |
| 58 | 58 | return $_ENV[$var]; |
| 59 | - } |
|
| 60 | - elseif(function_exists('getenv')){ |
|
| 59 | + } elseif(function_exists('getenv')){ |
|
| 61 | 60 | if($e = getenv($var) !== false){ |
| 62 | 61 | return $e; |
| 63 | 62 | } |
@@ -53,8 +53,7 @@ |
||
| 53 | 53 | |
| 54 | 54 | if(is_null($offset)){ |
| 55 | 55 | $this->array[] = $value; |
| 56 | - } |
|
| 57 | - else{ |
|
| 56 | + } else{ |
|
| 58 | 57 | $this->array[$offset] = $value; |
| 59 | 58 | } |
| 60 | 59 | |
@@ -69,8 +69,7 @@ |
||
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | return $out; |
| 72 | - } |
|
| 73 | - catch(Exception $e){ |
|
| 72 | + } catch(Exception $e){ |
|
| 74 | 73 | throw new TraitException($e->getMessage()); |
| 75 | 74 | } |
| 76 | 75 | |
@@ -35,17 +35,13 @@ |
||
| 35 | 35 | |
| 36 | 36 | if(($array instanceof ArrayObject) || ($array instanceof ArrayIterator)){ |
| 37 | 37 | $this->array = $array->getArrayCopy(); |
| 38 | - } |
|
| 39 | - elseif($array instanceof Traversable){ |
|
| 38 | + } elseif($array instanceof Traversable){ |
|
| 40 | 39 | $this->array = iterator_to_array($array); |
| 41 | - } |
|
| 42 | - elseif(gettype($array) === 'object'){ |
|
| 40 | + } elseif(gettype($array) === 'object'){ |
|
| 43 | 41 | $this->array = get_object_vars($array); |
| 44 | - } |
|
| 45 | - elseif(is_array($array)){ |
|
| 42 | + } elseif(is_array($array)){ |
|
| 46 | 43 | $this->array = $array; |
| 47 | - } |
|
| 48 | - else{ |
|
| 44 | + } else{ |
|
| 49 | 45 | $this->array = []; |
| 50 | 46 | } |
| 51 | 47 | |