@@ -55,7 +55,8 @@ discard block |
||
| 55 | 55 | $logger = $factory->getLogger(); |
| 56 | 56 | |
| 57 | 57 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
| 58 | - new class() implements LoaderInterface { |
|
| 58 | + new class() implements LoaderInterface |
|
| 59 | + { |
|
| 59 | 60 | public function has(string $section): bool |
| 60 | 61 | { |
| 61 | 62 | return false; |
@@ -84,7 +85,8 @@ discard block |
||
| 84 | 85 | $factory = new LogFactory(new MonologConfig([]), new ListenerRegistry(), new Container()); |
| 85 | 86 | |
| 86 | 87 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
| 87 | - new class() implements LoaderInterface { |
|
| 88 | + new class() implements LoaderInterface |
|
| 89 | + { |
|
| 88 | 90 | public function has(string $section): bool |
| 89 | 91 | { |
| 90 | 92 | return false; |
@@ -111,7 +113,8 @@ discard block |
||
| 111 | 113 | public function testFinalizerShouldResetDefaultLogger(): void |
| 112 | 114 | { |
| 113 | 115 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
| 114 | - new class() implements LoaderInterface { |
|
| 116 | + new class() implements LoaderInterface |
|
| 117 | + { |
|
| 115 | 118 | public function has(string $section): bool |
| 116 | 119 | { |
| 117 | 120 | return false; |
@@ -151,7 +154,8 @@ discard block |
||
| 151 | 154 | public function testFinalizerShouldNotResetLoggerWhenApplicationTerminating(): void |
| 152 | 155 | { |
| 153 | 156 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
| 154 | - new class() implements LoaderInterface { |
|
| 157 | + new class() implements LoaderInterface |
|
| 158 | + { |
|
| 155 | 159 | public function has(string $section): bool |
| 156 | 160 | { |
| 157 | 161 | return false; |
@@ -73,7 +73,8 @@ |
||
| 73 | 73 | $this->container->bind( |
| 74 | 74 | ConfiguratorInterface::class, |
| 75 | 75 | new ConfigManager( |
| 76 | - new class() implements LoaderInterface { |
|
| 76 | + new class() implements LoaderInterface |
|
| 77 | + { |
|
| 77 | 78 | public function has(string $section): bool |
| 78 | 79 | { |
| 79 | 80 | return false; |
@@ -26,7 +26,8 @@ |
||
| 26 | 26 | public function testLoggerShouldBeReset(): void |
| 27 | 27 | { |
| 28 | 28 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
| 29 | - new class() implements LoaderInterface { |
|
| 29 | + new class() implements LoaderInterface |
|
| 30 | + { |
|
| 30 | 31 | public function has(string $section): bool |
| 31 | 32 | { |
| 32 | 33 | return false; |
@@ -22,7 +22,8 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | public function loadEnvVariables(DirectoriesInterface $dirs, EnvironmentInterface $env): void |
| 24 | 24 | { |
| 25 | - if ($this->init) { |
|
| 25 | + if ($this->init) |
|
| 26 | + { |
|
| 26 | 27 | return; |
| 27 | 28 | } |
| 28 | 29 | |
@@ -30,14 +31,16 @@ discard block |
||
| 30 | 31 | |
| 31 | 32 | $dotenvPath = $env->get('DOTENV_PATH', $dirs->get('root') . '.env'); |
| 32 | 33 | |
| 33 | - if (!\file_exists($dotenvPath)) { |
|
| 34 | + if (!\file_exists($dotenvPath)) |
|
| 35 | + { |
|
| 34 | 36 | return; |
| 35 | 37 | } |
| 36 | 38 | |
| 37 | 39 | $path = \dirname((string) $dotenvPath); |
| 38 | 40 | $file = \basename((string) $dotenvPath); |
| 39 | 41 | |
| 40 | - foreach (Dotenv::createImmutable($path, $file)->load() as $key => $value) { |
|
| 42 | + foreach (Dotenv::createImmutable($path, $file)->load() as $key => $value) |
|
| 43 | + { |
|
| 41 | 44 | $env->set($key, $value); |
| 42 | 45 | } |
| 43 | 46 | } |
@@ -43,10 +43,13 @@ discard block |
||
| 43 | 43 | { |
| 44 | 44 | $s = $this->getStempler(); |
| 45 | 45 | |
| 46 | - try { |
|
| 46 | + try |
|
| 47 | + { |
|
| 47 | 48 | $s->get('echo', new ViewContext())->render(); |
| 48 | 49 | $this->fail('Exception expected'); |
| 49 | - } catch (RenderException $e) { |
|
| 50 | + } |
|
| 51 | + catch (RenderException $e) |
|
| 52 | + { |
|
| 50 | 53 | $t = $e->getUserTrace()[0]; |
| 51 | 54 | |
| 52 | 55 | self::assertSame(2, $t['line']); |
@@ -58,10 +61,13 @@ discard block |
||
| 58 | 61 | { |
| 59 | 62 | $s = $this->getStempler(); |
| 60 | 63 | |
| 61 | - try { |
|
| 64 | + try |
|
| 65 | + { |
|
| 62 | 66 | $s->get('other:echo-in', new ViewContext())->render(); |
| 63 | 67 | $this->fail('Exception expected'); |
| 64 | - } catch (RenderException $e) { |
|
| 68 | + } |
|
| 69 | + catch (RenderException $e) |
|
| 70 | + { |
|
| 65 | 71 | $t = $e->getUserTrace(); |
| 66 | 72 | self::assertCount(2, $t); |
| 67 | 73 | |
@@ -77,9 +83,12 @@ discard block |
||
| 77 | 83 | { |
| 78 | 84 | $twig = $this->getStempler(); |
| 79 | 85 | |
| 80 | - try { |
|
| 86 | + try |
|
| 87 | + { |
|
| 81 | 88 | $twig->get('other:bad', new ViewContext()); |
| 82 | - } catch (CompileException $e) { |
|
| 89 | + } |
|
| 90 | + catch (CompileException $e) |
|
| 91 | + { |
|
| 83 | 92 | self::assertStringContainsString('bad.dark.php', $e->getFile()); |
| 84 | 93 | } |
| 85 | 94 | } |