@@ -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); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | * |
74 | 74 | * @return string |
75 | 75 | */ |
76 | - final public function __toString () { |
|
76 | + final public function __toString() { |
|
77 | 77 | return $this->driver; |
78 | 78 | } |
79 | 79 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * @param string $sql |
84 | 84 | * @return int |
85 | 85 | */ |
86 | - public function exec ($sql): int { |
|
86 | + public function exec($sql): int { |
|
87 | 87 | $this->logger->__invoke($sql); |
88 | 88 | return parent::exec($sql); |
89 | 89 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | /** |
92 | 92 | * @return string |
93 | 93 | */ |
94 | - final public function getDriver (): string { |
|
94 | + final public function getDriver(): string { |
|
95 | 95 | return $this->driver; |
96 | 96 | } |
97 | 97 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * @param string $interface |
102 | 102 | * @return Junction |
103 | 103 | */ |
104 | - public function getJunction ($interface) { |
|
104 | + public function getJunction($interface) { |
|
105 | 105 | if (!isset($this->junctions[$interface])) { |
106 | 106 | $this->junctions[$interface] = Junction::fromInterface($this, $interface); |
107 | 107 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | /** |
112 | 112 | * @return Closure |
113 | 113 | */ |
114 | - public function getLogger () { |
|
114 | + public function getLogger() { |
|
115 | 115 | return $this->logger; |
116 | 116 | } |
117 | 117 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | * @param string|EntityInterface $class |
122 | 122 | * @return Record |
123 | 123 | */ |
124 | - public function getRecord ($class) { |
|
124 | + public function getRecord($class) { |
|
125 | 125 | if (is_object($class)) { |
126 | 126 | $class = get_class($class); |
127 | 127 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | * @param mixed $b |
149 | 149 | * @return Predicate |
150 | 150 | */ |
151 | - public function match ($a, $b) { |
|
151 | + public function match($a, $b) { |
|
152 | 152 | if ($b instanceof Closure) { |
153 | 153 | return $b->__invoke($a, $this); |
154 | 154 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | * @param string $class Class or interface name. |
169 | 169 | * @return bool |
170 | 170 | */ |
171 | - public function offsetExists ($class): bool { |
|
171 | + public function offsetExists($class): bool { |
|
172 | 172 | return (bool)$this->offsetGet($class); |
173 | 173 | } |
174 | 174 | |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | * @param string $class Class or interface name. |
177 | 177 | * @return null|Record|Junction |
178 | 178 | */ |
179 | - public function offsetGet ($class) { |
|
179 | + public function offsetGet($class) { |
|
180 | 180 | if (class_exists($class)) { |
181 | 181 | return $this->getRecord($class); |
182 | 182 | } |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | * @param string $class Class or interface name. |
191 | 191 | * @param Record|Junction $access |
192 | 192 | */ |
193 | - public function offsetSet ($class, $access) { |
|
193 | + public function offsetSet($class, $access) { |
|
194 | 194 | if ($access instanceof Record) { |
195 | 195 | $this->setRecord($class, $access); |
196 | 196 | } |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | /** |
203 | 203 | * @param string $class Class or interface name. |
204 | 204 | */ |
205 | - public function offsetUnset ($class) { |
|
205 | + public function offsetUnset($class) { |
|
206 | 206 | unset($this->records[$class]); |
207 | 207 | unset($this->junctions[$class]); |
208 | 208 | } |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | * @param array $options |
215 | 215 | * @return Statement |
216 | 216 | */ |
217 | - public function prepare ($sql, $options = []) { |
|
217 | + public function prepare($sql, $options = []) { |
|
218 | 218 | $this->logger->__invoke($sql); |
219 | 219 | /** @var Statement $statement */ |
220 | 220 | $statement = parent::prepare($sql, $options); |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | * @param array $ctorargs |
231 | 231 | * @return Statement |
232 | 232 | */ |
233 | - public function query ($sql, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, array $ctorargs = []) { |
|
233 | + public function query($sql, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, array $ctorargs = []) { |
|
234 | 234 | $this->logger->__invoke($sql); |
235 | 235 | /** @var Statement $statement */ |
236 | 236 | $statement = parent::query(...func_get_args()); |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | * @param int $type Ignored. |
250 | 250 | * @return string |
251 | 251 | */ |
252 | - public function quote ($value, $type = self::PARAM_STR) { |
|
252 | + public function quote($value, $type = self::PARAM_STR) { |
|
253 | 253 | if ($value instanceof ExpressionInterface) { |
254 | 254 | return $value; |
255 | 255 | } |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | * @param array $values |
270 | 270 | * @return string[] |
271 | 271 | */ |
272 | - public function quoteArray (array $values): array { |
|
272 | + public function quoteArray(array $values): array { |
|
273 | 273 | return array_map([$this, 'quote'], $values); |
274 | 274 | } |
275 | 275 | |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | * @param array $values |
280 | 280 | * @return string |
281 | 281 | */ |
282 | - public function quoteList (array $values): string { |
|
282 | + public function quoteList(array $values): string { |
|
283 | 283 | return implode(',', $this->quoteArray($values)); |
284 | 284 | } |
285 | 285 | |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | * @param EntityInterface $entity |
290 | 290 | * @return int ID |
291 | 291 | */ |
292 | - public function save (EntityInterface $entity): int { |
|
292 | + public function save(EntityInterface $entity): int { |
|
293 | 293 | return $this->getRecord($entity)->save($entity); |
294 | 294 | } |
295 | 295 | |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | * @param Junction $junction |
299 | 299 | * @return $this |
300 | 300 | */ |
301 | - public function setJunction (string $interface, Junction $junction) { |
|
301 | + public function setJunction(string $interface, Junction $junction) { |
|
302 | 302 | $this->junctions[$interface] = $junction; |
303 | 303 | return $this; |
304 | 304 | } |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | * @param Closure $logger |
308 | 308 | * @return $this |
309 | 309 | */ |
310 | - public function setLogger (Closure $logger) { |
|
310 | + public function setLogger(Closure $logger) { |
|
311 | 311 | $this->logger = $logger; |
312 | 312 | return $this; |
313 | 313 | } |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | * @param Record $record |
318 | 318 | * @return $this |
319 | 319 | */ |
320 | - public function setRecord (string $class, Record $record) { |
|
320 | + public function setRecord(string $class, Record $record) { |
|
321 | 321 | $this->records[$class] = $record; |
322 | 322 | return $this; |
323 | 323 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | /** |
31 | 31 | * @return array |
32 | 32 | */ |
33 | - public function getAttributes (): array { |
|
33 | + public function getAttributes(): array { |
|
34 | 34 | return $this->attributes ?: []; |
35 | 35 | } |
36 | 36 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * @param mixed $attr |
39 | 39 | * @return bool |
40 | 40 | */ |
41 | - public function offsetExists ($attr): bool { |
|
41 | + public function offsetExists($attr): bool { |
|
42 | 42 | return $this->attributes and array_key_exists($attr, $this->attributes); |
43 | 43 | } |
44 | 44 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @param mixed $attr |
47 | 47 | * @return null|mixed |
48 | 48 | */ |
49 | - public function offsetGet ($attr) { |
|
49 | + public function offsetGet($attr) { |
|
50 | 50 | return $this->attributes[$attr] ?? null; |
51 | 51 | } |
52 | 52 | |
@@ -54,14 +54,14 @@ discard block |
||
54 | 54 | * @param mixed $attr |
55 | 55 | * @param mixed $value |
56 | 56 | */ |
57 | - public function offsetSet ($attr, $value): void { |
|
57 | + public function offsetSet($attr, $value): void { |
|
58 | 58 | $this->attributes[$attr] = $value; |
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
62 | 62 | * @param mixed $attr |
63 | 63 | */ |
64 | - public function offsetUnset ($attr): void { |
|
64 | + public function offsetUnset($attr): void { |
|
65 | 65 | unset($this->attributes[$attr]); |
66 | 66 | } |
67 | 67 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @param array $attributes |
70 | 70 | * @return $this |
71 | 71 | */ |
72 | - public function setAttributes (array $attributes) { |
|
72 | + public function setAttributes(array $attributes) { |
|
73 | 73 | $this->attributes = $attributes; |
74 | 74 | return $this; |
75 | 75 | } |