@@ -30,9 +30,9 @@ |
||
30 | 30 | \preg_replace_callback( |
31 | 31 | $this->pattern, |
32 | 32 | static function (array $matches) use ($context) { |
33 | - try { |
|
33 | + try{ |
|
34 | 34 | return $context->resolveValue($matches['name']) ?? $matches['default'] ?? null; |
35 | - } catch (ContextException $e) { |
|
35 | + }catch (ContextException $e){ |
|
36 | 36 | return $matches['default'] ?? throw $e; |
37 | 37 | } |
38 | 38 | }, |
@@ -29,10 +29,14 @@ |
||
29 | 29 | return $source->withCode( |
30 | 30 | \preg_replace_callback( |
31 | 31 | $this->pattern, |
32 | - static function (array $matches) use ($context) { |
|
33 | - try { |
|
32 | + static function (array $matches) use ($context) |
|
33 | + { |
|
34 | + try |
|
35 | + { |
|
34 | 36 | return $context->resolveValue($matches['name']) ?? $matches['default'] ?? null; |
35 | - } catch (ContextException $e) { |
|
37 | + } |
|
38 | + catch (ContextException $e) |
|
39 | + { |
|
36 | 40 | return $matches['default'] ?? throw $e; |
37 | 41 | } |
38 | 42 | }, |
@@ -69,8 +69,8 @@ |
||
69 | 69 | protected function getSource(string $path): ViewSource |
70 | 70 | { |
71 | 71 | $loader = new ViewLoader([ |
72 | - 'default' => __DIR__ . '/fixtures/default', |
|
73 | - 'other' => __DIR__ . '/fixtures/other', |
|
72 | + 'default' => __DIR__.'/fixtures/default', |
|
73 | + 'other' => __DIR__.'/fixtures/other', |
|
74 | 74 | ]); |
75 | 75 | |
76 | 76 | return $loader->withExtension('php')->load($path); |