@@ -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 | /** |
@@ -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 | /** |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | /** |
| 32 | 32 | * Get field definition from FIELDS, including parent classes. |
| 33 | 33 | */ |
| 34 | - protected static function fieldType(string $field, bool $strict=false) |
|
| 34 | + protected static function fieldType(string $field, bool $strict = false) |
|
| 35 | 35 | { |
| 36 | 36 | $class = get_called_class(); |
| 37 | 37 | while ($class && $class != self::class) { |
@@ -51,11 +51,11 @@ discard block |
||
| 51 | 51 | private function fieldException($field, $message) |
| 52 | 52 | { |
| 53 | 53 | return new InvalidArgumentException( |
| 54 | - get_called_class()."->$field must $message" |
|
| 54 | + get_called_class() . "->$field must $message" |
|
| 55 | 55 | ); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - protected function setField(string $field, $value, bool $strict=true) |
|
| 58 | + protected function setField(string $field, $value, bool $strict = true) |
|
| 59 | 59 | { |
| 60 | 60 | if ($field == '@context') { |
| 61 | 61 | return; |
@@ -72,9 +72,9 @@ discard block |
||
| 72 | 72 | if ($type[0] == 'Set') { |
| 73 | 73 | if (!($value instanceof Set)) { |
| 74 | 74 | if (is_array($value)) { |
| 75 | - $class = 'JSKOS\\'.$type[1]; |
|
| 75 | + $class = 'JSKOS\\' . $type[1]; |
|
| 76 | 76 | $value = new Set( |
| 77 | - array_map(function ($m) use ($class) { |
|
| 77 | + array_map(function($m) use ($class) { |
|
| 78 | 78 | if (is_null($m)) { |
| 79 | 79 | return null; |
| 80 | 80 | } |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | } else { |
| 137 | 137 | trigger_error( |
| 138 | - "Undefined property: ".get_called_class()."::$$field", |
|
| 138 | + "Undefined property: " . get_called_class() . "::$$field", |
|
| 139 | 139 | \E_USER_NOTICE |
| 140 | 140 | ); |
| 141 | 141 | } |