public static function isVendorFile($pathOrFileObject)
    {
        $path = ($pathOrFileObject instanceof \SplFileInfo) ? $pathOrFileObject->getPathname() : $pathOrFileObject;
        if (!file_exists($path)) {
            $message = '"' . $path . '" does not reference a file or directory.';
            throw new \InvalidArgumentException($message);
        }
        // The file path must start with the vendor directory.
        return strpos($path, static::getVendorDirectory()) === 0;
    }