Dodo
DOm DOcument implementation
Loading...
Searching...
No Matches
Wikimedia\Dodo\Internal\Util Class Reference

Static Public Member Functions

static assert (bool $condition, ?string $message="")
 Original: throw new Error("Assertion failed: " + (msg || "") + "\n" new Error().stack);.
 
static never error (string $name, ?string $message=null)
 Throw a DOMException.
 
static string toAsciiLowercase (string $s)
 ASCII lowercase a string.
 
static string toAsciiUppercase (string $s)
 ASCII uppercase a string.
 
static string stripAndCollapseWhitespace (string $s)
 "Strip and collapse ASCII whitespace"
 

Public Attributes

const NAMESPACE_HTML = "http://www.w3.org/1999/xhtml"
 NAMESPACE_* Strings defining the various document namespaces [DODO] These are used by this library and aren't part of a spec.
 
const NAMESPACE_XML = "http://www.w3.org/XML/1998/namespace"
 
const NAMESPACE_XMLNS = "http://www.w3.org/2000/xmlns/"
 
const NAMESPACE_MATHML = "http://www.w3.org/1998/Math/MathML"
 
const NAMESPACE_SVG = "http://www.w3.org/2000/svg"
 
const NAMESPACE_XLINK = "http://www.w3.org/1999/xlink"
 

Member Function Documentation

◆ assert()

static Wikimedia\Dodo\Internal\Util::assert ( bool $condition,
?string $message = "" )
static

Original: throw new Error("Assertion failed: " + (msg || "") + "\n" new Error().stack);.

TODO: Need to add the stack trace info, or advise catchers call Exception::getTraceAsString()

TODO: Make this a true PHP assert?

Parameters
bool$condition
?string$message
Exceptions

Exception -assert-true-condition $condition

◆ error()

static never Wikimedia\Dodo\Internal\Util::error ( string $name,
?string $message = null )
static

Throw a DOMException.

Parameters
string$nameone of the values below
string | null$messagean optional message to include in the Exception
Exceptions
DOMException

NOTE Allowed values for $string are: IndexSizeError, HierarchyRequestError WrongDocumentError, InvalidCharacterError, NoModificationAllowedError, NotFoundError, NotSupportedError, InvalidStateError, SyntaxError, InvalidModificationError, NamespaceError, InvalidAccessError, TypeMismatchError, SecurityError, NetworkError, AbortError, UrlMismatchError, QuotaExceededError, TimeoutError, InvalidNodeTypeError, and DataCloneError

For more information, see interfaces/DOMException.php

Returns
never

◆ stripAndCollapseWhitespace()

static string Wikimedia\Dodo\Internal\Util::stripAndCollapseWhitespace ( string $s)
static

"Strip and collapse ASCII whitespace"

See also
https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
Parameters
string$s
Returns
string

◆ toAsciiLowercase()

static string Wikimedia\Dodo\Internal\Util::toAsciiLowercase ( string $s)
static

ASCII lowercase a string.

See also
https://infra.spec.whatwg.org/#ascii-lowercase
Parameters
string$s
Returns
string

◆ toAsciiUppercase()

static string Wikimedia\Dodo\Internal\Util::toAsciiUppercase ( string $s)
static

ASCII uppercase a string.

See also
https://infra.spec.whatwg.org/#ascii-uppercase
Parameters
string$s
Returns
string

The documentation for this class was generated from the following file: