@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | namespace JSKOS; |
4 | 4 |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | namespace JSKOS; |
4 | 4 | |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | 'created' => 'Date', |
25 | 25 | 'issued' => 'Date', |
26 | 26 | 'modified' => 'Date', |
27 | - 'creator' => ['Set','Concept'], |
|
28 | - 'contributor' => ['Set','Concept'], |
|
29 | - 'publisher' => ['Set','Concept'], |
|
30 | - 'partOf' => ['Set','Concept'], |
|
27 | + 'creator' => ['Set', 'Concept'], |
|
28 | + 'contributor' => ['Set', 'Concept'], |
|
29 | + 'publisher' => ['Set', 'Concept'], |
|
30 | + 'partOf' => ['Set', 'Concept'], |
|
31 | 31 | ]; |
32 | 32 | |
33 | 33 | /** |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | namespace JSKOS; |
4 | 4 | |
@@ -16,14 +16,14 @@ discard block |
||
16 | 16 | ]; |
17 | 17 | |
18 | 18 | const FIELDS = [ |
19 | - 'narrower' => ['Set','Concept'], |
|
20 | - 'broader' => ['Set','Concept'], |
|
21 | - 'related' => ['Set','Concept'], |
|
22 | - 'previous' => ['Set','Concept'], |
|
23 | - 'next' => ['Set','Concept'], |
|
24 | - 'ancestors' => ['Set','Concept'], |
|
25 | - 'inScheme' => ['Set','ConceptScheme'], |
|
26 | - 'topConceptOf' => ['Set','ConceptScheme'], |
|
19 | + 'narrower' => ['Set', 'Concept'], |
|
20 | + 'broader' => ['Set', 'Concept'], |
|
21 | + 'related' => ['Set', 'Concept'], |
|
22 | + 'previous' => ['Set', 'Concept'], |
|
23 | + 'next' => ['Set', 'Concept'], |
|
24 | + 'ancestors' => ['Set', 'Concept'], |
|
25 | + 'inScheme' => ['Set', 'ConceptScheme'], |
|
26 | + 'topConceptOf' => ['Set', 'ConceptScheme'], |
|
27 | 27 | ]; |
28 | 28 | |
29 | 29 | /** |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | namespace JSKOS; |
4 | 4 |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | namespace JSKOS; |
4 | 4 |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | namespace JSKOS; |
4 | 4 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | } |
40 | 40 | } |
41 | 41 | |
42 | - protected function setField(string $field, $value, bool $strict=true) |
|
42 | + protected function setField(string $field, $value, bool $strict = true) |
|
43 | 43 | { |
44 | 44 | if ($field == '@context') { |
45 | 45 | return; |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | } elseif (is_array($type)) { # Set or Listing |
61 | 61 | if ($type[0] == 'Set') { |
62 | 62 | if (is_array($value)) { |
63 | - $class = 'JSKOS\\'.$type[1]; |
|
63 | + $class = 'JSKOS\\' . $type[1]; |
|
64 | 64 | $value = new Set( |
65 | - array_map(function ($m) use ($class) { |
|
65 | + array_map(function($m) use ($class) { |
|
66 | 66 | if (is_null($m)) { |
67 | 67 | return null; |
68 | 68 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | }, $value) |
74 | 74 | ); |
75 | 75 | } elseif (!is_a($value, 'JSKOS\Set')) { |
76 | - $msg = get_called_class()."->$field must be a Set"; |
|
76 | + $msg = get_called_class() . "->$field must be a Set"; |
|
77 | 77 | throw new InvalidArgumentException($msg); |
78 | 78 | } else { |
79 | 79 | # TODO: check member types |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | if ($type == 'ConceptScheme') { |
98 | 98 | $value = new ConceptScheme($value); |
99 | 99 | } else { |
100 | - $msg = get_called_class()."->$field must match JSKOS\DataType::is$type"; |
|
100 | + $msg = get_called_class() . "->$field must match JSKOS\DataType::is$type"; |
|
101 | 101 | throw new InvalidArgumentException($msg); |
102 | 102 | } |
103 | 103 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | } |
123 | 123 | } else { |
124 | 124 | trigger_error( |
125 | - "Undefined property: ".get_called_class()."::$$field", |
|
125 | + "Undefined property: " . get_called_class() . "::$$field", |
|
126 | 126 | \E_USER_NOTICE |
127 | 127 | ); |
128 | 128 | return null; |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | namespace JSKOS; |
4 | 4 |
@@ -12,7 +12,7 @@ |
||
12 | 12 | /** |
13 | 13 | * Set a field value. |
14 | 14 | */ |
15 | - abstract protected function setField(string $field, $value, bool $strict=true); |
|
15 | + abstract protected function setField(string $field, $value, bool $strict = true); |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Create a new JSKOS object with given field values. |
@@ -175,7 +175,7 @@ |
||
175 | 175 | */ |
176 | 176 | public function jsonLDSerialize(string $context = self::DEFAULT_CONTEXT) |
177 | 177 | { |
178 | - $set = array_map(function ($m) { |
|
178 | + $set = array_map(function($m) { |
|
179 | 179 | return is_object($m) ? $m->jsonLDSerialize('') : $m; |
180 | 180 | }, $this->members); |
181 | 181 |