Total Complexity | 2 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 5 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class EventArgs |
||
15 | { |
||
16 | /** |
||
17 | * Single instance of EventArgs. |
||
18 | * |
||
19 | * @var EventArgs |
||
20 | */ |
||
21 | private static $_emptyEventArgsInstance; |
||
22 | |||
23 | /** |
||
24 | * Gets the single, empty and immutable EventArgs instance. |
||
25 | * |
||
26 | * This instance will be used when events are dispatched without any parameter, |
||
27 | * like this: EventManager::dispatchEvent('eventname'); |
||
28 | * |
||
29 | * The benefit from this is that only one empty instance is instantiated and shared |
||
30 | * (otherwise there would be instances for every dispatched in the abovementioned form). |
||
31 | * |
||
32 | * @link https://msdn.microsoft.com/en-us/library/system.eventargs.aspx |
||
33 | * @see EventManager::dispatchEvent |
||
34 | * |
||
35 | * @return EventArgs |
||
36 | */ |
||
37 | 1 | public static function getEmptyInstance() |
|
46 |