PluginProbe
ActivityPub / 7.7.0
ActivityPub v7.7.0
9.3.1 9.3.0 9.2.2 9.2.1 9.2.0 9.1.0 9.0.2 9.0.1 9.0.0 8.3.0 8.2.1 8.2.0 8.1.1 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.3.0 2.0.0 2.0.1 2.1.0 2.1.1 All 160 releases
← All changes | includes/activity/class-base-object.php +46 -76 9.2.07.7.0 View file →
@@ -8,10 +8,8 @@
8 8 */
9 9
10 10 namespace Activitypub\Activity;
11 11
12 -use Activitypub\Activity\Extended_Object\Place;
13 -
14 12 /**
15 13 * Base_Object is an implementation of one of the
16 14 * Activity Streams Core Types.
17 15 *
@@ -22,51 +20,49 @@
22 20 * 'Base_' for this reason.
23 21 *
24 22 * @see https://www.w3.org/TR/activitystreams-core/#object
25 23 *
26 - * @method array|string|null get_attachment() Gets the attachment property of the object.
27 - * @method array|string|null get_attributed_to() Gets the entity attributed as the original author.
28 - * @method string|null get_audience() Gets the total population of entities for which the object can be considered relevant.
29 - * @method string[]|string|null get_bcc() Gets the private secondary audience of the object.
30 - * @method string[]|string|null get_bto() Gets the private primary audience of the object.
31 - * @method string[]|string|null get_cc() Gets the secondary recipients of the object.
32 - * @method string|null get_content() Gets the content property of the object.
33 - * @method string[]|null get_content_map() Gets the content map property of the object.
34 - * @method string|null get_context() Gets the context within which the object exists.
35 - * @method array|null get_dcterms() Gets the Dublin Core terms property of the object.
36 - * @method string|null get_duration() Gets the duration property of time-bound resources.
37 - * @method string|null get_end_time() Gets the date and time describing the ending time of the object.
38 - * @method string|null get_generator() Gets the entity that generated the object.
39 - * @method string[]|null get_icon() Gets the icon property of the object.
40 - * @method string|null get_id() Gets the object's unique global identifier.
41 - * @method string[]|null get_image() Gets the image property of the object.
42 - * @method string[]|string|null get_in_reply_to() Gets the objects this object is in reply to.
43 - * @method array|null get_interaction_policy() Gets the interaction policy property of the object.
44 - * @method array|null get_likes() Gets the collection of likes for this object.
45 - * @method array|string|null|Place get_location() Gets the physical or logical locations associated with the object.
46 - * @method string|null get_media_type() Gets the MIME media type of the content property.
47 - * @method string|null get_name() Gets the natural language name of the object.
48 - * @method string[]|null get_name_map() Gets the name map property of the object.
49 - * @method string|null get_preview() Gets the entity that provides a preview of this object.
50 - * @method string|null get_published() Gets the date and time the object was published in ISO 8601 format.
51 - * @method string|null get_quote() Gets the quote property of the object (FEP-044f).
52 - * @method string|null get_quote_url() Gets the quoteUrl property of the object.
53 - * @method string|null get_quote_uri() Gets the quoteUri property of the object.
54 - * @method string|null get__misskey_quote() Gets the _misskey_quote property of the object.
55 - * @method string|array|null get_replies() Gets the collection of responses to this object.
56 - * @method bool|null get_sensitive() Gets the sensitive property of the object.
57 - * @method array|null get_shares() Gets the collection of shares for this object.
58 - * @method array|null get_source() Gets the source property indicating content markup derivation.
59 - * @method string|null get_start_time() Gets the date and time describing the starting time of the object.
60 - * @method string|null get_summary() Gets the natural language summary of the object.
61 - * @method string[]|null get_summary_map() Gets the summary map property of the object.
62 - * @method array[]|null get_tag() Gets the tag property of the object.
63 - * @method string[]|string|null get_to() Gets the primary recipients of the object.
64 - * @method string get_type() Gets the type of the object.
65 - * @method string|null get_updated() Gets the date and time the object was updated in ISO 8601 format.
66 - * @method string|null get_url() Gets the URL of the object.
67 - * @method string|null get_former_type() Gets the former type of a Tombstone object.
68 - * @method string|null get_deleted() Gets the date and time the object was deleted in ISO 8601 format.
24 + * @method array|string|null get_attachment() Gets the attachment property of the object.
25 + * @method array|string|null get_attributed_to() Gets the entity attributed as the original author.
26 + * @method string|null get_audience() Gets the total population of entities for which the object can be considered relevant.
27 + * @method string[]|string|null get_bcc() Gets the private secondary audience of the object.
28 + * @method string[]|string|null get_bto() Gets the private primary audience of the object.
29 + * @method string[]|string|null get_cc() Gets the secondary recipients of the object.
30 + * @method string|null get_content() Gets the content property of the object.
31 + * @method string[]|null get_content_map() Gets the content map property of the object.
32 + * @method string|null get_context() Gets the context within which the object exists.
33 + * @method array|null get_dcterms() Gets the Dublin Core terms property of the object.
34 + * @method string|null get_duration() Gets the duration property of time-bound resources.
35 + * @method string|null get_end_time() Gets the date and time describing the ending time of the object.
36 + * @method string|null get_generator() Gets the entity that generated the object.
37 + * @method string[]|null get_icon() Gets the icon property of the object.
38 + * @method string|null get_id() Gets the object's unique global identifier.
39 + * @method string[]|null get_image() Gets the image property of the object.
40 + * @method string[]|string|null get_in_reply_to() Gets the objects this object is in reply to.
41 + * @method array|null get_interaction_policy() Gets the interaction policy property of the object.
42 + * @method array|null get_likes() Gets the collection of likes for this object.
43 + * @method array|string|null get_location() Gets the physical or logical locations associated with the object.
44 + * @method string|null get_media_type() Gets the MIME media type of the content property.
45 + * @method string|null get_name() Gets the natural language name of the object.
46 + * @method string[]|null get_name_map() Gets the name map property of the object.
47 + * @method string|null get_preview() Gets the entity that provides a preview of this object.
48 + * @method string|null get_published() Gets the date and time the object was published in ISO 8601 format.
49 + * @method string|null get_quote() Gets the quote property of the object (FEP-044f).
50 + * @method string|null get_quote_url() Gets the quoteUrl property of the object.
51 + * @method string|null get_quote_uri() Gets the quoteUri property of the object.
52 + * @method string|null get__misskey_quote() Gets the _misskey_quote property of the object.
53 + * @method string|array|null get_replies() Gets the collection of responses to this object.
54 + * @method bool|null get_sensitive() Gets the sensitive property of the object.
55 + * @method array|null get_shares() Gets the collection of shares for this object.
56 + * @method array|null get_source() Gets the source property indicating content markup derivation.
57 + * @method string|null get_start_time() Gets the date and time describing the starting time of the object.
58 + * @method string|null get_summary() Gets the natural language summary of the object.
59 + * @method string[]|null get_summary_map() Gets the summary map property of the object.
60 + * @method array[]|null get_tag() Gets the tag property of the object.
61 + * @method string[]|string|null get_to() Gets the primary recipients of the object.
62 + * @method string get_type() Gets the type of the object.
63 + * @method string|null get_updated() Gets the date and time the object was updated in ISO 8601 format.
64 + * @method string|null get_url() Gets the URL of the object.
69 65 *
70 66 * @method string|string[] add_cc( string|array $cc ) Adds one or more entities to the secondary audience of the object.
71 67 * @method string|string[] add_to( string|array $to ) Adds one or more entities to the primary audience of the object.
72 68 *
@@ -88,9 +84,9 @@
88 84 * @method Base_Object set_image( array $image ) Sets the image property of the object.
89 85 * @method Base_Object set_in_reply_to( string|string[] $in_reply_to ) Sets the is in reply to property of the object.
90 86 * @method Base_Object set_interaction_policy( array|null $policy ) Sets the interaction policy property of the object.
91 87 * @method Base_Object set_likes( array $likes ) Sets the collection of likes for this object.
92 - * @method Base_Object set_location( array|string|Place $location ) Sets the physical or logical locations associated with the object.
88 + * @method Base_Object set_location( array|string $location ) Sets the physical or logical locations associated with the object.
93 89 * @method Base_Object set_media_type( string $media_type ) Sets the MIME media type of the content property.
94 90 * @method Base_Object set_name( string $name ) Sets the natural language name of the object.
95 91 * @method Base_Object set_name_map( array|null $name_map ) Sets the name map property of the object.
96 92 * @method Base_Object set_preview( string $preview ) Sets the entity that provides a preview of this object.
@@ -110,10 +106,8 @@
110 106 * @method Base_Object set_to( string|string[] $to ) Sets the primary recipients of the object.
111 107 * @method Base_Object set_type( string $type ) Sets the type of the object.
112 108 * @method Base_Object set_updated( string $updated ) Sets the date and time the object was updated in ISO 8601 format.
113 109 * @method Base_Object set_url( string $url ) Sets the URL of the object.
114 - * @method Base_Object set_former_type( string $former_type ) Sets the former type of a Tombstone object.
115 - * @method Base_Object set_deleted( string $deleted ) Sets the date and time the object was deleted in ISO 8601 format.
116 110 */
117 111 class Base_Object extends Generic_Object {
118 112 /**
119 113 * The JSON-LD context for the object.
@@ -126,11 +120,8 @@
126 120 'Hashtag' => 'as:Hashtag',
127 121 'sensitive' => 'as:sensitive',
128 122 'dcterms' => 'http://purl.org/dc/terms/',
129 123 'gts' => 'https://gotosocial.org/ns#',
130 - 'schema' => 'http://schema.org/',
131 - 'exifData' => 'schema:exifData',
132 - 'PropertyValue' => 'schema:PropertyValue',
133 124 'interactionPolicy' => array(
134 125 '@id' => 'gts:interactionPolicy',
135 126 '@type' => '@id',
136 127 ),
@@ -161,10 +152,8 @@
161 152 'always' => array(
162 153 '@id' => 'gts:always',
163 154 '@type' => '@id',
164 155 ),
165 - 'toot' => 'http://joinmastodon.org/ns#',
166 - 'blurhash' => 'toot:blurhash',
167 156 ),
168 157 );
169 158
170 159 /**
@@ -269,27 +258,8 @@
269 258 */
270 259 protected $content_map;
271 260
272 261 /**
273 - * The date and time at which the object was deleted.
274 - *
275 - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-deleted
276 - *
277 - * @var string|null
278 - */
279 - protected $deleted;
280 -
281 - /**
282 - * The former type of the object. Used in Tombstone objects to
283 - * indicate the type of the object prior to deletion.
284 - *
285 - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-formertype
286 - *
287 - * @var string|null
288 - */
289 - protected $former_type;
290 -
291 - /**
292 262 * A simple, human-readable, plain-text name for the object.
293 263 * HTML markup MUST NOT be included.
294 264 *
295 265 * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-name
@@ -365,9 +335,9 @@
365 335 * object.
366 336 *
367 337 * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-location
368 338 *
369 - * @var string|null|Place
339 + * @var string|null
370 340 */
371 341 protected $location;
372 342
373 343 /**
@@ -635,9 +605,9 @@
635 605 * @return mixed The value.
636 606 */
637 607 public function get( $key ) {
638 608 if ( ! $this->has( $key ) ) {
639 - return new \WP_Error( 'invalid_key', \__( 'Invalid key', 'activitypub' ), array( 'status' => 404 ) );
609 + return new \WP_Error( 'invalid_key', __( 'Invalid key', 'activitypub' ), array( 'status' => 404 ) );
640 610 }
641 611
642 612 return parent::get( $key );
643 613 }
@@ -651,9 +621,9 @@
651 621 * @return mixed The value.
652 622 */
653 623 public function set( $key, $value ) {
654 624 if ( ! $this->has( $key ) ) {
655 - return new \WP_Error( 'invalid_key', \__( 'Invalid key', 'activitypub' ), array( 'status' => 404 ) );
625 + return new \WP_Error( 'invalid_key', __( 'Invalid key', 'activitypub' ), array( 'status' => 404 ) );
656 626 }
657 627
658 628 return parent::set( $key, $value );
659 629 }
@@ -667,9 +637,9 @@
667 637 * @return mixed The value.
668 638 */
669 639 public function add( $key, $value ) {
670 640 if ( ! $this->has( $key ) ) {
671 - return new \WP_Error( 'invalid_key', \__( 'Invalid key', 'activitypub' ), array( 'status' => 404 ) );
641 + return new \WP_Error( 'invalid_key', __( 'Invalid key', 'activitypub' ), array( 'status' => 404 ) );
672 642 }
673 643
674 644 return parent::add( $key, $value );
675 645 }