@@ -79,7 +79,7 @@ |
||
| 79 | 79 | |
| 80 | 80 | if (!$this->isSynced($this->parent, $this->instance)) { |
| 81 | 81 | //Syncing FKs before primary command been executed |
| 82 | - $innerCommand->onExecute(function ($innerCommand) use ($parentCommand) { |
|
| 82 | + $innerCommand->onExecute(function($innerCommand) use ($parentCommand) { |
|
| 83 | 83 | $parentCommand->addContext( |
| 84 | 84 | $this->key(Record::INNER_KEY), |
| 85 | 85 | $this->lookupKey(Record::OUTER_KEY, $this->parent, $innerCommand) |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | |
| 175 | 175 | if (!$this->isSynced($this->parent, $instance)) { |
| 176 | 176 | //Delayed linking |
| 177 | - $parentCommand->onExecute(function ($outerCommand) use ($innerCommand) { |
|
| 177 | + $parentCommand->onExecute(function($outerCommand) use ($innerCommand) { |
|
| 178 | 178 | $innerCommand->addContext( |
| 179 | 179 | $this->key(Record::OUTER_KEY), |
| 180 | 180 | $this->lookupKey(Record::INNER_KEY, $this->parent, $outerCommand) |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | //Morph key |
| 233 | 233 | $decorator = new WhereDecorator($selector, 'where', $selector->getAlias()); |
| 234 | 234 | $decorator->where( |
| 235 | - '{@}.' . $this->key(Record::MORPH_KEY), |
|
| 235 | + '{@}.'.$this->key(Record::MORPH_KEY), |
|
| 236 | 236 | $this->orm->define(get_class($this->parent), ORMInterface::R_ROLE_NAME) |
| 237 | 237 | ); |
| 238 | 238 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | //Inversed version of BelongsTo |
| 90 | 90 | if (!$this->isSynced($this->parent, $this->instance)) { |
| 91 | 91 | //Syncing FKs after primary command been executed |
| 92 | - $parentCommand->onExecute(function ($outerCommand) use ($innerCommand) { |
|
| 92 | + $parentCommand->onExecute(function($outerCommand) use ($innerCommand) { |
|
| 93 | 93 | $innerCommand->addContext( |
| 94 | 94 | $this->key(Record::OUTER_KEY), |
| 95 | 95 | $this->lookupKey(Record::INNER_KEY, $this->parent, $outerCommand) |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | |
| 120 | 120 | if (!empty($morphKey = $this->key(Record::MORPH_KEY))) { |
| 121 | 121 | //HasOne relation support additional morph key |
| 122 | - $where['{@}.' . $this->key(Record::MORPH_KEY)] = $this->orm->define( |
|
| 122 | + $where['{@}.'.$this->key(Record::MORPH_KEY)] = $this->orm->define( |
|
| 123 | 123 | get_class($this->parent), |
| 124 | 124 | ORMInterface::R_ROLE_NAME |
| 125 | 125 | ); |
@@ -84,11 +84,11 @@ |
||
| 84 | 84 | $reflection = new ReflectionFile( |
| 85 | 85 | $filename, |
| 86 | 86 | $this->normalizeTokens(token_get_all($this->files->read($filename))), |
| 87 | - (array)$this->memory->loadData(self::MEMORY . '.' . $fileMD5) |
|
| 87 | + (array)$this->memory->loadData(self::MEMORY.'.'.$fileMD5) |
|
| 88 | 88 | ); |
| 89 | 89 | |
| 90 | 90 | //Let's save to cache |
| 91 | - $this->memory->saveData(self::MEMORY . '.' . $fileMD5, $reflection->exportSchema()); |
|
| 91 | + $this->memory->saveData(self::MEMORY.'.'.$fileMD5, $reflection->exportSchema()); |
|
| 92 | 92 | |
| 93 | 93 | return $reflection; |
| 94 | 94 | } |
@@ -140,11 +140,11 @@ |
||
| 140 | 140 | * |
| 141 | 141 | * @return string |
| 142 | 142 | */ |
| 143 | - protected function createPlaceholder(string $name, string &$blockID = null): string |
|
| 143 | + protected function createPlaceholder(string $name, string & $blockID = null): string |
|
| 144 | 144 | { |
| 145 | - $blockID = $name . '-' . $this->supervisor->uniquePlaceholder(); |
|
| 145 | + $blockID = $name.'-'.$this->supervisor->uniquePlaceholder(); |
|
| 146 | 146 | |
| 147 | 147 | //Short block declaration syntax |
| 148 | - return '${' . $blockID . '}'; |
|
| 148 | + return '${'.$blockID.'}'; |
|
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | 151 | \ No newline at end of file |
@@ -375,7 +375,7 @@ |
||
| 375 | 375 | * Execute statement. |
| 376 | 376 | * |
| 377 | 377 | * @param string $statement |
| 378 | - * @param array $parameters |
|
| 378 | + * @param string[] $parameters |
|
| 379 | 379 | * |
| 380 | 380 | * @return \PDOStatement |
| 381 | 381 | * |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | if (!empty($table->getPrimaryKeys())) { |
| 331 | 331 | $primaryKeys = array_map([$this, 'identify'], $table->getPrimaryKeys()); |
| 332 | 332 | |
| 333 | - $innerStatement[] = 'PRIMARY KEY (' . join(', ', $primaryKeys) . ')'; |
|
| 333 | + $innerStatement[] = 'PRIMARY KEY ('.join(', ', $primaryKeys).')'; |
|
| 334 | 334 | } |
| 335 | 335 | |
| 336 | 336 | //Constraints and foreign keys |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | $innerStatement[] = $reference->sqlStatement($this->driver); |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | - $statement[] = " " . join(",\n ", $innerStatement); |
|
| 341 | + $statement[] = " ".join(",\n ", $innerStatement); |
|
| 342 | 342 | $statement[] = ')'; |
| 343 | 343 | |
| 344 | 344 | return join("\n", $statement); |
@@ -18,10 +18,10 @@ |
||
| 18 | 18 | /** |
| 19 | 19 | * Argument types. |
| 20 | 20 | */ |
| 21 | - const CONSTANT = 'constant'; //Scalar constant and not variable. |
|
| 22 | - const VARIABLE = 'variable'; //PHP variable |
|
| 21 | + const CONSTANT = 'constant'; //Scalar constant and not variable. |
|
| 22 | + const VARIABLE = 'variable'; //PHP variable |
|
| 23 | 23 | const EXPRESSION = 'expression'; //PHP code (expression). |
| 24 | - const STRING = 'string'; //Simple scalar string, can be fetched using stringValue(). |
|
| 24 | + const STRING = 'string'; //Simple scalar string, can be fetched using stringValue(). |
|
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * @var string |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | */ |
| 89 | 89 | protected function classReflection(string $class): \ReflectionClass |
| 90 | 90 | { |
| 91 | - $loader = function ($class) { |
|
| 91 | + $loader = function($class) { |
|
| 92 | 92 | throw new LocatorException("Class '{$class}' can not be loaded"); |
| 93 | 93 | }; |
| 94 | 94 | |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | */ |
| 351 | 351 | private function onWrapper() |
| 352 | 352 | { |
| 353 | - return function ($parameter) { |
|
| 353 | + return function($parameter) { |
|
| 354 | 354 | if ($parameter instanceof FragmentInterface) { |
| 355 | 355 | return $parameter; |
| 356 | 356 | } |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | */ |
| 367 | 367 | private function onWhereWrapper() |
| 368 | 368 | { |
| 369 | - return function ($parameter) { |
|
| 369 | + return function($parameter) { |
|
| 370 | 370 | if ($parameter instanceof FragmentInterface) { |
| 371 | 371 | //We are only not creating bindings for plan fragments |
| 372 | 372 | if (!$parameter instanceof ParameterInterface && !$parameter instanceof QueryBuilder) { |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | * Register new JOIN with specified type with set of on conditions (linking one table to |
| 82 | 82 | * another, no parametric on conditions allowed here). |
| 83 | 83 | * |
| 84 | - * @param string|QueryBuilder $type Join type. Allowed values, LEFT, RIGHT, INNER and etc. |
|
| 84 | + * @param string $type Join type. Allowed values, LEFT, RIGHT, INNER and etc. |
|
| 85 | 85 | * @param string $outer Joined table name (without prefix), may include AS |
| 86 | 86 | * statement. |
| 87 | 87 | * @param string $alias Joined table or query alias. |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | * @link http://www.w3schools.com/sql/sql_join_inner.asp |
| 111 | 111 | * @see join() |
| 112 | 112 | * |
| 113 | - * @param string|QueryBuilder $outer Joined table name (without prefix), may include AS |
|
| 113 | + * @param string $outer Joined table name (without prefix), may include AS |
|
| 114 | 114 | * statement. |
| 115 | 115 | * @param string $alias Joined table or query alias. |
| 116 | 116 | * |
@@ -220,6 +220,7 @@ discard block |
||
| 220 | 220 | * together, no parametric values allowed. |
| 221 | 221 | * |
| 222 | 222 | * @param mixed ...$args [(column, outer column), (column, operator, outer column)] |
| 223 | + * @param null|string $args |
|
| 223 | 224 | * |
| 224 | 225 | * @return $this |
| 225 | 226 | * |
@@ -361,7 +362,7 @@ discard block |
||
| 361 | 362 | * @param string $joiner Boolean joiner (AND | OR). |
| 362 | 363 | * @param array $parameters Set of parameters collected from where functions. |
| 363 | 364 | * @param array $tokens Array to aggregate compiled tokens. Reference. |
| 364 | - * @param \Closure|null|callable $wrapper Callback or closure used to wrap/collect every |
|
| 365 | + * @param callable $wrapper Callback or closure used to wrap/collect every |
|
| 365 | 366 | * potential parameter. |
| 366 | 367 | * |
| 367 | 368 | * @throws BuilderException |