Skip to content

Commit

Permalink
Merge pull request #6 from wackyMole/#5
Browse files Browse the repository at this point in the history
Update for Symfony 3.0+
  • Loading branch information
WackyMole authored Aug 11, 2017
2 parents fdc8196 + 8ce168e commit da1ce7c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
dopiaza_slack_exception_logger.listener:
class: Dopiaza\Slack\ExceptionLoggerBundle\Service\ExceptionHandler
arguments:
- @logger
- %kernel.environment%
- "@logger"
- "%kernel.environment%"
tags:
- { name: kernel.event_listener, event: kernel.exception, method: onKernelException }
- { name: kernel.event_listener, event: kernel.exception, method: onKernelException }
8 changes: 5 additions & 3 deletions Service/ExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/
namespace Dopiaza\Slack\ExceptionLoggerBundle\Service;

use Psr\Log\LoggerInterface;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\HttpKernel\Log\LoggerInterface;

class ExceptionHandler
{
Expand Down Expand Up @@ -241,7 +241,9 @@ private function shouldProcessException($exception)
*/
private function getConfigForEnvironment()
{
return $this->environmentConfigurations[$this->environment];
return isset($this->environmentConfigurations[$this->environment])
? $this->environmentConfigurations[$this->environment]
: null;
}

protected function log($message)
Expand Down Expand Up @@ -315,4 +317,4 @@ public function setEnvironmentConfigurations($environmentConfigurations)
{
$this->environmentConfigurations = $environmentConfigurations;
}
}
}
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"require" : {
"php": ">=5.3.2",
"symfony/framework-bundle": "2.*"
"symfony/framework-bundle": "~3.0"
},
"autoload" : {
"psr-0" : {
Expand All @@ -29,4 +29,4 @@
"dev-master" : "1.0.x-dev"
}
}
}
}

0 comments on commit da1ce7c

Please sign in to comment.