Ver Fonte

Remove not needed checks for PHP version

George Mponos há 7 anos atrás
pai
commit
e855ad8923
2 ficheiros alterados com 2 adições e 2 exclusões
  1. 1 1
      src/Monolog/Handler/NewRelicHandler.php
  2. 1 1
      tests/Monolog/LoggerTest.php

+ 1 - 1
src/Monolog/Handler/NewRelicHandler.php

@@ -89,7 +89,7 @@ class NewRelicHandler extends AbstractProcessingHandler
             unset($record['formatted']['context']['transaction_name']);
         }
 
-        if (isset($record['context']['exception']) && ($record['context']['exception'] instanceof \Exception || (PHP_VERSION_ID >= 70000 && $record['context']['exception'] instanceof \Throwable))) {
+        if (isset($record['context']['exception']) && $record['context']['exception'] instanceof \Throwable) {
             newrelic_notice_error($record['message'], $record['context']['exception']);
             unset($record['formatted']['context']['exception']);
         } else {

+ 1 - 1
tests/Monolog/LoggerTest.php

@@ -573,7 +573,7 @@ class LoggerTest extends \PHPUnit\Framework\TestCase
             // this has a very small chance of a false negative (1/10^6)
             'with microseconds' => [true, 'assertNotSame', 'Y-m-d\TH:i:s.uP'],
             // php 7.1 always includes microseconds, so we keep them in, but we format the datetime without
-            'without microseconds' => [false, PHP_VERSION_ID >= 70100 ? 'assertNotSame' : 'assertSame', 'Y-m-d\TH:i:sP'],
+            'without microseconds' => [false, 'assertNotSame', 'Y-m-d\TH:i:sP'],
         ];
     }