Compare commits

..

2 commits

Author SHA1 Message Date
ee7612403c 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
2023-12-11 19:45:03 +01:00
25ecff16e7 adding todo's 2023-12-11 19:43:50 +01:00
2 changed files with 13 additions and 8 deletions

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

View file

@ -25,7 +25,7 @@ use function Activitypub\site_supports_blocks;
* *
* *
*/ */
abstract class Base { abstract class Base { // todo renmae to Base_tranformer
/** /**
* The WP_Post object. * The WP_Post object.
* *
@ -341,6 +341,8 @@ abstract class Base {
* @return string The User-URL. * @return string The User-URL.
*/ */
protected function get_attributed_to() { protected function get_attributed_to() {
// todo is this descriptive enough? what if for some people the event should be attributed to the venue?
// i would maybe prefer something like "get post author??"
if ( is_single_user() ) { // todo what is if this setting gets changed if ( is_single_user() ) { // todo what is if this setting gets changed
$user = new Blog_User(); $user = new Blog_User();
return $user->get_url(); return $user->get_url();
@ -691,7 +693,7 @@ abstract class Base {
*/ */
protected function get_basic_content_map() { protected function get_basic_content_map() {
return array( return array(
$this->get_locale() => $this->get_content(), $this->get_locale() => $this->get_content(), // todo is this a valid assumption?
); );
} }
} }