Skip to content

Commit

Permalink
Checking if filter exists leads to endless recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
aschempp committed Jan 17, 2025
1 parent 57bce04 commit 38bea2d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
7 changes: 1 addition & 6 deletions config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,7 @@
])
;

$services->set(NotificationCenterExtension::class)
->args([
service('twig')
])
;

$services->set(NotificationCenterExtension::class);
$services->set(NotificationCenterRuntime::class)
->args([
service(ContaoFramework::class),
Expand Down
10 changes: 0 additions & 10 deletions src/Twig/NotificationCenterExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,12 @@

namespace Terminal42\NotificationCenterBundle\Twig;

use Twig\Environment;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
use Twig\TwigFunction;

class NotificationCenterExtension extends AbstractExtension
{
public function __construct(private readonly Environment $env)
{
}

public function getFunctions(): array
{
return [
Expand All @@ -24,11 +19,6 @@ public function getFunctions(): array

public function getFilters(): array
{
// Use the format_bytes filter in Contao 5
if (null !== $this->env->getFilter('format_bytes')) {
return [];
}

return [
new TwigFilter(
'format_bytes',
Expand Down

0 comments on commit 38bea2d

Please sign in to comment.