@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @param string $passwd |
46 | 46 | * @param array $options |
47 | 47 | */ |
48 | - public function __construct ($dsn, $username = null, $passwd = null, $options = null) { |
|
48 | + public function __construct($dsn, $username = null, $passwd = null, $options = null) { |
|
49 | 49 | parent::__construct($dsn, $username, $passwd, $options); |
50 | 50 | $this->setAttribute(self::ATTR_DEFAULT_FETCH_MODE, self::FETCH_ASSOC); |
51 | 51 | $this->setAttribute(self::ATTR_EMULATE_PREPARES, false); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * @param string $sql |
62 | 62 | * @return int |
63 | 63 | */ |
64 | - public function exec ($sql): int { |
|
64 | + public function exec($sql): int { |
|
65 | 65 | $this->logger->__invoke($sql); |
66 | 66 | return parent::exec($sql); |
67 | 67 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | * |
72 | 72 | * @return string |
73 | 73 | */ |
74 | - final public function getDriver (): string { |
|
74 | + final public function getDriver(): string { |
|
75 | 75 | return $this->getAttribute(self::ATTR_DRIVER_NAME); |
76 | 76 | } |
77 | 77 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | * @param string $interface |
82 | 82 | * @return Junction |
83 | 83 | */ |
84 | - public function getJunction ($interface): Junction { |
|
84 | + public function getJunction($interface): Junction { |
|
85 | 85 | if (!isset($this->junctions[$interface])) { |
86 | 86 | $this->junctions[$interface] = new Junction($this, $interface); |
87 | 87 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | /** |
92 | 92 | * @return Closure |
93 | 93 | */ |
94 | - public function getLogger (): Closure { |
|
94 | + public function getLogger(): Closure { |
|
95 | 95 | return $this->logger; |
96 | 96 | } |
97 | 97 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * @param string|EntityInterface $class |
102 | 102 | * @return Record |
103 | 103 | */ |
104 | - public function getRecord ($class): Record { |
|
104 | + public function getRecord($class): Record { |
|
105 | 105 | if (is_object($class)) { |
106 | 106 | $class = get_class($class); |
107 | 107 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * @param mixed $b |
127 | 127 | * @return string |
128 | 128 | */ |
129 | - public function match ($a, $b = null) { |
|
129 | + public function match($a, $b = null) { |
|
130 | 130 | if (is_int($a) and is_string($b)) { |
131 | 131 | return $b; |
132 | 132 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | * @param array $match |
150 | 150 | * @return string[] |
151 | 151 | */ |
152 | - public function matchArray (array $match) { |
|
152 | + public function matchArray(array $match) { |
|
153 | 153 | return array_map([$this, 'match'], array_keys($match), $match); |
154 | 154 | } |
155 | 155 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | * @param mixed $match |
162 | 162 | * @return string|string[] |
163 | 163 | */ |
164 | - public function matchMixed ($match) { |
|
164 | + public function matchMixed($match) { |
|
165 | 165 | if (is_array($match)) { |
166 | 166 | return $this->matchArray($match); |
167 | 167 | } |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | * @param string $access Class or interface name. |
173 | 173 | * @return bool |
174 | 174 | */ |
175 | - public function offsetExists ($access): bool { |
|
175 | + public function offsetExists($access): bool { |
|
176 | 176 | return (bool)$this->offsetGet($access); |
177 | 177 | } |
178 | 178 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | * @param string $access Class or interface name. |
181 | 181 | * @return null|Record|Junction |
182 | 182 | */ |
183 | - public function offsetGet ($access) { |
|
183 | + public function offsetGet($access) { |
|
184 | 184 | if (class_exists($access)) { |
185 | 185 | return $this->getRecord($access); |
186 | 186 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | * @param void $value |
198 | 198 | * @throws Exception |
199 | 199 | */ |
200 | - final public function offsetSet ($access, $value): void { |
|
200 | + final public function offsetSet($access, $value): void { |
|
201 | 201 | throw new Exception('The schema is immutable.'); |
202 | 202 | } |
203 | 203 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | * @param void $access |
208 | 208 | * @throws Exception |
209 | 209 | */ |
210 | - final public function offsetUnset ($access): void { |
|
210 | + final public function offsetUnset($access): void { |
|
211 | 211 | $this->offsetSet($access, null); |
212 | 212 | } |
213 | 213 | |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | * @param array $options |
219 | 219 | * @return Statement |
220 | 220 | */ |
221 | - public function prepare ($sql, $options = []): Statement { |
|
221 | + public function prepare($sql, $options = []): Statement { |
|
222 | 222 | $this->logger->__invoke($sql); |
223 | 223 | /** @var Statement $statement */ |
224 | 224 | $statement = parent::prepare($sql, $options); |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | * @param array $ctorargs |
235 | 235 | * @return Statement |
236 | 236 | */ |
237 | - public function query ($sql, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, array $ctorargs = []): Statement { |
|
237 | + public function query($sql, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, array $ctorargs = []): Statement { |
|
238 | 238 | $this->logger->__invoke($sql); |
239 | 239 | /** @var Statement $statement */ |
240 | 240 | $statement = parent::query(...func_get_args()); |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | * @param int $type Ignored. |
254 | 254 | * @return string |
255 | 255 | */ |
256 | - public function quote ($value, $type = null) { |
|
256 | + public function quote($value, $type = null) { |
|
257 | 257 | if ($value instanceof ExpressionInterface) { |
258 | 258 | return $value; |
259 | 259 | } |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | * @param array $values |
274 | 274 | * @return array |
275 | 275 | */ |
276 | - public function quoteArray (array $values): array { |
|
276 | + public function quoteArray(array $values): array { |
|
277 | 277 | return array_map([$this, 'quote'], $values); |
278 | 278 | } |
279 | 279 | |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | * @param mixed $value |
284 | 284 | * @return array|string |
285 | 285 | */ |
286 | - public function quoteMixed ($value) { |
|
286 | + public function quoteMixed($value) { |
|
287 | 287 | if (is_array($value)) { |
288 | 288 | return $this->quoteArray($value); |
289 | 289 | } |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | * @param EntityInterface $entity |
297 | 297 | * @return int ID |
298 | 298 | */ |
299 | - public function save (EntityInterface $entity): int { |
|
299 | + public function save(EntityInterface $entity): int { |
|
300 | 300 | return $this->getRecord($entity)->save($entity); |
301 | 301 | } |
302 | 302 | |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | * @param Closure $logger |
305 | 305 | * @return $this |
306 | 306 | */ |
307 | - public function setLogger (Closure $logger) { |
|
307 | + public function setLogger(Closure $logger) { |
|
308 | 308 | $this->logger = $logger; |
309 | 309 | return $this; |
310 | 310 | } |