@@ -38,7 +38,7 @@ |
||
| 38 | 38 | { |
| 39 | 39 | $core = new InterceptableCore($core); |
| 40 | 40 | |
| 41 | - foreach (static::INTERCEPTORS as $interceptor) { |
|
| 41 | + foreach (static::INTERCEPTORS as $interceptor){ |
|
| 42 | 42 | $core->addInterceptor($container->get($interceptor)); |
| 43 | 43 | } |
| 44 | 44 | |
@@ -38,7 +38,8 @@ |
||
| 38 | 38 | { |
| 39 | 39 | $core = new InterceptableCore($core); |
| 40 | 40 | |
| 41 | - foreach (static::INTERCEPTORS as $interceptor) { |
|
| 41 | + foreach (static::INTERCEPTORS as $interceptor) |
|
| 42 | + { |
|
| 42 | 43 | $core->addInterceptor($container->get($interceptor)); |
| 43 | 44 | } |
| 44 | 45 | |
@@ -60,8 +60,8 @@ |
||
| 60 | 60 | */ |
| 61 | 61 | public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs): void |
| 62 | 62 | { |
| 63 | - if (!$dirs->has('locale')) { |
|
| 64 | - $dirs->set('locale', $dirs->get('app') . 'locale/'); |
|
| 63 | + if (!$dirs->has('locale')){ |
|
| 64 | + $dirs->set('locale', $dirs->get('app').'locale/'); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | $this->config->setDefaults( |
@@ -58,7 +58,8 @@ |
||
| 58 | 58 | */ |
| 59 | 59 | public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs): void |
| 60 | 60 | { |
| 61 | - if (!$dirs->has('locale')) { |
|
| 61 | + if (!$dirs->has('locale')) |
|
| 62 | + { |
|
| 62 | 63 | $dirs->set('locale', $dirs->get('app') . 'locale/'); |
| 63 | 64 | } |
| 64 | 65 | |
@@ -42,7 +42,8 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs): void |
| 44 | 44 | { |
| 45 | - if (!$dirs->has('views')) { |
|
| 45 | + if (!$dirs->has('views')) |
|
| 46 | + { |
|
| 46 | 47 | $dirs->set('views', $dirs->get('app') . 'views'); |
| 47 | 48 | } |
| 48 | 49 | |
@@ -66,7 +67,8 @@ discard block |
||
| 66 | 67 | */ |
| 67 | 68 | public function addDirectory(string $namespace, string $directory): void |
| 68 | 69 | { |
| 69 | - if (!isset($this->config->getConfig('views')['namespaces'][$namespace])) { |
|
| 70 | + if (!isset($this->config->getConfig('views')['namespaces'][$namespace])) |
|
| 71 | + { |
|
| 70 | 72 | $this->config->modify('views', new Append('namespaces', $namespace, [])); |
| 71 | 73 | } |
| 72 | 74 | |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs): void |
| 46 | 46 | { |
| 47 | - if (!$dirs->has('views')) { |
|
| 48 | - $dirs->set('views', $dirs->get('app') . 'views'); |
|
| 47 | + if (!$dirs->has('views')){ |
|
| 48 | + $dirs->set('views', $dirs->get('app').'views'); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | // default view config |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | [ |
| 55 | 55 | 'cache' => [ |
| 56 | 56 | 'enabled' => $env->get('VIEW_CACHE', !$env->get('DEBUG', false)), |
| 57 | - 'directory' => $dirs->get('cache') . 'views', |
|
| 57 | + 'directory' => $dirs->get('cache').'views', |
|
| 58 | 58 | ], |
| 59 | 59 | 'namespaces' => [ |
| 60 | 60 | 'default' => [$dirs->get('views')], |
@@ -71,11 +71,11 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | public function addDirectory(string $namespace, string $directory): void |
| 73 | 73 | { |
| 74 | - if (!isset($this->config->getConfig('views')['namespaces'][$namespace])) { |
|
| 74 | + if (!isset($this->config->getConfig('views')['namespaces'][$namespace])){ |
|
| 75 | 75 | $this->config->modify('views', new Append('namespaces', $namespace, [])); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - $this->config->modify('views', new Append('namespaces.' . $namespace, null, $directory)); |
|
| 78 | + $this->config->modify('views', new Append('namespaces.'.$namespace, null, $directory)); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
@@ -70,16 +70,16 @@ |
||
| 70 | 70 | { |
| 71 | 71 | $state = new State(); |
| 72 | 72 | |
| 73 | - foreach ($this->collectors as $collector) { |
|
| 74 | - if (is_string($collector)) { |
|
| 73 | + foreach ($this->collectors as $collector){ |
|
| 74 | + if (is_string($collector)){ |
|
| 75 | 75 | $collector = $this->factory->make($collector); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - if ($collector instanceof Autowire) { |
|
| 78 | + if ($collector instanceof Autowire){ |
|
| 79 | 79 | $collector = $collector->resolve($this->factory); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - if (!$collector instanceof StateCollectorInterface) { |
|
| 82 | + if (!$collector instanceof StateCollectorInterface){ |
|
| 83 | 83 | throw new StateException( |
| 84 | 84 | sprintf( |
| 85 | 85 | 'Unable to populate state, invalid state collector %s', |
@@ -70,16 +70,20 @@ |
||
| 70 | 70 | { |
| 71 | 71 | $state = new State(); |
| 72 | 72 | |
| 73 | - foreach ($this->collectors as $collector) { |
|
| 74 | - if (is_string($collector)) { |
|
| 73 | + foreach ($this->collectors as $collector) |
|
| 74 | + { |
|
| 75 | + if (is_string($collector)) |
|
| 76 | + { |
|
| 75 | 77 | $collector = $this->factory->make($collector); |
| 76 | 78 | } |
| 77 | 79 | |
| 78 | - if ($collector instanceof Autowire) { |
|
| 80 | + if ($collector instanceof Autowire) |
|
| 81 | + { |
|
| 79 | 82 | $collector = $collector->resolve($this->factory); |
| 80 | 83 | } |
| 81 | 84 | |
| 82 | - if (!$collector instanceof StateCollectorInterface) { |
|
| 85 | + if (!$collector instanceof StateCollectorInterface) |
|
| 86 | + { |
|
| 83 | 87 | throw new StateException( |
| 84 | 88 | sprintf( |
| 85 | 89 | 'Unable to populate state, invalid state collector %s', |
@@ -46,9 +46,9 @@ |
||
| 46 | 46 | DirectoriesInterface $dirs, |
| 47 | 47 | FilesInterface $files, |
| 48 | 48 | LoggerInterface $logger = null |
| 49 | - ) { |
|
| 49 | + ){ |
|
| 50 | 50 | return new FileSnapshooter( |
| 51 | - $dirs->get('runtime') . '/snapshots/', |
|
| 51 | + $dirs->get('runtime').'/snapshots/', |
|
| 52 | 52 | $env->get('SNAPSHOT_MAX_FILES', self::MAX_SNAPSHOTS), |
| 53 | 53 | $env->get('SNAPSHOT_VERBOSITY', HandlerInterface::VERBOSITY_VERBOSE), |
| 54 | 54 | new PlainHandler(), |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | private function actor(AuthContextInterface $context): ActorInterface |
| 39 | 39 | { |
| 40 | 40 | $actor = $context->getActor(); |
| 41 | - if ($actor instanceof ActorInterface) { |
|
| 41 | + if ($actor instanceof ActorInterface){ |
|
| 42 | 42 | return $actor; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -38,7 +38,8 @@ |
||
| 38 | 38 | private function actor(AuthContextInterface $context): ActorInterface |
| 39 | 39 | { |
| 40 | 40 | $actor = $context->getActor(); |
| 41 | - if ($actor instanceof ActorInterface) { |
|
| 41 | + if ($actor instanceof ActorInterface) |
|
| 42 | + { |
|
| 42 | 43 | return $actor; |
| 43 | 44 | } |
| 44 | 45 | |
@@ -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 | |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function getActor(TokenInterface $token): ?object |
| 54 | 54 | { |
| 55 | - foreach ($this->getProviders() as $provider) { |
|
| 56 | - if (!$provider instanceof ActorProviderInterface) { |
|
| 55 | + foreach ($this->getProviders() as $provider){ |
|
| 56 | + if (!$provider instanceof ActorProviderInterface){ |
|
| 57 | 57 | throw new AuthException( |
| 58 | 58 | sprintf( |
| 59 | 59 | 'Expected `ActorProviderInterface`, got `%s`', |
@@ -63,12 +63,12 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | $actor = $provider->getActor($token); |
| 66 | - if ($actor !== null) { |
|
| 66 | + if ($actor !== null){ |
|
| 67 | 67 | return $actor; |
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - if ($this->actorProvider === []) { |
|
| 71 | + if ($this->actorProvider === []){ |
|
| 72 | 72 | throw new AuthException('No actor provider'); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -90,13 +90,13 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | private function getProviders(): \Generator |
| 92 | 92 | { |
| 93 | - foreach ($this->actorProvider as $provider) { |
|
| 94 | - if ($provider instanceof Autowire) { |
|
| 93 | + foreach ($this->actorProvider as $provider){ |
|
| 94 | + if ($provider instanceof Autowire){ |
|
| 95 | 95 | yield $provider->resolve($this->factory); |
| 96 | 96 | continue; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if (is_object($provider)) { |
|
| 99 | + if (is_object($provider)){ |
|
| 100 | 100 | yield $provider; |
| 101 | 101 | continue; |
| 102 | 102 | } |
@@ -52,8 +52,10 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function getActor(TokenInterface $token): ?object |
| 54 | 54 | { |
| 55 | - foreach ($this->getProviders() as $provider) { |
|
| 56 | - if (!$provider instanceof ActorProviderInterface) { |
|
| 55 | + foreach ($this->getProviders() as $provider) |
|
| 56 | + { |
|
| 57 | + if (!$provider instanceof ActorProviderInterface) |
|
| 58 | + { |
|
| 57 | 59 | throw new AuthException( |
| 58 | 60 | sprintf( |
| 59 | 61 | 'Expected `ActorProviderInterface`, got `%s`', |
@@ -63,12 +65,14 @@ discard block |
||
| 63 | 65 | } |
| 64 | 66 | |
| 65 | 67 | $actor = $provider->getActor($token); |
| 66 | - if ($actor !== null) { |
|
| 68 | + if ($actor !== null) |
|
| 69 | + { |
|
| 67 | 70 | return $actor; |
| 68 | 71 | } |
| 69 | 72 | } |
| 70 | 73 | |
| 71 | - if ($this->actorProvider === []) { |
|
| 74 | + if ($this->actorProvider === []) |
|
| 75 | + { |
|
| 72 | 76 | throw new AuthException('No actor provider'); |
| 73 | 77 | } |
| 74 | 78 | |
@@ -90,13 +94,16 @@ discard block |
||
| 90 | 94 | */ |
| 91 | 95 | private function getProviders(): \Generator |
| 92 | 96 | { |
| 93 | - foreach ($this->actorProvider as $provider) { |
|
| 94 | - if ($provider instanceof Autowire) { |
|
| 97 | + foreach ($this->actorProvider as $provider) |
|
| 98 | + { |
|
| 99 | + if ($provider instanceof Autowire) |
|
| 100 | + { |
|
| 95 | 101 | yield $provider->resolve($this->factory); |
| 96 | 102 | continue; |
| 97 | 103 | } |
| 98 | 104 | |
| 99 | - if (is_object($provider)) { |
|
| 105 | + if (is_object($provider)) |
|
| 106 | + { |
|
| 100 | 107 | yield $provider; |
| 101 | 108 | continue; |
| 102 | 109 | } |
@@ -128,7 +128,7 @@ |
||
| 128 | 128 | string $footer, |
| 129 | 129 | array $options |
| 130 | 130 | ): Append { |
| 131 | - if (is_array($sequence) || $sequence instanceof \Closure) { |
|
| 131 | + if (is_array($sequence) || $sequence instanceof \Closure){ |
|
| 132 | 132 | return new Append( |
| 133 | 133 | $target, |
| 134 | 134 | null, |
@@ -133,7 +133,8 @@ |
||
| 133 | 133 | string $footer, |
| 134 | 134 | array $options |
| 135 | 135 | ): Append { |
| 136 | - if (is_array($sequence) || $sequence instanceof \Closure) { |
|
| 136 | + if (is_array($sequence) || $sequence instanceof \Closure) |
|
| 137 | + { |
|
| 137 | 138 | return new Append( |
| 138 | 139 | $target, |
| 139 | 140 | null, |