This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user