@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * @param string $password |
53 | 53 | * @param array $options |
54 | 54 | */ |
55 | - public function __construct ($dsn, $username = null, $password = null, $options = null) { |
|
55 | + public function __construct($dsn, $username = null, $password = null, $options = null) { |
|
56 | 56 | parent::__construct($dsn, $username, $password, $options); |
57 | 57 | $this->driver = $this->getAttribute(self::ATTR_DRIVER_NAME); |
58 | 58 | $this->setAttribute(self::ATTR_DEFAULT_FETCH_MODE, self::FETCH_ASSOC); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * |
75 | 75 | * @return string |
76 | 76 | */ |
77 | - final public function __toString () { |
|
77 | + final public function __toString() { |
|
78 | 78 | return $this->driver; |
79 | 79 | } |
80 | 80 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * @param string $sql |
85 | 85 | * @return int |
86 | 86 | */ |
87 | - public function exec ($sql): int { |
|
87 | + public function exec($sql): int { |
|
88 | 88 | $this->logger->__invoke($sql); |
89 | 89 | return parent::exec($sql); |
90 | 90 | } |
@@ -98,14 +98,14 @@ discard block |
||
98 | 98 | * @param mixed ...$args |
99 | 99 | * @return mixed |
100 | 100 | */ |
101 | - public function factory (string $class, ...$args) { |
|
101 | + public function factory(string $class, ...$args) { |
|
102 | 102 | return new $class(...$args); |
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
106 | 106 | * @return string |
107 | 107 | */ |
108 | - final public function getDriver (): string { |
|
108 | + final public function getDriver(): string { |
|
109 | 109 | return $this->driver; |
110 | 110 | } |
111 | 111 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @param string $interface |
116 | 116 | * @return Junction |
117 | 117 | */ |
118 | - public function getJunction ($interface) { |
|
118 | + public function getJunction($interface) { |
|
119 | 119 | if (!isset($this->junctions[$interface])) { |
120 | 120 | $this->junctions[$interface] = Junction::fromInterface($this, $interface); |
121 | 121 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | /** |
126 | 126 | * @return Closure |
127 | 127 | */ |
128 | - public function getLogger () { |
|
128 | + public function getLogger() { |
|
129 | 129 | return $this->logger; |
130 | 130 | } |
131 | 131 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * @param string|EntityInterface $class |
136 | 136 | * @return Record |
137 | 137 | */ |
138 | - public function getRecord ($class) { |
|
138 | + public function getRecord($class) { |
|
139 | 139 | if (is_object($class)) { |
140 | 140 | $class = get_class($class); |
141 | 141 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | * @param mixed $b |
163 | 163 | * @return Predicate |
164 | 164 | */ |
165 | - public function match ($a, $b) { |
|
165 | + public function match($a, $b) { |
|
166 | 166 | if ($b instanceof Closure) { |
167 | 167 | return $b->__invoke($a, $this); |
168 | 168 | } |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | * @param string $class Class or interface name. |
183 | 183 | * @return bool |
184 | 184 | */ |
185 | - public function offsetExists ($class): bool { |
|
185 | + public function offsetExists($class): bool { |
|
186 | 186 | return (bool)$this->offsetGet($class); |
187 | 187 | } |
188 | 188 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | * @param string $class Class or interface name. |
191 | 191 | * @return null|Record|Junction |
192 | 192 | */ |
193 | - public function offsetGet ($class) { |
|
193 | + public function offsetGet($class) { |
|
194 | 194 | if (class_exists($class)) { |
195 | 195 | return $this->getRecord($class); |
196 | 196 | } |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | * @param string $class Class or interface name. |
205 | 205 | * @param Record|Junction $access |
206 | 206 | */ |
207 | - public function offsetSet ($class, $access) { |
|
207 | + public function offsetSet($class, $access) { |
|
208 | 208 | if ($access instanceof Record) { |
209 | 209 | $this->setRecord($class, $access); |
210 | 210 | } |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | /** |
217 | 217 | * @param string $class Class or interface name. |
218 | 218 | */ |
219 | - public function offsetUnset ($class) { |
|
219 | + public function offsetUnset($class) { |
|
220 | 220 | unset($this->records[$class]); |
221 | 221 | unset($this->junctions[$class]); |
222 | 222 | } |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | * @param array $options |
229 | 229 | * @return Statement |
230 | 230 | */ |
231 | - public function prepare ($sql, $options = []) { |
|
231 | + public function prepare($sql, $options = []) { |
|
232 | 232 | $this->logger->__invoke($sql); |
233 | 233 | /** @var Statement $statement */ |
234 | 234 | $statement = parent::prepare($sql, $options); |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | * @param array $ctorargs Optional. |
245 | 245 | * @return Statement |
246 | 246 | */ |
247 | - public function query ($sql, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, array $ctorargs = []) { |
|
247 | + public function query($sql, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, array $ctorargs = []) { |
|
248 | 248 | $this->logger->__invoke($sql); |
249 | 249 | /** @var Statement $statement */ |
250 | 250 | $statement = parent::query(...func_get_args()); |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | * @param int $type Ignored. |
263 | 263 | * @return string|ExpressionInterface |
264 | 264 | */ |
265 | - public function quote ($value, $type = self::PARAM_STR) { |
|
265 | + public function quote($value, $type = self::PARAM_STR) { |
|
266 | 266 | if ($value instanceof ExpressionInterface) { |
267 | 267 | return $value; |
268 | 268 | } |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | * @param array $values |
283 | 283 | * @return string[] |
284 | 284 | */ |
285 | - public function quoteArray (array $values) { |
|
285 | + public function quoteArray(array $values) { |
|
286 | 286 | return array_map([$this, 'quote'], $values); |
287 | 287 | } |
288 | 288 | |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | * @param array $values |
293 | 293 | * @return string |
294 | 294 | */ |
295 | - public function quoteList (array $values): string { |
|
295 | + public function quoteList(array $values): string { |
|
296 | 296 | return implode(',', $this->quoteArray($values)); |
297 | 297 | } |
298 | 298 | |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | * @param EntityInterface $entity |
303 | 303 | * @return int ID |
304 | 304 | */ |
305 | - public function save (EntityInterface $entity): int { |
|
305 | + public function save(EntityInterface $entity): int { |
|
306 | 306 | return $this->getRecord($entity)->save($entity); |
307 | 307 | } |
308 | 308 | |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | * @param Junction $junction |
312 | 312 | * @return $this |
313 | 313 | */ |
314 | - public function setJunction (string $interface, Junction $junction) { |
|
314 | + public function setJunction(string $interface, Junction $junction) { |
|
315 | 315 | $this->junctions[$interface] = $junction; |
316 | 316 | return $this; |
317 | 317 | } |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | * @param Closure $logger |
321 | 321 | * @return $this |
322 | 322 | */ |
323 | - public function setLogger (Closure $logger) { |
|
323 | + public function setLogger(Closure $logger) { |
|
324 | 324 | $this->logger = $logger; |
325 | 325 | return $this; |
326 | 326 | } |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | * @param Record $record |
331 | 331 | * @return $this |
332 | 332 | */ |
333 | - public function setRecord (string $class, Record $record) { |
|
333 | + public function setRecord(string $class, Record $record) { |
|
334 | 334 | $this->records[$class] = $record; |
335 | 335 | return $this; |
336 | 336 | } |