Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Commit

Permalink
factory added to interface
Browse files Browse the repository at this point in the history
  • Loading branch information
mkorkmaz committed Jun 21, 2017
1 parent 4ee70a4 commit 4a66c10
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Twig/Twig.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct(TwigEnvironment $twig, array $config)
new TwigExtensions($this->twig, $this->config);
}

public static function twigFactory(ContainerInterface $container, $config) : Twig
public static function viewFactory(ContainerInterface $container, array $config) : ViewInterface
{
$twig = $container->get(TwigEnvironment::class);
return new static($twig, $config);
Expand Down
4 changes: 3 additions & 1 deletion src/ViewInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@

namespace Selami\View;

use Psr\Container\ContainerInterface;

interface ViewInterface
{
public static function viewFactory(ContainerInterface $container, array $config) : ViewInterface;
public function addGlobal(string $name, $value) : void;

public function render(string $templateFile, array $parameters = []) : string;
}
2 changes: 1 addition & 1 deletion test/TwigTest/TwigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function setUp()

$container->setService(TwigEnvironment::class, $twig);

$this->view = Twig::twigFactory($container, $this->config);
$this->view = Twig::viewFactory($container, $this->config);
}

/**
Expand Down

0 comments on commit 4a66c10

Please sign in to comment.