Files
archived-scheduler/Event/PostRunEvent.php
Christian Flothmann 2e70ee0f59 make newly added constructor argument optional
As the PostRunEvent class is already present in Symfony since 6.4 we cannot add
new mandatory constructor arguments without breaking backwards compatibility.
2025-02-08 13:14:06 +01:00

47 lines
1.0 KiB
PHP

<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Scheduler\Event;
use Symfony\Component\Scheduler\Generator\MessageContext;
use Symfony\Component\Scheduler\ScheduleProviderInterface;
class PostRunEvent
{
public function __construct(
private readonly ScheduleProviderInterface $schedule,
private readonly MessageContext $messageContext,
private readonly object $message,
private readonly mixed $result = null,
) {
}
public function getMessageContext(): MessageContext
{
return $this->messageContext;
}
public function getSchedule(): ScheduleProviderInterface
{
return $this->schedule;
}
public function getMessage(): object
{
return $this->message;
}
public function getResult(): mixed
{
return $this->result;
}
}