@@ -60,9 +60,9 @@ |
||
60 | 60 | { |
61 | 61 | $connection = new Driver\Manager(sprintf('mongodb://%s%s@%s%s/%s', |
62 | 62 | ($this->config->getUser()) ?: '', |
63 | - !empty($this->config->getPassword()) ? ':'. $this->config->getPassword() : '', |
|
63 | + !empty($this->config->getPassword()) ? ':' . $this->config->getPassword() : '', |
|
64 | 64 | $this->config->getLocation(), |
65 | - !empty($this->config->getPort()) ? ':'. $this->config->getPort() : '', |
|
65 | + !empty($this->config->getPort()) ? ':' . $this->config->getPort() : '', |
|
66 | 66 | $this->config->getDatabase() |
67 | 67 | ), $this->attributes); |
68 | 68 |
@@ -149,21 +149,21 @@ discard block |
||
149 | 149 | $path .= (IRegistry::REG_NONE == $type) ? '\\' : ''; // none type = it's "dir", not "entry" |
150 | 150 | |
151 | 151 | if (IDriverSources::ACTION_INSERT == $action) { |
152 | - try{ |
|
152 | + try { |
|
153 | 153 | $this->connection->RegWrite($path, $content, static::$allowedTypes[$type]); |
154 | 154 | } catch (\Exception $e) { |
155 | 155 | throw new MapperException('Cannot write into registry', 0, $e); |
156 | 156 | } |
157 | 157 | } elseif (IDriverSources::ACTION_UPDATE == $action) { |
158 | - try{ |
|
158 | + try { |
|
159 | 159 | $this->connection->RegWrite($path, $content, static::$allowedTypes[$type]); |
160 | 160 | } catch (\Exception $e) { |
161 | 161 | throw new MapperException('Cannot write into registry', 0, $e); |
162 | 162 | } |
163 | 163 | } elseif (IDriverSources::ACTION_DELETE == $action) { |
164 | - try{ |
|
164 | + try { |
|
165 | 165 | $this->connection->RegDelete($path); |
166 | - } catch(\Exception $e) { |
|
166 | + } catch (\Exception $e) { |
|
167 | 167 | throw new MapperException('Cannot delete from registry', 0, $e); |
168 | 168 | } |
169 | 169 | } else { |
@@ -182,6 +182,6 @@ discard block |
||
182 | 182 | |
183 | 183 | protected function dropSlash(string $key): string |
184 | 184 | { |
185 | - return ('\\' == mb_substr($key, -1, 1)) ? mb_substr($key, 0, -1) : $key ; |
|
185 | + return ('\\' == mb_substr($key, -1, 1)) ? mb_substr($key, 0, -1) : $key; |
|
186 | 186 | } |
187 | 187 | } |
@@ -64,7 +64,7 @@ |
||
64 | 64 | throw new \RuntimeException('Ldap connection error.'); |
65 | 65 | } |
66 | 66 | |
67 | - if ( false !== strpos($this->config->getLocation(), 'ldaps://' )) { |
|
67 | + if (false !== strpos($this->config->getLocation(), 'ldaps://')) { |
|
68 | 68 | if (!ldap_start_tls($connection)) { |
69 | 69 | throw new MapperException('Cannot start TLS for secured connection!'); |
70 | 70 | } |
@@ -120,12 +120,12 @@ |
||
120 | 120 | |
121 | 121 | public function lastInsertId(): ?string |
122 | 122 | { |
123 | - return $this->lastStatement ? strval($this->lastStatement->insert_id) : null ; |
|
123 | + return $this->lastStatement ? strval($this->lastStatement->insert_id) : null; |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | public function rowCount(): ?int |
127 | 127 | { |
128 | - return $this->lastStatement ? intval($this->lastStatement->num_rows) : null ; |
|
128 | + return $this->lastStatement ? intval($this->lastStatement->num_rows) : null; |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | public function beginTransaction(): bool |
@@ -59,7 +59,7 @@ |
||
59 | 59 | |
60 | 60 | public function describe(QueryBuilder $builder) |
61 | 61 | { |
62 | - return sprintf('SELECT table_name, column_name, data_type FROM information_schema.columns WHERE table_name = \'%s\';', $builder->getBaseTable() ); |
|
62 | + return sprintf('SELECT table_name, column_name, data_type FROM information_schema.columns WHERE table_name = \'%s\';', $builder->getBaseTable()); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | protected function makeLimits(?int $limit, ?int $offset): string |
@@ -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 |
@@ -61,7 +61,7 @@ |
||
61 | 61 | |
62 | 62 | public function describe(QueryBuilder $builder) |
63 | 63 | { |
64 | - return sprintf('DESCRIBE `%s`;', $builder->getBaseTable() ); |
|
64 | + return sprintf('DESCRIBE `%s`;', $builder->getBaseTable()); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | protected function makeLimits(?int $limit, ?int $offset): string |
@@ -83,7 +83,7 @@ |
||
83 | 83 | |
84 | 84 | public function describe(QueryBuilder $builder) |
85 | 85 | { |
86 | - return sprintf('SELECT "sql" FROM "sqlite_master" WHERE "name" = \'%s\';', $builder->getBaseTable() ); |
|
86 | + return sprintf('SELECT "sql" FROM "sqlite_master" WHERE "name" = \'%s\';', $builder->getBaseTable()); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | protected function makeLimits(?int $limit, ?int $offset): string |
@@ -98,7 +98,7 @@ |
||
98 | 98 | { |
99 | 99 | $columns = []; |
100 | 100 | foreach ($ordering as $column) { |
101 | - $columns[$column->getColumnName()] = (IQueryBuilder::ORDER_ASC == $column->getDirection() ? 1 : -1 ); |
|
101 | + $columns[$column->getColumnName()] = (IQueryBuilder::ORDER_ASC == $column->getDirection() ? 1 : -1); |
|
102 | 102 | } |
103 | 103 | return $columns; |
104 | 104 | } |