diff --git a/src/Bundle/ChillTaskBundle/Event/AssignTaskEvent.php b/src/Bundle/ChillTaskBundle/Event/AssignTaskEvent.php index a7eca02f4..bf74c446e 100644 --- a/src/Bundle/ChillTaskBundle/Event/AssignTaskEvent.php +++ b/src/Bundle/ChillTaskBundle/Event/AssignTaskEvent.php @@ -18,6 +18,7 @@ use Symfony\Contracts\EventDispatcher\Event; class AssignTaskEvent extends Event { final public const PERSIST = 'chill_task.assign_task'; + public function __construct( private readonly SingleTask $task, private readonly ?User $initialAssignee, diff --git a/src/Bundle/ChillTaskBundle/Notification/AssignTaskNotificationFlagProvider.php b/src/Bundle/ChillTaskBundle/Notification/AssignTaskNotificationFlagProvider.php index 2be454840..63978913c 100644 --- a/src/Bundle/ChillTaskBundle/Notification/AssignTaskNotificationFlagProvider.php +++ b/src/Bundle/ChillTaskBundle/Notification/AssignTaskNotificationFlagProvider.php @@ -1,5 +1,14 @@ getPerson()]; } - public function getRelatedEntity(Notification $notification): object + public function getRelatedEntity(Notification $notification): ?object { return $this->taskRepository->find($notification->getRelatedEntityId()); } diff --git a/src/Bundle/ChillTaskBundle/Tests/EventSubscriber/TaskAssignEventSubscriberTest.php b/src/Bundle/ChillTaskBundle/Tests/EventSubscriber/TaskAssignEventSubscriberTest.php index 3cd3ff20f..2a820478c 100644 --- a/src/Bundle/ChillTaskBundle/Tests/EventSubscriber/TaskAssignEventSubscriberTest.php +++ b/src/Bundle/ChillTaskBundle/Tests/EventSubscriber/TaskAssignEventSubscriberTest.php @@ -2,6 +2,13 @@ declare(strict_types=1); +/* + * 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. + */ + namespace Chill\TaskBundle\Tests\EventSubscriber; use Chill\MainBundle\Entity\Notification; @@ -14,6 +21,11 @@ use Doctrine\ORM\EntityManagerInterface; use PHPUnit\Framework\TestCase; use Twig\Environment; +/** + * @internal + * + * @coversNothing + */ class TaskAssignEventSubscriberTest extends TestCase { private EntityManagerInterface $entityManager;