private function transformer($transformer)
    {
        if (is_string($transformer) && class_exists($transformer)) {
            $transformer = new $transformer();
        }
        if (is_object($transformer) && method_exists($transformer, 'transform')) {
            $transformer = [$transformer, 'transform'];
        }

        return is_callable($transformer) ? $transformer : false;
    }