Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making ProfilerExtension compatible to Twig 3 #116

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
10 changes: 7 additions & 3 deletions sources/lib/Twig/Extension/ProfilerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
*/
namespace PommProject\PommBundle\Twig\Extension;

use Twig\Extension\AbstractExtension;
use Twig\Loader\FilesystemLoader;
use Twig\TwigFilter;

/**
* ProfilerExtension
*
Expand All @@ -20,7 +24,7 @@
* @license X11 {@link http://opensource.org/licenses/mit-license.php}
* @see \Twig_Extension
*/
class ProfilerExtension extends \Twig_Extension
class ProfilerExtension extends AbstractExtension
{
/**
* __construct
Expand All @@ -30,7 +34,7 @@ class ProfilerExtension extends \Twig_Extension
* @access public
* @param \Twig_Loader_Filesystem $loader
*/
public function __construct(\Twig_Loader_Filesystem $loader)
public function __construct(FilesystemLoader $loader)
{
$loader->addPath($this->getTemplateDirectory(), 'Pomm');
}
Expand Down Expand Up @@ -58,7 +62,7 @@ private function getTemplateDirectory()
public function getFilters()
{
return [
new \Twig_SimpleFilter('sql_format', function ($sql) {
new TwigFilter('sql_format', function ($sql) {
return \SqlFormatter::format($sql);
}),
];
Expand Down