protected function createJsonApi($source, DocumentHydrator $hydrator): JsonApiObject
    {
        $jsonApi = isset($source->version)
            ? new JsonApiObject($source->version)
            : new JsonApiObject();

        $hydrator->hydrateObject($jsonApi, $source);

        return $jsonApi;
    }
protected function createJsonApi($source, DocumentHydrator $hydrator): JsonApiObject
    {
        $jsonApi = isset($source->version)
            ? new JsonApiObject($source->version)
            : new JsonApiObject();

        $hydrator->hydrateObject($jsonApi, $source);

        return $jsonApi;
    }
protected function createJsonApi ( $ source , DocumentHydrator $ hydrator ) : JsonApiObject { $ jsonApi = isset ( $ source -> version ) ? new JsonApiObject ( $ source -> version ) : new JsonApiObject ( ) ; $ hydrator -> hydrateObject ( $ jsonApi , $ source ) ; return $ jsonApi ; }
Create JsonAPI-object

@param  $source
@param  DocumentHydrator $hydrator
@return JsonApiObject
Create JsonAPI - object