1919class Event extends Base_Object {
2020 // Human friendly minimal context for full Mobilizon compatible ActivityPub events.
2121 const JSON_LD_CONTEXT = array (
22- 'https://schema.org/ ' , // The base context is schema.org, cause it is used a lot.
23- 'https://www.w3.org/ns/activitystreams ' , // The ActivityStreams context overrides everyting also defined in schema.org.
22+ 'https://schema.org/ ' , // The base context is schema.org, because it is used a lot.
23+ 'https://www.w3.org/ns/activitystreams ' , // The ActivityStreams context overrides everything also defined in schema.org.
2424 array ( // The keys here override/extend the context even more.
2525 'pt ' => 'https://joinpeertube.org/ns# ' ,
2626 'mz ' => 'https://joinmobilizon.org/ns# ' ,
@@ -59,7 +59,7 @@ class Event extends Base_Object {
5959 /**
6060 * Mobilizon compatible values for joinModeTypes.
6161 */
62- const JOIN_MODE_TYPES = array ( 'free ' , 'restricted ' , 'external ' ); // and 'invite', but not used by mobilizon atm
62+ const JOIN_MODE_TYPES = array ( 'free ' , 'restricted ' , 'external ' ); // and 'invite', but not used by mobilizon atm.
6363
6464 /**
6565 * Allowed values for ical VEVENT STATUS.
@@ -109,8 +109,7 @@ class Event extends Base_Object {
109109 );
110110
111111 /**
112- * Event is an implementation of one of the
113- * Activity Streams
112+ * Event is an implementation of one of the Activity Streams.
114113 *
115114 * @var string
116115 */
@@ -124,7 +123,7 @@ class Event extends Base_Object {
124123 protected $ name ;
125124
126125 /**
127- * The events contacts
126+ * The events contacts.
128127 *
129128 * @context {
130129 * '@id' => 'mz:contacts',
@@ -200,7 +199,7 @@ class Event extends Base_Object {
200199 * The event's status.
201200 *
202201 * @context https://www.w3.org/2002/12/cal/ical#status
203- * @var enum
202+ * @var string
204203 */
205204 protected $ status ;
206205
@@ -263,6 +262,7 @@ class Event extends Base_Object {
263262 * The passed timezone is only set when it is a valid one, otherwise the site's timezone is used.
264263 *
265264 * @param string $timezone The timezone string to be set, e.g. 'Europe/Berlin'.
265+ * @return Event
266266 */
267267 public function set_timezone ( $ timezone ) {
268268 if ( in_array ( $ timezone , timezone_identifiers_list (), true ) ) {
@@ -275,9 +275,11 @@ public function set_timezone( $timezone ) {
275275 }
276276
277277 /**
278- * Custom setter for repliesModerationOption which also directy sets commentsEnabled accordingly.
278+ * Custom setter for repliesModerationOption which also directly sets commentsEnabled accordingly.
279+ *
280+ * @param string $type The type of the replies moderation option.
279281 *
280- * @param string $type
282+ * @return Event
281283 */
282284 public function set_replies_moderation_option ( $ type ) {
283285 if ( in_array ( $ type , self ::REPLIES_MODERATION_OPTION_TYPES , true ) ) {
@@ -297,7 +299,9 @@ public function set_replies_moderation_option( $type ) {
297299 /**
298300 * Custom setter for commentsEnabled which also directly sets repliesModerationOption accordingly.
299301 *
300- * @param bool $comments_enabled
302+ * @param bool $comments_enabled Whether comments are enabled.
303+ *
304+ * @return Event
301305 */
302306 public function set_comments_enabled ( $ comments_enabled ) {
303307 if ( is_bool ( $ comments_enabled ) ) {
@@ -317,7 +321,9 @@ public function set_comments_enabled( $comments_enabled ) {
317321 /**
318322 * Custom setter for the ical status that checks whether the status is an ical event status.
319323 *
320- * @param string $status
324+ * @param string $status The status of the event.
325+ *
326+ * @return Event
321327 */
322328 public function set_status ( $ status ) {
323329 if ( in_array ( $ status , self ::ICAL_EVENT_STATUS_TYPES , true ) ) {
@@ -338,8 +344,10 @@ public function set_status( $status ) {
338344 *
339345 * Falls back to Mobilizons default category.
340346 *
341- * @param string $category
342- * @param bool $mobilizon_compatibilty Whether the category must be compatibly with Mobilizon.
347+ * @param string $category The category of the event.
348+ * @param bool $mobilizon_compatibilty Optional. Whether the category must be compatibly with Mobilizon. Default true.
349+ *
350+ * @return Event
343351 */
344352 public function set_category ( $ category , $ mobilizon_compatibilty = true ) {
345353 if ( $ mobilizon_compatibilty ) {
@@ -356,7 +364,9 @@ public function set_category( $category, $mobilizon_compatibilty = true ) {
356364 *
357365 * Automatically sets the joinMode to true if called.
358366 *
359- * @param string $url
367+ * @param string $url The URL for external participation.
368+ *
369+ * @return Event
360370 */
361371 public function set_external_participation_url ( $ url ) {
362372 if ( preg_match ( '/^https?:\/\/.*/i ' , $ url ) ) {
0 commit comments