Skip to content

Commit 4dce339

Browse files
committed
Code Modernization: Revert [60796]. This change needs some more work before it's fully ready.
See #63962 git-svn-id: https://develop.svn.wordpress.org/trunk@60804 602fd350-edb4-49c9-b593-d223f7449a82
1 parent bbc90ae commit 4dce339

7 files changed

+9
-98
lines changed

src/wp-includes/class-wp-block-bindings-registry.php

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -257,13 +257,11 @@ public function is_registered( $source_name ) {
257257
}
258258

259259
/**
260-
* Unserialize magic method.
261-
*
262-
* @since 6.9.0
260+
* Wakeup magic method.
263261
*
264-
* @param array $data Data to unserialize.
262+
* @since 6.5.0
265263
*/
266-
public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
264+
public function __wakeup() {
267265
if ( ! $this->sources ) {
268266
return;
269267
}
@@ -277,15 +275,6 @@ public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.Functi
277275
}
278276
}
279277

280-
/**
281-
* Wakeup magic method.
282-
*
283-
* @since 6.5.0
284-
*/
285-
public function __wakeup() {
286-
$this->__unserialize( array() );
287-
}
288-
289278
/**
290279
* Utility method to retrieve the main instance of the class.
291280
*

src/wp-includes/class-wp-block-bindings-source.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,23 +98,12 @@ public function get_value( array $source_args, $block_instance, string $attribut
9898
return apply_filters( 'block_bindings_source_value', $value, $this->name, $source_args, $block_instance, $attribute_name );
9999
}
100100

101-
/**
102-
* Unserialize magic method.
103-
*
104-
* @since 6.9.0
105-
*
106-
* @param array $data Data to unserialize.
107-
*/
108-
public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
109-
throw new \LogicException( __CLASS__ . ' should never be unserialized' );
110-
}
111-
112101
/**
113102
* Wakeup magic method.
114103
*
115104
* @since 6.5.0
116105
*/
117106
public function __wakeup() {
118-
$this->__unserialize( array() );
107+
throw new \LogicException( __CLASS__ . ' should never be unserialized' );
119108
}
120109
}

src/wp-includes/class-wp-block-patterns-registry.php

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,7 @@ public function is_registered( $pattern_name ) {
245245
return isset( $this->registered_patterns[ $pattern_name ] );
246246
}
247247

248-
/**
249-
* Unserialize magic method.
250-
*
251-
* @since 6.9.0
252-
*
253-
* @param array $data Data to unserialize.
254-
*/
255-
public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
248+
public function __wakeup() {
256249
if ( ! $this->registered_patterns ) {
257250
return;
258251
}
@@ -267,15 +260,6 @@ public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.Functi
267260
$this->registered_patterns_outside_init = array();
268261
}
269262

270-
/**
271-
* Wakeup magic method.
272-
*
273-
* @since 6.4.0
274-
*/
275-
public function __wakeup() {
276-
$this->__unserialize( array() );
277-
}
278-
279263
/**
280264
* Utility method to retrieve the main instance of the class.
281265
*

src/wp-includes/class-wp-block-type-registry.php

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,7 @@ public function is_registered( $name ) {
168168
return isset( $this->registered_block_types[ $name ] );
169169
}
170170

171-
/**
172-
* Unserialize magic method.
173-
*
174-
* @since 6.9.0
175-
*
176-
* @param array $data Data to unserialize.
177-
*/
178-
public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
171+
public function __wakeup() {
179172
if ( ! $this->registered_block_types ) {
180173
return;
181174
}
@@ -189,15 +182,6 @@ public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.Functi
189182
}
190183
}
191184

192-
/**
193-
* Wakeup magic method.
194-
*
195-
* @since 6.4.0
196-
*/
197-
public function __wakeup() {
198-
$this->__unserialize( array() );
199-
}
200-
201185
/**
202186
* Utility method to retrieve the main instance of the class.
203187
*

src/wp-includes/class-wp-theme.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -783,12 +783,8 @@ public function parent() {
783783
* Perform reinitialization tasks.
784784
*
785785
* Prevents a callback from being injected during unserialization of an object.
786-
*
787-
* @since 6.9.0
788-
*
789-
* @param array $data Data to unserialize.
790786
*/
791-
public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
787+
public function __wakeup() {
792788
if ( $this->parent && ! $this->parent instanceof self ) {
793789
throw new UnexpectedValueException();
794790
}
@@ -803,15 +799,6 @@ public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.Functi
803799
$this->headers_sanitized = array();
804800
}
805801

806-
/**
807-
* Wakeup magic method.
808-
*
809-
* @since 6.4.0
810-
*/
811-
public function __wakeup() {
812-
$this->__unserialize( array() );
813-
}
814-
815802
/**
816803
* Adds theme data to cache.
817804
*

src/wp-includes/html-api/class-wp-html-open-elements.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -841,23 +841,12 @@ public function clear_to_table_row_context(): void {
841841
}
842842
}
843843

844-
/**
845-
* Unserialize magic method.
846-
*
847-
* @since 6.9.0
848-
*
849-
* @param array $data Data to unserialize.
850-
*/
851-
public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
852-
throw new \LogicException( __CLASS__ . ' should never be unserialized' );
853-
}
854-
855844
/**
856845
* Wakeup magic method.
857846
*
858847
* @since 6.6.0
859848
*/
860849
public function __wakeup() {
861-
$this->__unserialize( array() );
850+
throw new \LogicException( __CLASS__ . ' should never be unserialized' );
862851
}
863852
}

src/wp-includes/html-api/class-wp-html-token.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -115,23 +115,12 @@ public function __destruct() {
115115
}
116116
}
117117

118-
/**
119-
* Unserialize magic method.
120-
*
121-
* @since 6.9.0
122-
*
123-
* @param array $data Data to unserialize.
124-
*/
125-
public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
126-
throw new \LogicException( __CLASS__ . ' should never be unserialized' );
127-
}
128-
129118
/**
130119
* Wakeup magic method.
131120
*
132121
* @since 6.4.2
133122
*/
134123
public function __wakeup() {
135-
$this->__unserialize( array() );
124+
throw new \LogicException( __CLASS__ . ' should never be unserialized' );
136125
}
137126
}

0 commit comments

Comments
 (0)