Skip to content

Commit

Permalink
Merge pull request #17 from 1on/master
Browse files Browse the repository at this point in the history
Enable symfony 5 components
  • Loading branch information
muxx authored Jan 13, 2020
2 parents fd2f968 + 63fda34 commit 615ec5e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
13 changes: 9 additions & 4 deletions EventListener/ScriptNameConfigureListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,26 @@
namespace Intaro\PinbaBundle\EventListener;

use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpKernel\Event\KernelEvent;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;

class ScriptNameConfigureListener
{
public function onRequest(GetResponseEvent $event)
public function onRequest(KernelEvent $event)
{
if (!($event instanceof GetResponseEvent || $event instanceof RequestEvent)) {
throw new \InvalidArgumentException('Event must be GetResponseEvent or RequestEvent');
}

if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
return;
}

if (!function_exists('pinba_script_name_set') || PHP_SAPI === 'cli') {
if (!function_exists('pinba_script_name_set') || \PHP_SAPI === 'cli') {
return;
}

pinba_script_name_set($event->getRequest()->getRequestUri());
}
}
}
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
}],
"require": {
"php": ">=5.3.0",
"symfony/framework-bundle" : "~2.3|~3.0|^4.0",
"symfony/yaml": "~2.2|~3.0|^4.0"
"symfony/framework-bundle" : "~2.8|~3.0|^4.0|^5.0",
"symfony/yaml": "~2.8|~3.0|^4.0|^5.0"
},
"autoload": {
"psr-0": {
Expand Down

0 comments on commit 615ec5e

Please sign in to comment.