@@ -19,10 +19,10 @@ discard block |
||
| 19 | 19 | public function singleSimpleColumn(QueryBuilder\Column $column): string |
| 20 | 20 | { |
| 21 | 21 | $alias = empty($column->getColumnAlias()) ? '' : sprintf(' AS %s', $column->getColumnAlias()); |
| 22 | - $where = sprintf('%s', $column->getColumnName() ); |
|
| 22 | + $where = sprintf('%s', $column->getColumnName()); |
|
| 23 | 23 | return empty($column->getAggregate()) |
| 24 | - ? sprintf('%s%s', $where, $alias ) |
|
| 25 | - : sprintf('%s(%s)%s', $column->getAggregate(), $where, $alias ) |
|
| 24 | + ? sprintf('%s%s', $where, $alias) |
|
| 25 | + : sprintf('%s(%s)%s', $column->getAggregate(), $where, $alias) |
|
| 26 | 26 | ; |
| 27 | 27 | } |
| 28 | 28 | |
@@ -30,12 +30,12 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | $alias = empty($column->getColumnAlias()) ? '' : sprintf(' AS %s', $column->getColumnAlias()); |
| 32 | 32 | $where = empty($column->getTableName()) |
| 33 | - ? sprintf('%s', $column->getColumnName() ) |
|
| 33 | + ? sprintf('%s', $column->getColumnName()) |
|
| 34 | 34 | : sprintf('%s.%s', $column->getTableName(), $column->getColumnName()) |
| 35 | 35 | ; |
| 36 | 36 | return empty($column->getAggregate()) |
| 37 | - ? sprintf('%s%s', $where, $alias ) |
|
| 38 | - : sprintf('%s(%s)%s', $column->getAggregate(), $where, $alias ) |
|
| 37 | + ? sprintf('%s%s', $where, $alias) |
|
| 38 | + : sprintf('%s(%s)%s', $column->getAggregate(), $where, $alias) |
|
| 39 | 39 | ; |
| 40 | 40 | } |
| 41 | 41 | |
@@ -49,14 +49,14 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | public function singleSimplePropertyListed(QueryBuilder\Property $column): string |
| 51 | 51 | { |
| 52 | - return sprintf('%s', $column->getColumnName() ); |
|
| 52 | + return sprintf('%s', $column->getColumnName()); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | public function singleFullPropertyListed(QueryBuilder\Property $column): string |
| 56 | 56 | { |
| 57 | 57 | return empty($column->getTableName()) |
| 58 | - ? sprintf('%s', $column->getColumnName() ) |
|
| 59 | - : sprintf('%s.%s', $column->getTableName(), $column->getColumnName() ) |
|
| 58 | + ? sprintf('%s', $column->getColumnName()) |
|
| 59 | + : sprintf('%s.%s', $column->getTableName(), $column->getColumnName()) |
|
| 60 | 60 | ; |
| 61 | 61 | } |
| 62 | 62 | |
@@ -93,14 +93,14 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | public function singleSimpleOrder(QueryBuilder\Order $order): string |
| 95 | 95 | { |
| 96 | - return sprintf('%s %s', $order->getColumnName(), $order->getDirection() ); |
|
| 96 | + return sprintf('%s %s', $order->getColumnName(), $order->getDirection()); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | public function singleFullOrder(QueryBuilder\Order $order): string |
| 100 | 100 | { |
| 101 | 101 | return empty($order->getTableName()) |
| 102 | - ? sprintf('%s %s', $order->getColumnName(), $order->getDirection() ) |
|
| 103 | - : sprintf('%s.%s %s', $order->getTableName(), $order->getColumnName(), $order->getDirection() ) |
|
| 102 | + ? sprintf('%s %s', $order->getColumnName(), $order->getDirection()) |
|
| 103 | + : sprintf('%s.%s %s', $order->getTableName(), $order->getColumnName(), $order->getDirection()) |
|
| 104 | 104 | ; |
| 105 | 105 | } |
| 106 | 106 | |
@@ -19,10 +19,10 @@ discard block |
||
| 19 | 19 | public function singleSimpleColumn(QueryBuilder\Column $column): string |
| 20 | 20 | { |
| 21 | 21 | $alias = empty($column->getColumnAlias()) ? '' : sprintf(' AS "%s"', $column->getColumnAlias()); |
| 22 | - $where = sprintf('"%s"', $column->getColumnName() ); |
|
| 22 | + $where = sprintf('"%s"', $column->getColumnName()); |
|
| 23 | 23 | return empty($column->getAggregate()) |
| 24 | - ? sprintf('%s%s', $where, $alias ) |
|
| 25 | - : sprintf('%s(%s)%s', $column->getAggregate(), $where, $alias ) |
|
| 24 | + ? sprintf('%s%s', $where, $alias) |
|
| 25 | + : sprintf('%s(%s)%s', $column->getAggregate(), $where, $alias) |
|
| 26 | 26 | ; |
| 27 | 27 | } |
| 28 | 28 | |
@@ -30,12 +30,12 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | $alias = empty($column->getColumnAlias()) ? '' : sprintf(' AS "%s"', $column->getColumnAlias()); |
| 32 | 32 | $where = empty($column->getTableName()) |
| 33 | - ? sprintf('"%s"', $column->getColumnName() ) |
|
| 33 | + ? sprintf('"%s"', $column->getColumnName()) |
|
| 34 | 34 | : sprintf('"%s"."%s"', $column->getTableName(), $column->getColumnName()) |
| 35 | 35 | ; |
| 36 | 36 | return empty($column->getAggregate()) |
| 37 | - ? sprintf('%s%s', $where, $alias ) |
|
| 38 | - : sprintf('%s(%s)%s', $column->getAggregate(), $where, $alias ) |
|
| 37 | + ? sprintf('%s%s', $where, $alias) |
|
| 38 | + : sprintf('%s(%s)%s', $column->getAggregate(), $where, $alias) |
|
| 39 | 39 | ; |
| 40 | 40 | } |
| 41 | 41 | |
@@ -49,14 +49,14 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | public function singleSimplePropertyListed(QueryBuilder\Property $column): string |
| 51 | 51 | { |
| 52 | - return sprintf('"%s"', $column->getColumnName() ); |
|
| 52 | + return sprintf('"%s"', $column->getColumnName()); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | public function singleFullPropertyListed(QueryBuilder\Property $column): string |
| 56 | 56 | { |
| 57 | 57 | return empty($column->getTableName()) |
| 58 | - ? sprintf('"%s"', $column->getColumnName() ) |
|
| 59 | - : sprintf('"%s"."%s"', $column->getTableName(), $column->getColumnName() ) |
|
| 58 | + ? sprintf('"%s"', $column->getColumnName()) |
|
| 59 | + : sprintf('"%s"."%s"', $column->getTableName(), $column->getColumnName()) |
|
| 60 | 60 | ; |
| 61 | 61 | } |
| 62 | 62 | |
@@ -88,14 +88,14 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | public function singleSimpleOrder(QueryBuilder\Order $order): string |
| 90 | 90 | { |
| 91 | - return sprintf('"%s" %s', $order->getColumnName(), $order->getDirection() ); |
|
| 91 | + return sprintf('"%s" %s', $order->getColumnName(), $order->getDirection()); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | public function singleFullOrder(QueryBuilder\Order $order): string |
| 95 | 95 | { |
| 96 | 96 | return empty($order->getTableName()) |
| 97 | - ? sprintf('"%s" %s', $order->getColumnName(), $order->getDirection() ) |
|
| 98 | - : sprintf('"%s"."%s" %s', $order->getTableName(), $order->getColumnName(), $order->getDirection() ) |
|
| 97 | + ? sprintf('"%s" %s', $order->getColumnName(), $order->getDirection()) |
|
| 98 | + : sprintf('"%s"."%s" %s', $order->getTableName(), $order->getColumnName(), $order->getDirection()) |
|
| 99 | 99 | ; |
| 100 | 100 | } |
| 101 | 101 | |
@@ -17,19 +17,19 @@ |
||
| 17 | 17 | const ORDER_ASC = 'ASC'; |
| 18 | 18 | const ORDER_DESC = 'DESC'; |
| 19 | 19 | |
| 20 | - const OPERATION_NULL = 'nul'; // is null |
|
| 21 | - const OPERATION_NNULL = 'nnul'; // is not null |
|
| 22 | - const OPERATION_EQ = 'eq'; // = |
|
| 23 | - const OPERATION_NEQ = 'neq'; // != |
|
| 24 | - const OPERATION_GT = 'gt'; // > |
|
| 25 | - const OPERATION_GTE = 'gte'; // >= |
|
| 26 | - const OPERATION_LT = 'lt'; // < |
|
| 27 | - const OPERATION_LTE = 'lte'; // <= |
|
| 28 | - const OPERATION_LIKE = 'like'; // like... |
|
| 20 | + const OPERATION_NULL = 'nul'; // is null |
|
| 21 | + const OPERATION_NNULL = 'nnul'; // is not null |
|
| 22 | + const OPERATION_EQ = 'eq'; // = |
|
| 23 | + const OPERATION_NEQ = 'neq'; // != |
|
| 24 | + const OPERATION_GT = 'gt'; // > |
|
| 25 | + const OPERATION_GTE = 'gte'; // >= |
|
| 26 | + const OPERATION_LT = 'lt'; // < |
|
| 27 | + const OPERATION_LTE = 'lte'; // <= |
|
| 28 | + const OPERATION_LIKE = 'like'; // like... |
|
| 29 | 29 | const OPERATION_NLIKE = 'nlike'; // not like |
| 30 | - const OPERATION_REXP = 'rexp'; // regex |
|
| 31 | - const OPERATION_IN = 'in'; // in () |
|
| 32 | - const OPERATION_NIN = 'nin'; // not in () |
|
| 30 | + const OPERATION_REXP = 'rexp'; // regex |
|
| 31 | + const OPERATION_IN = 'in'; // in () |
|
| 32 | + const OPERATION_NIN = 'nin'; // not in () |
|
| 33 | 33 | |
| 34 | 34 | const AGGREGATE_AVG = 'AVG'; |
| 35 | 35 | const AGGREGATE_COUNT = 'COUNT'; |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | $connection->setAttribute(PDO::ATTR_PERSISTENT, true); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - foreach ($this->attributes as $key => $value){ |
|
| 40 | + foreach ($this->attributes as $key => $value) { |
|
| 41 | 41 | $connection->setAttribute($key, $value); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | $connection->setAttribute(PDO::ATTR_PERSISTENT, true); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - foreach ($this->attributes as $key => $value){ |
|
| 40 | + foreach ($this->attributes as $key => $value) { |
|
| 41 | 41 | $connection->setAttribute($key, $value); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | $connection->setAttribute(PDO::ATTR_PERSISTENT, true); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - foreach ($this->attributes as $key => $value){ |
|
| 40 | + foreach ($this->attributes as $key => $value) { |
|
| 41 | 41 | $connection->setAttribute($key, $value); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | $connection->setAttribute(PDO::ATTR_PERSISTENT, true); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - foreach ($this->attributes as $key => $value){ |
|
| 40 | + foreach ($this->attributes as $key => $value) { |
|
| 41 | 41 | $connection->setAttribute($key, $value); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | */ |
| 408 | 408 | protected function correctTable(string $table): string |
| 409 | 409 | { |
| 410 | - return empty($table) ? $this->basicRecord->getMapper()->getAlias() : $table ; |
|
| 410 | + return empty($table) ? $this->basicRecord->getMapper()->getAlias() : $table; |
|
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | /** |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | */ |
| 419 | 419 | protected function correctColumn(string $table, string $column) |
| 420 | 420 | { |
| 421 | - $record = !empty($table) ? $this->recordLookup($table)->getRecord() : $this->basicRecord ; |
|
| 421 | + $record = !empty($table) ? $this->recordLookup($table)->getRecord() : $this->basicRecord; |
|
| 422 | 422 | if (empty($record)) { |
| 423 | 423 | // @codeCoverageIgnoreStart |
| 424 | 424 | throw new MapperException(sprintf('Unknown relation table *%s*', $table)); |
@@ -42,14 +42,14 @@ |
||
| 42 | 42 | // through relations |
| 43 | 43 | foreach ($toCompare as $relationKey => $compareValue) { |
| 44 | 44 | foreach ($this->records as $positionKey => $knownRecord) { |
| 45 | - if ( !isset($toProcess[$positionKey]) ) { // not twice |
|
| 45 | + if (!isset($toProcess[$positionKey])) { // not twice |
|
| 46 | 46 | continue; |
| 47 | 47 | } |
| 48 | - if ( !$knownRecord->offsetExists($relationKey) ) { // unknown relation key in record is not allowed into compare |
|
| 48 | + if (!$knownRecord->offsetExists($relationKey)) { // unknown relation key in record is not allowed into compare |
|
| 49 | 49 | unset($toProcess[$positionKey]); |
| 50 | 50 | continue; |
| 51 | 51 | } |
| 52 | - if ( strval($knownRecord->offsetGet($relationKey)) != strval($compareValue) ) { |
|
| 52 | + if (strval($knownRecord->offsetGet($relationKey)) != strval($compareValue)) { |
|
| 53 | 53 | unset($toProcess[$positionKey]); |
| 54 | 54 | continue; |
| 55 | 55 | } |