@@ -27,7 +27,7 @@ |
||
27 | 27 | $this->record = $record; |
28 | 28 | $this->parentAlias = $parentAlias; |
29 | 29 | $this->storeKey = $storeKey; |
30 | - $this->knownAs = empty($knownAs) ? $storeKey : $knownAs ; |
|
30 | + $this->knownAs = empty($knownAs) ? $storeKey : $knownAs; |
|
31 | 31 | return $this; |
32 | 32 | } |
33 | 33 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | protected function parseProperty(string $property): array |
37 | 37 | { |
38 | 38 | $separated = explode(static::$propertySeparator, $property, 2); |
39 | - return ((false !== $separated) && (1 < count($separated)) && mb_strlen($separated[0]) && mb_strlen($separated[1]) ) |
|
39 | + return ((false !== $separated) && (1 < count($separated)) && mb_strlen($separated[0]) && mb_strlen($separated[1])) |
|
40 | 40 | ? $separated |
41 | 41 | : ['', $property] |
42 | 42 | ; |
@@ -115,7 +115,7 @@ |
||
115 | 115 | #[\ReturnTypeWillChange] |
116 | 116 | final public function current() |
117 | 117 | { |
118 | - return $this->valid() ? $this->offsetGet($this->key) : null ; |
|
118 | + return $this->valid() ? $this->offsetGet($this->key) : null; |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | final public function next(): void |
@@ -31,9 +31,9 @@ |
||
31 | 31 | |
32 | 32 | /** @var int[] */ |
33 | 33 | protected static array $types = [IEntryType::TYPE_BOOLEAN, |
34 | - IEntryType::TYPE_INTEGER, IEntryType::TYPE_FLOAT, |
|
35 | - IEntryType::TYPE_STRING, |
|
36 | - IEntryType::TYPE_SET, IEntryType::TYPE_ARRAY, IEntryType::TYPE_OBJECT]; |
|
34 | + IEntryType::TYPE_INTEGER, IEntryType::TYPE_FLOAT, |
|
35 | + IEntryType::TYPE_STRING, |
|
36 | + IEntryType::TYPE_SET, IEntryType::TYPE_ARRAY, IEntryType::TYPE_OBJECT]; |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * Mapper constructor. |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * @param Entry $entry |
18 | 18 | * @param mixed $value |
19 | 19 | */ |
20 | - protected function typedFill(Entry &$entry, $value): void |
|
20 | + protected function typedFill(Entry & $entry, $value): void |
|
21 | 21 | { |
22 | 22 | $entry->setData($this->typedFillSelection($entry, $value)); |
23 | 23 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @param mixed $dbValue |
28 | 28 | * @return bool|float|int|string |
29 | 29 | */ |
30 | - protected function typedFillSelection(Entry &$entry, $dbValue) |
|
30 | + protected function typedFillSelection(Entry & $entry, $dbValue) |
|
31 | 31 | { |
32 | 32 | switch ($entry->getType()) { |
33 | 33 | case IEntryType::TYPE_BOOLEAN: |
@@ -33,7 +33,7 @@ |
||
33 | 33 | } |
34 | 34 | $binds[] = $params[$key]; |
35 | 35 | $types[] = $this->getTypeOf($params[$key]); |
36 | - $query = substr($query, 0, $pos) . '?' . ( $nextSpace ? substr($query, $nextSpace) : '' ); |
|
36 | + $query = substr($query, 0, $pos) . '?' . ($nextSpace ? substr($query, $nextSpace) : ''); |
|
37 | 37 | } |
38 | 38 | return [$query, $binds, $types]; |
39 | 39 | } |
@@ -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 |
@@ -86,7 +86,7 @@ |
||
86 | 86 | |
87 | 87 | public function rowCount(): ?int |
88 | 88 | { |
89 | - return $this->lastStatement ? $this->lastStatement->rowCount() : null ; |
|
89 | + return $this->lastStatement ? $this->lastStatement->rowCount() : null; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | public function beginTransaction(): bool |
@@ -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 | } |