Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Commit

Permalink
Merge branch 'improvement/38'
Browse files Browse the repository at this point in the history
Close #38
  • Loading branch information
michalbundyra committed Oct 8, 2019
2 parents 63e4945 + 573f438 commit 90695b9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
11 changes: 2 additions & 9 deletions src/Extension/EscaperExtensionFactory.php
Expand Up @@ -32,16 +32,9 @@ class EscaperExtensionFactory
public function __invoke(ContainerInterface $container) : EscaperExtension
{
$config = $container->has('config') ? $container->get('config') : [];
$config = isset($config['plates']) ? $config['plates'] : [];

$encoding = null;

// Set encoding
if (isset($config['encoding'])) {
$encoding = $config['encoding'];
}
$config = $config['plates'] ?? [];

// Create new EscaperExtension instance
return new EscaperExtension($encoding);
return new EscaperExtension($config['encoding'] ?? null);
}
}
2 changes: 1 addition & 1 deletion src/PlatesEngineFactory.php
Expand Up @@ -49,7 +49,7 @@ class PlatesEngineFactory
public function __invoke(ContainerInterface $container) : PlatesEngine
{
$config = $container->has('config') ? $container->get('config') : [];
$config = isset($config['plates']) ? $config['plates'] : [];
$config = $config['plates'] ?? [];

// Create the engine instance:
$engine = new PlatesEngine();
Expand Down
2 changes: 1 addition & 1 deletion src/PlatesRendererFactory.php
Expand Up @@ -42,7 +42,7 @@ class PlatesRendererFactory
public function __invoke(ContainerInterface $container) : PlatesRenderer
{
$config = $container->has('config') ? $container->get('config') : [];
$config = isset($config['templates']) ? $config['templates'] : [];
$config = $config['templates'] ?? [];

// Create the engine instance:
$engine = $this->createEngine($container);
Expand Down

0 comments on commit 90695b9

Please sign in to comment.