1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-21 12:22:21 +02:00

Use fully-qualified name for native functions (#1887)

This commit is contained in:
Christoph Dreis
2024-06-28 10:45:25 +02:00
committed by GitHub
parent 4e03d25f6d
commit 3ba77d1d39
90 changed files with 246 additions and 245 deletions

View File

@@ -193,8 +193,8 @@ class GelfMessageFormatterTest extends TestCase
$length = 200;
foreach ($messageArray as $key => $value) {
if (!in_array($key, ['level', 'timestamp']) && is_string($value)) {
$length += strlen($value);
if (!\in_array($key, ['level', 'timestamp']) && \is_string($value)) {
$length += \strlen($value);
}
}
@@ -219,8 +219,8 @@ class GelfMessageFormatterTest extends TestCase
$length = 200;
foreach ($messageArray as $key => $value) {
if (!in_array($key, ['level', 'timestamp'])) {
$length += strlen($value);
if (!\in_array($key, ['level', 'timestamp'])) {
$length += \strlen($value);
}
}

View File

@@ -244,7 +244,7 @@ class JsonFormatterTest extends TestCase
private function formatException($exception, ?string $previous = null): string
{
$formattedException =
'{"class":"' . get_class($exception) .
'{"class":"' . \get_class($exception) .
'","message":"' . $exception->getMessage() .
'","code":' . $exception->getCode() .
',"file":"' . $this->formatExceptionFilePathWithLine($exception) .

View File

@@ -296,7 +296,7 @@ class LineFormatterTest extends TestCase
{
$formatter = new LineFormatter();
$formatter->includeStacktraces();
$formatter->setBasePath(dirname(dirname(dirname(__DIR__))));
$formatter->setBasePath(\dirname(\dirname(\dirname(__DIR__))));
$formatter->indentStackTraces(' ');
$message = $formatter->format($this->getRecord(message: "foo", context: ['exception' => new RuntimeException('lala')]));

View File

@@ -67,13 +67,13 @@ class NormalizerFormatterTest extends TestCase
'exception' => $e2,
]);
$this->assertGreaterThan(5, count($formatted['exception']['trace']));
$this->assertGreaterThan(5, \count($formatted['exception']['trace']));
$this->assertTrue(isset($formatted['exception']['previous']));
unset($formatted['exception']['trace'], $formatted['exception']['previous']);
$this->assertEquals([
'exception' => [
'class' => get_class($e2),
'class' => \get_class($e2),
'message' => $e2->getMessage(),
'code' => $e2->getCode(),
'file' => $e2->getFile().':'.$e2->getLine(),
@@ -416,7 +416,7 @@ class NormalizerFormatterTest extends TestCase
{
try {
$arg = new TestInfoLeak;
call_user_func([$this, 'throwHelper'], $arg, $dt = new \DateTime());
\call_user_func([$this, 'throwHelper'], $arg, $dt = new \DateTime());
} catch (\Exception $e) {
}

View File

@@ -69,7 +69,7 @@ class ScalarFormatterTest extends TestCase
'bat' => ['foo' => 'bar'],
'bap' => (string) $dt,
'ban' => [
'class' => get_class($exception),
'class' => \get_class($exception),
'message' => $exception->getMessage(),
'code' => $exception->getCode(),
'file' => $exception->getFile() . ':' . $exception->getLine(),
@@ -97,7 +97,7 @@ class ScalarFormatterTest extends TestCase
$this->assertSame($this->encodeJson([
'exception' => [
'class' => get_class($exception),
'class' => \get_class($exception),
'message' => $exception->getMessage(),
'code' => $exception->getCode(),
'file' => $exception->getFile() . ':' . $exception->getLine(),