src/Scope.php
protected function serializeResource(SerializerAbstract $serializer, $data)
    {
        $resourceKey = $this->resource->getResourceKey();

        if ($this->resource instanceof Collection) {
            return $serializer->collection($resourceKey, $data);
        }

        if ($this->resource instanceof Item) {
            return $serializer->item($resourceKey, $data);
        }

        return $serializer->null();
    }
protected function serializeResource(SerializerAbstract $serializer, $data)
    {
        $resourceKey = $this->resource->getResourceKey();

        if ($this->resource instanceof Collection) {
            return $serializer->collection($resourceKey, $data);
        }

        if ($this->resource instanceof Item) {
            return $serializer->item($resourceKey, $data);
        }

        return $serializer->null();
    }
protected function serializeResource ( SerializerAbstract $ serializer , $ data ) { $ resourceKey = $ this -> resource -> getResourceKey ( ) ; if ( $ this -> resource instanceof Collection ) { return $ serializer -> collection ( $ resourceKey , $ data ) ; } if ( $ this -> resource instanceof Item ) { return $ serializer -> item ( $ resourceKey , $ data ) ; } return $ serializer -> null ( ) ; }
Serialize a resource

@internal

@param SerializerAbstract $serializer
@param mixed              $data

@return array
Serialize a resource