@@ -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 | |
@@ -16,14 +16,14 @@ |
||
| 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 | /** |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - protected function setField(string $field, $value, bool $strict=true) |
|
| 45 | + protected function setField(string $field, $value, bool $strict = true) |
|
| 46 | 46 | { |
| 47 | 47 | if ($field == '@context') { |
| 48 | 48 | return; |
@@ -63,9 +63,9 @@ discard block |
||
| 63 | 63 | } elseif (is_array($type)) { # Set or Listing |
| 64 | 64 | if ($type[0] == 'Set') { |
| 65 | 65 | if (is_array($value)) { |
| 66 | - $class = 'JSKOS\\'.$type[1]; |
|
| 66 | + $class = 'JSKOS\\' . $type[1]; |
|
| 67 | 67 | $value = new Set( |
| 68 | - array_map(function ($m) use ($class) { |
|
| 68 | + array_map(function($m) use ($class) { |
|
| 69 | 69 | if (is_null($m)) { |
| 70 | 70 | return null; |
| 71 | 71 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | }, $value) |
| 77 | 77 | ); |
| 78 | 78 | } elseif (!is_a($value, 'JSKOS\Set')) { |
| 79 | - $msg = get_called_class()."->$field must be a Set"; |
|
| 79 | + $msg = get_called_class() . "->$field must be a Set"; |
|
| 80 | 80 | throw new InvalidArgumentException($msg); |
| 81 | 81 | } else { |
| 82 | 82 | # TODO: check member types |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | if ($type == 'ConceptScheme') { |
| 101 | 101 | $value = new ConceptScheme($value); |
| 102 | 102 | } else { |
| 103 | - $msg = get_called_class()."->$field must match JSKOS\DataType::is$type"; |
|
| 103 | + $msg = get_called_class() . "->$field must match JSKOS\DataType::is$type"; |
|
| 104 | 104 | throw new InvalidArgumentException($msg); |
| 105 | 105 | } |
| 106 | 106 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | } |
| 126 | 126 | } else { |
| 127 | 127 | trigger_error( |
| 128 | - "Undefined property: ".get_called_class()."::$$field", |
|
| 128 | + "Undefined property: " . get_called_class() . "::$$field", |
|
| 129 | 129 | \E_USER_NOTICE |
| 130 | 130 | ); |
| 131 | 131 | return null; |
@@ -24,10 +24,10 @@ |
||
| 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 | /** |