@@ -41,7 +41,7 @@ class RdfResource implements \ArrayAccess
41
41
*
42
42
* @param EasyRdfGraph|RdfGraph|null $graph
43
43
*/
44
- public function __construct (?string $ uri , $ graph = null , ? EasyRdfResource $ resource = null )
44
+ public function __construct (?string $ uri , $ graph = null , EasyRdfResource $ resource = null )
45
45
{
46
46
$ graph = ($ graph instanceof RdfGraph) ? $ graph ->getEasyGraph () : $ graph ;
47
47
$ this ->resource = $ resource ?? new EasyRdfResource ($ uri , $ graph );
@@ -174,7 +174,7 @@ public function localId(): ?string
174
174
* Returns the label of the resource in the given language with given style
175
175
* or make use of the default label if none exists in the defined language.
176
176
*/
177
- private function labelAsName (?string $ language , ? string $ namingConvention = null ): ?string
177
+ private function labelAsName (?string $ language , string $ namingConvention = null ): ?string
178
178
{
179
179
// English is the default language, forseeing graphs with several ones.
180
180
$ language = $ language ?: 'en ' ;
@@ -185,18 +185,19 @@ private function labelAsName(?string $language, ?string $namingConvention = null
185
185
return $ label ? u ($ label ->getValue ())->snake ()->__toString () :
186
186
($ defaultLabel ? u ($ defaultLabel ->getValue ())->snake ()->__toString () : null );
187
187
}
188
+
188
189
// default is camel case style as with schema.org
189
190
return $ label ? u ($ label ->getValue ())->camel ()->__toString () :
190
191
($ defaultLabel ? u ($ defaultLabel ->getValue ())->camel ()->__toString () : null );
191
192
}
192
193
193
- /**
194
- * Gets the graph related to this resource as a Schema Generator's RdfGraph.
195
- */
196
- public function getGraph (): ?RdfGraph
197
- {
198
- return ($ this ->hasGraph ()) ? RdfGraph::fromEasyRdf ($ this ->resource ->getGraph ()) : null ;
199
- }
194
+ /**
195
+ * Gets the graph related to this resource as a Schema Generator's RdfGraph.
196
+ */
197
+ public function getGraph (): ?RdfGraph
198
+ {
199
+ return ($ this ->hasGraph ()) ? RdfGraph::fromEasyRdf ($ this ->resource ->getGraph ()) : null ;
200
+ }
200
201
201
202
/**
202
203
* Returns true if the current RdfResource belongs to a graph.
@@ -405,7 +406,7 @@ public function offsetExists($offset): bool
405
406
/**
406
407
* Array Access Interface: perform get at using array syntax.
407
408
*
408
- * @return mixed Can return all value types.
409
+ * @return mixed can return all value types
409
410
*/
410
411
#[\ReturnTypeWillChange]
411
412
public function offsetGet ($ offset )
0 commit comments