Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
/*
4
 * This file is part of the Symfony package.
5
 *
6
 * (c) Fabien Potencier <fabien@symfony.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
 
12
namespace Symfony\Contracts\EventDispatcher;
13
 
14
use Psr\EventDispatcher\StoppableEventInterface;
15
 
16
/**
17
 * Event is the base class for classes containing event data.
18
 *
19
 * This class contains no event data. It is used by events that do not pass
20
 * state information to an event handler when an event is raised.
21
 *
22
 * You can call the method stopPropagation() to abort the execution of
23
 * further listeners in your event listener.
24
 *
25
 * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
26
 * @author Jonathan Wage <jonwage@gmail.com>
27
 * @author Roman Borschel <roman@code-factory.org>
28
 * @author Bernhard Schussek <bschussek@gmail.com>
29
 * @author Nicolas Grekas <p@tchwork.com>
30
 */
31
class Event implements StoppableEventInterface
32
{
33
    private bool $propagationStopped = false;
34
 
35
    public function isPropagationStopped(): bool
36
    {
37
        return $this->propagationStopped;
38
    }
39
 
40
    /**
41
     * Stops the propagation of the event to further event listeners.
42
     *
43
     * If multiple event listeners are connected to the same event, no
44
     * further event listener will be triggered once any trigger calls
45
     * stopPropagation().
46
     */
47
    public function stopPropagation(): void
48
    {
49
        $this->propagationStopped = true;
50
    }
51
}