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;
    }
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;
    }
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 ; }
Checks if the given file is located in the vendor directory.

@param string|\SplFileInfo $pathOrFileObject
@return boolean
@throws \InvalidArgumentException If no valid file path is provided.
Checks if the given file is located in the vendor directory .