@@ -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); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | * @param string $sql |
| 75 | 75 | * @return int |
| 76 | 76 | */ |
| 77 | - public function exec ($sql): int { |
|
| 77 | + public function exec($sql): int { |
|
| 78 | 78 | $this->logger->__invoke($sql); |
| 79 | 79 | return parent::exec($sql); |
| 80 | 80 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | /** |
| 83 | 83 | * @return string |
| 84 | 84 | */ |
| 85 | - final public function getDriver (): string { |
|
| 85 | + final public function getDriver(): string { |
|
| 86 | 86 | return $this->driver; |
| 87 | 87 | } |
| 88 | 88 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | * @param string $interface |
| 93 | 93 | * @return Junction |
| 94 | 94 | */ |
| 95 | - public function getJunction ($interface) { |
|
| 95 | + public function getJunction($interface) { |
|
| 96 | 96 | if (!isset($this->junctions[$interface])) { |
| 97 | 97 | $this->junctions[$interface] = Junction::fromInterface($this, $interface); |
| 98 | 98 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | /** |
| 103 | 103 | * @return Closure |
| 104 | 104 | */ |
| 105 | - public function getLogger () { |
|
| 105 | + public function getLogger() { |
|
| 106 | 106 | return $this->logger; |
| 107 | 107 | } |
| 108 | 108 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | * @param string|EntityInterface $class |
| 113 | 113 | * @return Record |
| 114 | 114 | */ |
| 115 | - public function getRecord ($class) { |
|
| 115 | + public function getRecord($class) { |
|
| 116 | 116 | $name = $class; |
| 117 | 117 | if (is_object($name)) { |
| 118 | 118 | $name = get_class($name); |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | * @param mixed $b |
| 138 | 138 | * @return string |
| 139 | 139 | */ |
| 140 | - public function match ($a, $b) { |
|
| 140 | + public function match($a, $b) { |
|
| 141 | 141 | if ($b instanceof Closure) { |
| 142 | 142 | if (!$a instanceof Column) { |
| 143 | 143 | $a = new Column($this, $a); |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | * @param array $match |
| 164 | 164 | * @return string[] |
| 165 | 165 | */ |
| 166 | - public function matchArray (array $match) { |
|
| 166 | + public function matchArray(array $match) { |
|
| 167 | 167 | return array_map([$this, 'match'], array_keys($match), $match); |
| 168 | 168 | } |
| 169 | 169 | |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | * @param string $class Class or interface name. |
| 172 | 172 | * @return bool |
| 173 | 173 | */ |
| 174 | - public function offsetExists ($class): bool { |
|
| 174 | + public function offsetExists($class): bool { |
|
| 175 | 175 | return (bool)$this->offsetGet($class); |
| 176 | 176 | } |
| 177 | 177 | |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | * @param string $class Class or interface name. |
| 180 | 180 | * @return null|Record|Junction |
| 181 | 181 | */ |
| 182 | - public function offsetGet ($class) { |
|
| 182 | + public function offsetGet($class) { |
|
| 183 | 183 | if (class_exists($class)) { |
| 184 | 184 | return $this->getRecord($class); |
| 185 | 185 | } |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | * @param string $class Class or interface name. |
| 194 | 194 | * @param Record|Junction $access |
| 195 | 195 | */ |
| 196 | - public function offsetSet ($class, $access) { |
|
| 196 | + public function offsetSet($class, $access) { |
|
| 197 | 197 | if ($access instanceof Record) { |
| 198 | 198 | $this->setRecord($class, $access); |
| 199 | 199 | } |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | /** |
| 206 | 206 | * @param string $class Class or interface name. |
| 207 | 207 | */ |
| 208 | - public function offsetUnset ($class) { |
|
| 208 | + public function offsetUnset($class) { |
|
| 209 | 209 | unset($this->records[$class]); |
| 210 | 210 | unset($this->junctions[$class]); |
| 211 | 211 | } |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | * @param array $options |
| 218 | 218 | * @return Statement |
| 219 | 219 | */ |
| 220 | - public function prepare ($sql, $options = []) { |
|
| 220 | + public function prepare($sql, $options = []) { |
|
| 221 | 221 | $this->logger->__invoke($sql); |
| 222 | 222 | /** @var Statement $statement */ |
| 223 | 223 | $statement = parent::prepare($sql, $options); |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | * @param array $ctorargs |
| 234 | 234 | * @return Statement |
| 235 | 235 | */ |
| 236 | - public function query ($sql, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, array $ctorargs = []) { |
|
| 236 | + public function query($sql, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, array $ctorargs = []) { |
|
| 237 | 237 | $this->logger->__invoke($sql); |
| 238 | 238 | /** @var Statement $statement */ |
| 239 | 239 | $statement = parent::query(...func_get_args()); |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | * @param int $type Ignored. |
| 253 | 253 | * @return string |
| 254 | 254 | */ |
| 255 | - public function quote ($value, $type = null) { |
|
| 255 | + public function quote($value, $type = null) { |
|
| 256 | 256 | if ($value instanceof ExpressionInterface) { |
| 257 | 257 | return $value; |
| 258 | 258 | } |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | * @param array $values |
| 273 | 273 | * @return string[] |
| 274 | 274 | */ |
| 275 | - public function quoteArray (array $values): array { |
|
| 275 | + public function quoteArray(array $values): array { |
|
| 276 | 276 | return array_map([$this, 'quote'], $values); |
| 277 | 277 | } |
| 278 | 278 | |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | * @param mixed $value |
| 283 | 283 | * @return string|string[] |
| 284 | 284 | */ |
| 285 | - public function quoteMixed ($value) { |
|
| 285 | + public function quoteMixed($value) { |
|
| 286 | 286 | if (is_array($value)) { |
| 287 | 287 | return $this->quoteArray($value); |
| 288 | 288 | } |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | * @param EntityInterface $entity |
| 296 | 296 | * @return int ID |
| 297 | 297 | */ |
| 298 | - public function save (EntityInterface $entity): int { |
|
| 298 | + public function save(EntityInterface $entity): int { |
|
| 299 | 299 | return $this->getRecord($entity)->save($entity); |
| 300 | 300 | } |
| 301 | 301 | |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | * @param Junction $junction |
| 305 | 305 | * @return $this |
| 306 | 306 | */ |
| 307 | - public function setJunction (string $interface, Junction $junction) { |
|
| 307 | + public function setJunction(string $interface, Junction $junction) { |
|
| 308 | 308 | $this->junctions[$interface] = $junction; |
| 309 | 309 | return $this; |
| 310 | 310 | } |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | * @param Closure $logger |
| 314 | 314 | * @return $this |
| 315 | 315 | */ |
| 316 | - public function setLogger (Closure $logger) { |
|
| 316 | + public function setLogger(Closure $logger) { |
|
| 317 | 317 | $this->logger = $logger; |
| 318 | 318 | return $this; |
| 319 | 319 | } |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | * @param Record $record |
| 324 | 324 | * @return $this |
| 325 | 325 | */ |
| 326 | - public function setRecord (string $class, Record $record) { |
|
| 326 | + public function setRecord(string $class, Record $record) { |
|
| 327 | 327 | $this->records[$class] = $record; |
| 328 | 328 | return $this; |
| 329 | 329 | } |