| @@ -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 | |
| @@ -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 | |
| @@ -12,7 +12,7 @@ discard block | ||
| 12 | 12 | class AccessPoint extends Item | 
| 13 | 13 |  { | 
| 14 | 14 | const FIELDS = [ | 
| 15 | - 'set' => ['Set','Concept'], | |
| 15 | + 'set' => ['Set', 'Concept'], | |
| 16 | 16 | 'download' => 'URL', | 
| 17 | 17 | ]; | 
| 18 | 18 | |
| @@ -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 | |
| @@ -27,9 +27,9 @@ discard block | ||
| 27 | 27 | * | 
| 28 | 28 | * @param string $context optional JSON-LD context URL. Use empty string to omit. | 
| 29 | 29 | */ | 
| 30 | - public function jsonLDSerialize(string $context=self::DEFAULT_CONTEXT) | |
| 30 | + public function jsonLDSerialize(string $context = self::DEFAULT_CONTEXT) | |
| 31 | 31 |      { | 
| 32 | - $json = [ ]; | |
| 32 | + $json = []; | |
| 33 | 33 | |
| 34 | 34 |          foreach ($this as $key => $value) { | 
| 35 | 35 |              if (isset($value)) { | 
| @@ -51,7 +51,7 @@ discard block | ||
| 51 | 51 | |
| 52 | 52 |          if ($context) { | 
| 53 | 53 | $json['@context'] = $context; | 
| 54 | - $types = defined(get_called_class().'::TYPES') ? static::TYPES : []; | |
| 54 | + $types = defined(get_called_class() . '::TYPES') ? static::TYPES : []; | |
| 55 | 55 |              if (property_exists($this, 'type') and count($types)) { | 
| 56 | 56 |                  if (isset($json['type'])) { | 
| 57 | 57 |                      if (empty(array_intersect($json['type'], $types))) { |