Passed
Push — master ( 11c56d...7a080f )
by butschster
02:58 queued 18s
created
src/Broadcasting/src/TopicRegistry.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,7 +10,8 @@  discard block
 block discarded – undo
10 10
 
11 11
     public function __construct(array $topics = [])
12 12
     {
13
-        foreach ($topics as $topic => $callback) {
13
+        foreach ($topics as $topic => $callback)
14
+        {
14 15
             $this->register($topic, $callback);
15 16
         }
16 17
     }
@@ -22,8 +23,10 @@  discard block
 block discarded – undo
22 23
 
23 24
     public function findCallback(string $topic, array &$matches): ?callable
24 25
     {
25
-        foreach ($this->patterns as $pattern => $callback) {
26
-            if (preg_match($pattern, $topic, $matches)) {
26
+        foreach ($this->patterns as $pattern => $callback)
27
+        {
28
+            if (preg_match($pattern, $topic, $matches))
29
+            {
27 30
                 return $callback;
28 31
             }
29 32
         }
@@ -34,9 +37,11 @@  discard block
 block discarded – undo
34 37
     private function compilePattern(string $topic): string
35 38
     {
36 39
         $replaces = [];
37
-        if (preg_match_all('/\{(\w+):?(.*?)?\}/', $topic, $matches)) {
40
+        if (preg_match_all('/\{(\w+):?(.*?)?\}/', $topic, $matches))
41
+        {
38 42
             $variables = array_combine($matches[1], $matches[2]);
39
-            foreach ($variables as $key => $_) {
43
+            foreach ($variables as $key => $_)
44
+            {
40 45
                 $replaces['{' . $key . '}'] = '(?P<' . $key . '>[^\/\.]+)';
41 46
             }
42 47
         }
Please login to merge, or discard this patch.
src/Broadcasting/src/Config/BroadcastConfig.php 1 patch
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -53,11 +53,13 @@  discard block
 block discarded – undo
53 53
      */
54 54
     public function getDefaultConnection(): string
55 55
     {
56
-        if (!isset($this->config['default']) || empty($this->config['default'])) {
56
+        if (!isset($this->config['default']) || empty($this->config['default']))
57
+        {
57 58
             throw new InvalidArgumentException('Default broadcast connection is not defined.');
58 59
         }
59 60
 
60
-        if (!\is_string($this->config['default'])) {
61
+        if (!\is_string($this->config['default']))
62
+        {
61 63
             throw new InvalidArgumentException('Default broadcast connection config value must be a string');
62 64
         }
63 65
 
@@ -66,7 +68,8 @@  discard block
 block discarded – undo
66 68
 
67 69
     public function getConnectionConfig(string $name): array
68 70
     {
69
-        if (!isset($this->config['connections'][$name])) {
71
+        if (!isset($this->config['connections'][$name]))
72
+        {
70 73
             throw new InvalidArgumentException(
71 74
                 sprintf('Config for connection `%s` is not defined.', $name)
72 75
             );
@@ -74,19 +77,22 @@  discard block
 block discarded – undo
74 77
 
75 78
         $config = $this->config['connections'][$name];
76 79
 
77
-        if (!isset($config['driver'])) {
80
+        if (!isset($config['driver']))
81
+        {
78 82
             throw new InvalidArgumentException(
79 83
                 sprintf('Driver for `%s` connection is not defined.', $name)
80 84
             );
81 85
         }
82 86
 
83
-        if (!\is_string($config['driver'])) {
87
+        if (!\is_string($config['driver']))
88
+        {
84 89
             throw new InvalidArgumentException(
85 90
                 \sprintf('Driver value for `%s` connection must be a string', $name)
86 91
             );
87 92
         }
88 93
 
89
-        if (isset($this->config['driverAliases'][$config['driver']])) {
94
+        if (isset($this->config['driverAliases'][$config['driver']]))
95
+        {
90 96
             $config['driver'] = $this->config['driverAliases'][$config['driver']];
91 97
         }
92 98
 
Please login to merge, or discard this patch.