@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | { |
56 | 56 | $manager = new CacheManager($config, $container); |
57 | 57 | |
58 | - foreach ($config->getAliases() as $alias => $storageName) { |
|
58 | + foreach ($config->getAliases() as $alias => $storageName){ |
|
59 | 59 | $container->bind($alias, static function (CacheManager $manager) use ($storageName) { |
60 | 60 | return $manager->storage($storageName); |
61 | 61 | }); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | ], |
78 | 78 | 'file' => [ |
79 | 79 | 'type' => 'file', |
80 | - 'path' => $dirs->get('runtime') . 'cache', |
|
80 | + 'path' => $dirs->get('runtime').'cache', |
|
81 | 81 | ], |
82 | 82 | ], |
83 | 83 | 'typeAliases' => [ |
@@ -25,21 +25,21 @@ discard block |
||
25 | 25 | |
26 | 26 | public function createInjection(ReflectionClass $class, string $context = null): CacheInterface |
27 | 27 | { |
28 | - try { |
|
29 | - if ($context === null) { |
|
28 | + try{ |
|
29 | + if ($context === null){ |
|
30 | 30 | $connection = $this->provider->storage(); |
31 | - } else { |
|
31 | + }else{ |
|
32 | 32 | // Get Cache by context |
33 | - try { |
|
33 | + try{ |
|
34 | 34 | $connection = $this->provider->storage($context); |
35 | - } catch (InvalidArgumentException $e) { |
|
35 | + }catch (InvalidArgumentException $e){ |
|
36 | 36 | // Case when context doesn't match to configured connections |
37 | 37 | return $this->provider->storage(); |
38 | 38 | } |
39 | 39 | } |
40 | 40 | |
41 | 41 | $this->matchType($class, $context, $connection); |
42 | - } catch (\Throwable $e) { |
|
42 | + }catch (\Throwable $e){ |
|
43 | 43 | throw new ContainerException(sprintf("Can't inject the required cache. %s", $e->getMessage()), 0, $e); |
44 | 44 | } |
45 | 45 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | private function matchType(ReflectionClass $class, ?string $context, CacheInterface $connection): void |
55 | 55 | { |
56 | 56 | $className = $class->getName(); |
57 | - if ($className !== CacheInterface::class && !$connection instanceof $className) { |
|
57 | + if ($className !== CacheInterface::class && !$connection instanceof $className){ |
|
58 | 58 | throw new \RuntimeException( |
59 | 59 | \sprintf( |
60 | 60 | "The cache obtained by the context `%s` doesn't match the type `%s`.", |
@@ -25,21 +25,21 @@ discard block |
||
25 | 25 | |
26 | 26 | public function createInjection(ReflectionClass $class, string $context = null): QueueInterface |
27 | 27 | { |
28 | - try { |
|
29 | - if ($context === null) { |
|
28 | + try{ |
|
29 | + if ($context === null){ |
|
30 | 30 | $connection = $this->queueManager->getConnection(); |
31 | - } else { |
|
31 | + }else{ |
|
32 | 32 | // Get Queue by context |
33 | - try { |
|
33 | + try{ |
|
34 | 34 | $connection = $this->queueManager->getConnection($context); |
35 | - } catch (InvalidArgumentException $e) { |
|
35 | + }catch (InvalidArgumentException $e){ |
|
36 | 36 | // Case when context doesn't match to configured connections |
37 | 37 | return $this->queueManager->getConnection(); |
38 | 38 | } |
39 | 39 | } |
40 | 40 | |
41 | 41 | $this->matchType($class, $context, $connection); |
42 | - } catch (\Throwable $e) { |
|
42 | + }catch (\Throwable $e){ |
|
43 | 43 | throw new ContainerException(sprintf("Can't inject the required queue. %s", $e->getMessage()), 0, $e); |
44 | 44 | } |
45 | 45 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | private function matchType(ReflectionClass $class, ?string $context, QueueInterface $connection): void |
55 | 55 | { |
56 | 56 | $className = $class->getName(); |
57 | - if ($className !== QueueInterface::class && !$connection instanceof $className) { |
|
57 | + if ($className !== QueueInterface::class && !$connection instanceof $className){ |
|
58 | 58 | throw new \RuntimeException( |
59 | 59 | \sprintf( |
60 | 60 | "The queue obtained by the context `%s` doesn't match the type `%s`.", |
@@ -76,7 +76,7 @@ |
||
76 | 76 | 'test' => $this->defaultCache, |
77 | 77 | 'array' => new ArrayStorage(), |
78 | 78 | ][$name] ?? null; |
79 | - if ($result === null) { |
|
79 | + if ($result === null){ |
|
80 | 80 | throw new NotFoundException(); |
81 | 81 | } |
82 | 82 | return $result; |