renamed $skip_next to $_skip_next
Some checks failed
Unit Testing / phpunit (7.0) (push) Waiting to run
Unit Testing / phpunit (7.2) (push) Waiting to run
Unit Testing / phpunit (7.3) (push) Waiting to run
Unit Testing / phpunit (7.4) (push) Waiting to run
Unit Testing / phpunit (8.0) (push) Waiting to run
Unit Testing / phpunit (8.1) (push) Waiting to run
Unit Testing / phpunit (8.2) (push) Waiting to run
Unit Testing / phpunit (latest) (push) Waiting to run
PHP_CodeSniffer / phpcs (push) Failing after 4m9s
Unit Testing / phpunit (5.6, 6.2) (push) Has been cancelled

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

View file

@ -26,6 +26,13 @@ use function Activitypub\snake_to_camel_case;
* @see https://www.w3.org/TR/activitystreams-core/#object * @see https://www.w3.org/TR/activitystreams-core/#object
*/ */
class Base_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 * 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 ) ); 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; return $this->$var;
} }
@ -526,8 +529,8 @@ class Base_Object {
return new WP_Error( 'invalid_key', __( 'Invalid key', 'activitypub' ), array( 'status' => 404 ) ); return new WP_Error( 'invalid_key', __( 'Invalid key', 'activitypub' ), array( 'status' => 404 ) );
} }
if ( $this->skip_next ) { if ( $this->_skip_next ) {
$this->skip_next = false; $this->_skip_next = false;
return $this; return $this;
} }