@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | * |
| 458 | 458 | * @see findOne() |
| 459 | 459 | * @param mixed $id Primary key value. |
| 460 | - * @return RecordEntity|null |
|
| 460 | + * @return null|RecordInterface |
|
| 461 | 461 | * @throws SelectorException |
| 462 | 462 | */ |
| 463 | 463 | public function findByPK($id) |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | * @see findByPK() |
| 483 | 483 | * @param array $where Selection WHERE statement. |
| 484 | 484 | * @param bool $setLimit Use limit 1. |
| 485 | - * @return RecordEntity|null |
|
| 485 | + * @return null|RecordInterface |
|
| 486 | 486 | */ |
| 487 | 487 | public function findOne(array $where = [], $setLimit = true) |
| 488 | 488 | { |
@@ -154,8 +154,8 @@ |
||
| 154 | 154 | { |
| 155 | 155 | $offset = count($this->dataColumns); |
| 156 | 156 | foreach ($columns as $column) { |
| 157 | - $columnAlias = 'c' . (++$this->countColumns); |
|
| 158 | - $this->dataColumns[] = $table . '.' . $column . ' AS ' . $columnAlias; |
|
| 157 | + $columnAlias = 'c'.(++$this->countColumns); |
|
| 158 | + $this->dataColumns[] = $table.'.'.$column.' AS '.$columnAlias; |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | return $offset; |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | * Perform iterator on pre-loaded data. Use relation selector to iterate thought custom relation |
| 336 | 336 | * query. |
| 337 | 337 | * |
| 338 | - * @return RecordEntity|RecordEntity[]|RecordIterator |
|
| 338 | + * @return null|EntityInterface |
|
| 339 | 339 | */ |
| 340 | 340 | public function getIterator() |
| 341 | 341 | { |
@@ -465,7 +465,7 @@ discard block |
||
| 465 | 465 | * |
| 466 | 466 | * @param EntityInterface $entity |
| 467 | 467 | * @param bool $validate |
| 468 | - * @return bool|void |
|
| 468 | + * @return boolean |
|
| 469 | 469 | */ |
| 470 | 470 | private function saveEntity(EntityInterface $entity, $validate) |
| 471 | 471 | { |
@@ -189,7 +189,7 @@ |
||
| 189 | 189 | * $tag->tagged->posts; |
| 190 | 190 | * |
| 191 | 191 | * @param string $alias |
| 192 | - * @return RecordEntity|RecordIterator |
|
| 192 | + * @return null|EntityInterface |
|
| 193 | 193 | */ |
| 194 | 194 | public function __get($alias) |
| 195 | 195 | { |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | /** |
| 99 | 99 | * Related source class. |
| 100 | 100 | * |
| 101 | - * @return string|null |
|
| 101 | + * @return string |
|
| 102 | 102 | */ |
| 103 | 103 | public function getSource() |
| 104 | 104 | { |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | * value using class name and Doctrine inflector. |
| 154 | 154 | * |
| 155 | 155 | * @see Record::$table |
| 156 | - * @return mixed |
|
| 156 | + * @return string |
|
| 157 | 157 | */ |
| 158 | 158 | public function getTable() |
| 159 | 159 | { |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | * Get database where record data should be stored in. Database alias must be resolved. |
| 173 | 173 | * |
| 174 | 174 | * @see Record::$database |
| 175 | - * @return mixed |
|
| 175 | + * @return string |
|
| 176 | 176 | */ |
| 177 | 177 | public function getDatabase() |
| 178 | 178 | { |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | * @param AbstractColumn $column |
| 488 | 488 | * @param string $definition |
| 489 | 489 | * @param mixed $default Default value declared by record schema. |
| 490 | - * @return mixed |
|
| 490 | + * @return AbstractColumn |
|
| 491 | 491 | * @throws DefinitionException |
| 492 | 492 | * @throws \Spiral\Database\Exceptions\SchemaException |
| 493 | 493 | */ |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | */ |
| 181 | 181 | public function getTableID() |
| 182 | 182 | { |
| 183 | - return $this->getDatabase() . '.' . $this->getTable(); |
|
| 183 | + return $this->getDatabase().'.'.$this->getTable(); |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | /** |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | if (!empty($filter = $this->builder->getMutators($column->abstractType()))) { |
| 425 | 425 | //Mutator associated with type directly |
| 426 | 426 | $resolved += $filter; |
| 427 | - } elseif (!empty($filter = $this->builder->getMutators('php:' . $column->phpType()))) { |
|
| 427 | + } elseif (!empty($filter = $this->builder->getMutators('php:'.$column->phpType()))) { |
|
| 428 | 428 | //Mutator associated with php type |
| 429 | 429 | $resolved += $filter; |
| 430 | 430 | } |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | /** |
| 69 | 69 | * Migration status. |
| 70 | 70 | * |
| 71 | - * @return int |
|
| 71 | + * @return boolean |
|
| 72 | 72 | */ |
| 73 | 73 | public function getStatus() |
| 74 | 74 | { |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | /** |
| 297 | 297 | * {@inheritdoc} |
| 298 | 298 | * |
| 299 | - * @return DocumentCursor|DocumentEntity[] |
|
| 299 | + * @return DocumentCursor |
|
| 300 | 300 | */ |
| 301 | 301 | public function getIterator() |
| 302 | 302 | { |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | * Debug information and logging. |
| 437 | 437 | * |
| 438 | 438 | * @param \MongoCursor $cursor |
| 439 | - * @param int|bool $profiling Profiling level |
|
| 439 | + * @param integer $profiling Profiling level |
|
| 440 | 440 | */ |
| 441 | 441 | protected function describeCursor( |
| 442 | 442 | \MongoCursor $cursor, |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | public function __debugInfo() |
| 329 | 329 | { |
| 330 | 330 | return [ |
| 331 | - 'collection' => $this->getDatabase() . '/' . $this->getCollection(), |
|
| 331 | + 'collection' => $this->getDatabase().'/'.$this->getCollection(), |
|
| 332 | 332 | 'query' => $this->query, |
| 333 | 333 | 'limit' => $this->getLimit(), |
| 334 | 334 | 'offset' => $this->getOffset(), |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | */ |
| 423 | 423 | private function normalizeDates(array $query) |
| 424 | 424 | { |
| 425 | - array_walk_recursive($query, function (&$value) { |
|
| 425 | + array_walk_recursive($query, function(&$value) { |
|
| 426 | 426 | if ($value instanceof \DateTime) { |
| 427 | 427 | //MongoDate is always UTC, which is good :) |
| 428 | 428 | $value = new \MongoDate($value->getTimestamp()); |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | $debug['explained'] = $cursor->explain(); |
| 472 | 472 | } |
| 473 | 473 | |
| 474 | - $this->logger()->debug('{db}/{collection}: ' . json_encode($debug, JSON_PRETTY_PRINT), [ |
|
| 474 | + $this->logger()->debug('{db}/{collection}: '.json_encode($debug, JSON_PRETTY_PRINT), [ |
|
| 475 | 475 | 'db' => $this->getDatabase(), |
| 476 | 476 | 'collection' => $this->getCollection(), |
| 477 | 477 | 'queryInfo' => $debug, |
@@ -105,7 +105,7 @@ |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
| 108 | - * @return SourceInterface |
|
| 108 | + * @return FilesInterface |
|
| 109 | 109 | */ |
| 110 | 110 | public function getSource() |
| 111 | 111 | { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | return $this->options['pivotAlias']; |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - return $this->getAlias() . '_pivot'; |
|
| 100 | + return $this->getAlias().'_pivot'; |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /** |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | //Pivot table joining (INNER in post selection) |
| 116 | 116 | $pivotOuterKey = $this->getPivotKey(RecordEntity::THOUGHT_OUTER_KEY); |
| 117 | - $selector->innerJoin($this->pivotTable() . ' AS ' . $this->pivotAlias(), [ |
|
| 117 | + $selector->innerJoin($this->pivotTable().' AS '.$this->pivotAlias(), [ |
|
| 118 | 118 | $pivotOuterKey => $this->getKey(RecordEntity::OUTER_KEY) |
| 119 | 119 | ]); |
| 120 | 120 | |
@@ -156,14 +156,14 @@ discard block |
||
| 156 | 156 | { |
| 157 | 157 | $selector->join( |
| 158 | 158 | $this->joinType(), |
| 159 | - $this->pivotTable() . ' AS ' . $this->pivotAlias(), |
|
| 159 | + $this->pivotTable().' AS '.$this->pivotAlias(), |
|
| 160 | 160 | [$this->getPivotKey(RecordEntity::THOUGHT_INNER_KEY) => $this->getParentKey()] |
| 161 | 161 | ); |
| 162 | 162 | |
| 163 | 163 | $this->pivotConditions($selector); |
| 164 | 164 | |
| 165 | 165 | $pivotOuterKey = $this->getPivotKey(RecordEntity::THOUGHT_OUTER_KEY); |
| 166 | - $selector->join($this->joinType(), $this->getTable() . ' AS ' . $this->getAlias(), [ |
|
| 166 | + $selector->join($this->joinType(), $this->getTable().' AS '.$this->getAlias(), [ |
|
| 167 | 167 | $pivotOuterKey => $this->getKey(RecordEntity::OUTER_KEY) |
| 168 | 168 | ]); |
| 169 | 169 | |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | return null; |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | - return $this->pivotAlias() . '.' . $this->definition[$key]; |
|
| 208 | + return $this->pivotAlias().'.'.$this->definition[$key]; |
|
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | /** |
@@ -301,10 +301,10 @@ discard block |
||
| 301 | 301 | protected function deduplicate(array &$data) |
| 302 | 302 | { |
| 303 | 303 | $criteria = $data[ORM::PIVOT_DATA][$this->definition[RecordEntity::THOUGHT_INNER_KEY]] |
| 304 | - . '.' . $data[ORM::PIVOT_DATA][$this->definition[RecordEntity::THOUGHT_OUTER_KEY]]; |
|
| 304 | + . '.'.$data[ORM::PIVOT_DATA][$this->definition[RecordEntity::THOUGHT_OUTER_KEY]]; |
|
| 305 | 305 | |
| 306 | 306 | if (!empty($this->definition[RecordEntity::MORPH_KEY])) { |
| 307 | - $criteria .= ':' . $data[ORM::PIVOT_DATA][$this->definition[RecordEntity::MORPH_KEY]]; |
|
| 307 | + $criteria .= ':'.$data[ORM::PIVOT_DATA][$this->definition[RecordEntity::MORPH_KEY]]; |
|
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | if (isset($this->duplicates[$criteria])) { |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | */ |
| 75 | 75 | protected function clarifySelector(RecordSelector $selector) |
| 76 | 76 | { |
| 77 | - $selector->join($this->joinType(), $this->getTable() . ' AS ' . $this->getAlias(), [ |
|
| 77 | + $selector->join($this->joinType(), $this->getTable().' AS '.$this->getAlias(), [ |
|
| 78 | 78 | $this->getKey(RecordEntity::OUTER_KEY) => $this->getParentKey() |
| 79 | 79 | ]); |
| 80 | 80 | |