@@ -183,7 +183,7 @@ |
||
183 | 183 | return; |
184 | 184 | } |
185 | 185 | |
186 | - $propertyValues =& $this->offsetGet($iri); |
|
186 | + $propertyValues = & $this->offsetGet($iri); |
|
187 | 187 | $propertyValues = array_merge($propertyValues, $values); |
188 | 188 | } |
189 | 189 |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | /** |
168 | 168 | * Return whether a property exists |
169 | 169 | * |
170 | - * @param \stdClass|Iri|string $iri IRI |
|
170 | + * @param Iri $iri IRI |
|
171 | 171 | * @return boolean Property exists |
172 | 172 | */ |
173 | 173 | public function offsetExists($iri) |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | /** |
237 | 237 | * Set a particular property |
238 | 238 | * |
239 | - * @param \stdClass|Iri|string $iri IRI |
|
239 | + * @param Iri $iri IRI |
|
240 | 240 | * @param array $value Property values |
241 | 241 | */ |
242 | 242 | public function offsetSet($iri, $value) |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | { |
149 | 149 | return (object)[ |
150 | 150 | 'items' => array_map( |
151 | - function (ItemInterface $item) { |
|
151 | + function(ItemInterface $item) { |
|
152 | 152 | return $item->toObject(); |
153 | 153 | }, $this->items |
154 | 154 | ) |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | if (count($types)) { |
192 | 192 | return array_filter( |
193 | 193 | $this->items, |
194 | - function (ItemInterface $item) use ($types) { |
|
194 | + function(ItemInterface $item) use ($types) { |
|
195 | 195 | return $item->isOfType(...$types); |
196 | 196 | } |
197 | 197 | ); |
@@ -200,8 +200,7 @@ |
||
200 | 200 | { |
201 | 201 | $iri = IriFactory::create( |
202 | 202 | (($profile === null) || is_object($name)) ? |
203 | - $name : |
|
204 | - (object)[ |
|
203 | + $name : (object)[ |
|
205 | 204 | 'profile' => $profile, |
206 | 205 | 'name' => $name |
207 | 206 | ] |
@@ -106,7 +106,7 @@ |
||
106 | 106 | $profiledName = strval($iri); |
107 | 107 | $cursor = $this->nameToCursor[$profiledName]; |
108 | 108 | $propertyList[$profiledName] = array_map( |
109 | - function (ExportableInterface $value) { |
|
109 | + function(ExportableInterface $value) { |
|
110 | 110 | return $value->export(); |
111 | 111 | }, $this->values[$cursor] |
112 | 112 | ); |
@@ -116,14 +116,14 @@ |
||
116 | 116 | 'id' => $this->getId(), |
117 | 117 | 'lang' => $this->getLanguage(), |
118 | 118 | 'types' => array_map( |
119 | - function ($type) { |
|
119 | + function($type) { |
|
120 | 120 | return $type->profile.$type->name; |
121 | 121 | }, |
122 | 122 | $this->getType() |
123 | 123 | ), |
124 | 124 | 'properties' => $this->getProperties()->export(), |
125 | 125 | 'items' => array_map( |
126 | - function (ItemInterface $item) { |
|
126 | + function(ItemInterface $item) { |
|
127 | 127 | return $item->export(); |
128 | 128 | }, |
129 | 129 | $this->getChildren() |
@@ -140,6 +140,7 @@ discard block |
||
140 | 140 | * The item type(s) can be specified in a variety of ways, @see ProfiledNamesFactory::createFromArguments() |
141 | 141 | * |
142 | 142 | * @param array ...$types Item types |
143 | + * @param string $types |
|
143 | 144 | * @return boolean Item type is contained in the list of types |
144 | 145 | * @api |
145 | 146 | */ |
@@ -165,7 +166,7 @@ discard block |
||
165 | 166 | * Return whether an aliased item type in contained in a set of query types |
166 | 167 | * |
167 | 168 | * @param string $profile Type profile |
168 | - * @param array $names Aliased type names |
|
169 | + * @param string[] $names Aliased type names |
|
169 | 170 | * @param ProfiledNamesList $types Query types |
170 | 171 | * @return bool Item type is contained in the set of query types |
171 | 172 | */ |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | protected static function createTypes(array $types) |
93 | 93 | { |
94 | 94 | return array_map( |
95 | - function ($type) { |
|
95 | + function($type) { |
|
96 | 96 | return (object)['profile' => self::MF2_PROFILE_URI, 'name' => $type]; |
97 | 97 | }, $types |
98 | 98 | ); |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | { |
155 | 155 | $lang = null; |
156 | 156 | $values = self::createLanguage($values, $lang); |
157 | - return $lang ? array_map(function ($value) use ($lang) { |
|
157 | + return $lang ? array_map(function($value) use ($lang) { |
|
158 | 158 | return (object)['value' => $value, 'lang' => $lang]; |
159 | 159 | }, $values) : $values; |
160 | 160 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | protected static function createProperty(array $propertyValues) |
169 | 169 | { |
170 | 170 | return array_map( |
171 | - function ($propertyValue) { |
|
171 | + function($propertyValue) { |
|
172 | 172 | if (is_array($propertyValue)) { |
173 | 173 | return isset($propertyValue['type']) ? |
174 | 174 | self::createItem($propertyValue) : self::tagLanguage($propertyValue); |