@@ -38,8 +38,10 @@ class RdfResource implements \ArrayAccess
3838 /**
3939 * Constructor, creates the RdfResource decorating a freshly created
4040 * or given EasyRdf\Resource with new resource naming capabilities.
41+ *
42+ * @param EasyRdfGraph|RdfGraph|null $graph
4143 */
42- public function __construct (?string $ uri , EasyRdfGraph | RdfGraph | null $ graph = null , ?EasyRdfResource $ resource = null )
44+ public function __construct (?string $ uri , $ graph = null , ?EasyRdfResource $ resource = null )
4345 {
4446 $ graph = ($ graph instanceof RdfGraph) ? $ graph ->getEasyGraph () : $ graph ;
4547 $ this ->resource = $ resource ?? new EasyRdfResource ($ uri , $ graph );
@@ -281,7 +283,7 @@ public static function fromEasyRdf(EasyRdfResource $resource): self
281283 * Turns any EasyRdf\Resource, provided by reference, into an RdfResource.
282284 * Any form of resource is accepted but only EasyRdf\Resources are impacted.
283285 *
284- * @param mixed &$resource
286+ * @param &$resource mixed resource types
285287 */
286288 public static function ensureResourceClass (&$ resource ): void
287289 {
@@ -294,18 +296,18 @@ public static function ensureResourceClass(&$resource): void
294296 */
295297 public static function ensureResourcesClass (array &$ resources ): void
296298 {
297- array_walk ($ resources , ' self::ensureResourceClass ' );
299+ array_walk ($ resources , self ::class. ' ::ensureResourceClass ' );
298300 }
299301
300302 /**
301303 * Extends the capabilities of any EasyRdf\Resource provided by turning it
302304 * into an RdfResource.
303305 *
304- * @param mixed $ resource
306+ * @param $resource mixed resource types
305307 *
306- * @return mixed $resource
308+ * @return $resource mixed but EasyRdf\Resource is wrapped into an RdfResource
307309 */
308- public static function wrapEasyRdfResource ($ resource ): mixed
310+ public static function wrapEasyRdfResource ($ resource )
309311 {
310312 $ resource = ($ resource instanceof EasyRdfResource) ? self ::fromEasyRdf ($ resource ) : $ resource ;
311313
@@ -318,15 +320,17 @@ public static function wrapEasyRdfResource($resource): mixed
318320 */
319321 public static function wrapEasyRdfResources (array $ resources ): array
320322 {
321- array_walk ($ resources , ' self::ensureResourceClass ' );
323+ array_walk ($ resources , self ::class. ' ::ensureResourceClass ' );
322324
323325 return $ resources ;
324326 }
325327
326328 /**
327329 * Returns the corresponding EasyRdf\Resource for any RdfResource provided.
328330 *
329- * @param mixed $resource
331+ * @param $resource mixed resource types
332+ *
333+ * @return $resource mixed but any RdfResource will return its contained EasyRdf\resource
330334 */
331335 public static function fromRdftoEasyRdfResource ($ resource )
332336 {
@@ -341,7 +345,7 @@ public static function fromRdftoEasyRdfResource($resource)
341345 */
342346 public static function fromRdftoEasyRdfResources (array $ resources ): array
343347 {
344- array_walk ($ resources , ' self::ensureEasyResourceClass ' );
348+ array_walk ($ resources , self ::class. ' ::ensureEasyResourceClass ' );
345349
346350 return $ resources ;
347351 }
@@ -401,7 +405,8 @@ public function offsetExists($offset): bool
401405 /**
402406 * Array Access Interface: perform get at using array syntax.
403407 */
404- public function offsetGet ($ offset ): mixed
408+ #[\ReturnTypeWillChange]
409+ public function offsetGet ($ offset )
405410 {
406411 return $ this ->resource ->offsetGet ($ offset );
407412 }
0 commit comments