Passed
Push — master ( 4d2055...b2dedb )
by Roeland
24:06 queued 11:47
created
lib/private/EventDispatcher/EventDispatcher.php 1 patch
Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -41,68 +41,68 @@
 block discarded – undo
41 41
 
42 42
 class EventDispatcher implements IEventDispatcher {
43 43
 
44
-	/** @var SymfonyDispatcher */
45
-	private $dispatcher;
46
-
47
-	/** @var IContainer */
48
-	private $container;
49
-
50
-	/** @var LoggerInterface */
51
-	private $logger;
52
-
53
-	public function __construct(SymfonyDispatcher $dispatcher,
54
-								IServerContainer $container,
55
-								LoggerInterface $logger) {
56
-		$this->dispatcher = $dispatcher;
57
-		$this->container = $container;
58
-		$this->logger = $logger;
59
-	}
60
-
61
-	public function addListener(string $eventName,
62
-								callable $listener,
63
-								int $priority = 0): void {
64
-		$this->dispatcher->addListener($eventName, $listener, $priority);
65
-	}
66
-
67
-	public function removeListener(string $eventName,
68
-								   callable $listener): void {
69
-		$this->dispatcher->removeListener($eventName, $listener);
70
-	}
71
-
72
-	public function addServiceListener(string $eventName,
73
-									   string $className,
74
-									   int $priority = 0): void {
75
-		$listener = new ServiceEventListener(
76
-			$this->container,
77
-			$className,
78
-			$this->logger
79
-		);
80
-
81
-		$this->addListener($eventName, $listener, $priority);
82
-	}
83
-
84
-	public function dispatch(string $eventName,
85
-							 Event $event): void {
86
-		$this->dispatcher->dispatch($event, $eventName);
87
-
88
-		if ($event instanceof ABroadcastedEvent && !$event->isPropagationStopped()) {
89
-			// Propagate broadcast
90
-			$this->dispatch(
91
-				IBroadcastEvent::class,
92
-				new BroadcastEvent($event)
93
-			);
94
-		}
95
-	}
96
-
97
-	public function dispatchTyped(Event $event): void {
98
-		$this->dispatch(get_class($event), $event);
99
-	}
100
-
101
-	/**
102
-	 * @return SymfonyDispatcher
103
-	 * @deprecated 20.0.0
104
-	 */
105
-	public function getSymfonyDispatcher(): SymfonyDispatcher {
106
-		return $this->dispatcher;
107
-	}
44
+    /** @var SymfonyDispatcher */
45
+    private $dispatcher;
46
+
47
+    /** @var IContainer */
48
+    private $container;
49
+
50
+    /** @var LoggerInterface */
51
+    private $logger;
52
+
53
+    public function __construct(SymfonyDispatcher $dispatcher,
54
+                                IServerContainer $container,
55
+                                LoggerInterface $logger) {
56
+        $this->dispatcher = $dispatcher;
57
+        $this->container = $container;
58
+        $this->logger = $logger;
59
+    }
60
+
61
+    public function addListener(string $eventName,
62
+                                callable $listener,
63
+                                int $priority = 0): void {
64
+        $this->dispatcher->addListener($eventName, $listener, $priority);
65
+    }
66
+
67
+    public function removeListener(string $eventName,
68
+                                    callable $listener): void {
69
+        $this->dispatcher->removeListener($eventName, $listener);
70
+    }
71
+
72
+    public function addServiceListener(string $eventName,
73
+                                        string $className,
74
+                                        int $priority = 0): void {
75
+        $listener = new ServiceEventListener(
76
+            $this->container,
77
+            $className,
78
+            $this->logger
79
+        );
80
+
81
+        $this->addListener($eventName, $listener, $priority);
82
+    }
83
+
84
+    public function dispatch(string $eventName,
85
+                                Event $event): void {
86
+        $this->dispatcher->dispatch($event, $eventName);
87
+
88
+        if ($event instanceof ABroadcastedEvent && !$event->isPropagationStopped()) {
89
+            // Propagate broadcast
90
+            $this->dispatch(
91
+                IBroadcastEvent::class,
92
+                new BroadcastEvent($event)
93
+            );
94
+        }
95
+    }
96
+
97
+    public function dispatchTyped(Event $event): void {
98
+        $this->dispatch(get_class($event), $event);
99
+    }
100
+
101
+    /**
102
+     * @return SymfonyDispatcher
103
+     * @deprecated 20.0.0
104
+     */
105
+    public function getSymfonyDispatcher(): SymfonyDispatcher {
106
+        return $this->dispatcher;
107
+    }
108 108
 }
Please login to merge, or discard this patch.
lib/private/EventDispatcher/ServiceEventListener.php 2 patches
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -40,38 +40,38 @@
 block discarded – undo
40 40
  */
41 41
 final class ServiceEventListener {
42 42
 
43
-	/** @var IContainer */
44
-	private $container;
43
+    /** @var IContainer */
44
+    private $container;
45 45
 
46
-	/** @var string */
47
-	private $class;
46
+    /** @var string */
47
+    private $class;
48 48
 
49
-	/** @var LoggerInterface */
50
-	private $logger;
49
+    /** @var LoggerInterface */
50
+    private $logger;
51 51
 
52
-	/** @var null|IEventListener */
53
-	private $service;
52
+    /** @var null|IEventListener */
53
+    private $service;
54 54
 
55
-	public function __construct(IContainer $container,
56
-								string $class,
57
-								LoggerInterface $logger) {
58
-		$this->container = $container;
59
-		$this->class = $class;
60
-		$this->logger = $logger;
61
-	}
55
+    public function __construct(IContainer $container,
56
+                                string $class,
57
+                                LoggerInterface $logger) {
58
+        $this->container = $container;
59
+        $this->class = $class;
60
+        $this->logger = $logger;
61
+    }
62 62
 
63
-	public function __invoke(Event $event) {
64
-		if ($this->service === null) {
65
-			try {
66
-				$this->service = $this->container->query($this->class);
67
-			} catch (QueryException $e) {
68
-				$this->logger->error("Could not load event listener service " . $this->class, [
69
-					'exception' => $e,
70
-				]);
71
-				return;
72
-			}
73
-		}
63
+    public function __invoke(Event $event) {
64
+        if ($this->service === null) {
65
+            try {
66
+                $this->service = $this->container->query($this->class);
67
+            } catch (QueryException $e) {
68
+                $this->logger->error("Could not load event listener service " . $this->class, [
69
+                    'exception' => $e,
70
+                ]);
71
+                return;
72
+            }
73
+        }
74 74
 
75
-		$this->service->handle($event);
76
-	}
75
+        $this->service->handle($event);
76
+    }
77 77
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
 			try {
66 66
 				$this->service = $this->container->query($this->class);
67 67
 			} catch (QueryException $e) {
68
-				$this->logger->error("Could not load event listener service " . $this->class, [
68
+				$this->logger->error("Could not load event listener service ".$this->class, [
69 69
 					'exception' => $e,
70 70
 				]);
71 71
 				return;
Please login to merge, or discard this patch.