Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Twig/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@

namespace TwigBridge\Twig;

use Twig_LoaderInterface;
use Twig_Source;
use Twig_Error_Loader;
use Twig_LoaderInterface;
use InvalidArgumentException;
use Illuminate\Filesystem\Filesystem;
use Illuminate\View\ViewFinderInterface;
Expand Down Expand Up @@ -92,7 +93,7 @@ public function findTemplate($name)
protected function normalizeName($name)
{
if ($this->files->extension($name) === $this->extension) {
$name = substr($name, 0, - (strlen($this->extension) + 1));
return $this->files->name($name);
}

return $name;
Expand Down Expand Up @@ -133,7 +134,7 @@ public function getSourceContext($name)
{
$path = $this->findTemplate($name);

return new \Twig_Source($this->files->get($path), $name, $path);
return new Twig_Source($this->files->get($path), $name, $path);
}

/**
Expand Down