public function createHandler($config)
{
if (!isset($config['token'])) {
throw new AcmeCliException('The Slack token (key "token") is required in the slack monitoring alert handler.');
}
if (!isset($config['channel'])) {
throw new AcmeCliException('The Slack channel (key "channel") is required in the slack monitoring alert handler.');
}
$config = array_merge(self::$defaults, $config);
$handler = new SlackHandler($config['token'], '#' . ltrim($config['channel'], '#'), $config['username'], true, null, Logger::DEBUG);
return new FingersCrossedHandler($handler, $config['level']);
}