public static function isValidDestination($destination, $exclude = [])
    {
        self::$error = 0;
        self::$target = $destination;

        if (is_link($destination)) {
            self::$error = self::IS_LINK;
        } elseif (file_exists($destination)) {
            self::$error = self::EXISTS;
        } elseif (!file_exists($destination)) {
            self::$error = self::NOT_FOUND;
        } elseif (!is_dir($destination)) {
            self::$error = self::NOT_DIRECTORY;
        }

        if (\count($exclude) && \in_array(self::$error, $exclude, true)) {
            return true;
        }

        return !self::$error;
    }
public static function isValidDestination($destination, $exclude = [])
    {
        self::$error = 0;
        self::$target = $destination;

        if (is_link($destination)) {
            self::$error = self::IS_LINK;
        } elseif (file_exists($destination)) {
            self::$error = self::EXISTS;
        } elseif (!file_exists($destination)) {
            self::$error = self::NOT_FOUND;
        } elseif (!is_dir($destination)) {
            self::$error = self::NOT_DIRECTORY;
        }

        if (\count($exclude) && \in_array(self::$error, $exclude, true)) {
            return true;
        }

        return !self::$error;
    }
public static function isValidDestination ( $ destination , $ exclude = [ ] ) { self :: $ error = 0 ; self :: $ target = $ destination ; if ( is_link ( $ destination ) ) { self :: $ error = self :: IS_LINK ; } elseif ( file_exists ( $ destination ) ) { self :: $ error = self :: EXISTS ; } elseif ( ! file_exists ( $ destination ) ) { self :: $ error = self :: NOT_FOUND ; } elseif ( ! is_dir ( $ destination ) ) { self :: $ error = self :: NOT_DIRECTORY ; } if ( \ count ( $ exclude ) && \ in_array ( self :: $ error , $ exclude , true ) ) { return true ; } return ! self :: $ error ; }
Runs a set of checks on the destination and sets the Error if any

@param  string $destination The directory to run validations at
@param  array  $exclude     An array of constants to exclude from the validation

@return bool True if validation passed. False otherwise
Runs a set of checks on the destination and sets the Error if any