Skip to content

Commit

Permalink
refactor: deprecate webhook recipient
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubmikita committed Jun 28, 2024
1 parent 3772542 commit 2f0ff9d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@

declare(strict_types=1);

namespace BracketSpace\Notification\Repository\Recipient;
namespace BracketSpace\Notification\Defaults\Recipient;

use BracketSpace\Notification\Repository\Field;

/**
* Webhook recipient
*
* @deprecated [Next]
*/
class Webhook extends BaseRecipient
{
Expand All @@ -26,6 +28,8 @@ class Webhook extends BaseRecipient
*/
public function __construct($slug, $name)
{
notification_deprecated_class( __CLASS__, '[Next]' );

parent::__construct(
[
'slug' => $slug,
Expand Down
3 changes: 2 additions & 1 deletion src/Repository/RecipientRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
namespace BracketSpace\Notification\Repository;

use BracketSpace\Notification\Register;
use BracketSpace\Notification\Defaults\Recipient\Webhook;

/**
* Recipient Repository.
Expand Down Expand Up @@ -42,7 +43,7 @@ public static function register()
Register::recipient('email', new Recipient\Role());

foreach (self::$webhookRecipientTypes as $type => $name) {
$recipient = new Recipient\Webhook($type, $name);
$recipient = new Webhook($type, $name);

Register::recipient('webhook', $recipient);
Register::recipient('webhook_json', $recipient);
Expand Down
2 changes: 1 addition & 1 deletion src/Runtime.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function init()
$requirements = new Requirements(
__('Notification', 'notification'),
[
'php' => '7.0',
'php' => '7.4',
'php_extensions' => ['xml'],
'wp' => '5.3',
]
Expand Down

0 comments on commit 2f0ff9d

Please sign in to comment.