@@ -66,8 +66,8 @@ |
||
| 66 | 66 | if (false !== ($exceptionKey = array_search('Exception', $classNameParts)) OR
|
| 67 | 67 | false !== ($exceptionKey = array_search('Exceptions', $classNameParts))
|
| 68 | 68 | ) {
|
| 69 | - if (isset($classNameParts[ $exceptionKey - 1 ])) {
|
|
| 70 | - $classParameter = $classNameParts[ $exceptionKey - 1 ]; |
|
| 69 | + if (isset($classNameParts[$exceptionKey - 1])) {
|
|
| 70 | + $classParameter = $classNameParts[$exceptionKey - 1]; |
|
| 71 | 71 | |
| 72 | 72 | } |
| 73 | 73 | } |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | * @param $className |
| 17 | 17 | */ |
| 18 | 18 | spl_autoload_register( |
| 19 | - function ($className) {
|
|
| 19 | + function($className) {
|
|
| 20 | 20 | if (strpos($className, 'O2System\Spl\\') === false) {
|
| 21 | 21 | return; |
| 22 | 22 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public function __isset($offset) |
| 53 | 53 | {
|
| 54 | - return isset($this->storage[ $offset ]); |
|
| 54 | + return isset($this->storage[$offset]); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | // ------------------------------------------------------------------------ |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function __unset($offset) |
| 71 | 71 | {
|
| 72 | - unset($this->storage[ $offset ]); |
|
| 72 | + unset($this->storage[$offset]); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | // ------------------------------------------------------------------------ |
@@ -126,11 +126,11 @@ discard block |
||
| 126 | 126 | public function offsetGet($offset) |
| 127 | 127 | {
|
| 128 | 128 | if ($this->offsetExists($offset)) {
|
| 129 | - return $this->storage[ $offset ]; |
|
| 129 | + return $this->storage[$offset]; |
|
| 130 | 130 | } else {
|
| 131 | - $this->storage[ $offset ] = []; |
|
| 131 | + $this->storage[$offset] = []; |
|
| 132 | 132 | |
| 133 | - return $this->storage[ $offset ]; |
|
| 133 | + return $this->storage[$offset]; |
|
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | */ |
| 156 | 156 | public function offsetExists($offset) |
| 157 | 157 | {
|
| 158 | - return (bool)isset($this->storage[ $offset ]); |
|
| 158 | + return (bool)isset($this->storage[$offset]); |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | // ------------------------------------------------------------------------ |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | */ |
| 180 | 180 | public function offsetSet($offset, $value) |
| 181 | 181 | {
|
| 182 | - $this->storage[ $offset ] = $value; |
|
| 182 | + $this->storage[$offset] = $value; |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | // ------------------------------------------------------------------------ |
@@ -200,8 +200,8 @@ discard block |
||
| 200 | 200 | */ |
| 201 | 201 | public function offsetUnset($offset) |
| 202 | 202 | {
|
| 203 | - if (isset($this->storage[ $offset ])) {
|
|
| 204 | - unset($this->storage[ $offset ]); |
|
| 203 | + if (isset($this->storage[$offset])) {
|
|
| 204 | + unset($this->storage[$offset]); |
|
| 205 | 205 | } |
| 206 | 206 | } |
| 207 | 207 | |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | return filter_var_array($offset, $filter); |
| 227 | 227 | } elseif (is_array($storage) AND isset($filter)) {
|
| 228 | 228 | foreach ($storage as $key => $value) {
|
| 229 | - $storage[ $key ] = filter_var($value, $filter); |
|
| 229 | + $storage[$key] = filter_var($value, $filter); |
|
| 230 | 230 | } |
| 231 | 231 | } elseif (isset($filter)) {
|
| 232 | 232 | return filter_var($storage, $filter); |
@@ -105,7 +105,7 @@ |
||
| 105 | 105 | $arrayCopy = []; |
| 106 | 106 | |
| 107 | 107 | foreach ($this as $key => $value) {
|
| 108 | - $arrayCopy[ $key ] = $value; |
|
| 108 | + $arrayCopy[$key] = $value; |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | return $arrayCopy; |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | $camelcaseStorage = []; |
| 99 | 99 | |
| 100 | 100 | foreach ($this->getArrayCopy() as $offset => $value) {
|
| 101 | - $camelcaseStorage[ camelcase($offset) ] = $value; |
|
| 101 | + $camelcaseStorage[camelcase($offset)] = $value; |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | $this->exchangeArray($camelcaseStorage); |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $arraySlices = []; |
| 133 | 133 | |
| 134 | 134 | foreach ($lengths as $key => $length) {
|
| 135 | - $arraySlices[ $key ] = array_slice($this->getArrayCopy(), 0, $length, $preserveKeys); |
|
| 135 | + $arraySlices[$key] = array_slice($this->getArrayCopy(), 0, $length, $preserveKeys); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | return $arraySlices; |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | |
| 182 | 182 | $offset = 0; |
| 183 | 183 | foreach ($sizes as $key => $limit) {
|
| 184 | - $arrayChunks[ $key ] = array_slice($this->getArrayCopy(), $offset, $limit, $preserveKeys); |
|
| 184 | + $arrayChunks[$key] = array_slice($this->getArrayCopy(), $offset, $limit, $preserveKeys); |
|
| 185 | 185 | $offset = $limit; |
| 186 | 186 | } |
| 187 | 187 | |
@@ -105,7 +105,7 @@ |
||
| 105 | 105 | $arrayCopy = []; |
| 106 | 106 | |
| 107 | 107 | foreach ($this as $key => $value) {
|
| 108 | - $arrayCopy[ $key ] = $value; |
|
| 108 | + $arrayCopy[$key] = $value; |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | return $arrayCopy; |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function attach($offset, \Closure $closure) |
| 45 | 45 | {
|
| 46 | - $this->closures[ $offset ] = $closure; |
|
| 46 | + $this->closures[$offset] = $closure; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | // ------------------------------------------------------------------------ |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public function has($offset) |
| 78 | 78 | {
|
| 79 | - return (bool)isset($this->closures[ $offset ]); |
|
| 79 | + return (bool)isset($this->closures[$offset]); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | // ------------------------------------------------------------------------ |
@@ -105,8 +105,8 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | public function detach($offset) |
| 107 | 107 | {
|
| 108 | - if (isset($this->closures[ $offset ])) {
|
|
| 109 | - unset($this->closures[ $offset ]); |
|
| 108 | + if (isset($this->closures[$offset])) {
|
|
| 109 | + unset($this->closures[$offset]); |
|
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | |
@@ -142,8 +142,8 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | public function get($offset, array $arguments = []) |
| 144 | 144 | {
|
| 145 | - return isset($this->closures[ $offset ]) ? call_user_func_array( |
|
| 146 | - $this->closures[ $offset ], |
|
| 145 | + return isset($this->closures[$offset]) ? call_user_func_array( |
|
| 146 | + $this->closures[$offset], |
|
| 147 | 147 | $arguments |
| 148 | 148 | ) : false; |
| 149 | 149 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function attach($offset, SplServiceRegistry $service) |
| 46 | 46 | {
|
| 47 | - $this->services[ $offset ] = $service; |
|
| 47 | + $this->services[$offset] = $service; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | // ------------------------------------------------------------------------ |
@@ -73,8 +73,8 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | public function detach($offset) |
| 75 | 75 | {
|
| 76 | - if (isset($this->services[ $offset ])) {
|
|
| 77 | - unset($this->services[ $offset ]); |
|
| 76 | + if (isset($this->services[$offset])) {
|
|
| 77 | + unset($this->services[$offset]); |
|
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | public function has($offset) |
| 110 | 110 | {
|
| 111 | - return (bool)isset($this->services[ $offset ]); |
|
| 111 | + return (bool)isset($this->services[$offset]); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | // ------------------------------------------------------------------------ |
@@ -125,9 +125,9 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | public function &__get($offset) |
| 127 | 127 | {
|
| 128 | - $get[ $offset ] = $this->get($offset); |
|
| 128 | + $get[$offset] = $this->get($offset); |
|
| 129 | 129 | |
| 130 | - return $get[ $offset ]; |
|
| 130 | + return $get[$offset]; |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | // ------------------------------------------------------------------------ |
@@ -144,16 +144,16 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | public function &get($offset, array $arguments = []) |
| 146 | 146 | {
|
| 147 | - $get[ $offset ] = false; |
|
| 147 | + $get[$offset] = false; |
|
| 148 | 148 | |
| 149 | 149 | if ($this->has($offset)) {
|
| 150 | - $service = $this->services[ $offset ]; |
|
| 150 | + $service = $this->services[$offset]; |
|
| 151 | 151 | |
| 152 | 152 | if ($service instanceof SplServiceRegistry) {
|
| 153 | 153 | if (empty($arguments)) {
|
| 154 | 154 | return $service->getInstance(); |
| 155 | 155 | } else {
|
| 156 | - if($service->hasMethod('__construct')) {
|
|
| 156 | + if ($service->hasMethod('__construct')) {
|
|
| 157 | 157 | $newServiceInstance = $service->newInstanceArgs($arguments); |
| 158 | 158 | } else {
|
| 159 | 159 | $newServiceInstance = $service->getInstance(); |
@@ -162,24 +162,24 @@ discard block |
||
| 162 | 162 | if ($DocComment = $service->getDocComment()) {
|
| 163 | 163 | preg_match_all('/@inject\s(.*)/', $DocComment, $matches);
|
| 164 | 164 | |
| 165 | - if (count($matches[ 1 ])) {
|
|
| 166 | - foreach ($matches[ 1 ] as $className) {
|
|
| 165 | + if (count($matches[1])) {
|
|
| 166 | + foreach ($matches[1] as $className) {
|
|
| 167 | 167 | $className = trim($className, '\\'); |
| 168 | 168 | $className = trim($className); |
| 169 | 169 | |
| 170 | 170 | $map = strtolower(get_class_name($className)); |
| 171 | 171 | |
| 172 | - if (isset($this->map[ $className ])) {
|
|
| 173 | - $map = $this->map[ $className ]; |
|
| 172 | + if (isset($this->map[$className])) {
|
|
| 173 | + $map = $this->map[$className]; |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | $variable = $map; |
| 177 | - $object =& $this->get($map); |
|
| 177 | + $object = & $this->get($map); |
|
| 178 | 178 | |
| 179 | 179 | preg_match_all('/[$](.*)\s(.*)/', trim($className), $classMatches);
|
| 180 | 180 | |
| 181 | - if (count($classMatches[ 1 ])) {
|
|
| 182 | - $variable = $classMatches[ 1 ][ 0 ]; |
|
| 181 | + if (count($classMatches[1])) {
|
|
| 182 | + $variable = $classMatches[1][0]; |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | $setterMethod = ucwords(str_replace(['-', '_'], ' ', $variable)); |
@@ -191,18 +191,18 @@ discard block |
||
| 191 | 191 | } elseif (method_exists($newServiceInstance, '__set')) {
|
| 192 | 192 | $newServiceInstance->__set($variable, $object); |
| 193 | 193 | } else {
|
| 194 | - $newServiceInstance->{$variable} =& $object;
|
|
| 194 | + $newServiceInstance->{$variable} = & $object;
|
|
| 195 | 195 | } |
| 196 | 196 | } |
| 197 | 197 | } |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | - $get[ $offset ] = $newServiceInstance; |
|
| 200 | + $get[$offset] = $newServiceInstance; |
|
| 201 | 201 | } |
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | - return $get[ $offset ]; |
|
| 205 | + return $get[$offset]; |
|
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | // ------------------------------------------------------------------------ |