@@ -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; |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | { |
| 51 | 51 | $parts = [$hour, $minute, $second]; |
| 52 | 52 | foreach ($parts as &$part) { |
| 53 | - $part = (int) $part; |
|
| 53 | + $part = (int)$part; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | return $parts; |
@@ -37,8 +37,8 @@ |
||
| 37 | 37 | throw $this->getValidationException("couldn't parse date/time according to given strptime format '{$this->format()}''", $val); |
| 38 | 38 | } else { |
| 39 | 39 | return Carbon::create( |
| 40 | - (int) $date['tm_year'] + 1900, (int) $date['tm_mon'] + 1, (int) $date['tm_mday'], |
|
| 41 | - (int) $date['tm_hour'], (int) $date['tm_min'], (int) $date['tm_sec'] |
|
| 40 | + (int)$date['tm_year'] + 1900, (int)$date['tm_mon'] + 1, (int)$date['tm_mday'], |
|
| 41 | + (int)$date['tm_hour'], (int)$date['tm_min'], (int)$date['tm_sec'] |
|
| 42 | 42 | ); |
| 43 | 43 | } |
| 44 | 44 | } |