@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * @param string $name |
44 | 44 | * @param string $qualifier |
45 | 45 | */ |
46 | - public function __construct (DB $db, string $name, string $qualifier = '') { |
|
46 | + public function __construct(DB $db, string $name, string $qualifier = '') { |
|
47 | 47 | $this->db = $db; |
48 | 48 | $this->name = $name; |
49 | 49 | $this->qualifier = $qualifier; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * |
55 | 55 | * @return string |
56 | 56 | */ |
57 | - public function __toString () { |
|
57 | + public function __toString() { |
|
58 | 58 | if (strlen($this->qualifier)) { |
59 | 59 | return "{$this->qualifier}.{$this->name}"; |
60 | 60 | } |
@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | /** |
65 | 65 | * @return string |
66 | 66 | */ |
67 | - final public function getName (): string { |
|
67 | + final public function getName(): string { |
|
68 | 68 | return $this->name; |
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
72 | 72 | * @return string |
73 | 73 | */ |
74 | - final public function getQualifier (): string { |
|
74 | + final public function getQualifier(): string { |
|
75 | 75 | return $this->qualifier; |
76 | 76 | } |
77 | 77 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @return Select|scalar[] |
82 | 82 | */ |
83 | - public function select () { |
|
83 | + public function select() { |
|
84 | 84 | return Select::factory($this->db, $this->qualifier, [$this->name]) |
85 | 85 | ->setFetcher(function(Statement $statement) { |
86 | 86 | while (false !== $value = $statement->fetchColumn()) { |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @param string $name |
94 | 94 | * @return $this |
95 | 95 | */ |
96 | - public function setName (string $name) { |
|
96 | + public function setName(string $name) { |
|
97 | 97 | $clone = clone $this; |
98 | 98 | $clone->name = $name; |
99 | 99 | return $clone; |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * @param string $qualifier |
104 | 104 | * @return $this |
105 | 105 | */ |
106 | - public function setQualifier (string $qualifier) { |
|
106 | + public function setQualifier(string $qualifier) { |
|
107 | 107 | $clone = clone $this; |
108 | 108 | $clone->qualifier = $qualifier; |
109 | 109 | return $clone; |
@@ -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 |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * |
20 | 20 | * @return Text |
21 | 21 | */ |
22 | - public function date () { |
|
22 | + public function date() { |
|
23 | 23 | return Text::factory($this->db, $this->dateFormat('%Y-%m-%d')); |
24 | 24 | } |
25 | 25 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @param string|string[] $format Format, or formats keyed by driver name. |
30 | 30 | * @return Text |
31 | 31 | */ |
32 | - public function dateFormat ($format) { |
|
32 | + public function dateFormat($format) { |
|
33 | 33 | if (is_array($format)) { |
34 | 34 | $format = $format[$this->db->getDriver()]; |
35 | 35 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * |
46 | 46 | * @return Text |
47 | 47 | */ |
48 | - public function datetime () { |
|
48 | + public function datetime() { |
|
49 | 49 | return Text::factory($this->db, $this->dateFormat([ |
50 | 50 | 'mysql' => '%Y-%m-%d %H:%i:%S', |
51 | 51 | 'sqlite' => '%Y-%m-%d %H:%M:%S' |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * |
58 | 58 | * @return Num |
59 | 59 | */ |
60 | - public function day () { |
|
60 | + public function day() { |
|
61 | 61 | return Num::factory($this->db, $this->dateFormat('%d')); |
62 | 62 | } |
63 | 63 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @return Num |
68 | 68 | */ |
69 | - public function dayOfWeek () { |
|
69 | + public function dayOfWeek() { |
|
70 | 70 | return Num::factory($this->db, $this->dateFormat('%w')); |
71 | 71 | } |
72 | 72 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * |
76 | 76 | * @return Num |
77 | 77 | */ |
78 | - public function dayOfYear () { |
|
78 | + public function dayOfYear() { |
|
79 | 79 | return Num::factory($this->db, $this->dateFormat('%j')); |
80 | 80 | } |
81 | 81 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * |
85 | 85 | * @return Num |
86 | 86 | */ |
87 | - public function hours () { |
|
87 | + public function hours() { |
|
88 | 88 | return Num::factory($this->db, $this->dateFormat('%H')); |
89 | 89 | } |
90 | 90 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * |
94 | 94 | * @return Num |
95 | 95 | */ |
96 | - public function minutes () { |
|
96 | + public function minutes() { |
|
97 | 97 | return Num::factory($this->db, $this->dateFormat([ |
98 | 98 | 'mysql' => '%i', |
99 | 99 | 'sqlite' => '%M' |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * |
106 | 106 | * @return Num |
107 | 107 | */ |
108 | - public function month () { |
|
108 | + public function month() { |
|
109 | 109 | return Num::factory($this->db, $this->dateFormat('%m')); |
110 | 110 | } |
111 | 111 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | * |
115 | 115 | * @return Num |
116 | 116 | */ |
117 | - public function seconds () { |
|
117 | + public function seconds() { |
|
118 | 118 | return Num::factory($this->db, $this->dateFormat('%S')); |
119 | 119 | } |
120 | 120 | |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | * |
124 | 124 | * @return Text |
125 | 125 | */ |
126 | - public function time () { |
|
126 | + public function time() { |
|
127 | 127 | return Text::factory($this->db, $this->dateFormat([ |
128 | 128 | 'mysql' => '%H:%i:%S', |
129 | 129 | 'sqlite' => '%H:%M:%S' |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * |
136 | 136 | * @return Num |
137 | 137 | */ |
138 | - public function timestamp () { |
|
138 | + public function timestamp() { |
|
139 | 139 | if ($this->db->isSQLite()) { |
140 | 140 | return Num::factory($this->db, "STRFTIME('%s',{$this})"); |
141 | 141 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | * |
148 | 148 | * @return Num |
149 | 149 | */ |
150 | - public function weekOfYear () { |
|
150 | + public function weekOfYear() { |
|
151 | 151 | return Num::factory($this->db, $this->dateFormat([ |
152 | 152 | 'mysql' => '%U', |
153 | 153 | 'sqlite' => '%W' |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | * |
160 | 160 | * @return Num |
161 | 161 | */ |
162 | - public function year () { |
|
162 | + public function year() { |
|
163 | 163 | return Num::factory($this->db, $this->dateFormat('%Y')); |
164 | 164 | } |
165 | 165 | } |
166 | 166 | \ No newline at end of file |
@@ -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 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | * |
17 | 17 | * @return Text |
18 | 18 | */ |
19 | - public function hex () { |
|
19 | + public function hex() { |
|
20 | 20 | return Text::factory($this->db, "HEX({$this})"); |
21 | 21 | } |
22 | 22 | |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @return Num |
29 | 29 | */ |
30 | - public function length () { |
|
30 | + public function length() { |
|
31 | 31 | if ($this->db->isSQLite()) { |
32 | 32 | return Num::factory($this->db, "LENGTH(CAST({$this} AS TEXT))"); |
33 | 33 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * |
42 | 42 | * @return Text |
43 | 43 | */ |
44 | - public function lower () { |
|
44 | + public function lower() { |
|
45 | 45 | return Text::factory($this->db, "LOWER({$this})"); |
46 | 46 | } |
47 | 47 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @param string $substring |
54 | 54 | * @return Num |
55 | 55 | */ |
56 | - public function position (string $substring) { |
|
56 | + public function position(string $substring) { |
|
57 | 57 | $substring = $this->db->quote($substring); |
58 | 58 | if ($this->db->isSQLite()) { |
59 | 59 | return Num::factory($this->db, "INSTR({$this},{$substring})"); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * @param string $replace |
71 | 71 | * @return Text |
72 | 72 | */ |
73 | - public function replace (string $search, string $replace) { |
|
73 | + public function replace(string $search, string $replace) { |
|
74 | 74 | $search = $this->db->quote($search); |
75 | 75 | $replace = $this->db->quote($replace); |
76 | 76 | return Text::factory($this->db, "REPLACE({$this},{$search},{$replace})"); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | * |
82 | 82 | * @return Num |
83 | 83 | */ |
84 | - public function size () { |
|
84 | + public function size() { |
|
85 | 85 | if ($this->db->isSQLite()) { |
86 | 86 | return Num::factory($this->db, "LENGTH(CAST({$this} AS BLOB))"); |
87 | 87 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * @param null|int $length |
98 | 98 | * @return Text |
99 | 99 | */ |
100 | - public function substr (int $start, int $length = null) { |
|
100 | + public function substr(int $start, int $length = null) { |
|
101 | 101 | if (isset($length)) { |
102 | 102 | return Text::factory($this->db, "SUBSTR({$this},{$start},{$length})"); |
103 | 103 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * |
112 | 112 | * @return Text |
113 | 113 | */ |
114 | - public function upper () { |
|
114 | + public function upper() { |
|
115 | 115 | return Text::factory($this->db, "UPPER({$this})"); |
116 | 116 | } |
117 | 117 | } |
118 | 118 | \ No newline at end of file |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | * |
15 | 15 | * @return Num |
16 | 16 | */ |
17 | - public function abs () { |
|
17 | + public function abs() { |
|
18 | 18 | return Num::factory($this->db, "ABS({$this})"); |
19 | 19 | } |
20 | 20 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * |
24 | 24 | * @return Num |
25 | 25 | */ |
26 | - public function acos () { |
|
26 | + public function acos() { |
|
27 | 27 | return Num::factory($this->db, "ACOS({$this})"); |
28 | 28 | } |
29 | 29 | |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * @param number|ValueInterface $arg |
34 | 34 | * @return Num |
35 | 35 | */ |
36 | - public function add ($arg) { |
|
36 | + public function add($arg) { |
|
37 | 37 | $arg = $this->db->quote($arg); |
38 | 38 | return Num::factory($this->db, "({$this} + {$arg})"); |
39 | 39 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * |
44 | 44 | * @return Num |
45 | 45 | */ |
46 | - public function asin () { |
|
46 | + public function asin() { |
|
47 | 47 | return Num::factory($this->db, "ASIN({$this})"); |
48 | 48 | } |
49 | 49 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * |
53 | 53 | * @return Num |
54 | 54 | */ |
55 | - public function atan () { |
|
55 | + public function atan() { |
|
56 | 56 | return Num::factory($this->db, "ATAN({$this})"); |
57 | 57 | } |
58 | 58 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * |
62 | 62 | * @return Num |
63 | 63 | */ |
64 | - public function ceil () { |
|
64 | + public function ceil() { |
|
65 | 65 | return Num::factory($this->db, "CEIL({$this})"); |
66 | 66 | } |
67 | 67 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * |
71 | 71 | * @return Num |
72 | 72 | */ |
73 | - public function cos () { |
|
73 | + public function cos() { |
|
74 | 74 | return Num::factory($this->db, "COS({$this})"); |
75 | 75 | } |
76 | 76 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | * |
82 | 82 | * @return Num |
83 | 83 | */ |
84 | - public function degrees () { |
|
84 | + public function degrees() { |
|
85 | 85 | return Num::factory($this->db, "DEGREES({$this})"); |
86 | 86 | } |
87 | 87 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * @param number|ValueInterface $arg |
92 | 92 | * @return Num |
93 | 93 | */ |
94 | - public function div ($arg) { |
|
94 | + public function div($arg) { |
|
95 | 95 | $arg = $this->db->quote($arg); |
96 | 96 | return Num::factory($this->db, "({$this} / {$arg})"); |
97 | 97 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * |
104 | 104 | * @return Num |
105 | 105 | */ |
106 | - public function exp () { |
|
106 | + public function exp() { |
|
107 | 107 | return Num::factory($this->db, "EXP({$this})"); |
108 | 108 | } |
109 | 109 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | * |
113 | 113 | * @return Num |
114 | 114 | */ |
115 | - public function floor () { |
|
115 | + public function floor() { |
|
116 | 116 | return Num::factory($this->db, "FLOOR({$this})"); |
117 | 117 | } |
118 | 118 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | * |
122 | 122 | * @return Predicate |
123 | 123 | */ |
124 | - public function isEven () { |
|
124 | + public function isEven() { |
|
125 | 125 | return Predicate::factory($this->db, "({$this} % 2) = 0"); |
126 | 126 | } |
127 | 127 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | * |
131 | 131 | * @return Predicate |
132 | 132 | */ |
133 | - public function isNegative () { |
|
133 | + public function isNegative() { |
|
134 | 134 | return Predicate::factory($this->db, "{$this} < 0"); |
135 | 135 | } |
136 | 136 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | * |
140 | 140 | * @return Predicate |
141 | 141 | */ |
142 | - public function isOdd () { |
|
142 | + public function isOdd() { |
|
143 | 143 | return Predicate::factory($this->db, "({$this} % 2) <> 0"); |
144 | 144 | } |
145 | 145 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | * |
149 | 149 | * @return Predicate |
150 | 150 | */ |
151 | - public function isPositive () { |
|
151 | + public function isPositive() { |
|
152 | 152 | return Predicate::factory($this->db, "{$this} > 0"); |
153 | 153 | } |
154 | 154 | |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | * |
158 | 158 | * @return Num |
159 | 159 | */ |
160 | - public function ln () { |
|
160 | + public function ln() { |
|
161 | 161 | return Num::factory($this->db, "LN({$this})"); |
162 | 162 | } |
163 | 163 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | * @param float $base |
170 | 170 | * @return Num |
171 | 171 | */ |
172 | - public function log (float $base) { |
|
172 | + public function log(float $base) { |
|
173 | 173 | return Num::factory($this->db, "LOG({$base},{$this})"); |
174 | 174 | } |
175 | 175 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | * |
179 | 179 | * @return Num |
180 | 180 | */ |
181 | - public function log10 () { |
|
181 | + public function log10() { |
|
182 | 182 | return Num::factory($this->db, "LOG10({$this})"); |
183 | 183 | } |
184 | 184 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * |
188 | 188 | * @return Num |
189 | 189 | */ |
190 | - public function log2 () { |
|
190 | + public function log2() { |
|
191 | 191 | return Num::factory($this->db, "LOG2({$this})"); |
192 | 192 | } |
193 | 193 | |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | * @param float $divisor |
198 | 198 | * @return Num |
199 | 199 | */ |
200 | - public function mod (float $divisor) { |
|
200 | + public function mod(float $divisor) { |
|
201 | 201 | return Num::factory($this->db, "({$this} % {$divisor})"); |
202 | 202 | } |
203 | 203 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | * @param number|ValueInterface $arg |
208 | 208 | * @return Num |
209 | 209 | */ |
210 | - public function mul ($arg) { |
|
210 | + public function mul($arg) { |
|
211 | 211 | $arg = $this->db->quote($arg); |
212 | 212 | return Num::factory($this->db, "({$this} * {$arg})"); |
213 | 213 | } |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | * @param float $exponent |
219 | 219 | * @return Num |
220 | 220 | */ |
221 | - public function pow (float $exponent) { |
|
221 | + public function pow(float $exponent) { |
|
222 | 222 | return Num::factory($this->db, "POW({$this},{$exponent})"); |
223 | 223 | } |
224 | 224 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | * |
230 | 230 | * @return Num |
231 | 231 | */ |
232 | - public function radians () { |
|
232 | + public function radians() { |
|
233 | 233 | return Num::factory($this->db, "RADIANS({$this})"); |
234 | 234 | } |
235 | 235 | |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | * @param int $decimals |
240 | 240 | * @return Num |
241 | 241 | */ |
242 | - public function round (int $decimals = 0) { |
|
242 | + public function round(int $decimals = 0) { |
|
243 | 243 | return Num::factory($this->db, "ROUND({$this},{$decimals})"); |
244 | 244 | } |
245 | 245 | |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | * |
249 | 249 | * @return Num `-1`, `0`, `1` |
250 | 250 | */ |
251 | - public function sign () { |
|
251 | + public function sign() { |
|
252 | 252 | return Num::factory($this->db, "SIGN({$this})"); |
253 | 253 | } |
254 | 254 | |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | * |
258 | 258 | * @return Num |
259 | 259 | */ |
260 | - public function sin () { |
|
260 | + public function sin() { |
|
261 | 261 | return Num::factory($this->db, "SIN({$this})"); |
262 | 262 | } |
263 | 263 | |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | * |
267 | 267 | * @return Num |
268 | 268 | */ |
269 | - public function sqrt () { |
|
269 | + public function sqrt() { |
|
270 | 270 | return Num::factory($this->db, "SQRT({$this})"); |
271 | 271 | } |
272 | 272 | |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | * @param number|ValueInterface $arg |
277 | 277 | * @return Num |
278 | 278 | */ |
279 | - public function sub ($arg) { |
|
279 | + public function sub($arg) { |
|
280 | 280 | $arg = $this->db->quote($arg); |
281 | 281 | return Num::factory($this->db, "({$this} - {$arg})"); |
282 | 282 | } |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | * |
287 | 287 | * @return Num |
288 | 288 | */ |
289 | - public function tan () { |
|
289 | + public function tan() { |
|
290 | 290 | return Num::factory($this->db, "TAN({$this})"); |
291 | 291 | } |
292 | 292 | } |
293 | 293 | \ No newline at end of file |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @param scalar[] $values |
13 | 13 | * @return Value |
14 | 14 | */ |
15 | - public function coalesce (array $values) { |
|
15 | + public function coalesce(array $values) { |
|
16 | 16 | array_unshift($values, $this); |
17 | 17 | $values = $this->db->quoteList($values); |
18 | 18 | return Value::factory($this->db, "COALESCE({$values})"); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @param int $to |
26 | 26 | * @return Text |
27 | 27 | */ |
28 | - public function toBase (int $from, int $to) { |
|
28 | + public function toBase(int $from, int $to) { |
|
29 | 29 | return Text::factory($this->db, "CONV({$this},{$from},{$to})"); |
30 | 30 | } |
31 | 31 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * @param int $from |
36 | 36 | * @return Num |
37 | 37 | */ |
38 | - public function toBase10 (int $from) { |
|
38 | + public function toBase10(int $from) { |
|
39 | 39 | return Num::factory($this->db, "CONV({$this},{$from},10)"); |
40 | 40 | } |
41 | 41 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @param int $from |
48 | 48 | * @return Text |
49 | 49 | */ |
50 | - public function toBase16 (int $from) { |
|
50 | + public function toBase16(int $from) { |
|
51 | 51 | return $this->toBase($from, 16); |
52 | 52 | } |
53 | 53 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @param int $from |
58 | 58 | * @return Text |
59 | 59 | */ |
60 | - public function toBase2 (int $from) { |
|
60 | + public function toBase2(int $from) { |
|
61 | 61 | return $this->toBase($from, 2); |
62 | 62 | } |
63 | 63 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * @param int $from |
68 | 68 | * @return Text |
69 | 69 | */ |
70 | - public function toBase8 (int $from) { |
|
70 | + public function toBase8(int $from) { |
|
71 | 71 | return $this->toBase($from, 8); |
72 | 72 | } |
73 | 73 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * |
77 | 77 | * @return Num |
78 | 78 | */ |
79 | - public function toFloat () { |
|
79 | + public function toFloat() { |
|
80 | 80 | if ($this->db->isSQLite()) { |
81 | 81 | return Num::factory($this->db, "CAST({$this} AS REAL)"); |
82 | 82 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * |
89 | 89 | * @return Num |
90 | 90 | */ |
91 | - public function toInt () { |
|
91 | + public function toInt() { |
|
92 | 92 | if ($this->db->isSQLite()) { |
93 | 93 | return Num::factory($this->db, "CAST({$this} AS INTEGER)"); |
94 | 94 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * |
101 | 101 | * @return Text |
102 | 102 | */ |
103 | - public function toText () { |
|
103 | + public function toText() { |
|
104 | 104 | if ($this->db->isSQLite()) { |
105 | 105 | return Text::factory($this->db, "CAST({$this} AS TEXT)"); |
106 | 106 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @return Predicate |
26 | 26 | * @internal |
27 | 27 | */ |
28 | - protected function _isRelational ($arg, string $oper, string $multi) { |
|
28 | + protected function _isRelational($arg, string $oper, string $multi) { |
|
29 | 29 | static $inverse = [ |
30 | 30 | '<' => '>=', |
31 | 31 | '<=' => '>', |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * @param null|scalar|Select $arg |
55 | 55 | * @return Predicate |
56 | 56 | */ |
57 | - public function is ($arg): Predicate { |
|
57 | + public function is($arg): Predicate { |
|
58 | 58 | if ($arg instanceof Select) { |
59 | 59 | if ($this->db->isSQLite()) { |
60 | 60 | return Select::factory($this->db, $arg, [$arg[0]]) |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @param number $max |
83 | 83 | * @return Predicate |
84 | 84 | */ |
85 | - public function isBetween ($min, $max) { |
|
85 | + public function isBetween($min, $max) { |
|
86 | 86 | $min = $this->db->quote($min); |
87 | 87 | $max = $this->db->quote($max); |
88 | 88 | return Predicate::factory($this->db, "{$this} BETWEEN {$min} AND {$max}"); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * @param scalar|array|Select $arg |
95 | 95 | * @return Predicate |
96 | 96 | */ |
97 | - public function isEqual ($arg) { |
|
97 | + public function isEqual($arg) { |
|
98 | 98 | return $this->db->match($this, $arg); |
99 | 99 | } |
100 | 100 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * |
104 | 104 | * @return Predicate |
105 | 105 | */ |
106 | - public function isFalse () { |
|
106 | + public function isFalse() { |
|
107 | 107 | return Predicate::factory($this->db, "{$this} IS FALSE"); |
108 | 108 | } |
109 | 109 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | * @param number|string|Select $arg |
114 | 114 | * @return Predicate |
115 | 115 | */ |
116 | - public function isGt ($arg) { |
|
116 | + public function isGt($arg) { |
|
117 | 117 | return $this->_isRelational($arg, '>', 'ALL'); |
118 | 118 | } |
119 | 119 | |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | * @param Select $select |
124 | 124 | * @return Predicate |
125 | 125 | */ |
126 | - public function isGtAny (Select $select) { |
|
126 | + public function isGtAny(Select $select) { |
|
127 | 127 | return $this->_isRelational($select, '>', 'ANY'); |
128 | 128 | } |
129 | 129 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | * @param number|string|Select $arg |
134 | 134 | * @return Predicate |
135 | 135 | */ |
136 | - public function isGte ($arg) { |
|
136 | + public function isGte($arg) { |
|
137 | 137 | return $this->_isRelational($arg, '>=', 'ALL'); |
138 | 138 | } |
139 | 139 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @param Select $select |
144 | 144 | * @return Predicate |
145 | 145 | */ |
146 | - public function isGteAny (Select $select) { |
|
146 | + public function isGteAny(Select $select) { |
|
147 | 147 | return $this->_isRelational($select, '>=', 'ANY'); |
148 | 148 | } |
149 | 149 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | * @param string $pattern |
154 | 154 | * @return Predicate |
155 | 155 | */ |
156 | - public function isLike (string $pattern) { |
|
156 | + public function isLike(string $pattern) { |
|
157 | 157 | $pattern = $this->db->quote($pattern); |
158 | 158 | return Predicate::factory($this->db, "{$this} LIKE {$pattern}"); |
159 | 159 | } |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | * @param number|string|Select $arg |
165 | 165 | * @return Predicate |
166 | 166 | */ |
167 | - public function isLt ($arg) { |
|
167 | + public function isLt($arg) { |
|
168 | 168 | return $this->_isRelational($arg, '<', 'ALL'); |
169 | 169 | } |
170 | 170 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | * @param Select $select |
175 | 175 | * @return Predicate |
176 | 176 | */ |
177 | - public function isLtAny (Select $select) { |
|
177 | + public function isLtAny(Select $select) { |
|
178 | 178 | return $this->_isRelational($select, '<', 'ANY'); |
179 | 179 | } |
180 | 180 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | * @param number|string|Select $arg |
185 | 185 | * @return Predicate |
186 | 186 | */ |
187 | - public function isLte ($arg) { |
|
187 | + public function isLte($arg) { |
|
188 | 188 | return $this->_isRelational($arg, '<=', 'ALL'); |
189 | 189 | } |
190 | 190 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | * @param Select $select |
195 | 195 | * @return Predicate |
196 | 196 | */ |
197 | - public function isLteAny (Select $select) { |
|
197 | + public function isLteAny(Select $select) { |
|
198 | 198 | return $this->_isRelational($select, '<=', 'ANY'); |
199 | 199 | } |
200 | 200 | |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | * @param null|scalar|Select $arg |
205 | 205 | * @return Predicate |
206 | 206 | */ |
207 | - public function isNot ($arg) { |
|
207 | + public function isNot($arg) { |
|
208 | 208 | return $this->is($arg)->not(); |
209 | 209 | } |
210 | 210 | |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | * @param number $max |
216 | 216 | * @return Predicate |
217 | 217 | */ |
218 | - public function isNotBetween ($min, $max) { |
|
218 | + public function isNotBetween($min, $max) { |
|
219 | 219 | $min = $this->db->quote($min); |
220 | 220 | $max = $this->db->quote($max); |
221 | 221 | return Predicate::factory($this->db, "{$this} NOT BETWEEN {$min} AND {$max}"); |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | * @param scalar|array|Select $arg |
228 | 228 | * @return Predicate |
229 | 229 | */ |
230 | - public function isNotEqual ($arg) { |
|
230 | + public function isNotEqual($arg) { |
|
231 | 231 | if ($arg instanceof Select) { |
232 | 232 | return Predicate::factory($this->db, "{$this} NOT IN ({$arg->toSql()})"); |
233 | 233 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | * @param string $pattern |
244 | 244 | * @return Predicate |
245 | 245 | */ |
246 | - public function isNotLike (string $pattern) { |
|
246 | + public function isNotLike(string $pattern) { |
|
247 | 247 | $pattern = $this->db->quote($pattern); |
248 | 248 | return Predicate::factory($this->db, "{$this} NOT LIKE {$pattern}"); |
249 | 249 | } |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | * |
254 | 254 | * @return Predicate |
255 | 255 | */ |
256 | - public function isNotNull () { |
|
256 | + public function isNotNull() { |
|
257 | 257 | return Predicate::factory($this->db, "{$this} IS NOT NULL"); |
258 | 258 | } |
259 | 259 | |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | * @param string $pattern |
264 | 264 | * @return Predicate |
265 | 265 | */ |
266 | - public function isNotRegExp (string $pattern) { |
|
266 | + public function isNotRegExp(string $pattern) { |
|
267 | 267 | $pattern = $this->db->quote($pattern); |
268 | 268 | return Predicate::factory($this->db, "{$this} NOT REGEXP {$pattern}"); |
269 | 269 | } |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | * |
274 | 274 | * @return Predicate |
275 | 275 | */ |
276 | - public function isNull () { |
|
276 | + public function isNull() { |
|
277 | 277 | return Predicate::factory($this->db, "{$this} IS NULL"); |
278 | 278 | } |
279 | 279 | |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | * @param string $pattern |
284 | 284 | * @return Predicate |
285 | 285 | */ |
286 | - public function isRegExp (string $pattern) { |
|
286 | + public function isRegExp(string $pattern) { |
|
287 | 287 | $pattern = $this->db->quote($pattern); |
288 | 288 | return Predicate::factory($this->db, "{$this} REGEXP {$pattern}"); |
289 | 289 | } |