Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Pentzold committed May 22, 2017
2 parents 26c7de1 + e5ff7eb commit 1c48ebb
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -14,6 +14,8 @@ matrix:
- php: 7.1
- php: nightly
fast_finish: true
allow_failures:
- php: nightly

before_script:
- echo "extension = redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
Expand Down
2 changes: 1 addition & 1 deletion src/Monolog/ErrorHandler.php
Expand Up @@ -175,7 +175,7 @@ public function handleError($code, $message, $file = '', $line = 0, $context = [

// fatal error codes are ignored if a fatal error handler is present as well to avoid duplicate log entries
if (!$this->hasFatalErrorHandler || !in_array($code, self::$fatalErrors, true)) {
$level = isset($this->errorLevelMap[$code]) ? $this->errorLevelMap[$code] : LogLevel::CRITICAL;
$level = $this->errorLevelMap[$code] ?? LogLevel::CRITICAL;
$this->logger->log($level, self::codeToString($code).': '.$message, ['code' => $code, 'message' => $message, 'file' => $file, 'line' => $line]);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Monolog/Handler/ChromePHPHandler.php
Expand Up @@ -132,7 +132,7 @@ protected function send()
return;
}

self::$json['request_uri'] = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
self::$json['request_uri'] = $_SERVER['REQUEST_URI'] ?? '';
}

$json = @json_encode(self::$json);
Expand Down
8 changes: 4 additions & 4 deletions src/Monolog/Handler/PHPConsoleHandler.php
Expand Up @@ -203,10 +203,10 @@ private function handleErrorRecord(array $record)
$context = $record['context'];

$this->connector->getErrorsDispatcher()->dispatchError(
isset($context['code']) ? $context['code'] : null,
isset($context['message']) ? $context['message'] : $record['message'],
isset($context['file']) ? $context['file'] : null,
isset($context['line']) ? $context['line'] : null,
$context['code'] ?? null,
$context['message'] ?? $record['message'],
$context['file'] ?? null,
$context['line'] ?? null,
$this->options['classesPartialsTraceIgnore']
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Monolog/Processor/WebProcessor.php
Expand Up @@ -88,7 +88,7 @@ public function addExtraField(string $extraName, string $serverName): self
private function appendExtraFields(array $extra): array
{
foreach ($this->extraFields as $extraName => $serverName) {
$extra[$extraName] = isset($this->serverData[$serverName]) ? $this->serverData[$serverName] : null;
$extra[$extraName] = $this->serverData[$serverName] ?? null;
}

if (isset($this->serverData['UNIQUE_ID'])) {
Expand Down
4 changes: 4 additions & 0 deletions tests/Monolog/LoggerTest.php
Expand Up @@ -553,6 +553,10 @@ public function tearDown()
*/
public function testUseMicrosecondTimestamps($micro, $assert, $assertFormat)
{
if (PHP_VERSION_ID === 70103) {
$this->markTestSkipped();
}

$logger = new Logger('foo');
$logger->useMicrosecondTimestamps($micro);
$handler = new TestHandler;
Expand Down

0 comments on commit 1c48ebb

Please sign in to comment.