@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function getActor(TokenInterface $token): ?object |
53 | 53 | { |
54 | - foreach ($this->getProviders() as $provider) { |
|
55 | - if (!$provider instanceof ActorProviderInterface) { |
|
54 | + foreach ($this->getProviders() as $provider){ |
|
55 | + if (!$provider instanceof ActorProviderInterface){ |
|
56 | 56 | throw new AuthException(sprintf( |
57 | 57 | 'Expected `ActorProviderInterface`, got `%s`', |
58 | 58 | get_class($provider) |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | $actor = $provider->getActor($token); |
63 | - if ($actor !== null) { |
|
63 | + if ($actor !== null){ |
|
64 | 64 | return $actor; |
65 | 65 | } |
66 | 66 | } |
@@ -83,13 +83,13 @@ discard block |
||
83 | 83 | */ |
84 | 84 | private function getProviders(): \Generator |
85 | 85 | { |
86 | - foreach ($this->actorProvider as $provider) { |
|
87 | - if ($provider instanceof Autowire) { |
|
86 | + foreach ($this->actorProvider as $provider){ |
|
87 | + if ($provider instanceof Autowire){ |
|
88 | 88 | yield $provider->resolve($this->factory); |
89 | 89 | continue; |
90 | 90 | } |
91 | 91 | |
92 | - if (is_object($provider)) { |
|
92 | + if (is_object($provider)){ |
|
93 | 93 | yield $provider; |
94 | 94 | continue; |
95 | 95 | } |
@@ -51,8 +51,10 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function getActor(TokenInterface $token): ?object |
53 | 53 | { |
54 | - foreach ($this->getProviders() as $provider) { |
|
55 | - if (!$provider instanceof ActorProviderInterface) { |
|
54 | + foreach ($this->getProviders() as $provider) |
|
55 | + { |
|
56 | + if (!$provider instanceof ActorProviderInterface) |
|
57 | + { |
|
56 | 58 | throw new AuthException(sprintf( |
57 | 59 | 'Expected `ActorProviderInterface`, got `%s`', |
58 | 60 | get_class($provider) |
@@ -60,7 +62,8 @@ discard block |
||
60 | 62 | } |
61 | 63 | |
62 | 64 | $actor = $provider->getActor($token); |
63 | - if ($actor !== null) { |
|
65 | + if ($actor !== null) |
|
66 | + { |
|
64 | 67 | return $actor; |
65 | 68 | } |
66 | 69 | } |
@@ -83,13 +86,16 @@ discard block |
||
83 | 86 | */ |
84 | 87 | private function getProviders(): \Generator |
85 | 88 | { |
86 | - foreach ($this->actorProvider as $provider) { |
|
87 | - if ($provider instanceof Autowire) { |
|
89 | + foreach ($this->actorProvider as $provider) |
|
90 | + { |
|
91 | + if ($provider instanceof Autowire) |
|
92 | + { |
|
88 | 93 | yield $provider->resolve($this->factory); |
89 | 94 | continue; |
90 | 95 | } |
91 | 96 | |
92 | - if (is_object($provider)) { |
|
97 | + if (is_object($provider)) |
|
98 | + { |
|
93 | 99 | yield $provider; |
94 | 100 | continue; |
95 | 101 | } |
@@ -87,8 +87,8 @@ |
||
87 | 87 | $registry = new TransportRegistry(); |
88 | 88 | $registry->setDefaultTransport($config->getDefaultTransport()); |
89 | 89 | |
90 | - foreach ($config->getTransports() as $name => $transport) { |
|
91 | - if ($transport instanceof Autowire) { |
|
90 | + foreach ($config->getTransports() as $name => $transport){ |
|
91 | + if ($transport instanceof Autowire){ |
|
92 | 92 | $transport = $transport->resolve($factory); |
93 | 93 | } |
94 | 94 |
@@ -87,8 +87,10 @@ |
||
87 | 87 | $registry = new TransportRegistry(); |
88 | 88 | $registry->setDefaultTransport($config->getDefaultTransport()); |
89 | 89 | |
90 | - foreach ($config->getTransports() as $name => $transport) { |
|
91 | - if ($transport instanceof Autowire) { |
|
90 | + foreach ($config->getTransports() as $name => $transport) |
|
91 | + { |
|
92 | + if ($transport instanceof Autowire) |
|
93 | + { |
|
92 | 94 | $transport = $transport->resolve($factory); |
93 | 95 | } |
94 | 96 |
@@ -44,28 +44,28 @@ |
||
44 | 44 | */ |
45 | 45 | protected function mapDirectories(array $directories): array |
46 | 46 | { |
47 | - if (!isset($directories['root'])) { |
|
47 | + if (!isset($directories['root'])){ |
|
48 | 48 | throw new BootException('Missing required directory `root`.'); |
49 | 49 | } |
50 | 50 | |
51 | - if (!isset($directories['app'])) { |
|
52 | - $directories['app'] = $directories['root'] . '/app/'; |
|
51 | + if (!isset($directories['app'])){ |
|
52 | + $directories['app'] = $directories['root'].'/app/'; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | return array_merge([ |
56 | 56 | // public root |
57 | - 'public' => $directories['root'] . '/public/', |
|
57 | + 'public' => $directories['root'].'/public/', |
|
58 | 58 | |
59 | 59 | // vendor libraries |
60 | - 'vendor' => $directories['root'] . '/vendor/', |
|
60 | + 'vendor' => $directories['root'].'/vendor/', |
|
61 | 61 | |
62 | 62 | // data directories |
63 | - 'runtime' => $directories['root'] . '/runtime/', |
|
64 | - 'cache' => $directories['root'] . '/runtime/cache/', |
|
63 | + 'runtime' => $directories['root'].'/runtime/', |
|
64 | + 'cache' => $directories['root'].'/runtime/cache/', |
|
65 | 65 | |
66 | 66 | // application directories |
67 | - 'config' => $directories['app'] . '/config/', |
|
68 | - 'resources' => $directories['app'] . '/resources/', |
|
67 | + 'config' => $directories['app'].'/config/', |
|
68 | + 'resources' => $directories['app'].'/resources/', |
|
69 | 69 | ], $directories); |
70 | 70 | } |
71 | 71 | } |
72 | 72 | \ No newline at end of file |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function __invoke(LogEvent $event): void |
52 | 52 | { |
53 | - if (empty($this->output)) { |
|
53 | + if (empty($this->output)){ |
|
54 | 54 | return; |
55 | 55 | } |
56 | 56 | |
57 | - if ($this->output->getVerbosity() < OutputInterface::VERBOSITY_VERY_VERBOSE) { |
|
57 | + if ($this->output->getVerbosity() < OutputInterface::VERBOSITY_VERY_VERBOSE){ |
|
58 | 58 | return; |
59 | 59 | } |
60 | 60 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function enable(): self |
92 | 92 | { |
93 | - if (!empty($this->logs)) { |
|
93 | + if (!empty($this->logs)){ |
|
94 | 94 | $this->logs->addListener($this); |
95 | 95 | } |
96 | 96 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | */ |
105 | 105 | public function disable(): self |
106 | 106 | { |
107 | - if (!empty($this->logs)) { |
|
107 | + if (!empty($this->logs)){ |
|
108 | 108 | $this->logs->removeListener($this); |
109 | 109 | } |
110 | 110 | |
@@ -127,13 +127,13 @@ discard block |
||
127 | 127 | */ |
128 | 128 | private function getChannel(string $channel): string |
129 | 129 | { |
130 | - if (!class_exists($channel, false)) { |
|
130 | + if (!class_exists($channel, false)){ |
|
131 | 131 | return "[{$channel}]"; |
132 | 132 | } |
133 | 133 | |
134 | - try { |
|
134 | + try{ |
|
135 | 135 | $reflection = new \ReflectionClass($channel); |
136 | - } catch (\ReflectionException $e) { |
|
136 | + }catch (\ReflectionException $e){ |
|
137 | 137 | return $channel; |
138 | 138 | } |
139 | 139 | |
@@ -147,10 +147,10 @@ discard block |
||
147 | 147 | */ |
148 | 148 | private function getMessage(bool $decorated, string $message) |
149 | 149 | { |
150 | - if (!$decorated) { |
|
150 | + if (!$decorated){ |
|
151 | 151 | return $message; |
152 | 152 | } |
153 | 153 | |
154 | - return Color::GRAY . $message . Color::RESET; |
|
154 | + return Color::GRAY.$message.Color::RESET; |
|
155 | 155 | } |
156 | 156 | } |
157 | 157 | \ No newline at end of file |