@@ -15,12 +15,12 @@ |
||
15 | 15 | public function __construct($descriptor, $descriptorSource, $errorMessage) |
16 | 16 | { |
17 | 17 | if (!empty($descriptor) && empty($descriptorSource)) { |
18 | - $message = 'error decoding descriptor '.json_encode($descriptor).": {$errorMessage}"; |
|
18 | + $message = 'error decoding descriptor ' . json_encode($descriptor) . ": {$errorMessage}"; |
|
19 | 19 | } elseif (!empty($descriptor) && !empty($descriptorSource)) { |
20 | - $message = 'error decoding descriptor from source '.json_encode($descriptorSource) |
|
21 | - .' - '.json_encode($descriptor).": {$errorMessage}"; |
|
20 | + $message = 'error decoding descriptor from source ' . json_encode($descriptorSource) |
|
21 | + .' - ' . json_encode($descriptor) . ": {$errorMessage}"; |
|
22 | 22 | } elseif (empty($descriptor) && !empty($descriptorSource)) { |
23 | - $message = 'error loading descriptor from source '.json_encode($descriptorSource) |
|
23 | + $message = 'error loading descriptor from source ' . json_encode($descriptorSource) |
|
24 | 24 | .": {$errorMessage}"; |
25 | 25 | } else { |
26 | 26 | $message = "unexpected load error: {$errorMessage}"; |
@@ -15,7 +15,7 @@ |
||
15 | 15 | */ |
16 | 16 | public function __construct($descriptor = null, $lenient = false) |
17 | 17 | { |
18 | - $this->descriptor = empty($descriptor) ? (object) ['fields' => []] : $descriptor; |
|
18 | + $this->descriptor = empty($descriptor) ? (object)['fields' => []] : $descriptor; |
|
19 | 19 | $this->fieldsInferer = new Fields\FieldsInferrer(null, $lenient); |
20 | 20 | } |
21 | 21 |
@@ -6,7 +6,7 @@ |
||
6 | 6 | { |
7 | 7 | public function __construct($descriptor = null) |
8 | 8 | { |
9 | - $this->descriptor = empty($descriptor) ? (object) ['fields' => []] : $descriptor; |
|
9 | + $this->descriptor = empty($descriptor) ? (object)['fields' => []] : $descriptor; |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | public function fields($newFields = null) |
@@ -32,7 +32,7 @@ |
||
32 | 32 | throw $this->getValidationException("couldn't parse date/time according to given strptime format '{$this->format()}''", $val); |
33 | 33 | } else { |
34 | 34 | return Carbon::create( |
35 | - (int) $date['tm_year'] + 1900, (int) $date['tm_mon'] + 1, (int) $date['tm_mday'], |
|
35 | + (int)$date['tm_year'] + 1900, (int)$date['tm_mon'] + 1, (int)$date['tm_mday'], |
|
36 | 36 | 0, 0, 0 |
37 | 37 | ); |
38 | 38 | } |
@@ -20,8 +20,8 @@ |
||
20 | 20 | if ($year == '' || $month == '') { |
21 | 21 | throw $this->getValidationException(null, $val); |
22 | 22 | } else { |
23 | - $year = (int) $year; |
|
24 | - $month = (int) $month; |
|
23 | + $year = (int)$year; |
|
24 | + $month = (int)$month; |
|
25 | 25 | if ($month < 1 || $month > 12) { |
26 | 26 | throw $this->getValidationException(null, $val); |
27 | 27 | } else { |
@@ -10,8 +10,8 @@ |
||
10 | 10 | { |
11 | 11 | protected function validateCastValue($val) |
12 | 12 | { |
13 | - $year = (int) $val; |
|
14 | - if ((float) $val != (float) $year) { |
|
13 | + $year = (int)$val; |
|
14 | + if ((float)$val != (float)$year) { |
|
15 | 15 | throw $this->getValidationException(null, $val); |
16 | 16 | } else { |
17 | 17 | return $year; |
@@ -50,8 +50,8 @@ |
||
50 | 50 | throw $this->getValidationException('lon,lat array must contain only lon,lat', json_encode($arr)); |
51 | 51 | } else { |
52 | 52 | list($lon, $lat) = $arr; |
53 | - $lon = (int) $lon; |
|
54 | - $lat = (int) $lat; |
|
53 | + $lon = (int)$lon; |
|
54 | + $lat = (int)$lat; |
|
55 | 55 | if ( |
56 | 56 | $lon > 180 || $lon < -180 |
57 | 57 | || $lat > 90 or $lat < -90 |
@@ -38,7 +38,7 @@ |
||
38 | 38 | if (!is_numeric($val)) { |
39 | 39 | throw $this->getValidationException('value must be numeric', $val); |
40 | 40 | } else { |
41 | - $val = (float) $val; |
|
41 | + $val = (float)$val; |
|
42 | 42 | if ($isPercent) { |
43 | 43 | $val = $val / 100; |
44 | 44 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | protected function validateCastValue($val) |
25 | 25 | { |
26 | 26 | try { |
27 | - $val = (string) $val; |
|
27 | + $val = (string)$val; |
|
28 | 28 | } catch (\Exception $e) { |
29 | 29 | $val = json_encode($val); |
30 | 30 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $inferId = parent::getInferIdentifier(); |
61 | 61 | $format = $this->format(); |
62 | 62 | if (!$lenient && !empty($format)) { |
63 | - $inferId .= ':'.$this->format(); |
|
63 | + $inferId .= ':' . $this->format(); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | return $inferId; |