renamed $skip_next to $_skip_next
Some checks failed
PHP_CodeSniffer / phpcs (push) Failing after 4m11s
Unit Testing / phpunit (5.6, 6.2) (push) Failing after 4m56s
Unit Testing / phpunit (7.0) (push) Failing after 5m6s
Unit Testing / phpunit (7.2) (push) Failing after 5m8s
Unit Testing / phpunit (7.3) (push) Failing after 5m48s
Unit Testing / phpunit (7.4) (push) Failing after 5m47s
Unit Testing / phpunit (8.0) (push) Failing after 5m33s
Unit Testing / phpunit (8.1) (push) Failing after 5m46s
Unit Testing / phpunit (8.2) (push) Failing after 5m38s
Unit Testing / phpunit (latest) (push) Failing after 5m22s

This commit is contained in:
ruru4143 2023-12-11 19:44:44 +01:00
parent 25ecff16e7
commit 6cbe66d121

View file

@ -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;
}