@@ -48,14 +48,14 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | public function &loadConnection($connectionOffset) |
| 50 | 50 | {
|
| 51 | - $loadConnection[ $connectionOffset ] = false; |
|
| 51 | + $loadConnection[$connectionOffset] = false; |
|
| 52 | 52 | |
| 53 | 53 | if ( ! $this->exists($connectionOffset) and $this->config->offsetExists($connectionOffset)) {
|
| 54 | 54 | |
| 55 | 55 | $connectionConfig = $this->config->offsetGet($connectionOffset); |
| 56 | 56 | |
| 57 | 57 | if (is_array($connectionConfig)) {
|
| 58 | - new Datastructures\Config($this->config[ $connectionOffset ]); |
|
| 58 | + new Datastructures\Config($this->config[$connectionOffset]); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | $this->createConnection($connectionOffset, $connectionConfig); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | ]; |
| 91 | 91 | |
| 92 | 92 | if (array_key_exists($connectionConfig->driver, $driverMaps)) {
|
| 93 | - if (class_exists($driverClassName = $driverMaps[ $connectionConfig->driver ])) {
|
|
| 93 | + if (class_exists($driverClassName = $driverMaps[$connectionConfig->driver])) {
|
|
| 94 | 94 | $driverInstance = new $driverClassName($connectionConfig); |
| 95 | 95 | $this->register($driverInstance, $connectionOffset); |
| 96 | 96 | } |
@@ -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\Database\\') === false) {
|
| 21 | 21 | return; |
| 22 | 22 | } |
@@ -29,9 +29,9 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | public function __construct(array $config) |
| 31 | 31 | {
|
| 32 | - if (isset($config[ 'default' ])) {
|
|
| 32 | + if (isset($config['default'])) {
|
|
| 33 | 33 | foreach ($config as $poolOffset => $poolConfig) {
|
| 34 | - $config[ $poolOffset ] = new self($poolConfig); |
|
| 34 | + $config[$poolOffset] = new self($poolConfig); |
|
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | 37 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | public function &__get($property) |
| 73 | 73 | {
|
| 74 | - return $this->storage[ $property ]; |
|
| 74 | + return $this->storage[$property]; |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | // ------------------------------------------------------------------------ |
@@ -87,16 +87,16 @@ discard block |
||
| 87 | 87 | public function store($index, $value) |
| 88 | 88 | {
|
| 89 | 89 | if (array_key_exists($index, $this->storage)) {
|
| 90 | - if (is_array($this->storage[ $index ])) {
|
|
| 90 | + if (is_array($this->storage[$index])) {
|
|
| 91 | 91 | if (is_array($value)) {
|
| 92 | - $this->storage[ $index ] = array_merge($this->storage[ $index ], $value); |
|
| 92 | + $this->storage[$index] = array_merge($this->storage[$index], $value); |
|
| 93 | 93 | } else {
|
| 94 | - array_push($this->storage[ $index ], $value); |
|
| 94 | + array_push($this->storage[$index], $value); |
|
| 95 | 95 | } |
| 96 | - } elseif (is_bool($this->storage[ $index ])) {
|
|
| 97 | - $this->storage[ $index ] = (bool)$value; |
|
| 96 | + } elseif (is_bool($this->storage[$index])) {
|
|
| 97 | + $this->storage[$index] = (bool)$value; |
|
| 98 | 98 | } else {
|
| 99 | - $this->storage[ $index ] = $value; |
|
| 99 | + $this->storage[$index] = $value; |
|
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | protected function resetRun(array $cacheKeys) |
| 204 | 204 | {
|
| 205 | 205 | foreach ($cacheKeys as $cacheKey => $cacheDefaultValue) {
|
| 206 | - $this->storage[ $cacheKey ] = $cacheDefaultValue; |
|
| 206 | + $this->storage[$cacheKey] = $cacheDefaultValue; |
|
| 207 | 207 | } |
| 208 | 208 | } |
| 209 | 209 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | */ |
| 183 | 183 | public function addFilter($field, $value) |
| 184 | 184 | {
|
| 185 | - $this->filter[ $field ] = $value; |
|
| 185 | + $this->filter[$field] = $value; |
|
| 186 | 186 | |
| 187 | 187 | return $this; |
| 188 | 188 | } |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | */ |
| 232 | 232 | public function addOption($option, $value) |
| 233 | 233 | {
|
| 234 | - $this->options[ $option ] = $value; |
|
| 234 | + $this->options[$option] = $value; |
|
| 235 | 235 | |
| 236 | 236 | return $this; |
| 237 | 237 | } |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | */ |
| 362 | 362 | public function setError($errorCode, $errorMessage) |
| 363 | 363 | {
|
| 364 | - $this->error[ $errorCode ] = $errorMessage; |
|
| 364 | + $this->error[$errorCode] = $errorMessage; |
|
| 365 | 365 | |
| 366 | 366 | return $this; |
| 367 | 367 | } |
@@ -228,9 +228,9 @@ discard block |
||
| 228 | 228 | // No connection resource? Check if there is a failover else throw an error |
| 229 | 229 | if ( ! $this->handle) {
|
| 230 | 230 | // Check if there is a failover set |
| 231 | - if ( ! empty($this->config[ 'failover' ]) && is_array($this->config[ 'failover' ])) {
|
|
| 231 | + if ( ! empty($this->config['failover']) && is_array($this->config['failover'])) {
|
|
| 232 | 232 | // Go over all the failovers |
| 233 | - foreach ($this->config[ 'failover' ] as $failover) {
|
|
| 233 | + foreach ($this->config['failover'] as $failover) {
|
|
| 234 | 234 | |
| 235 | 235 | // Try to connect |
| 236 | 236 | $this->platformConnectHandler($failover = new Config($failover)); |
@@ -301,11 +301,11 @@ discard block |
||
| 301 | 301 | */ |
| 302 | 302 | public function getPlatformInfo() |
| 303 | 303 | {
|
| 304 | - if (isset($this->queriesResultCache[ 'platformInfo' ])) {
|
|
| 305 | - return $this->queriesResultCache[ 'platformInfo' ]; |
|
| 304 | + if (isset($this->queriesResultCache['platformInfo'])) {
|
|
| 305 | + return $this->queriesResultCache['platformInfo']; |
|
| 306 | 306 | } |
| 307 | 307 | |
| 308 | - return $this->queriesResultCache[ 'platformInfo' ] = $this->platformGetPlatformInfoHandler(); |
|
| 308 | + return $this->queriesResultCache['platformInfo'] = $this->platformGetPlatformInfoHandler(); |
|
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | // ------------------------------------------------------------------------ |
@@ -473,11 +473,11 @@ discard block |
||
| 473 | 473 | */ |
| 474 | 474 | final public function hasDatabase($databaseName) |
| 475 | 475 | {
|
| 476 | - if (empty($this->queriesResultCache[ 'databaseNames' ])) {
|
|
| 476 | + if (empty($this->queriesResultCache['databaseNames'])) {
|
|
| 477 | 477 | $this->getDatabases(); |
| 478 | 478 | } |
| 479 | 479 | |
| 480 | - return (bool)in_array($databaseName, $this->queriesResultCache[ 'databaseNames' ]); |
|
| 480 | + return (bool)in_array($databaseName, $this->queriesResultCache['databaseNames']); |
|
| 481 | 481 | } |
| 482 | 482 | |
| 483 | 483 | //-------------------------------------------------------------------- |
@@ -505,11 +505,11 @@ discard block |
||
| 505 | 505 | */ |
| 506 | 506 | public function hasCollection($collection) |
| 507 | 507 | {
|
| 508 | - if (empty($this->queriesResultCache[ 'collectionNames' ])) {
|
|
| 508 | + if (empty($this->queriesResultCache['collectionNames'])) {
|
|
| 509 | 509 | $this->getCollections(); |
| 510 | 510 | } |
| 511 | 511 | |
| 512 | - return (bool)in_array($collection, $this->queriesResultCache[ 'collectionNames' ]); |
|
| 512 | + return (bool)in_array($collection, $this->queriesResultCache['collectionNames']); |
|
| 513 | 513 | } |
| 514 | 514 | |
| 515 | 515 | // ------------------------------------------------------------------------ |
@@ -537,11 +537,11 @@ discard block |
||
| 537 | 537 | */ |
| 538 | 538 | public function hasKey($key, $collection) |
| 539 | 539 | {
|
| 540 | - if (empty($this->queriesResultCache[ 'collectionKeys' ][ $collection ])) {
|
|
| 540 | + if (empty($this->queriesResultCache['collectionKeys'][$collection])) {
|
|
| 541 | 541 | $this->getKeys($collection); |
| 542 | 542 | } |
| 543 | 543 | |
| 544 | - return (bool)in_array($key, $this->queriesResultCache[ 'collectionKeys' ][ $collection ]); |
|
| 544 | + return (bool)in_array($key, $this->queriesResultCache['collectionKeys'][$collection]); |
|
| 545 | 545 | } |
| 546 | 546 | |
| 547 | 547 | // ------------------------------------------------------------------------ |
@@ -572,11 +572,11 @@ discard block |
||
| 572 | 572 | */ |
| 573 | 573 | public function hasIndex($index, $collection) |
| 574 | 574 | {
|
| 575 | - if (empty($this->queriesResultCache[ 'collectionIndexes' ][ $collection ])) {
|
|
| 575 | + if (empty($this->queriesResultCache['collectionIndexes'][$collection])) {
|
|
| 576 | 576 | $this->getIndexes($collection); |
| 577 | 577 | } |
| 578 | 578 | |
| 579 | - return (bool)in_array($index, $this->queriesResultCache[ 'collectionIndexes' ][ $collection ]); |
|
| 579 | + return (bool)in_array($index, $this->queriesResultCache['collectionIndexes'][$collection]); |
|
| 580 | 580 | } |
| 581 | 581 | |
| 582 | 582 | // ------------------------------------------------------------------------ |
@@ -101,17 +101,17 @@ discard block |
||
| 101 | 101 | $cursor->setTypeMap(['root' => 'array', 'document' => 'array']); |
| 102 | 102 | $result = current($cursor->toArray()); |
| 103 | 103 | |
| 104 | - $this->queriesResultCache[ 'databaseNames' ] = []; |
|
| 104 | + $this->queriesResultCache['databaseNames'] = []; |
|
| 105 | 105 | |
| 106 | - if ( ! empty($result[ 'databases' ])) {
|
|
| 107 | - foreach ($result[ 'databases' ] as $database) {
|
|
| 108 | - if ( ! in_array($database[ 'name' ], ['admin', 'local'])) {
|
|
| 109 | - $this->queriesResultCache[ 'databaseNames' ][] = $database[ 'name' ]; |
|
| 106 | + if ( ! empty($result['databases'])) {
|
|
| 107 | + foreach ($result['databases'] as $database) {
|
|
| 108 | + if ( ! in_array($database['name'], ['admin', 'local'])) {
|
|
| 109 | + $this->queriesResultCache['databaseNames'][] = $database['name']; |
|
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - return $this->queriesResultCache[ 'databaseNames' ]; |
|
| 114 | + return $this->queriesResultCache['databaseNames']; |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | // ------------------------------------------------------------------------ |
@@ -131,15 +131,15 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | $result = new \IteratorIterator($cursor); |
| 133 | 133 | |
| 134 | - $this->queriesResultCache[ 'collectionNames' ] = []; |
|
| 134 | + $this->queriesResultCache['collectionNames'] = []; |
|
| 135 | 135 | |
| 136 | 136 | foreach ($result as $collection) {
|
| 137 | - if ($collection[ 'type' ] === 'collection') {
|
|
| 138 | - $this->queriesResultCache[ 'collectionNames' ][] = $collection[ 'name' ]; |
|
| 137 | + if ($collection['type'] === 'collection') {
|
|
| 138 | + $this->queriesResultCache['collectionNames'][] = $collection['name']; |
|
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | - return $this->queriesResultCache[ 'collectionNames' ]; |
|
| 142 | + return $this->queriesResultCache['collectionNames']; |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | // ------------------------------------------------------------------------ |
@@ -159,13 +159,13 @@ discard block |
||
| 159 | 159 | |
| 160 | 160 | $result = current($cursor->toArray()); |
| 161 | 161 | |
| 162 | - $this->queriesResultCache[ 'collectionKeys' ][ $collection ] = []; |
|
| 162 | + $this->queriesResultCache['collectionKeys'][$collection] = []; |
|
| 163 | 163 | |
| 164 | 164 | foreach (get_object_vars($result) as $key => $value) {
|
| 165 | - $this->queriesResultCache[ 'collectionKeys' ][ $collection ][] = $key; |
|
| 165 | + $this->queriesResultCache['collectionKeys'][$collection][] = $key; |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | - return $this->queriesResultCache[ 'collectionKeys' ][ $collection ]; |
|
| 168 | + return $this->queriesResultCache['collectionKeys'][$collection]; |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | // ------------------------------------------------------------------------ |
@@ -186,13 +186,13 @@ discard block |
||
| 186 | 186 | |
| 187 | 187 | $result = new \IteratorIterator($cursor); |
| 188 | 188 | |
| 189 | - $this->queriesResultCache[ 'collectionIndexes' ][ $collection ] = []; |
|
| 189 | + $this->queriesResultCache['collectionIndexes'][$collection] = []; |
|
| 190 | 190 | |
| 191 | 191 | foreach ($result as $index) {
|
| 192 | - $this->queriesResultCache[ 'collectionIndexes' ][ $collection ][] = $index[ 'name' ]; |
|
| 192 | + $this->queriesResultCache['collectionIndexes'][$collection][] = $index['name']; |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | - return $this->queriesResultCache[ 'collectionIndexes' ][ $collection ]; |
|
| 195 | + return $this->queriesResultCache['collectionIndexes'][$collection]; |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | // ------------------------------------------------------------------------ |
@@ -235,9 +235,9 @@ discard block |
||
| 235 | 235 | protected function platformGetPlatformInfoHandler() |
| 236 | 236 | {
|
| 237 | 237 | $metadata = $this->server->getInfo(); |
| 238 | - $metadata[ 'latency' ] = $this->server->getLatency(); |
|
| 239 | - $metadata[ 'type' ] = $this->server->getType(); |
|
| 240 | - $metadata[ 'tags' ] = $this->server->getTags(); |
|
| 238 | + $metadata['latency'] = $this->server->getLatency(); |
|
| 239 | + $metadata['type'] = $this->server->getType(); |
|
| 240 | + $metadata['tags'] = $this->server->getTags(); |
|
| 241 | 241 | |
| 242 | 242 | return new SplArrayObject([ |
| 243 | 243 | 'name' => $this->getPlatform(), |
@@ -298,10 +298,10 @@ discard block |
||
| 298 | 298 | {
|
| 299 | 299 | $this->parseQueryStatement($queryStatement); |
| 300 | 300 | |
| 301 | - if (isset($options[ 'method' ])) {
|
|
| 301 | + if (isset($options['method'])) {
|
|
| 302 | 302 | |
| 303 | - $method = $options[ 'method' ]; |
|
| 304 | - unset($options[ 'method' ]); |
|
| 303 | + $method = $options['method']; |
|
| 304 | + unset($options['method']); |
|
| 305 | 305 | |
| 306 | 306 | $options = array_merge(['safe' => true, 'ordered' => true], $options); |
| 307 | 307 | $bulk = new \MongoDb\Driver\BulkWrite($options); |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | $projection = []; |
| 386 | 386 | |
| 387 | 387 | foreach ($queryBuilderCache->select as $field) {
|
| 388 | - $projection[ $field ] = 1; |
|
| 388 | + $projection[$field] = 1; |
|
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | $queryStatement->addOption('projection', $projection);
|
@@ -395,9 +395,9 @@ discard block |
||
| 395 | 395 | if (count($queryBuilderCache->whereIn)) {
|
| 396 | 396 | foreach ($queryBuilderCache->whereIn as $field => $clause) {
|
| 397 | 397 | if (count($queryBuilderCache->orWhereIn)) {
|
| 398 | - $queryBuilderCache->orWhere[ $field ] = ['$in' => $clause]; |
|
| 398 | + $queryBuilderCache->orWhere[$field] = ['$in' => $clause]; |
|
| 399 | 399 | } else {
|
| 400 | - $queryBuilderCache->where[ $field ] = ['$in' => $clause]; |
|
| 400 | + $queryBuilderCache->where[$field] = ['$in' => $clause]; |
|
| 401 | 401 | } |
| 402 | 402 | } |
| 403 | 403 | } |
@@ -405,44 +405,44 @@ discard block |
||
| 405 | 405 | // Filter Where Not In |
| 406 | 406 | if (count($queryBuilderCache->whereNotIn)) {
|
| 407 | 407 | foreach ($queryBuilderCache->whereNotIn as $field => $clause) {
|
| 408 | - $queryBuilderCache->where[ $field ] = ['$nin' => $clause]; |
|
| 408 | + $queryBuilderCache->where[$field] = ['$nin' => $clause]; |
|
| 409 | 409 | } |
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | // Filter Or Where In |
| 413 | 413 | if (count($queryBuilderCache->orWhereIn)) {
|
| 414 | 414 | foreach ($queryBuilderCache->orWhereIn as $field => $clause) {
|
| 415 | - $queryBuilderCache->orWhere[ $field ] = ['$in' => $clause]; |
|
| 415 | + $queryBuilderCache->orWhere[$field] = ['$in' => $clause]; |
|
| 416 | 416 | } |
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | // Filter Or Where Not In |
| 420 | 420 | if (count($queryBuilderCache->orWhereNotIn)) {
|
| 421 | 421 | foreach ($queryBuilderCache->orWhereNotIn as $field => $clause) {
|
| 422 | - $queryBuilderCache->orWhere[ $field ] = ['$nin' => $clause]; |
|
| 422 | + $queryBuilderCache->orWhere[$field] = ['$nin' => $clause]; |
|
| 423 | 423 | } |
| 424 | 424 | } |
| 425 | 425 | |
| 426 | 426 | // Filter Where Between |
| 427 | 427 | if (count($queryBuilderCache->between)) {
|
| 428 | 428 | foreach ($queryBuilderCache->between as $field => $clause) {
|
| 429 | - $queryBuilderCache->where[ $field ] = ['$gte' => $clause[ 'start' ], '$lte' => $clause[ 'end' ]]; |
|
| 429 | + $queryBuilderCache->where[$field] = ['$gte' => $clause['start'], '$lte' => $clause['end']]; |
|
| 430 | 430 | } |
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | // Filter Or Where Between |
| 434 | 434 | if (count($queryBuilderCache->orBetween)) {
|
| 435 | 435 | foreach ($queryBuilderCache->orBetween as $field => $clause) {
|
| 436 | - $queryBuilderCache->orWhere[ $field ] = ['$gte' => $clause[ 'start' ], '$lte' => $clause[ 'end' ]]; |
|
| 436 | + $queryBuilderCache->orWhere[$field] = ['$gte' => $clause['start'], '$lte' => $clause['end']]; |
|
| 437 | 437 | } |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 | // Filter Where Not Between |
| 441 | 441 | if (count($queryBuilderCache->notBetween)) {
|
| 442 | 442 | foreach ($queryBuilderCache->notBetween as $field => $clause) {
|
| 443 | - $queryBuilderCache->where[ $field ][ '$not' ] = [ |
|
| 444 | - '$gte' => $clause[ 'start' ], |
|
| 445 | - '$lte' => $clause[ 'end' ], |
|
| 443 | + $queryBuilderCache->where[$field]['$not'] = [ |
|
| 444 | + '$gte' => $clause['start'], |
|
| 445 | + '$lte' => $clause['end'], |
|
| 446 | 446 | ]; |
| 447 | 447 | } |
| 448 | 448 | } |
@@ -450,9 +450,9 @@ discard block |
||
| 450 | 450 | // Filter Or Where Not Between |
| 451 | 451 | if (count($queryBuilderCache->orNotBetween)) {
|
| 452 | 452 | foreach ($queryBuilderCache->orNotBetween as $field => $clause) {
|
| 453 | - $queryBuilderCache->orWhere[ $field ][ '$not' ] = [ |
|
| 454 | - '$gte' => $clause[ 'start' ], |
|
| 455 | - '$lte' => $clause[ 'end' ], |
|
| 453 | + $queryBuilderCache->orWhere[$field]['$not'] = [ |
|
| 454 | + '$gte' => $clause['start'], |
|
| 455 | + '$lte' => $clause['end'], |
|
| 456 | 456 | ]; |
| 457 | 457 | } |
| 458 | 458 | } |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | $sort = []; |
| 493 | 493 | foreach ($queryBuilderCache->orderBy as $field => $direction) {
|
| 494 | 494 | $direction = $direction === 'ASC' ? 1 : -1; |
| 495 | - $sort[ $field ] = $direction; |
|
| 495 | + $sort[$field] = $direction; |
|
| 496 | 496 | } |
| 497 | 497 | |
| 498 | 498 | $queryStatement->addOption('sort', $sort);
|
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | if ($field === '_id') {
|
| 122 | 122 | foreach ($values as $key => $value) {
|
| 123 | - $values[ $key ] = new \MongoDb\BSON\ObjectID($value); |
|
| 123 | + $values[$key] = new \MongoDb\BSON\ObjectID($value); |
|
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | $newQueryBuilderCache->store('from', $collection);
|
| 188 | 188 | $newQueryBuilderCache->store('where', ['_id' => $document->_id]);
|
| 189 | 189 | $document = $document->getArrayCopy(); |
| 190 | - unset($document[ '_id' ]); |
|
| 190 | + unset($document['_id']); |
|
| 191 | 191 | |
| 192 | 192 | $newQueryBuilderCache->store('sets', array_merge($document, $sets));
|
| 193 | 193 | |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | $document = $this->get()->first(); |
| 226 | 226 | $documentIds[] = $document->_id; |
| 227 | 227 | $document = $document->getArrayCopy(); |
| 228 | - unset($document[ '_id' ]); |
|
| 228 | + unset($document['_id']); |
|
| 229 | 229 | |
| 230 | 230 | $documents[] = array_merge($document, $sets); |
| 231 | 231 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $this->rows = new \SplFixedArray($this->numRows); |
| 90 | 90 | |
| 91 | 91 | foreach ($rows as $key => $row) {
|
| 92 | - $this->rows[ $key ] = new Result\Row($row); |
|
| 92 | + $this->rows[$key] = new Result\Row($row); |
|
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | |
@@ -113,8 +113,8 @@ discard block |
||
| 113 | 113 | {
|
| 114 | 114 | $this->seek(0); |
| 115 | 115 | |
| 116 | - if($this->count()) {
|
|
| 117 | - return $this->rows[ $this->position ]; |
|
| 116 | + if ($this->count()) {
|
|
| 117 | + return $this->rows[$this->position]; |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | return new Row(); |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $position = $this->count(); |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - if (isset($this->rows[ $position ])) {
|
|
| 147 | + if (isset($this->rows[$position])) {
|
|
| 148 | 148 | $this->position = $position; |
| 149 | 149 | } |
| 150 | 150 | } |
@@ -181,8 +181,8 @@ discard block |
||
| 181 | 181 | {
|
| 182 | 182 | $this->seek($this->count() - 1); |
| 183 | 183 | |
| 184 | - if($this->count()) {
|
|
| 185 | - return $this->rows[ $this->position ]; |
|
| 184 | + if ($this->count()) {
|
|
| 185 | + return $this->rows[$this->position]; |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | return new Row(); |
@@ -203,8 +203,8 @@ discard block |
||
| 203 | 203 | {
|
| 204 | 204 | $this->seek($this->position); |
| 205 | 205 | |
| 206 | - if($this->count()) {
|
|
| 207 | - return $this->rows[ $this->position ]; |
|
| 206 | + if ($this->count()) {
|
|
| 207 | + return $this->rows[$this->position]; |
|
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | return new Row(); |
@@ -273,8 +273,8 @@ discard block |
||
| 273 | 273 | */ |
| 274 | 274 | public function valid() |
| 275 | 275 | {
|
| 276 | - if($this->count()) {
|
|
| 277 | - return isset($this->rows[ $this->position ]); |
|
| 276 | + if ($this->count()) {
|
|
| 277 | + return isset($this->rows[$this->position]); |
|
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | return false; |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | */ |
| 346 | 346 | public function offsetExists($offset) |
| 347 | 347 | {
|
| 348 | - return (bool)isset($this->rows[ $offset ]); |
|
| 348 | + return (bool)isset($this->rows[$offset]); |
|
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | // ------------------------------------------------------------------------ |
@@ -366,8 +366,8 @@ discard block |
||
| 366 | 366 | */ |
| 367 | 367 | public function offsetGet($offset) |
| 368 | 368 | {
|
| 369 | - if (isset($this->rows[ $offset ])) {
|
|
| 370 | - return $this->rows[ $offset ]; |
|
| 369 | + if (isset($this->rows[$offset])) {
|
|
| 370 | + return $this->rows[$offset]; |
|
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | return false; |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | public function offsetSet($offset, $value) |
| 396 | 396 | {
|
| 397 | 397 | if ($value instanceof Row) {
|
| 398 | - $this->rows[ $offset ] = $value; |
|
| 398 | + $this->rows[$offset] = $value; |
|
| 399 | 399 | } |
| 400 | 400 | } |
| 401 | 401 | |
@@ -417,8 +417,8 @@ discard block |
||
| 417 | 417 | */ |
| 418 | 418 | public function offsetUnset($offset) |
| 419 | 419 | {
|
| 420 | - if (isset($this->rows[ $offset ])) {
|
|
| 421 | - unset($this->rows[ $offset ]); |
|
| 420 | + if (isset($this->rows[$offset])) {
|
|
| 421 | + unset($this->rows[$offset]); |
|
| 422 | 422 | } |
| 423 | 423 | } |
| 424 | 424 | |