Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pomm-project/pomm-bundle",
"type": "symfony-bundle",
"description": "The Symfony2 bundle for Pomm2",
"description": "The Symfony bundle for Pomm2",
"keywords": ["orm", "postgresql", "database", "symfony", "pomm"],
"homepage": "http://www.pomm-project.org",
"license": "MIT",
Expand All @@ -21,7 +21,8 @@
"pomm-project/model-manager": "~2.0",
"pomm-project/cli": "~2.0",
"pomm-project/pomm-symfony-bridge": "~2.5|~3.0",
"symfony/framework-bundle": "^3.4|^4.3|^5.0"
"symfony/framework-bundle": "^3.4|^4.3|^5.0",
"twig/twig": "^3.3"
},
"require-dev": {
"symfony/console": "^3.4|^4.3|^5.0",
Expand All @@ -42,4 +43,3 @@
}
}
}

20 changes: 13 additions & 7 deletions sources/lib/Twig/Extension/ProfilerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
*/
namespace PommProject\PommBundle\Twig\Extension;

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

/**
* ProfilerExtension
*
Expand All @@ -18,19 +23,20 @@
* @copyright 2014 Grégoire HUBERT
* @author Nicolas JOSEPH
* @license X11 {@link http://opensource.org/licenses/mit-license.php}
* @see \Twig_Extension
* @see AbstractExtension
*/
class ProfilerExtension extends \Twig_Extension
class ProfilerExtension extends AbstractExtension
{
/**
* __construct
*
* Extension constructor.
*
* @access public
* @param \Twig_Loader_Filesystem $loader
* @param FilesystemLoader $loader
* @throws LoaderError
*/
public function __construct(\Twig_Loader_Filesystem $loader)
public function __construct(FilesystemLoader $loader)
{
$loader->addPath($this->getTemplateDirectory(), 'Pomm');
}
Expand All @@ -53,12 +59,12 @@ private function getTemplateDirectory()
/**
* getFilters
*
* @see \Twig_Extension
* @see AbstractExtension
*/
public function getFilters()
{
return [
new \Twig_SimpleFilter('sql_format', function ($sql) {
new TwigFilter('sql_format', function ($sql) {
return \SqlFormatter::format($sql);
}),
];
Expand All @@ -67,7 +73,7 @@ public function getFilters()
/**
* getName
*
* @see \Twig_Extension
* @see AbstractExtension
*/
public function getName()
{
Expand Down