add fixed export
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Marko
2023-11-14 10:14:28 +01:00
parent 8554cf714d
commit dd8faaea95
4 changed files with 87 additions and 127 deletions

View File

@@ -4,10 +4,8 @@ namespace App\EventSubscriber;
use ApiPlatform\Symfony\EventListener\EventPriorities;
use App\Entity\Order;
use App\Helper\Hiltes;
use App\Helper\Slack;
use Maknz\Slack\Client;
use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\ViewEvent;
@@ -19,17 +17,11 @@ class SlackNotifySubscriber implements EventSubscriberInterface
/**
* @var Slack
*/
public $logger;
private $slackWebhookUrl;
private $hiltes;
public function __construct(string $slackWebhookUrl, LoggerInterface $logger, Hiltes $hiltes)
public function __construct(string $slackWebhookUrl)
{
$this->slackWebhookUrl = $slackWebhookUrl;
$this->logger = $logger;
$this->hiltes = $hiltes;
}
public static function getSubscribedEvents(): array
@@ -75,11 +67,6 @@ class SlackNotifySubscriber implements EventSubscriberInterface
if ($order->getStatus() == 1) {
$slack->from('CDS-Notify')
->send($msg);
} elseif ($order->getStatus() == 2) {
//Send to Hiltes
$this->hiltes->createRequest($order);
} else {
$this->logger->error('Status ist nicht 1 oder 2');
}
}
}