| @@ -1,17 +1,10 @@ | ||
| 1 | 1 | <?php |
| 2 | -/** | |
| 3 | - * Notification file. | |
| 4 | - * | |
| 5 | - * @package Activitypub | |
| 6 | - */ | |
| 7 | 2 | |
| 8 | 3 | namespace Activitypub; |
| 9 | 4 | |
| 10 | 5 | /** |
| 11 | 6 | * Notification class. |
| 12 | - * | |
| 13 | - * @deprecated 7.5.0 Use action hooks like 'activitypub_handled_{type}' instead. | |
| 14 | 7 | */ |
| 15 | 8 | class Notification { |
| 16 | 9 | /** |
| 17 | 10 | * The type of the notification. |
| @@ -43,19 +36,17 @@ | ||
| 43 | 36 | |
| 44 | 37 | /** |
| 45 | 38 | * Notification constructor. |
| 46 | 39 | * |
| 47 | - * @param string $type The type of the notification. | |
| 48 | - * @param string $actor The actor URL. | |
| 49 | - * @param array $activity The Activity object. | |
| 50 | - * @param int $target The WordPress User-Id. | |
| 40 | + * @param string $type The type of the notification. | |
| 41 | + * @param string $actor The actor URL. | |
| 42 | + * @param array $object The Activity object. | |
| 43 | + * @param int $target The WordPress User-Id. | |
| 51 | 44 | */ |
| 52 | - public function __construct( $type, $actor, $activity, $target ) { | |
| 53 | - \_deprecated_class( __CLASS__, '7.5.0', 'Use action hooks like "activitypub_handled_{type}" instead.' ); | |
| 54 | - | |
| 55 | - $this->type = $type; | |
| 56 | - $this->actor = $actor; | |
| 57 | - $this->object = $activity; | |
| 45 | + public function __construct( $type, $actor, $object, $target ) { // phpcs:ignore Universal.NamingConventions.NoReservedKeywordParameterNames.objectFound | |
| 46 | + $this->type = $type; | |
| 47 | + $this->actor = $actor; | |
| 48 | + $this->object = $object; | |
| 58 | 49 | $this->target = $target; |
| 59 | 50 | } |
| 60 | 51 | |
| 61 | 52 | /** |
| @@ -63,23 +54,8 @@ | ||
| 63 | 54 | */ |
| 64 | 55 | public function send() { |
| 65 | 56 | $type = \strtolower( $this->type ); |
| 66 | 57 | |
| 67 | - /** | |
| 68 | - * Action to send ActivityPub notifications. | |
| 69 | - * | |
| 70 | - * @deprecated 7.5.0 Use "activitypub_handled_{$type}" instead. | |
| 71 | - * | |
| 72 | - * @param Notification $instance The notification object. | |
| 73 | - */ | |
| 74 | - \do_action_deprecated( 'activitypub_notification', array( $this ), '7.5.0', "activitypub_handled_{$type}" ); | |
| 75 | - | |
| 76 | - /** | |
| 77 | - * Type-specific action to send ActivityPub notifications. | |
| 78 | - * | |
| 79 | - * @deprecated 7.5.0 Use "activitypub_handled_{$type}" instead. | |
| 80 | - * | |
| 81 | - * @param Notification $instance The notification object. | |
| 82 | - */ | |
| 83 | - \do_action_deprecated( "activitypub_notification_{$type}", array( $this ), '7.5.0', "activitypub_handled_{$type}" ); | |
| 58 | + do_action( 'activitypub_notification', $this ); | |
| 59 | + do_action( "activitypub_notification_{$type}", $this ); | |
| 84 | 60 | } |
| 85 | 61 | } |