From 6cbe66d121695eafab9aa83807b3f62830c5148d Mon Sep 17 00:00:00 2001 From: ruru4143 Date: Mon, 11 Dec 2023 19:44:44 +0100 Subject: [PATCH] renamed $skip_next to $_skip_next --- includes/activity/class-base-object.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/includes/activity/class-base-object.php b/includes/activity/class-base-object.php index cd3fb63..15cf799 100644 --- a/includes/activity/class-base-object.php +++ b/includes/activity/class-base-object.php @@ -26,6 +26,13 @@ use function Activitypub\snake_to_camel_case; * @see https://www.w3.org/TR/activitystreams-core/#object */ class Base_Object { + /** + * if this is set, the next setter call doesn't change anything + * + * @var bool + */ + protected $_skip_next; + /** * The object's unique global identifier * @@ -453,10 +460,6 @@ class Base_Object { return new WP_Error( 'invalid_key', __( 'Invalid key', 'activitypub' ), array( 'status' => 404 ) ); } - if ( $var === 'skip_next' ) { - return; // skip_next should never be retrieved publicly - } - return $this->$var; } @@ -526,8 +529,8 @@ class Base_Object { return new WP_Error( 'invalid_key', __( 'Invalid key', 'activitypub' ), array( 'status' => 404 ) ); } - if ( $this->skip_next ) { - $this->skip_next = false; + if ( $this->_skip_next ) { + $this->_skip_next = false; return $this; } @@ -686,7 +689,7 @@ class Base_Object { } public function if( bool $b ) { - $this->skip_next = ! $b; + $this->_skip_next = ! $b; return $this; }