@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | * |
15 | 15 | * @return Num |
16 | 16 | */ |
17 | - public function toFloat () { |
|
17 | + public function toFloat() { |
|
18 | 18 | if ($this->db->isSQLite()) { |
19 | 19 | return Num::factory($this->db, "CAST({$this} AS REAL)"); |
20 | 20 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @return Num |
28 | 28 | */ |
29 | - public function toInt () { |
|
29 | + public function toInt() { |
|
30 | 30 | if ($this->db->isSQLite()) { |
31 | 31 | return Num::factory($this->db, "CAST({$this} AS INTEGER)"); |
32 | 32 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | */ |
10 | 10 | trait TextTrait { |
11 | 11 | |
12 | - abstract public function __toString (); |
|
12 | + abstract public function __toString(); |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * @var DB |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | /** |
20 | 20 | * @return Text |
21 | 21 | */ |
22 | - public function getHex () { |
|
22 | + public function getHex() { |
|
23 | 23 | return Text::factory($this->db, "HEX({$this})"); |
24 | 24 | } |
25 | 25 | |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * |
31 | 31 | * @return Num |
32 | 32 | */ |
33 | - public function getLength () { |
|
33 | + public function getLength() { |
|
34 | 34 | if ($this->db->isSQLite()) { |
35 | 35 | return Num::factory($this->db, "LENGTH(CAST({$this} AS TEXT))"); |
36 | 36 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * |
43 | 43 | * @return Text |
44 | 44 | */ |
45 | - public function getLower () { |
|
45 | + public function getLower() { |
|
46 | 46 | return Text::factory($this->db, "LOWER({$this})"); |
47 | 47 | } |
48 | 48 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * @param string $substring |
55 | 55 | * @return Num |
56 | 56 | */ |
57 | - public function getPosition (string $substring) { |
|
57 | + public function getPosition(string $substring) { |
|
58 | 58 | $substring = $this->db->quote($substring); |
59 | 59 | if ($this->db->isSQLite()) { |
60 | 60 | return Num::factory($this->db, "INSTR({$this},{$substring})"); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @param string $replace |
70 | 70 | * @return Text |
71 | 71 | */ |
72 | - public function getReplacement (string $search, string $replace) { |
|
72 | + public function getReplacement(string $search, string $replace) { |
|
73 | 73 | $search = $this->db->quote($search); |
74 | 74 | $replace = $this->db->quote($replace); |
75 | 75 | return Text::factory($this->db, "REPLACE({$this},{$search},{$replace})"); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @return Num |
82 | 82 | */ |
83 | - public function getSize () { |
|
83 | + public function getSize() { |
|
84 | 84 | if ($this->db->isSQLite()) { |
85 | 85 | return Num::factory($this->db, "LENGTH(CAST({$this} AS BLOB))"); |
86 | 86 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * @param null|int $length |
95 | 95 | * @return Text |
96 | 96 | */ |
97 | - public function getSubstring (int $start, int $length = null) { |
|
97 | + public function getSubstring(int $start, int $length = null) { |
|
98 | 98 | if (isset($length)) { |
99 | 99 | return Text::factory($this->db, "SUBSTR({$this},{$start},{$length})"); |
100 | 100 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | * |
107 | 107 | * @return Text |
108 | 108 | */ |
109 | - public function getUpper () { |
|
109 | + public function getUpper() { |
|
110 | 110 | return Text::factory($this->db, "UPPER({$this})"); |
111 | 111 | } |
112 | 112 | } |
113 | 113 | \ No newline at end of file |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | */ |
13 | 13 | trait DateTimeTrait { |
14 | 14 | |
15 | - abstract public function __toString (); |
|
15 | + abstract public function __toString(); |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * @var DB |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * |
25 | 25 | * @return Text |
26 | 26 | */ |
27 | - public function getDate () { |
|
27 | + public function getDate() { |
|
28 | 28 | return Text::factory($this->db, $this->getDateTimeFormat('%Y-%m-%d')); |
29 | 29 | } |
30 | 30 | |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * |
34 | 34 | * @return Text |
35 | 35 | */ |
36 | - public function getDateTime () { |
|
36 | + public function getDateTime() { |
|
37 | 37 | return Text::factory($this->db, $this->getDateTimeFormat([ |
38 | 38 | 'mysql' => '%Y-%m-%d %H:%i:%S', |
39 | 39 | 'sqlite' => '%Y-%m-%d %H:%M:%S' |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @param string|string[] $format Format, or formats keyed by driver name. |
47 | 47 | * @return Text |
48 | 48 | */ |
49 | - public function getDateTimeFormat ($format) { |
|
49 | + public function getDateTimeFormat($format) { |
|
50 | 50 | if (is_array($format)) { |
51 | 51 | $format = $format[$this->db->getDriver()]; |
52 | 52 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * |
63 | 63 | * @return Num |
64 | 64 | */ |
65 | - public function getDay () { |
|
65 | + public function getDay() { |
|
66 | 66 | return Num::factory($this->db, $this->getDateTimeFormat('%d')); |
67 | 67 | } |
68 | 68 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | * |
72 | 72 | * @return Num |
73 | 73 | */ |
74 | - public function getDayOfWeek () { |
|
74 | + public function getDayOfWeek() { |
|
75 | 75 | return Num::factory($this->db, $this->getDateTimeFormat('%w')); |
76 | 76 | } |
77 | 77 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @return Num |
82 | 82 | */ |
83 | - public function getDayOfYear () { |
|
83 | + public function getDayOfYear() { |
|
84 | 84 | return Num::factory($this->db, $this->getDateTimeFormat('%j')); |
85 | 85 | } |
86 | 86 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * |
90 | 90 | * @return Num |
91 | 91 | */ |
92 | - public function getHours () { |
|
92 | + public function getHours() { |
|
93 | 93 | return Num::factory($this->db, $this->getDateTimeFormat('%H')); |
94 | 94 | } |
95 | 95 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * |
99 | 99 | * @return Num |
100 | 100 | */ |
101 | - public function getMinutes () { |
|
101 | + public function getMinutes() { |
|
102 | 102 | return Num::factory($this->db, $this->getDateTimeFormat([ |
103 | 103 | 'mysql' => '%i', |
104 | 104 | 'sqlite' => '%M' |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | * |
111 | 111 | * @return Num |
112 | 112 | */ |
113 | - public function getMonth () { |
|
113 | + public function getMonth() { |
|
114 | 114 | return Num::factory($this->db, $this->getDateTimeFormat('%m')); |
115 | 115 | } |
116 | 116 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | * |
120 | 120 | * @return Num |
121 | 121 | */ |
122 | - public function getSeconds () { |
|
122 | + public function getSeconds() { |
|
123 | 123 | return Num::factory($this->db, $this->getDateTimeFormat('%S')); |
124 | 124 | } |
125 | 125 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | * |
129 | 129 | * @return Text |
130 | 130 | */ |
131 | - public function getTime () { |
|
131 | + public function getTime() { |
|
132 | 132 | return Text::factory($this->db, $this->getDateTimeFormat([ |
133 | 133 | 'mysql' => '%H:%i:%S', |
134 | 134 | 'sqlite' => '%H:%M:%S' |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * |
141 | 141 | * @return Num |
142 | 142 | */ |
143 | - public function getTimestamp () { |
|
143 | + public function getTimestamp() { |
|
144 | 144 | if ($this->db->isSQLite()) { |
145 | 145 | return Num::factory($this->db, "STRFTIME('%s',{$this})"); |
146 | 146 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | * |
153 | 153 | * @return Num |
154 | 154 | */ |
155 | - public function getWeekOfYear () { |
|
155 | + public function getWeekOfYear() { |
|
156 | 156 | return Num::factory($this->db, $this->getDateTimeFormat([ |
157 | 157 | 'mysql' => '%U', |
158 | 158 | 'sqlite' => '%W' |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | * |
165 | 165 | * @return Num |
166 | 166 | */ |
167 | - public function getYear () { |
|
167 | + public function getYear() { |
|
168 | 168 | return Num::factory($this->db, $this->getDateTimeFormat('%Y')); |
169 | 169 | } |
170 | 170 | } |
171 | 171 | \ No newline at end of file |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | */ |
10 | 10 | trait NumTrait { |
11 | 11 | |
12 | - abstract public function __toString (); |
|
12 | + abstract public function __toString(); |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * @var DB |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @return Num |
23 | 23 | */ |
24 | - public function abs () { |
|
24 | + public function abs() { |
|
25 | 25 | return Num::factory($this->db, "ABS({$this})"); |
26 | 26 | } |
27 | 27 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @param number|ValueInterface $arg |
32 | 32 | * @return Num |
33 | 33 | */ |
34 | - public function add ($arg) { |
|
34 | + public function add($arg) { |
|
35 | 35 | return Num::factory($this->db, "({$this} + {$arg})"); |
36 | 36 | } |
37 | 37 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @return Num |
42 | 42 | */ |
43 | - public function ceil () { |
|
43 | + public function ceil() { |
|
44 | 44 | return Num::factory($this->db, "CEIL({$this})"); |
45 | 45 | } |
46 | 46 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * @param number|ValueInterface $arg |
51 | 51 | * @return Num |
52 | 52 | */ |
53 | - public function divide ($arg) { |
|
53 | + public function divide($arg) { |
|
54 | 54 | return Num::factory($this->db, "({$this} / {$arg})"); |
55 | 55 | } |
56 | 56 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * |
60 | 60 | * @return Num |
61 | 61 | */ |
62 | - public function floor () { |
|
62 | + public function floor() { |
|
63 | 63 | return Num::factory($this->db, "FLOOR({$this})"); |
64 | 64 | } |
65 | 65 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @return Predicate |
70 | 70 | */ |
71 | - public function isEven () { |
|
71 | + public function isEven() { |
|
72 | 72 | return Predicate::factory($this->db, "({$this} % 2) = 0"); |
73 | 73 | } |
74 | 74 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * |
78 | 78 | * @return Predicate |
79 | 79 | */ |
80 | - public function isNegative () { |
|
80 | + public function isNegative() { |
|
81 | 81 | return Predicate::factory($this->db, "{$this} < 0"); |
82 | 82 | } |
83 | 83 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * |
87 | 87 | * @return Predicate |
88 | 88 | */ |
89 | - public function isOdd () { |
|
89 | + public function isOdd() { |
|
90 | 90 | return Predicate::factory($this->db, "({$this} % 2) <> 0"); |
91 | 91 | } |
92 | 92 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * |
96 | 96 | * @return Predicate |
97 | 97 | */ |
98 | - public function isPositive () { |
|
98 | + public function isPositive() { |
|
99 | 99 | return Predicate::factory($this->db, "{$this} > 0"); |
100 | 100 | } |
101 | 101 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * @param number|ValueInterface $arg |
106 | 106 | * @return Num |
107 | 107 | */ |
108 | - public function modulo ($arg) { |
|
108 | + public function modulo($arg) { |
|
109 | 109 | return Num::factory($this->db, "({$this} % {$arg})"); |
110 | 110 | } |
111 | 111 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @param number|ValueInterface $arg |
116 | 116 | * @return Num |
117 | 117 | */ |
118 | - public function multiply ($arg) { |
|
118 | + public function multiply($arg) { |
|
119 | 119 | return Num::factory($this->db, "({$this} * {$arg})"); |
120 | 120 | } |
121 | 121 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * @param number|ValueInterface $exponent |
126 | 126 | * @return Num |
127 | 127 | */ |
128 | - public function pow ($exponent) { |
|
128 | + public function pow($exponent) { |
|
129 | 129 | return Num::factory($this->db, "POW({$this},{$exponent})"); |
130 | 130 | } |
131 | 131 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * @param int $decimals |
136 | 136 | * @return Num |
137 | 137 | */ |
138 | - public function round (int $decimals = 0) { |
|
138 | + public function round(int $decimals = 0) { |
|
139 | 139 | return Num::factory($this->db, "ROUND({$this},{$decimals})"); |
140 | 140 | } |
141 | 141 | |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | * @param number|ValueInterface $arg |
146 | 146 | * @return Num |
147 | 147 | */ |
148 | - public function subtract (ValueInterface $arg) { |
|
148 | + public function subtract(ValueInterface $arg) { |
|
149 | 149 | return Num::factory($this->db, "({$this} - {$arg})"); |
150 | 150 | } |
151 | 151 | } |
152 | 152 | \ No newline at end of file |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | */ |
10 | 10 | trait AggregateTrait { |
11 | 11 | |
12 | - abstract public function __toString (); |
|
12 | + abstract public function __toString(); |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * @var DB |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * @param string $aggregate `ALL|DISTINCT` |
23 | 23 | * @return Num |
24 | 24 | */ |
25 | - public function getAvg (string $aggregate = 'ALL') { |
|
25 | + public function getAvg(string $aggregate = 'ALL') { |
|
26 | 26 | return Num::factory($this->db, "AVG({$aggregate} {$this})"); |
27 | 27 | } |
28 | 28 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * @param string $delimiter |
33 | 33 | * @return Text |
34 | 34 | */ |
35 | - public function getConcat (string $delimiter = ',') { |
|
35 | + public function getConcat(string $delimiter = ',') { |
|
36 | 36 | $delimiter = $this->db->quote($delimiter); |
37 | 37 | if ($this->db->isSQLite()) { |
38 | 38 | return Text::factory($this->db, "GROUP_CONCAT({$this},{$delimiter})"); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @param string $aggregate `ALL|DISTINCT` |
47 | 47 | * @return Num |
48 | 48 | */ |
49 | - public function getCount (string $aggregate = 'ALL') { |
|
49 | + public function getCount(string $aggregate = 'ALL') { |
|
50 | 50 | return Num::factory($this->db, "COUNT({$aggregate} {$this})"); |
51 | 51 | } |
52 | 52 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * |
56 | 56 | * @return Num |
57 | 57 | */ |
58 | - public function getMax () { |
|
58 | + public function getMax() { |
|
59 | 59 | return Num::factory($this->db, "MAX({$this})"); |
60 | 60 | } |
61 | 61 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * |
65 | 65 | * @return Num |
66 | 66 | */ |
67 | - public function getMin () { |
|
67 | + public function getMin() { |
|
68 | 68 | return Num::factory($this->db, "MIN({$this})"); |
69 | 69 | } |
70 | 70 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * @param string $aggregate `ALL|DISTINCT` |
75 | 75 | * @return Num |
76 | 76 | */ |
77 | - public function getSum (string $aggregate = 'ALL') { |
|
77 | + public function getSum(string $aggregate = 'ALL') { |
|
78 | 78 | return Num::factory($this->db, "SUM({$aggregate} {$this})"); |
79 | 79 | } |
80 | 80 | } |
81 | 81 | \ No newline at end of file |