Passed
Push — develop ( a4f728...dbd9a2 )
by nguereza
13:02
created
src/SubscriberInterface.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,8 +50,7 @@
 block discarded – undo
50 50
  * @class SubscriberInterface
51 51
  * @package Platine\Event
52 52
  */
53
-interface SubscriberInterface
54
-{
53
+interface SubscriberInterface {
55 54
     /**
56 55
      * Return the array of event to subscribe in form of
57 56
      *
Please login to merge, or discard this patch.
src/Event.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -51,8 +51,7 @@  discard block
 block discarded – undo
51 51
  * @class Event
52 52
  * @package Platine\Event
53 53
  */
54
-class Event implements EventInterface
55
-{
54
+class Event implements EventInterface {
56 55
     /**
57 56
      * Whether the propagation is stopped.
58 57
      * @var boolean
@@ -64,8 +63,7 @@  discard block
 block discarded – undo
64 63
      * @param string $name the event name
65 64
      * @param array<string, mixed>  $arguments the event data
66 65
      */
67
-    public function __construct(protected string $name, protected array $arguments = [])
68
-    {
66
+    public function __construct(protected string $name, protected array $arguments = []) {
69 67
     }
70 68
 
71 69
     /**
Please login to merge, or discard this patch.
src/Exception/DispatcherException.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,6 +38,5 @@
 block discarded – undo
38 38
  * @class DispatcherException
39 39
  * @package Platine\Event\Exception
40 40
  */
41
-class DispatcherException extends Exception
42
-{
41
+class DispatcherException extends Exception {
43 42
 }
Please login to merge, or discard this patch.
src/DispatcherInterface.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      * @return EventInterface
81 81
      */
82 82
     public function dispatch(
83
-        string|EventInterface $eventName,
83
+        string | EventInterface $eventName,
84 84
         ?EventInterface $event = null
85 85
     ): EventInterface;
86 86
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      */
96 96
     public function addListener(
97 97
         string $eventName,
98
-        ListenerInterface|callable $listener,
98
+        ListenerInterface | callable $listener,
99 99
         int $priority = self::PRIORITY_DEFAULT
100 100
     ): void;
101 101
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      */
117 117
     public function removeListener(
118 118
         string $eventName,
119
-        ListenerInterface|callable $listener
119
+        ListenerInterface | callable $listener
120 120
     ): void;
121 121
 
122 122
     /**
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
      *
144 144
      * @return bool
145 145
      */
146
-    public function hasListener(string $eventName, ListenerInterface|callable $listener): bool;
146
+    public function hasListener(string $eventName, ListenerInterface | callable $listener): bool;
147 147
 
148 148
     /**
149 149
      * Get all listeners for the given event or all registered listeners.
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@
 block discarded – undo
53 53
  * @class DispatcherInterface
54 54
  * @package Platine\Event
55 55
  */
56
-interface DispatcherInterface
57
-{
56
+interface DispatcherInterface {
58 57
     /**
59 58
      * The low priority
60 59
      * @var int
Please login to merge, or discard this patch.
src/EventInterface.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,8 +50,7 @@
 block discarded – undo
50 50
  * @class EventInterface
51 51
  * @package Platine\Event
52 52
  */
53
-interface EventInterface
54
-{
53
+interface EventInterface {
55 54
     /**
56 55
      * Get the  event name
57 56
      * @return string
Please login to merge, or discard this patch.
src/Dispatcher.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      * {@inheritdoc}
67 67
      */
68 68
     public function dispatch(
69
-        string|EventInterface $eventName,
69
+        string | EventInterface $eventName,
70 70
         ?EventInterface $event = null
71 71
     ): EventInterface {
72 72
         if ($eventName instanceof EventInterface) {
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
      */
94 94
     public function addListener(
95 95
         string $eventName,
96
-        ListenerInterface|callable $listener,
96
+        ListenerInterface | callable $listener,
97 97
         int $priority = self::PRIORITY_DEFAULT
98 98
     ): void {
99 99
         if (!isset($this->listeners[$eventName])) {
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     /**
121 121
      * {@inheritdoc}
122 122
      */
123
-    public function removeListener(string $eventName, ListenerInterface|callable $listener): void
123
+    public function removeListener(string $eventName, ListenerInterface | callable $listener): void
124 124
     {
125 125
         if (empty($this->listeners[$eventName])) {
126 126
             return;
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
     /**
165 165
      * {@inheritdoc}
166 166
      */
167
-    public function hasListener(string $eventName, ListenerInterface|callable $listener): bool
167
+    public function hasListener(string $eventName, ListenerInterface | callable $listener): bool
168 168
     {
169 169
         if (!isset($this->listeners[$eventName])) {
170 170
             return false;
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,8 +54,7 @@
 block discarded – undo
54 54
  * @class Dispatcher
55 55
  * @package Platine\Event
56 56
  */
57
-class Dispatcher implements DispatcherInterface
58
-{
57
+class Dispatcher implements DispatcherInterface {
59 58
     /**
60 59
      * The list of listener
61 60
      * @var array<string, ListenerPriorityQueue>
Please login to merge, or discard this patch.
src/Listener/ListenerPriorityQueue.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,8 +56,7 @@
 block discarded – undo
56 56
  *
57 57
  * @implements IteratorAggregate<ListenerInterface>
58 58
  */
59
-class ListenerPriorityQueue implements IteratorAggregate
60
-{
59
+class ListenerPriorityQueue implements IteratorAggregate {
61 60
     /**
62 61
      * The storage
63 62
      * @var SplObjectStorage<ListenerInterface, int>
Please login to merge, or discard this patch.
src/Listener/ListenerInterface.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@
 block discarded – undo
52 52
  * @class ListenerInterface
53 53
  * @package Platine\Event\Listener
54 54
  */
55
-interface ListenerInterface
56
-{
55
+interface ListenerInterface {
57 56
     /**
58 57
      * Handle event
59 58
      * @param  EventInterface  $event the event instance
Please login to merge, or discard this patch.
src/Listener/CallableListener.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@
 block discarded – undo
102 102
      * @param  callable $callable the callable
103 103
      * @return $this|false
104 104
      */
105
-    public static function getListener(callable $callable): self|false
105
+    public static function getListener(callable $callable): self | false
106 106
     {
107 107
         foreach (static::$listeners as $listener) {
108 108
             if ($listener->getCallable() == $callable) {
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@  discard block
 block discarded – undo
52 52
  * @class CallableListener
53 53
  * @package Platine\Event\Listener
54 54
  */
55
-class CallableListener implements ListenerInterface
56
-{
55
+class CallableListener implements ListenerInterface {
57 56
     /**
58 57
      * The callable
59 58
      * @var callable
@@ -70,8 +69,7 @@  discard block
 block discarded – undo
70 69
      * Create new instance
71 70
      * @param  callable $callable
72 71
      */
73
-    public function __construct(callable $callable)
74
-    {
72
+    public function __construct(callable $callable) {
75 73
         $this->callable = $callable;
76 74
         static::$listeners[] = $this;
77 75
     }
Please login to merge, or discard this patch.