@@ -4,10 +4,10 @@ discard block |
||
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 |
||
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; |
@@ -19,7 +19,9 @@ |
||
19 | 19 | $this->fieldsCache = []; |
20 | 20 | foreach ($newFields as $name => $field) { |
21 | 21 | if (!is_a($field, "frictionlessdata\\tableschema\\Fields\\BaseField")) { |
22 | - if (!isset($field->name)) $field->name = $name; |
|
22 | + if (!isset($field->name)) { |
|
23 | + $field->name = $name; |
|
24 | + } |
|
23 | 25 | $field = FieldsFactory::field($field); |
24 | 26 | } |
25 | 27 | $this->fieldsCache[$name] = $field; |
@@ -59,7 +59,7 @@ discard block |
||
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 |
||
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)) { |