@@ -10,5 +10,5 @@ |
||
10 | 10 | /** |
11 | 11 | * @return int |
12 | 12 | */ |
13 | - public function getId (); |
|
13 | + public function getId(); |
|
14 | 14 | } |
15 | 15 | \ No newline at end of file |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @param DB $db |
23 | 23 | */ |
24 | - protected function __construct (DB $db) { |
|
24 | + protected function __construct(DB $db) { |
|
25 | 25 | $this->db = $db; |
26 | 26 | } |
27 | 27 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @param array $args |
32 | 32 | * @return $this |
33 | 33 | */ |
34 | - public function __invoke (array $args = null) { |
|
34 | + public function __invoke(array $args = null) { |
|
35 | 35 | $this->execute($args); |
36 | 36 | return $this; |
37 | 37 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * |
42 | 42 | * @return string |
43 | 43 | */ |
44 | - public function __toString () { |
|
44 | + public function __toString() { |
|
45 | 45 | return $this->queryString; |
46 | 46 | } |
47 | 47 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * @return bool |
55 | 55 | * @throws ArgumentCountError |
56 | 56 | */ |
57 | - public function execute ($args = null) { |
|
57 | + public function execute($args = null) { |
|
58 | 58 | $this->db->getLogger()->__invoke($this->queryString); |
59 | 59 | if ($result = !parent::execute($args)) { |
60 | 60 | $info = $this->errorInfo(); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | * |
72 | 72 | * @return int |
73 | 73 | */ |
74 | - public function getId (): int { |
|
74 | + public function getId(): int { |
|
75 | 75 | return (int)$this->db->lastInsertId(); |
76 | 76 | } |
77 | 77 | } |
@@ -10,5 +10,5 @@ |
||
10 | 10 | /** |
11 | 11 | * @return string |
12 | 12 | */ |
13 | - public function __toString (); |
|
13 | + public function __toString(); |
|
14 | 14 | } |
15 | 15 | \ No newline at end of file |
@@ -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 isset($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,7 +54,7 @@ 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 | if (isset($attr)) { |
59 | 59 | $this->attributes[$attr] = $value; |
60 | 60 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | /** |
67 | 67 | * @param mixed $attr |
68 | 68 | */ |
69 | - public function offsetUnset ($attr): void { |
|
69 | + public function offsetUnset($attr): void { |
|
70 | 70 | unset($this->attributes[$attr]); |
71 | 71 | } |
72 | 72 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * @param array $attributes |
75 | 75 | * @return $this |
76 | 76 | */ |
77 | - public function setAttributes (array $attributes) { |
|
77 | + public function setAttributes(array $attributes) { |
|
78 | 78 | $this->attributes = $attributes; |
79 | 79 | return $this; |
80 | 80 | } |
@@ -16,13 +16,13 @@ discard block |
||
16 | 16 | * |
17 | 17 | * @return string |
18 | 18 | */ |
19 | - abstract public function __toString (); |
|
19 | + abstract public function __toString(); |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * @param int|string $column |
23 | 23 | * @return null|Column |
24 | 24 | */ |
25 | - abstract public function offsetGet ($column); |
|
25 | + abstract public function offsetGet($column); |
|
26 | 26 | |
27 | 27 | /** |
28 | 28 | * @var DB |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | /** |
33 | 33 | * @param DB $db |
34 | 34 | */ |
35 | - public function __construct (DB $db) { |
|
35 | + public function __construct(DB $db) { |
|
36 | 36 | $this->db = $db; |
37 | 37 | } |
38 | 38 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * @param int|string $column |
41 | 41 | * @return bool |
42 | 42 | */ |
43 | - public function offsetExists ($column): bool { |
|
43 | + public function offsetExists($column): bool { |
|
44 | 44 | return $this->offsetGet($column) !== null; |
45 | 45 | } |
46 | 46 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | * @param void $value |
52 | 52 | * @throws Exception |
53 | 53 | */ |
54 | - final public function offsetSet ($offset, $value): void { |
|
54 | + final public function offsetSet($offset, $value): void { |
|
55 | 55 | throw new Exception('Tables are immutable.'); |
56 | 56 | } |
57 | 57 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * @param void $name |
62 | 62 | * @throws Exception |
63 | 63 | */ |
64 | - final public function offsetUnset ($name): void { |
|
64 | + final public function offsetUnset($name): void { |
|
65 | 65 | $this->offsetSet($name, null); |
66 | 66 | } |
67 | 67 | } |
68 | 68 | \ No newline at end of file |
@@ -18,11 +18,11 @@ discard block |
||
18 | 18 | * @param int|array|Countable $count |
19 | 19 | * @return ExpressionInterface[] |
20 | 20 | */ |
21 | - public static function marks ($count): array { |
|
21 | + public static function marks($count): array { |
|
22 | 22 | static $mark; |
23 | 23 | $mark ??= new class implements ExpressionInterface { |
24 | 24 | |
25 | - public function __toString () { |
|
25 | + public function __toString() { |
|
26 | 26 | return '?'; |
27 | 27 | } |
28 | 28 | }; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * @param string[] $columns |
42 | 42 | * @return string[] `["column" => ":column"]` |
43 | 43 | */ |
44 | - public static function slots (array $columns): array { |
|
44 | + public static function slots(array $columns): array { |
|
45 | 45 | $slots = []; |
46 | 46 | foreach ($columns as $column) { |
47 | 47 | $slots[$column] = ':' . str_replace('.', '__', $column); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @param string[] $columns |
54 | 54 | * @return string[] `["column" => "column=:column"]` |
55 | 55 | */ |
56 | - public static function slotsEqual (array $columns): array { |
|
56 | + public static function slotsEqual(array $columns): array { |
|
57 | 57 | $slots = static::slots($columns); |
58 | 58 | foreach ($slots as $column => $slot) { |
59 | 59 | $slots[$column] = "{$column} = {$slot}"; |
@@ -61,6 +61,6 @@ discard block |
||
61 | 61 | return $slots; |
62 | 62 | } |
63 | 63 | |
64 | - final private function __construct () { |
|
64 | + final private function __construct() { |
|
65 | 65 | } |
66 | 66 | } |
67 | 67 | \ No newline at end of file |
@@ -12,7 +12,7 @@ |
||
12 | 12 | * |
13 | 13 | * @return static |
14 | 14 | */ |
15 | - public function not () { |
|
15 | + public function not() { |
|
16 | 16 | return static::factory($this->db, "NOT({$this})"); |
17 | 17 | } |
18 | 18 |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * @param DB $db |
29 | 29 | * @param string $expression |
30 | 30 | */ |
31 | - public function __construct (DB $db, string $expression) { |
|
31 | + public function __construct(DB $db, string $expression) { |
|
32 | 32 | $this->db = $db; |
33 | 33 | $this->expression = $expression; |
34 | 34 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | /** |
37 | 37 | * @return string |
38 | 38 | */ |
39 | - public function __toString () { |
|
39 | + public function __toString() { |
|
40 | 40 | return $this->expression; |
41 | 41 | } |
42 | 42 | } |
43 | 43 | \ No newline at end of file |
@@ -17,7 +17,7 @@ |
||
17 | 17 | * @param array $args The first argument must be a {@link DB} instance. |
18 | 18 | * @return static |
19 | 19 | */ |
20 | - public static function __callStatic (string $ignored, array $args) { |
|
20 | + public static function __callStatic(string $ignored, array $args) { |
|
21 | 21 | /** @var DB $db */ |
22 | 22 | $db = $args[0]; |
23 | 23 | unset($args[0]); |