public function extension($file, $extensions): bool
    {
        if (!is_array($extensions)) {
            $extensions = array_slice(func_get_args(), 1);
        }

        if ($file instanceof UploadedFileInterface) {
            return in_array(
                $this->files->extension($file->getClientFilename()),
                $extensions
            );
        }

        return in_array($this->files->extension($file), $extensions);
    }