-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathPriorityChangedEvent.php
More file actions
51 lines (45 loc) · 1.26 KB
/
PriorityChangedEvent.php
File metadata and controls
51 lines (45 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* This file is part of graze/parallel-process.
*
* Copyright © 2018 Nature Delivered Ltd. <https://www.graze.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license https://github.com/graze/parallel-process/blob/master/LICENSE.md
* @link https://github.com/graze/parallel-process
*/
namespace Graze\ParallelProcess\Event;
use Graze\ParallelProcess\PrioritisedInterface;
use Symfony\Contracts\EventDispatcher\Event;
class PriorityChangedEvent extends Event
{
const CHANGED = 'priority.changed';
/** @var PrioritisedInterface */
private $item;
/** @var float */
private $priority;
/** @var float|null */
private $oldPriority;
/**
* RunEvent constructor.
*
* @param PrioritisedInterface $item
* @param float $priority
* @param float|null $oldPriority
*/
public function __construct(PrioritisedInterface $item, $priority, $oldPriority = null)
{
$this->item = $item;
$this->priority = $priority;
$this->oldPriority = $oldPriority;
}
/**
* @return PrioritisedInterface
*/
public function getItem()
{
return $this->item;
}
}