public static function isVendorClass($classNameOrObject)
    {
        $className = (is_object($classNameOrObject)) ?  get_class($classNameOrObject) : $classNameOrObject;
        if (!class_exists($className)) {
            $message = '"' . $className . '" is not the name of a loadable class.';
            throw new \InvalidArgumentException($message);
        }
        $reflection = new \ReflectionClass($className);
        if ($reflection->isInternal()) {
            return false;
        }
        return static::isVendorFile($reflection->getFileName());
    }
public static function isVendorClass($classNameOrObject)
    {
        $className = (is_object($classNameOrObject)) ?  get_class($classNameOrObject) : $classNameOrObject;
        if (!class_exists($className)) {
            $message = '"' . $className . '" is not the name of a loadable class.';
            throw new \InvalidArgumentException($message);
        }
        $reflection = new \ReflectionClass($className);
        if ($reflection->isInternal()) {
            return false;
        }
        return static::isVendorFile($reflection->getFileName());
    }
public static function isVendorClass ( $ classNameOrObject ) { $ className = ( is_object ( $ classNameOrObject ) ) ? get_class ( $ classNameOrObject ) : $ classNameOrObject ; if ( ! class_exists ( $ className ) ) { $ message = '"' . $ className . '" is not the name of a loadable class.' ; throw new \ InvalidArgumentException ( $ message ) ; } $ reflection = new \ ReflectionClass ( $ className ) ; if ( $ reflection -> isInternal ( ) ) { return false ; } return static :: isVendorFile ( $ reflection -> getFileName ( ) ) ; }
Checks if the given class is located in the vendor directory.

For convenience, it is also possible to pass an object whose
class is then checked.

@param string|object $classNameOrObject
@return boolean
@throws \InvalidArgumentException If no valid class name or object is passed.
Checks if the given class is located in the vendor directory .