mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
fix cs
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Notification\EventListener;
|
||||
|
||||
use Chill\MainBundle\Notification\NotificationPersisterInterface;
|
||||
@@ -9,7 +18,6 @@ use Symfony\Component\HttpKernel\Event\TerminateEvent;
|
||||
|
||||
class PersistNotificationOnTerminateEventSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
|
||||
private EntityManagerInterface $em;
|
||||
|
||||
private NotificationPersisterInterface $persister;
|
||||
@@ -25,7 +33,7 @@ class PersistNotificationOnTerminateEventSubscriber implements EventSubscriberIn
|
||||
return [
|
||||
'kernel.terminate' => [
|
||||
['onKernelTerminate', 1024], // we must ensure that the priority is before sending email
|
||||
]
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Notification;
|
||||
|
||||
use Chill\MainBundle\Entity\Notification;
|
||||
@@ -8,11 +17,6 @@ class NotificationPersister implements NotificationPersisterInterface
|
||||
{
|
||||
private array $waitingNotifications = [];
|
||||
|
||||
public function persist(Notification $notification): void
|
||||
{
|
||||
$this->waitingNotifications[] = $notification;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array|Notification[]
|
||||
*/
|
||||
@@ -20,4 +24,9 @@ class NotificationPersister implements NotificationPersisterInterface
|
||||
{
|
||||
return $this->waitingNotifications;
|
||||
}
|
||||
|
||||
public function persist(Notification $notification): void
|
||||
{
|
||||
$this->waitingNotifications[] = $notification;
|
||||
}
|
||||
}
|
||||
|
@@ -1,11 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Notification;
|
||||
|
||||
use Chill\MainBundle\Entity\Notification;
|
||||
|
||||
/**
|
||||
* Store the notification
|
||||
* Store the notification.
|
||||
*
|
||||
* Those notification will be stored into database by the kernel. This
|
||||
* will also ensure that this happens outside of regular operations
|
||||
@@ -13,10 +22,10 @@ use Chill\MainBundle\Entity\Notification;
|
||||
*/
|
||||
interface NotificationPersisterInterface
|
||||
{
|
||||
public function persist(Notification $notification): void;
|
||||
|
||||
/**
|
||||
* @return array|Notification[]
|
||||
*/
|
||||
public function getWaitingNotifications(): array;
|
||||
|
||||
public function persist(Notification $notification): void;
|
||||
}
|
||||
|
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Notification\EventListener;
|
||||
|
||||
use Chill\MainBundle\Entity\Notification;
|
||||
@@ -11,7 +20,11 @@ use Prophecy\Argument;
|
||||
use Prophecy\PhpUnit\ProphecyTrait;
|
||||
use Symfony\Component\HttpKernel\Event\TerminateEvent;
|
||||
|
||||
class PersistNotificationOnTerminateEventSubscriberTest extends TestCase
|
||||
/**
|
||||
* @internal
|
||||
* @coversNothing
|
||||
*/
|
||||
final class PersistNotificationOnTerminateEventSubscriberTest extends TestCase
|
||||
{
|
||||
use ProphecyTrait;
|
||||
|
||||
|
Reference in New Issue
Block a user