src/Model.php
public static function register_global_scope( $scope_or_identifier, Closure $closure = null ) {

		if ( $scope_or_identifier instanceof Scope ) {
			self::$_scopes[ get_called_class() ][ get_class( $scope_or_identifier ) ] = $scope_or_identifier;
		} elseif ( is_string( $scope_or_identifier ) && $closure ) {
			self::$_scopes[ get_called_class() ][ $scope_or_identifier ] = $closure;
		} else {
			throw new \InvalidArgumentException();
		}
	}
public static function register_global_scope( $scope_or_identifier, Closure $closure = null ) {

		if ( $scope_or_identifier instanceof Scope ) {
			self::$_scopes[ get_called_class() ][ get_class( $scope_or_identifier ) ] = $scope_or_identifier;
		} elseif ( is_string( $scope_or_identifier ) && $closure ) {
			self::$_scopes[ get_called_class() ][ $scope_or_identifier ] = $closure;
		} else {
			throw new \InvalidArgumentException();
		}
	}
Register a global query scope.

Global query scopes are automatically applied whenever the query() method is called.

@since 2.0

@param Scope|string $scope_or_identifier Either a Scope object or an identifier for an accompanying closure.
@param Closure|null $closure             When not using a Scope object, an implementation for the scope.

@throws \InvalidArgumentException