Verzeichnisstruktur phpBB-3.2.0
- Veröffentlicht
- 06.01.2017
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
WrappedListener.php
01 <?php
02
03 /*
04 * This file is part of the Symfony package.
05 *
06 * (c) Fabien Potencier <fabien@symfony.com>
07 *
08 * For the full copyright and license information, please view the LICENSE
09 * file that was distributed with this source code.
10 */
11
12 namespace Symfony\Component\EventDispatcher\Debug;
13
14 use Symfony\Component\Stopwatch\Stopwatch;
15 use Symfony\Component\EventDispatcher\Event;
16 use Symfony\Component\EventDispatcher\EventDispatcherInterface;
17
18 /**
19 * @author Fabien Potencier <fabien@symfony.com>
20 */
21 class WrappedListener
22 {
23 private $listener;
24 private $name;
25 private $called;
26 private $stoppedPropagation;
27 private $stopwatch;
28 private $dispatcher;
29
30 public function __construct($listener, $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null)
31 {
32 $this->listener = $listener;
33 $this->name = $name;
34 $this->stopwatch = $stopwatch;
35 $this->dispatcher = $dispatcher;
36 $this->called = false;
37 $this->stoppedPropagation = false;
38 }
39
40 public function getWrappedListener()
41 {
42 return $this->listener;
43 }
44
45 public function wasCalled()
46 {
47 return $this->called;
48 }
49
50 public function stoppedPropagation()
51 {
52 return $this->stoppedPropagation;
53 }
54
55 public function __invoke(Event $event, $eventName, EventDispatcherInterface $dispatcher)
56 {
57 $this->called = true;
58
59 $e = $this->stopwatch->start($this->name, 'event_listener');
60
61 call_user_func($this->listener, $event, $eventName, $this->dispatcher ?: $dispatcher);
62
63 if ($e->isStarted()) {
64 $e->stop();
65 }
66
67 if ($event->isPropagationStopped()) {
68 $this->stoppedPropagation = true;
69 }
70 }
71 }
72