Passed
Push — master ( 60d2ef...11c56d )
by butschster
03:22 queued 17s
created
src/Broadcasting/src/BroadcastManager.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,8 @@
 block discarded – undo
30 30
         // Replaces alias with real storage name
31 31
         $name = $this->config->getAliases()[$name] ?? $name;
32 32
 
33
-        if (isset($this->connections[$name])) {
33
+        if (isset($this->connections[$name]))
34
+        {
34 35
             return $this->connections[$name];
35 36
         }
36 37
 
Please login to merge, or discard this patch.
src/Broadcasting/src/Driver/AbstractBroadcast.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,8 @@  discard block
 block discarded – undo
16 16
      */
17 17
     protected function formatTopics(array $topics): array
18 18
     {
19
-        return array_map(function ($topic) {
19
+        return array_map(function ($topic)
20
+        {
20 21
             return (string)$topic;
21 22
         }, $topics);
22 23
     }
@@ -28,7 +29,8 @@  discard block
 block discarded – undo
28 29
      */
29 30
     protected function toArray($entries): array
30 31
     {
31
-        switch (true) {
32
+        switch (true)
33
+        {
32 34
             case \is_array($entries):
33 35
                 return $entries;
34 36
 
Please login to merge, or discard this patch.
src/Broadcasting/src/Config/BroadcastConfig.php 1 patch
Braces   +22 added lines, -11 removed lines patch added patch discarded remove patch
@@ -28,7 +28,8 @@  discard block
 block discarded – undo
28 28
         parent::__construct($config);
29 29
 
30 30
         $topics = (array)($config['authorize']['topics'] ?? []);
31
-        foreach ($topics as $topic => $callback) {
31
+        foreach ($topics as $topic => $callback)
32
+        {
32 33
             $this->patterns[$this->compilePattern($topic)] = $callback;
33 34
         }
34 35
     }
@@ -54,11 +55,13 @@  discard block
 block discarded – undo
54 55
      */
55 56
     public function getDefaultConnection(): string
56 57
     {
57
-        if (!isset($this->config['default']) || empty($this->config['default'])) {
58
+        if (!isset($this->config['default']) || empty($this->config['default']))
59
+        {
58 60
             throw new InvalidArgumentException('Default broadcast connection is not defined.');
59 61
         }
60 62
 
61
-        if (!\is_string($this->config['default'])) {
63
+        if (!\is_string($this->config['default']))
64
+        {
62 65
             throw new InvalidArgumentException('Default broadcast connection config value must be a string');
63 66
         }
64 67
 
@@ -67,7 +70,8 @@  discard block
 block discarded – undo
67 70
 
68 71
     public function getConnectionConfig(string $name): array
69 72
     {
70
-        if (!isset($this->config['connections'][$name])) {
73
+        if (!isset($this->config['connections'][$name]))
74
+        {
71 75
             throw new InvalidArgumentException(
72 76
                 sprintf('Config for connection `%s` is not defined.', $name)
73 77
             );
@@ -75,19 +79,22 @@  discard block
 block discarded – undo
75 79
 
76 80
         $config = $this->config['connections'][$name];
77 81
 
78
-        if (!isset($config['driver'])) {
82
+        if (!isset($config['driver']))
83
+        {
79 84
             throw new InvalidArgumentException(
80 85
                 sprintf('Driver for `%s` connection is not defined.', $name)
81 86
             );
82 87
         }
83 88
 
84
-        if (!\is_string($config['driver'])) {
89
+        if (!\is_string($config['driver']))
90
+        {
85 91
             throw new InvalidArgumentException(
86 92
                 \sprintf('Driver value for `%s` connection must be a string', $name)
87 93
             );
88 94
         }
89 95
 
90
-        if (isset($this->config['driverAliases'][$config['driver']])) {
96
+        if (isset($this->config['driverAliases'][$config['driver']]))
97
+        {
91 98
             $config['driver'] = $this->config['driverAliases'][$config['driver']];
92 99
         }
93 100
 
@@ -96,8 +103,10 @@  discard block
 block discarded – undo
96 103
 
97 104
     public function findTopicCallback(string $topic, array &$matches): ?callable
98 105
     {
99
-        foreach ($this->patterns as $pattern => $callback) {
100
-            if (preg_match($pattern, $topic, $matches)) {
106
+        foreach ($this->patterns as $pattern => $callback)
107
+        {
108
+            if (preg_match($pattern, $topic, $matches))
109
+            {
101 110
                 return $callback;
102 111
             }
103 112
         }
@@ -108,9 +117,11 @@  discard block
 block discarded – undo
108 117
     private function compilePattern(string $topic): string
109 118
     {
110 119
         $replaces = [];
111
-        if (preg_match_all('/\{(\w+):?(.*?)?\}/', $topic, $matches)) {
120
+        if (preg_match_all('/\{(\w+):?(.*?)?\}/', $topic, $matches))
121
+        {
112 122
             $variables = array_combine($matches[1], $matches[2]);
113
-            foreach ($variables as $key => $_) {
123
+            foreach ($variables as $key => $_)
124
+            {
114 125
                 $replaces['{' . $key . '}'] = '(?P<' . $key . '>[^\/\.]+)';
115 126
             }
116 127
         }
Please login to merge, or discard this patch.
src/Broadcasting/src/Driver/LogBroadcast.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,8 @@
 block discarded – undo
29 29
         $topics = implode(', ', $this->formatTopics($this->toArray($topics)));
30 30
 
31 31
         /** @var string $message */
32
-        foreach ($this->toArray($messages) as $message) {
32
+        foreach ($this->toArray($messages) as $message)
33
+        {
33 34
             assert(\is_string($message), 'Message argument must be a type of string');
34 35
             $this->logger->log($this->level, 'Broadcasting on channels [' . $topics . '] with payload: ' . $message);
35 36
         }
Please login to merge, or discard this patch.
src/Broadcasting/src/Bootloader/WebsocketsBootloader.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,8 @@
 block discarded – undo
35 35
         });
36 36
 
37 37
 
38
-        if ($config->getAuthorizationPath() !== null) {
38
+        if ($config->getAuthorizationPath() !== null)
39
+        {
39 40
             $http->addMiddleware(AuthorizationMiddleware::class);
40 41
         }
41 42
     }
Please login to merge, or discard this patch.
src/Broadcasting/src/Middleware/AuthorizationMiddleware.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,8 @@
 block discarded – undo
33 33
         ServerRequestInterface $request,
34 34
         RequestHandlerInterface $handler
35 35
     ): ResponseInterface {
36
-        if ($request->getUri()->getPath() !== $this->authorizationPath) {
36
+        if ($request->getUri()->getPath() !== $this->authorizationPath)
37
+        {
37 38
             return $handler->handle($request);
38 39
         }
39 40
 
Please login to merge, or discard this patch.