@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * @param string $passwd |
53 | 53 | * @param array $options |
54 | 54 | */ |
55 | - public function __construct ($dsn, $username = null, $passwd = null, $options = null) { |
|
55 | + public function __construct($dsn, $username = null, $passwd = null, $options = null) { |
|
56 | 56 | parent::__construct($dsn, $username, $passwd, $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 | $name = $class; |
126 | 126 | if (is_object($name)) { |
127 | 127 | $name = get_class($name); |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | * @param mixed $b |
150 | 150 | * @return Predicate |
151 | 151 | */ |
152 | - public function match ($a, $b) { |
|
152 | + public function match($a, $b) { |
|
153 | 153 | if ($b instanceof Closure) { |
154 | 154 | return $b->__invoke($a, $this); |
155 | 155 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | * @param string $class Class or interface name. |
170 | 170 | * @return bool |
171 | 171 | */ |
172 | - public function offsetExists ($class): bool { |
|
172 | + public function offsetExists($class): bool { |
|
173 | 173 | return (bool)$this->offsetGet($class); |
174 | 174 | } |
175 | 175 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | * @param string $class Class or interface name. |
178 | 178 | * @return null|Record|Junction |
179 | 179 | */ |
180 | - public function offsetGet ($class) { |
|
180 | + public function offsetGet($class) { |
|
181 | 181 | if (class_exists($class)) { |
182 | 182 | return $this->getRecord($class); |
183 | 183 | } |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | * @param string $class Class or interface name. |
192 | 192 | * @param Record|Junction $access |
193 | 193 | */ |
194 | - public function offsetSet ($class, $access) { |
|
194 | + public function offsetSet($class, $access) { |
|
195 | 195 | if ($access instanceof Record) { |
196 | 196 | $this->setRecord($class, $access); |
197 | 197 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | /** |
204 | 204 | * @param string $class Class or interface name. |
205 | 205 | */ |
206 | - public function offsetUnset ($class) { |
|
206 | + public function offsetUnset($class) { |
|
207 | 207 | unset($this->records[$class]); |
208 | 208 | unset($this->junctions[$class]); |
209 | 209 | } |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | * @param array $options |
216 | 216 | * @return Statement |
217 | 217 | */ |
218 | - public function prepare ($sql, $options = []) { |
|
218 | + public function prepare($sql, $options = []) { |
|
219 | 219 | $this->logger->__invoke($sql); |
220 | 220 | /** @var Statement $statement */ |
221 | 221 | $statement = parent::prepare($sql, $options); |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | * @param array $ctorargs |
232 | 232 | * @return Statement |
233 | 233 | */ |
234 | - public function query ($sql, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, array $ctorargs = []) { |
|
234 | + public function query($sql, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, array $ctorargs = []) { |
|
235 | 235 | $this->logger->__invoke($sql); |
236 | 236 | /** @var Statement $statement */ |
237 | 237 | $statement = parent::query(...func_get_args()); |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | * @param int $type Ignored. |
251 | 251 | * @return string |
252 | 252 | */ |
253 | - public function quote ($value, $type = self::PARAM_STR) { |
|
253 | + public function quote($value, $type = self::PARAM_STR) { |
|
254 | 254 | if ($value instanceof ExpressionInterface) { |
255 | 255 | return $value; |
256 | 256 | } |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | * @param array $values |
271 | 271 | * @return string[] |
272 | 272 | */ |
273 | - public function quoteArray (array $values): array { |
|
273 | + public function quoteArray(array $values): array { |
|
274 | 274 | return array_map([$this, 'quote'], $values); |
275 | 275 | } |
276 | 276 | |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | * @param array $values |
281 | 281 | * @return string |
282 | 282 | */ |
283 | - public function quoteList (array $values): string { |
|
283 | + public function quoteList(array $values): string { |
|
284 | 284 | return implode(',', $this->quoteArray($values)); |
285 | 285 | } |
286 | 286 | |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | * @param EntityInterface $entity |
291 | 291 | * @return int ID |
292 | 292 | */ |
293 | - public function save (EntityInterface $entity): int { |
|
293 | + public function save(EntityInterface $entity): int { |
|
294 | 294 | return $this->getRecord($entity)->save($entity); |
295 | 295 | } |
296 | 296 | |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | * @param Junction $junction |
300 | 300 | * @return $this |
301 | 301 | */ |
302 | - public function setJunction (string $interface, Junction $junction) { |
|
302 | + public function setJunction(string $interface, Junction $junction) { |
|
303 | 303 | $this->junctions[$interface] = $junction; |
304 | 304 | return $this; |
305 | 305 | } |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | * @param Closure $logger |
309 | 309 | * @return $this |
310 | 310 | */ |
311 | - public function setLogger (Closure $logger) { |
|
311 | + public function setLogger(Closure $logger) { |
|
312 | 312 | $this->logger = $logger; |
313 | 313 | return $this; |
314 | 314 | } |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | * @param Record $record |
319 | 319 | * @return $this |
320 | 320 | */ |
321 | - public function setRecord (string $class, Record $record) { |
|
321 | + public function setRecord(string $class, Record $record) { |
|
322 | 322 | $this->records[$class] = $record; |
323 | 323 | return $this; |
324 | 324 | } |