Merged in feature/81-dev-dev01 (pull request #5)
auto-patch 81-dev-dev01-2023-12-05T22_45_26 * auto-patch 81-dev-dev01-2023-12-05T22_45_26
This commit is contained in:
@@ -717,6 +717,20 @@ class Iri {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function __wakeup() {
|
||||
$class_props = get_class_vars( __CLASS__ );
|
||||
$string_props = array( 'scheme', 'iuserinfo', 'ihost', 'port', 'ipath', 'iquery', 'ifragment' );
|
||||
$array_props = array( 'normalization' );
|
||||
foreach ( $class_props as $prop => $default_value ) {
|
||||
if ( in_array( $prop, $string_props, true ) && ! is_string( $this->$prop ) ) {
|
||||
throw new UnexpectedValueException();
|
||||
} elseif ( in_array( $prop, $array_props, true ) && ! is_array( $this->$prop ) ) {
|
||||
throw new UnexpectedValueException();
|
||||
}
|
||||
$this->$prop = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the entire IRI. Returns true on success, false on failure (if there
|
||||
* are any invalid characters).
|
||||
|
||||
Reference in New Issue
Block a user