@@ -1,6 +1,5 @@ |
||
| 1 | 1 | <?php namespace Knot\Dict; |
| 2 | 2 | |
| 3 | -use ArrayAccess; |
|
| 4 | 3 | use Countable; |
| 5 | 4 | use Illuminate\Contracts\Support\Arrayable; |
| 6 | 5 | use IteratorAggregate; |
@@ -75,8 +75,7 @@ discard block |
||
| 75 | 75 | if ( array_key_exists($key, $this->data) ) |
| 76 | 76 | { |
| 77 | 77 | $target =& $this->data[$key]; |
| 78 | - } |
|
| 79 | - else |
|
| 78 | + } else |
|
| 80 | 79 | { |
| 81 | 80 | throw new WrongArrayPathException($key); |
| 82 | 81 | } |
@@ -115,8 +114,7 @@ discard block |
||
| 115 | 114 | $arguments = array_merge([ &$this->data ], $arguments); |
| 116 | 115 | |
| 117 | 116 | return call_user_func_array($function, $arguments); |
| 118 | - } |
|
| 119 | - catch (\Exception $e) |
|
| 117 | + } catch (\Exception $e) |
|
| 120 | 118 | { |
| 121 | 119 | throw new FunctionExecuteException($methodPath); |
| 122 | 120 | } |
@@ -137,8 +135,7 @@ discard block |
||
| 137 | 135 | try |
| 138 | 136 | { |
| 139 | 137 | return $this->getHelperManager()->execute($method, $arguments, $this); |
| 140 | - } |
|
| 141 | - catch (\Exception $e) |
|
| 138 | + } catch (\Exception $e) |
|
| 142 | 139 | { |
| 143 | 140 | throw $e; |
| 144 | 141 | } |
@@ -51,8 +51,7 @@ |
||
| 51 | 51 | if ( is_null($offset) ) |
| 52 | 52 | { |
| 53 | 53 | $this->data[] = $value; |
| 54 | - } |
|
| 55 | - else |
|
| 54 | + } else |
|
| 56 | 55 | { |
| 57 | 56 | $this->data[$offset] = $value; |
| 58 | 57 | } |
@@ -127,13 +127,11 @@ |
||
| 127 | 127 | try |
| 128 | 128 | { |
| 129 | 129 | return call_user_func($targetFunction, $knot, $arguments, $functionName); |
| 130 | - } |
|
| 131 | - catch (\Exception $e) |
|
| 130 | + } catch (\Exception $e) |
|
| 132 | 131 | { |
| 133 | 132 | throw new FunctionExecuteException($functionName); |
| 134 | 133 | } |
| 135 | - } |
|
| 136 | - else |
|
| 134 | + } else |
|
| 137 | 135 | { |
| 138 | 136 | throw new WrongFunctionException($functionName); |
| 139 | 137 | } |
@@ -63,8 +63,7 @@ discard block |
||
| 63 | 63 | $this->get($path); |
| 64 | 64 | |
| 65 | 65 | return true; |
| 66 | - } |
|
| 67 | - catch (WrongArrayPathException $e) |
|
| 66 | + } catch (WrongArrayPathException $e) |
|
| 68 | 67 | { |
| 69 | 68 | return false; |
| 70 | 69 | } |
@@ -136,8 +135,7 @@ discard block |
||
| 136 | 135 | try |
| 137 | 136 | { |
| 138 | 137 | return $this->get($path); |
| 139 | - } |
|
| 140 | - catch (WrongArrayPathException $e) |
|
| 138 | + } catch (WrongArrayPathException $e) |
|
| 141 | 139 | { |
| 142 | 140 | if ( isset( $value ) ) |
| 143 | 141 | { |