Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@PHP74Migration' => true,
'@PHP82Migration' => true,
'@PhpCsFixer' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Added support for Symfony 8.2
* Replaced the `gifexception:optimize` command and `bin/optimizer.php` by the `castor optimize` task
* Upgraded the test suite to PHPUnit 11
* Fixed a `TypeError` when the exception code is not an integer

## 1.11.1 (2026-05-26)

Expand Down
9 changes: 0 additions & 9 deletions DependencyInjection/GifExceptionExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@ public function load(array $configs, ContainerBuilder $container): void
}
}

$pattern = __DIR__ . '/../Resources/public/images/other/*.gif';
$images = glob($pattern);

if ($images) {
foreach ($images as $path) {
$gifs['other'][] = basename($path);
}
}

$container->getDefinition('gif_exception.listener.replace_image')->replaceArgument(0, $gifs);
}
}
7 changes: 4 additions & 3 deletions EventListener/ReplaceImageListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ public function onKernelResponse(ResponseEvent $event): void

// Status code is not set by the exception controller but only by the
// kernel at the very end.
// So lets use the status code from the flatten exception instead.
// So lets use the status code from the exception instead.
// Unless it comes from a fatal error handler or exception base class
if (method_exists($exception, 'getStatusCode')) {
$statusCode = $exception->getStatusCode();
$statusCode = (int) $exception->getStatusCode();
} else {
$statusCode = $exception->getCode();
// getCode() may return a string (e.g. \PDOException), not a HTTP status
$statusCode = (int) $exception->getCode();
}

$dir = $this->getGifDir($statusCode);
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

The GhostBuster of your exception page!

It displays a GIF instead of Symfony's ghost on exception page and it's compatible with Symfony versions from 5.4 to 8.2.
It displays a GIF instead of Symfony's ghost on exception page and it's compatible with Symfony versions from 6.4 to 8.2.
Here is what it looks like :

![Demo Symfony 4.4](Resources/doc/images/demo.gif)
Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"symfony/twig-bundle": "^6.4 || ^7.3 || ^8.0"
},
"require-dev": {
"doctrine/annotations": "^2.0",
"friendsofphp/php-cs-fixer": "^3.17",
"phpstan/phpstan": "^2.1",
"phpunit/phpunit": "^11.5",
Expand Down
2 changes: 1 addition & 1 deletion tests/app/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
$_SERVER['APP_ENV'] ??= 'test';
$_SERVER['APP_DEBUG'] = 1;

umask(0000);
umask(0o000);

Debug::enable();

Expand Down
Loading