for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Shieldon package.
*
* (c) Terry L. <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Shieldon\Firewall\Panel\Sandbox;
use Shieldon\Messenger as Messenger;
/**
* The sandbox for Slack Webhook.
class SlackWebhook
{
* Invoker.
* @param array $args
* @return bool
public function __invoke(array $args): bool
return $this->sandbox($args[0], $args[1]);
}
* Test Slack Webhook.
* @param array $getParams The GET params passed from tryMessenger method.
* @param array $message The message title and body.
private function sandbox($getParams, $message)
$webhookUrl = $getParams['webhookUrl'] ?? '';
if (!empty($webhookUrl)) {
$messenger = new Messenger\SlackWebhook($webhookUrl);
if ($messenger->send($message['body'])) {
return true;
return false;