protected function resolveSerializer($serializer):SerializerAbstract
    {
        if (is_string($serializer)) {
            $serializer = new $serializer;
        }

        if (! $serializer instanceof SerializerAbstract) {
            throw new InvalidSerializerException();
        }

        return $serializer;
    }