Code Modernization: Revert [60796]. This change needs some more work before it's fully ready.

See #63962

Built from https://develop.svn.wordpress.org/trunk@60804


git-svn-id: http://core.svn.wordpress.org/trunk@60140 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn
2025-09-28 21:56:27 +00:00
parent da949cda46
commit dc0b4ceef5
8 changed files with 10 additions and 99 deletions

View File

@@ -257,13 +257,11 @@ final class WP_Block_Bindings_Registry {
}
/**
* Unserialize magic method.
* Wakeup magic method.
*
* @since 6.9.0
*
* @param array $data Data to unserialize.
* @since 6.5.0
*/
public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
public function __wakeup() {
if ( ! $this->sources ) {
return;
}
@@ -277,15 +275,6 @@ final class WP_Block_Bindings_Registry {
}
}
/**
* Wakeup magic method.
*
* @since 6.5.0
*/
public function __wakeup() {
$this->__unserialize( array() );
}
/**
* Utility method to retrieve the main instance of the class.
*

View File

@@ -98,23 +98,12 @@ final class WP_Block_Bindings_Source {
return apply_filters( 'block_bindings_source_value', $value, $this->name, $source_args, $block_instance, $attribute_name );
}
/**
* Unserialize magic method.
*
* @since 6.9.0
*
* @param array $data Data to unserialize.
*/
public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
throw new \LogicException( __CLASS__ . ' should never be unserialized' );
}
/**
* Wakeup magic method.
*
* @since 6.5.0
*/
public function __wakeup() {
$this->__unserialize( array() );
throw new \LogicException( __CLASS__ . ' should never be unserialized' );
}
}

View File

@@ -245,14 +245,7 @@ final class WP_Block_Patterns_Registry {
return isset( $this->registered_patterns[ $pattern_name ] );
}
/**
* Unserialize magic method.
*
* @since 6.9.0
*
* @param array $data Data to unserialize.
*/
public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
public function __wakeup() {
if ( ! $this->registered_patterns ) {
return;
}
@@ -267,15 +260,6 @@ final class WP_Block_Patterns_Registry {
$this->registered_patterns_outside_init = array();
}
/**
* Wakeup magic method.
*
* @since 6.4.0
*/
public function __wakeup() {
$this->__unserialize( array() );
}
/**
* Utility method to retrieve the main instance of the class.
*

View File

@@ -168,14 +168,7 @@ final class WP_Block_Type_Registry {
return isset( $this->registered_block_types[ $name ] );
}
/**
* Unserialize magic method.
*
* @since 6.9.0
*
* @param array $data Data to unserialize.
*/
public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
public function __wakeup() {
if ( ! $this->registered_block_types ) {
return;
}
@@ -189,15 +182,6 @@ final class WP_Block_Type_Registry {
}
}
/**
* Wakeup magic method.
*
* @since 6.4.0
*/
public function __wakeup() {
$this->__unserialize( array() );
}
/**
* Utility method to retrieve the main instance of the class.
*

View File

@@ -783,12 +783,8 @@ final class WP_Theme implements ArrayAccess {
* Perform reinitialization tasks.
*
* Prevents a callback from being injected during unserialization of an object.
*
* @since 6.9.0
*
* @param array $data Data to unserialize.
*/
public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
public function __wakeup() {
if ( $this->parent && ! $this->parent instanceof self ) {
throw new UnexpectedValueException();
}
@@ -803,15 +799,6 @@ final class WP_Theme implements ArrayAccess {
$this->headers_sanitized = array();
}
/**
* Wakeup magic method.
*
* @since 6.4.0
*/
public function __wakeup() {
$this->__unserialize( array() );
}
/**
* Adds theme data to cache.
*

View File

@@ -841,23 +841,12 @@ class WP_HTML_Open_Elements {
}
}
/**
* Unserialize magic method.
*
* @since 6.9.0
*
* @param array $data Data to unserialize.
*/
public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
throw new \LogicException( __CLASS__ . ' should never be unserialized' );
}
/**
* Wakeup magic method.
*
* @since 6.6.0
*/
public function __wakeup() {
$this->__unserialize( array() );
throw new \LogicException( __CLASS__ . ' should never be unserialized' );
}
}

View File

@@ -115,23 +115,12 @@ class WP_HTML_Token {
}
}
/**
* Unserialize magic method.
*
* @since 6.9.0
*
* @param array $data Data to unserialize.
*/
public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
throw new \LogicException( __CLASS__ . ' should never be unserialized' );
}
/**
* Wakeup magic method.
*
* @since 6.4.2
*/
public function __wakeup() {
$this->__unserialize( array() );
throw new \LogicException( __CLASS__ . ' should never be unserialized' );
}
}

View File

@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.9-alpha-60803';
$wp_version = '6.9-alpha-60804';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.