@@ -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 |
@@ -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]); |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | /** |
| 15 | 15 | * @return string |
| 16 | 16 | */ |
| 17 | - abstract public function __toString (); |
|
| 17 | + abstract public function __toString(); |
|
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * @var DB |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | * |
| 15 | 15 | * @return Num |
| 16 | 16 | */ |
| 17 | - public function avg () { |
|
| 17 | + public function avg() { |
|
| 18 | 18 | return Num::factory($this->db, "AVG({$this})"); |
| 19 | 19 | } |
| 20 | 20 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | * |
| 24 | 24 | * @return Num |
| 25 | 25 | */ |
| 26 | - public function avgDistinct () { |
|
| 26 | + public function avgDistinct() { |
|
| 27 | 27 | return Num::factory($this->db, "AVG(DISTINCT {$this})"); |
| 28 | 28 | } |
| 29 | 29 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * |
| 33 | 33 | * @return Num |
| 34 | 34 | */ |
| 35 | - public function count () { |
|
| 35 | + public function count() { |
|
| 36 | 36 | return Num::factory($this->db, "COUNT({$this})"); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * |
| 42 | 42 | * @return Num |
| 43 | 43 | */ |
| 44 | - public function countDistinct () { |
|
| 44 | + public function countDistinct() { |
|
| 45 | 45 | return Num::factory($this->db, "COUNT(DISTINCT {$this})"); |
| 46 | 46 | } |
| 47 | 47 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | * @param string $delimiter |
| 52 | 52 | * @return Text |
| 53 | 53 | */ |
| 54 | - public function groupConcat (string $delimiter = ',') { |
|
| 54 | + public function groupConcat(string $delimiter = ',') { |
|
| 55 | 55 | $delimiter = $this->db->quote($delimiter); |
| 56 | 56 | if ($this->db->isSQLite()) { |
| 57 | 57 | return Text::factory($this->db, "GROUP_CONCAT({$this},{$delimiter})"); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | * |
| 65 | 65 | * @return Num |
| 66 | 66 | */ |
| 67 | - public function max () { |
|
| 67 | + public function max() { |
|
| 68 | 68 | return Num::factory($this->db, "MAX({$this})"); |
| 69 | 69 | } |
| 70 | 70 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | * |
| 74 | 74 | * @return Num |
| 75 | 75 | */ |
| 76 | - public function min () { |
|
| 76 | + public function min() { |
|
| 77 | 77 | return Num::factory($this->db, "MIN({$this})"); |
| 78 | 78 | } |
| 79 | 79 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | * |
| 83 | 83 | * @return Num |
| 84 | 84 | */ |
| 85 | - public function sum () { |
|
| 85 | + public function sum() { |
|
| 86 | 86 | return Num::factory($this->db, "SUM({$this})"); |
| 87 | 87 | } |
| 88 | 88 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | * |
| 92 | 92 | * @return Num |
| 93 | 93 | */ |
| 94 | - public function sumDistinct () { |
|
| 94 | + public function sumDistinct() { |
|
| 95 | 95 | return Num::factory($this->db, "SUM(DISTINCT {$this})"); |
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | \ No newline at end of file |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | * @param null|string $subject |
| 60 | 60 | * @param array $values `[when => then]` for the subject. |
| 61 | 61 | */ |
| 62 | - public function __construct (DB $db, string $subject = null, array $values = []) { |
|
| 62 | + public function __construct(DB $db, string $subject = null, array $values = []) { |
|
| 63 | 63 | parent::__construct($db, ''); |
| 64 | 64 | $this->subject = $subject; |
| 65 | 65 | $this->whenValues($values); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | /** |
| 69 | 69 | * @return string |
| 70 | 70 | */ |
| 71 | - public function __toString (): string { |
|
| 71 | + public function __toString(): string { |
|
| 72 | 72 | $sql = 'CASE'; |
| 73 | 73 | if (isset($this->subject)) { |
| 74 | 74 | $sql .= " {$this->subject}"; |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | * @param string|ValueInterface $then |
| 100 | 100 | * @return $this |
| 101 | 101 | */ |
| 102 | - public function when ($expression, $then) { |
|
| 102 | + public function when($expression, $then) { |
|
| 103 | 103 | $this->values[$this->db->quote($expression)] = $this->db->quote($then); |
| 104 | 104 | return $this; |
| 105 | 105 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | * @param array $values `[when => then]` |
| 114 | 114 | * @return $this |
| 115 | 115 | */ |
| 116 | - public function whenValues (array $values) { |
|
| 116 | + public function whenValues(array $values) { |
|
| 117 | 117 | foreach ($values as $when => $then) { |
| 118 | 118 | $this->when($when, $then); |
| 119 | 119 | } |