@@ -28,17 +28,17 @@ |
||
| 28 | 28 | |
| 29 | 29 | public function setBooleanValue($value): bool |
| 30 | 30 | { |
| 31 | - return (boolean)$value; |
|
| 31 | + return (boolean) $value; |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | public function setDecimalValue($value): ?float |
| 35 | 35 | { |
| 36 | - return is_null($value) ? null : (float)preg_replace('/[^-\d.]/', '', $value); |
|
| 36 | + return is_null($value) ? null : (float) preg_replace('/[^-\d.]/', '', $value); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | public function setIntegerValue($value): ?int |
| 40 | 40 | { |
| 41 | - return is_null($value) ? null : (int)preg_replace('/[^-\d]/', '', $value); |
|
| 41 | + return is_null($value) ? null : (int) preg_replace('/[^-\d]/', '', $value); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | public function setTimestampValue($value): ?string |
@@ -132,9 +132,9 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | if ($cacheIndex) { |
| 134 | 134 | $key = sprintf('%s/%s:%s', static::$tableName, $field, $value); |
| 135 | - return DB::oneRecordCached($key, $query, $params, [static::class,'handleError']); |
|
| 135 | + return DB::oneRecordCached($key, $query, $params, [static::class, 'handleError']); |
|
| 136 | 136 | } else { |
| 137 | - return DB::oneRecord($query, $params, [static::class,'handleError']); |
|
| 137 | + return DB::oneRecord($query, $params, [static::class, 'handleError']); |
|
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | join(') AND (', $conditions), |
| 181 | 181 | $order ? 'ORDER BY '.join(',', $order) : '', |
| 182 | 182 | ], |
| 183 | - [static::class,'handleError'] |
|
| 183 | + [static::class, 'handleError'] |
|
| 184 | 184 | ); |
| 185 | 185 | } |
| 186 | 186 | |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | */ |
| 194 | 194 | public static function getByQuery($query, $params = []) |
| 195 | 195 | { |
| 196 | - return static::instantiateRecord(DB::oneRecord($query, $params, [static::class,'handleError'])); |
|
| 196 | + return static::instantiateRecord(DB::oneRecord($query, $params, [static::class, 'handleError'])); |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | /** |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | ]; |
| 296 | 296 | |
| 297 | 297 | if ($options['order']) { |
| 298 | - $query .= ' ORDER BY ' . join(',', static::_mapFieldOrder($options['order'])); |
|
| 298 | + $query .= ' ORDER BY '.join(',', static::_mapFieldOrder($options['order'])); |
|
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | if ($options['limit']) { |
@@ -303,9 +303,9 @@ discard block |
||
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | if ($options['indexField']) { |
| 306 | - return DB::table(static::_cn($options['indexField']), $query, $params, null, [static::class,'handleError']); |
|
| 306 | + return DB::table(static::_cn($options['indexField']), $query, $params, null, [static::class, 'handleError']); |
|
| 307 | 307 | } else { |
| 308 | - return DB::allRecords($query, $params, [static::class,'handleError']); |
|
| 308 | + return DB::allRecords($query, $params, [static::class, 'handleError']); |
|
| 309 | 309 | } |
| 310 | 310 | } |
| 311 | 311 | |
@@ -318,12 +318,12 @@ discard block |
||
| 318 | 318 | */ |
| 319 | 319 | public static function getAllByQuery($query, $params = []) |
| 320 | 320 | { |
| 321 | - return static::instantiateRecords(DB::allRecords($query, $params, [static::class,'handleError'])); |
|
| 321 | + return static::instantiateRecords(DB::allRecords($query, $params, [static::class, 'handleError'])); |
|
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | public static function getTableByQuery($keyField, $query, $params = []) |
| 325 | 325 | { |
| 326 | - return static::instantiateRecords(DB::table($keyField, $query, $params, [static::class,'handleError'])); |
|
| 326 | + return static::instantiateRecords(DB::table($keyField, $query, $params, [static::class, 'handleError'])); |
|
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | /** |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | ]; |
| 373 | 373 | |
| 374 | 374 | if ($options['order']) { |
| 375 | - $query .= ' ORDER BY ' . join(',', static::_mapFieldOrder($options['order'])); |
|
| 375 | + $query .= ' ORDER BY '.join(',', static::_mapFieldOrder($options['order'])); |
|
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | if ($options['limit']) { |
@@ -380,9 +380,9 @@ discard block |
||
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | if ($options['indexField']) { |
| 383 | - return DB::table(static::_cn($options['indexField']), $query, $params, null, [static::class,'handleError']); |
|
| 383 | + return DB::table(static::_cn($options['indexField']), $query, $params, null, [static::class, 'handleError']); |
|
| 384 | 384 | } else { |
| 385 | - return DB::allRecords($query, $params, [static::class,'handleError']); |
|
| 385 | + return DB::allRecords($query, $params, [static::class, 'handleError']); |
|
| 386 | 386 | } |
| 387 | 387 | } |
| 388 | 388 | |