@@ -656,7 +656,7 @@ discard block |
||
| 656 | 656 | } |
| 657 | 657 | |
| 658 | 658 | /** |
| 659 | - * @param object $entity |
|
| 659 | + * @param FileNodeInterface $entity |
|
| 660 | 660 | * |
| 661 | 661 | * @return string |
| 662 | 662 | */ |
@@ -682,7 +682,7 @@ discard block |
||
| 682 | 682 | } |
| 683 | 683 | |
| 684 | 684 | /** |
| 685 | - * @param object $entity |
|
| 685 | + * @param FileNodeInterface $entity |
|
| 686 | 686 | * |
| 687 | 687 | * @return string|null |
| 688 | 688 | */ |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | return [ |
| 56 | 56 | $this->format( |
| 57 | 57 | 'CREATE TABLE {new:schema|q}.{new:table|q} (LIKE {old:schema|q}.{old:table|q})', |
| 58 | - ['old' => $old, 'new' => $new,] |
|
| 58 | + ['old' => $old, 'new' => $new, ] |
|
| 59 | 59 | ), |
| 60 | 60 | [], |
| 61 | 61 | ]; |
@@ -155,8 +155,7 @@ discard block |
||
| 155 | 155 | $this->format( |
| 156 | 156 | ' {table:softUpdated|q} = CONVERT_TIMEZONE(\'UTC\', \'{timezone}\', GETDATE()),', |
| 157 | 157 | ['table' => $table, 'timezone' => $this->timezone] |
| 158 | - ) : |
|
| 159 | - ''), |
|
| 158 | + ) : ''), |
|
| 160 | 159 | 'where' => ($where ? 'WHERE ' . $where : ''), |
| 161 | 160 | 'timezone' => $this->timezone, |
| 162 | 161 | ] |
@@ -451,7 +450,7 @@ discard block |
||
| 451 | 450 | $bucket = $this->getS3BucketFromFile($file); |
| 452 | 451 | |
| 453 | 452 | if ($table->getColumns()) { |
| 454 | - $columns = implode(',', array_map(function ($column) { |
|
| 453 | + $columns = implode(',', array_map(function($column) { |
|
| 455 | 454 | return $this->format('{column|q}', ['column' => $column]); |
| 456 | 455 | }, $table->getColumns())); |
| 457 | 456 | } else { |
@@ -547,7 +546,7 @@ discard block |
||
| 547 | 546 | $bucket = $this->getS3BucketFromFile($file); |
| 548 | 547 | |
| 549 | 548 | if ($table->getColumns()) { |
| 550 | - $columns = implode(',', array_map(function ($column) { |
|
| 549 | + $columns = implode(',', array_map(function($column) { |
|
| 551 | 550 | return $this->format('{column|q}', ['column' => $column]); |
| 552 | 551 | }, $table->getColumns())); |
| 553 | 552 | } else { |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | - * @return int|mixed |
|
| 42 | + * @return integer |
|
| 43 | 43 | */ |
| 44 | 44 | public function key() |
| 45 | 45 | { |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | * |
| 22 | 22 | * @param AdapterInterface $adapter |
| 23 | 23 | * @param string $sql |
| 24 | - * @param array $bind |
|
| 24 | + * @param string[] $bind |
|
| 25 | 25 | */ |
| 26 | 26 | public function __construct(AdapterInterface $adapter, $sql, array $bind = []) |
| 27 | 27 | { |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | - * @return mixed |
|
| 55 | + * @return string |
|
| 56 | 56 | */ |
| 57 | 57 | public function getSql() |
| 58 | 58 | { |
@@ -128,7 +128,7 @@ |
||
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
| 131 | - * @return string[] |
|
| 131 | + * @return string |
|
| 132 | 132 | */ |
| 133 | 133 | public function getColumns() |
| 134 | 134 | { |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | return [ |
| 26 | 26 | $this->format( |
| 27 | 27 | 'CREATE TABLE {new:schema|q}.{new:table|q} LIKE {old:schema|q}.{old:table|q}', |
| 28 | - ['old' => $old, 'new' => $new,] |
|
| 28 | + ['old' => $old, 'new' => $new, ] |
|
| 29 | 29 | ), |
| 30 | 30 | [], |
| 31 | 31 | ]; |
@@ -119,8 +119,7 @@ discard block |
||
| 119 | 119 | [ |
| 120 | 120 | 'table' => $table, |
| 121 | 121 | 'softUpdated' => ($table->getSoftUpdated() ? |
| 122 | - $this->format(' {table:softUpdated|q} = CURRENT_TIMESTAMP,', ['table' => $table]) : |
|
| 123 | - ''), |
|
| 122 | + $this->format(' {table:softUpdated|q} = CURRENT_TIMESTAMP,', ['table' => $table]) : ''), |
|
| 124 | 123 | 'where' => ($where ? 'WHERE ' . $where : ''), |
| 125 | 124 | ] |
| 126 | 125 | ), |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | return [ |
| 60 | 60 | $this->format( |
| 61 | 61 | 'ALTER TABLE {table:schema|q}.{table:table|q} DROP COLUMN {column|q}', |
| 62 | - ['table' => $table, 'column' => $column,] |
|
| 62 | + ['table' => $table, 'column' => $column, ] |
|
| 63 | 63 | ), |
| 64 | 64 | [], |
| 65 | 65 | ]; |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | public function getCopyTable(TableNodeInterface $from, TableNodeInterface $to) |
| 118 | 118 | { |
| 119 | 119 | if ($from->getColumns()) { |
| 120 | - $fromColumns = implode(',', array_map(function ($column) { |
|
| 120 | + $fromColumns = implode(',', array_map(function($column) { |
|
| 121 | 121 | return $this->format('{column|q}', ['column' => $column]); |
| 122 | 122 | }, $from->getColumns())); |
| 123 | 123 | } else { |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | if ($to->getColumns()) { |
| 128 | 128 | $toColumns = sprintf( |
| 129 | 129 | ' (%s)', |
| 130 | - implode(',', array_map(function ($column) { |
|
| 130 | + implode(',', array_map(function($column) { |
|
| 131 | 131 | return $this->format('{column|q}', ['column' => $column]); |
| 132 | 132 | }, $to->getColumns())) |
| 133 | 133 | ); |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | public function getSelectSyntax(TableNodeInterface $table) |
| 159 | 159 | { |
| 160 | 160 | if ($table->getColumns()) { |
| 161 | - $fromColumns = implode(',', array_map(function ($column) { |
|
| 161 | + $fromColumns = implode(',', array_map(function($column) { |
|
| 162 | 162 | return $this->format('{column|q}', ['column' => $column]); |
| 163 | 163 | }, $table->getColumns())); |
| 164 | 164 | } else { |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | if ($table->getColumns()) { |
| 195 | 195 | $toColumns = sprintf( |
| 196 | 196 | ' (%s)', |
| 197 | - implode(',', array_map(function ($column) { |
|
| 197 | + implode(',', array_map(function($column) { |
|
| 198 | 198 | return $this->format('{column|q}', ['column' => $column]); |
| 199 | 199 | }, $table->getColumns())) |
| 200 | 200 | ); |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | */ |
| 49 | 49 | public function format($syntax, array $params = []) |
| 50 | 50 | { |
| 51 | - return preg_replace_callback('/(?<!\{)\{(\w+)(?:\:(\w+))?(\|q)?\}(?!\})/i', function ($match) use ($params) { |
|
| 51 | + return preg_replace_callback('/(?<!\{)\{(\w+)(?:\:(\w+))?(\|q)?\}(?!\})/i', function($match) use ($params) { |
|
| 52 | 52 | $key = $match[1]; |
| 53 | 53 | $result = $match[0]; |
| 54 | 54 | if (isset($params[$key])) { |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | $baseBindings = $query->getBind(); |
| 48 | 48 | return preg_replace_callback( |
| 49 | 49 | '/\?/', |
| 50 | - function ($value) use (&$c, $query, $baseBindings) { |
|
| 50 | + function($value) use (&$c, $query, $baseBindings) { |
|
| 51 | 51 | if (!isset($baseBindings[$c])) { |
| 52 | 52 | throw new RuntimeException("Different number of options in query to parameters supplied"); |
| 53 | 53 | } |
@@ -104,7 +104,7 @@ |
||
| 104 | 104 | $result = $db->fetchAll(trim($sql), $params); |
| 105 | 105 | |
| 106 | 106 | if ($result) { |
| 107 | - $col = array_map(function ($row) { |
|
| 107 | + $col = array_map(function($row) { |
|
| 108 | 108 | return $row['ddl']; |
| 109 | 109 | }, $result); |
| 110 | 110 | |