Completed
Push — master ( 1976df...54cab6 )
by Ori
02:32
created
src/Fields/YearField.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Fields/GeopointField.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,8 +50,8 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Fields/NumberField.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
src/Fields/StringField.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Fields/TimeField.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Fields/DatetimeField.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,8 +37,8 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
update-schema.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@  discard block
 block discarded – undo
4 4
 {
5 5
     $schemaUrl = 'http://specs.frictionlessdata.io/schemas/table-schema.json';
6 6
     $base_filename = realpath(dirname(__FILE__))
7
-        .DIRECTORY_SEPARATOR.'src'
8
-        .DIRECTORY_SEPARATOR.'schemas'
7
+        .DIRECTORY_SEPARATOR . 'src'
8
+        .DIRECTORY_SEPARATOR . 'schemas'
9 9
         .DIRECTORY_SEPARATOR;
10
-    $filename = $base_filename.'table-schema.json';
10
+    $filename = $base_filename . 'table-schema.json';
11 11
     $old_schema = file_exists($filename) ? file_get_contents($filename) : 'FORCE UPDATE';
12 12
     echo "downloading schema from {$schemaUrl}\n";
13 13
     $new_schema = file_get_contents($schemaUrl);
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     } else {
17 17
         echo "schema changed - updating local file\n";
18 18
         file_put_contents($filename, $new_schema);
19
-        file_put_contents($base_filename.'CHANGELOG', "\n\n".date('c')."\n* check the git diff and summarize the spec changes here\n* \n\n", FILE_APPEND);
19
+        file_put_contents($base_filename . 'CHANGELOG', "\n\n" . date('c') . "\n* check the git diff and summarize the spec changes here\n* \n\n", FILE_APPEND);
20 20
     }
21 21
 
22 22
     return 0;
Please login to merge, or discard this patch.
src/SchemaValidator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $descriptor = json_decode(json_encode($this->descriptor));
60 60
         $validator->validate(
61 61
             $descriptor,
62
-            (object) ['$ref' => 'file://'.realpath(dirname(__FILE__)).'/schemas/table-schema.json']
62
+            (object)['$ref' => 'file://' . realpath(dirname(__FILE__)) . '/schemas/table-schema.json']
63 63
         );
64 64
         if (!$validator->isValid()) {
65 65
             foreach ($validator->getErrors() as $error) {
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
     protected function validateKeys()
75 75
     {
76
-        $fieldNames = array_map(function ($field) {
76
+        $fieldNames = array_map(function($field) {
77 77
             return $field->name;
78 78
         }, $this->descriptor->fields);
79 79
         if (isset($this->descriptor->primaryKey)) {
Please login to merge, or discard this patch.
src/DataSources/BaseDataSource.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
     public function __construct($dataSource, $options = null)
11 11
     {
12 12
         $this->dataSource = $dataSource;
13
-        $this->options = empty($options) ? (object) [] : $options;
13
+        $this->options = empty($options) ? (object)[] : $options;
14 14
     }
15 15
 
16 16
     abstract public function open();
Please login to merge, or discard this patch.