@@ -58,7 +58,7 @@ |
||
58 | 58 | * Set table names SELECT query should be performed for. Table names can be provided with |
59 | 59 | * specified alias (AS construction). |
60 | 60 | * |
61 | - * @param array|string|mixed $tables Array of names, comma separated string or set of |
|
61 | + * @param string $tables Array of names, comma separated string or set of |
|
62 | 62 | * parameters. |
63 | 63 | * @return $this |
64 | 64 | */ |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | * such methods. |
233 | 233 | * |
234 | 234 | * @see AbstractWhere |
235 | - * @param string|mixed $joined Joined column or expression. |
|
235 | + * @param string $joined Joined column or expression. |
|
236 | 236 | * @param mixed $variousA Operator or value. |
237 | 237 | * @param mixed $variousB Value, if operator specified. |
238 | 238 | * @param mixed $variousC Required only in between statements. |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | * @param string $joiner Boolean joiner (AND | OR). |
301 | 301 | * @param array $parameters Set of parameters collected from where functions. |
302 | 302 | * @param array $tokens Array to aggregate compiled tokens. Reference. |
303 | - * @param \Closure|null $wrapper Callback or closure used to wrap/collect every potential |
|
303 | + * @param callable $wrapper Callback or closure used to wrap/collect every potential |
|
304 | 304 | * parameter. |
305 | 305 | * @throws BuilderException |
306 | 306 | */ |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | */ |
319 | 319 | private function onWrapper() |
320 | 320 | { |
321 | - return function ($parameter) { |
|
321 | + return function($parameter) { |
|
322 | 322 | if ($parameter instanceof FragmentInterface) { |
323 | 323 | return $parameter; |
324 | 324 | } |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | */ |
335 | 335 | private function whereWrapper() |
336 | 336 | { |
337 | - return function ($parameter) { |
|
337 | + return function($parameter) { |
|
338 | 338 | if ($parameter instanceof FragmentInterface) { |
339 | 339 | //We are only not creating bindings for plan fragments |
340 | 340 | if (!$parameter instanceof ParameterInterface && !$parameter instanceof QueryBuilder) { |
@@ -228,7 +228,7 @@ |
||
228 | 228 | * Execute statement. |
229 | 229 | * |
230 | 230 | * @param string $statement |
231 | - * @param array $parameters |
|
231 | + * @param string[] $parameters |
|
232 | 232 | * @return \PDOStatement |
233 | 233 | */ |
234 | 234 | protected function run($statement, array $parameters = []) |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | if (!empty($table->getPrimaryKeys())) { |
270 | 270 | $primaryKeys = array_map([$this, 'quote'], $table->getPrimaryKeys()); |
271 | 271 | |
272 | - $innerStatement[] = 'PRIMARY KEY (' . join(', ', $primaryKeys) . ')'; |
|
272 | + $innerStatement[] = 'PRIMARY KEY ('.join(', ', $primaryKeys).')'; |
|
273 | 273 | } |
274 | 274 | |
275 | 275 | //Constraints and foreign keys |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | $innerStatement[] = $reference->sqlStatement(); |
278 | 278 | } |
279 | 279 | |
280 | - $statement[] = " " . join(",\n ", $innerStatement); |
|
280 | + $statement[] = " ".join(",\n ", $innerStatement); |
|
281 | 281 | $statement[] = ')'; |
282 | 282 | |
283 | 283 | return join("\n", $statement); |
@@ -126,7 +126,7 @@ |
||
126 | 126 | * |
127 | 127 | * @param array $columns Array of columns. |
128 | 128 | * @param array $rowsets Array of rowsets. |
129 | - * @return mixed |
|
129 | + * @return integer |
|
130 | 130 | */ |
131 | 131 | public function batchInsert(array $columns = [], array $rowsets = []) |
132 | 132 | { |
@@ -93,7 +93,7 @@ |
||
93 | 93 | */ |
94 | 94 | public function realName() |
95 | 95 | { |
96 | - return $this->database->getPrefix() . $this->name; |
|
96 | + return $this->database->getPrefix().$this->name; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * @param array|\Closure $where Selection WHERE statement. |
43 | 43 | * @param array $load Array or relations to be pre-loaded. |
44 | 44 | * @param array $orderBy Sort by conditions. |
45 | - * @return RecordEntity|null |
|
45 | + * @return null|\Spiral\ORM\RecordInterface |
|
46 | 46 | */ |
47 | 47 | public static function findOne($where = [], array $load = [], array $orderBy = []) |
48 | 48 | { |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * |
63 | 63 | * @param mixed $primaryKey Primary key. |
64 | 64 | * @param array $load Array or relations to be pre-loaded. |
65 | - * @return RecordEntity|null |
|
65 | + * @return null|\Spiral\ORM\RecordInterface |
|
66 | 66 | */ |
67 | 67 | public static function findByPK($primaryKey, array $load = []) |
68 | 68 | { |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | /** |
34 | 34 | * New instance of ReflectionArgument. |
35 | 35 | * |
36 | - * @param mixed $type |
|
36 | + * @param string $type |
|
37 | 37 | * @param mixed $value |
38 | 38 | */ |
39 | 39 | public function __construct($type, $value) |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
46 | - * @return mixed |
|
46 | + * @return integer |
|
47 | 47 | */ |
48 | 48 | public function getType() |
49 | 49 | { |
@@ -15,10 +15,10 @@ |
||
15 | 15 | /** |
16 | 16 | * Argument types. |
17 | 17 | */ |
18 | - const CONSTANT = 'constant'; //Scalar constant and not variable. |
|
19 | - const VARIABLE = 'variable'; //PHP variable |
|
18 | + const CONSTANT = 'constant'; //Scalar constant and not variable. |
|
19 | + const VARIABLE = 'variable'; //PHP variable |
|
20 | 20 | const EXPRESSION = 'expression'; //PHP code (expression). |
21 | - const STRING = 'string'; //Simple scalar string, can be fetched using stringValue(). |
|
21 | + const STRING = 'string'; //Simple scalar string, can be fetched using stringValue(). |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * @var int |
@@ -189,14 +189,14 @@ |
||
189 | 189 | if ($this->abstractType() == 'enum') { |
190 | 190 | |
191 | 191 | //Fetching enum values |
192 | - $this->enumValues = array_map(function ($value) { |
|
192 | + $this->enumValues = array_map(function($value) { |
|
193 | 193 | return trim($value, $value[0]); |
194 | 194 | }, explode(',', $options)); |
195 | 195 | |
196 | 196 | return; |
197 | 197 | } |
198 | 198 | |
199 | - $options = array_map(function ($value) { |
|
199 | + $options = array_map(function($value) { |
|
200 | 200 | return intval($value); |
201 | 201 | }, explode(',', $options)); |
202 | 202 |
@@ -374,7 +374,7 @@ |
||
374 | 374 | return $this; |
375 | 375 | } |
376 | 376 | |
377 | - $this->data = array_filter($this->data, function ($item) use ($value) { |
|
377 | + $this->data = array_filter($this->data, function($item) use ($value) { |
|
378 | 378 | return $item != $value; |
379 | 379 | }); |
380 | 380 |
@@ -881,7 +881,7 @@ |
||
881 | 881 | * Parse single result row to generate data tree. Must pass parsing to evert nested loader. |
882 | 882 | * |
883 | 883 | * @param array $row |
884 | - * @return bool |
|
884 | + * @return boolean|null |
|
885 | 885 | */ |
886 | 886 | private function parseRow(array $row) |
887 | 887 | { |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | } |
281 | 281 | |
282 | 282 | //New alias is pretty simple and short |
283 | - return $this->alias = 'd' . decoct(++self::$counter); |
|
283 | + return $this->alias = 'd'.decoct(++self::$counter); |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | if (empty($this->parent)) { |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | $alias = $this->container; |
291 | 291 | } else { |
292 | 292 | //Let's use parent alias to continue chain |
293 | - $alias = $this->parent->getAlias() . '_' . $this->container; |
|
293 | + $alias = $this->parent->getAlias().'_'.$this->container; |
|
294 | 294 | } |
295 | 295 | |
296 | 296 | return $alias; |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | return null; |
329 | 329 | } |
330 | 330 | |
331 | - return $this->getAlias() . '.' . $this->schema[ORM::M_PRIMARY_KEY]; |
|
331 | + return $this->getAlias().'.'.$this->schema[ORM::M_PRIMARY_KEY]; |
|
332 | 332 | } |
333 | 333 | |
334 | 334 | /** |
@@ -852,7 +852,7 @@ discard block |
||
852 | 852 | return null; |
853 | 853 | } |
854 | 854 | |
855 | - return $this->getAlias() . '.' . $this->definition[$key]; |
|
855 | + return $this->getAlias().'.'.$this->definition[$key]; |
|
856 | 856 | } |
857 | 857 | |
858 | 858 | /** |
@@ -867,7 +867,7 @@ discard block |
||
867 | 867 | throw new LoaderException("Unable to get parent key, no parent loader provided."); |
868 | 868 | } |
869 | 869 | |
870 | - return $this->parent->getAlias() . '.' . $this->definition[RecordEntity::INNER_KEY]; |
|
870 | + return $this->parent->getAlias().'.'.$this->definition[RecordEntity::INNER_KEY]; |
|
871 | 871 | } |
872 | 872 | |
873 | 873 | /** |