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

Fix normalizeException types, fixes #1924

This commit is contained in:
Jordi Boggiano
2024-11-17 13:30:33 +01:00
parent 32e515fdc0
commit e940004193
3 changed files with 6 additions and 24 deletions

View File

@@ -6,24 +6,6 @@ parameters:
count: 1 count: 1
path: src/Monolog/ErrorHandler.php path: src/Monolog/ErrorHandler.php
-
message: '#^Method Monolog\\Formatter\\JsonFormatter\:\:normalizeException\(\) return type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Monolog/Formatter/JsonFormatter.php
-
message: '#^PHPDoc tag @return with type array\<string, array\<array\<string\>\|int\|string\>\|int\|string\>\|string is not subtype of native type array\.$#'
identifier: return.phpDocType
count: 1
path: src/Monolog/Formatter/JsonFormatter.php
-
message: '#^Return type \(array\) of method Monolog\\Formatter\\JsonFormatter\:\:normalizeException\(\) should be covariant with return type \(array\<string, array\<array\<string\>\|int\|string\>\|int\|string\>\|string\) of method Monolog\\Formatter\\NormalizerFormatter\:\:normalizeException\(\)$#'
identifier: method.childReturnType
count: 1
path: src/Monolog/Formatter/JsonFormatter.php
- -
message: '#^Return type \(array\<array\<mixed\>\|bool\|float\|int\|object\|string\|null\>\|bool\|float\|int\|object\|string\|null\) of method Monolog\\Formatter\\JsonFormatter\:\:normalize\(\) should be covariant with return type \(array\<array\<mixed\>\|bool\|float\|int\|string\|null\>\|bool\|float\|int\|string\|null\) of method Monolog\\Formatter\\NormalizerFormatter\:\:normalize\(\)$#' message: '#^Return type \(array\<array\<mixed\>\|bool\|float\|int\|object\|string\|null\>\|bool\|float\|int\|object\|string\|null\) of method Monolog\\Formatter\\JsonFormatter\:\:normalize\(\) should be covariant with return type \(array\<array\<mixed\>\|bool\|float\|int\|string\|null\>\|bool\|float\|int\|string\|null\) of method Monolog\\Formatter\\NormalizerFormatter\:\:normalize\(\)$#'
identifier: method.childReturnType identifier: method.childReturnType
@@ -37,13 +19,13 @@ parameters:
path: src/Monolog/Formatter/JsonFormatter.php path: src/Monolog/Formatter/JsonFormatter.php
- -
message: '#^Method Monolog\\Formatter\\NormalizerFormatter\:\:normalizeException\(\) should return array\<string, array\<array\<string\>\|int\|string\>\|int\|string\>\|string but returns array\<int, string\>\.$#' message: '#^Return type \(string\) of method Monolog\\Formatter\\LineFormatter\:\:normalizeException\(\) should be compatible with return type \(array\<array\<array\<string\>\|int\|string\>\|int\|string\>\) of method Monolog\\Formatter\\NormalizerFormatter\:\:normalizeException\(\)$#'
identifier: return.type identifier: method.childReturnType
count: 1 count: 1
path: src/Monolog/Formatter/NormalizerFormatter.php path: src/Monolog/Formatter/LineFormatter.php
- -
message: '#^Method Monolog\\Formatter\\NormalizerFormatter\:\:normalizeException\(\) should return array\<string, array\<array\<string\>\|int\|string\>\|int\|string\>\|string but returns array\<string, array\<int\<0, max\>\|string, array\<array\<string\>\|int\|string\>\|int\|string\>\|int\|string\>\.$#' message: '#^Method Monolog\\Formatter\\NormalizerFormatter\:\:normalizeException\(\) should return array\<array\<array\<string\>\|int\|string\>\|int\|string\> but returns array\<string, array\<array\<array\<string\>\|int\|string\>\|int\|string\>\|int\|string\>\.$#'
identifier: return.type identifier: return.type
count: 1 count: 1
path: src/Monolog/Formatter/NormalizerFormatter.php path: src/Monolog/Formatter/NormalizerFormatter.php

View File

@@ -216,7 +216,7 @@ class JsonFormatter extends NormalizerFormatter
* Normalizes given exception with or without its own stack trace based on * Normalizes given exception with or without its own stack trace based on
* `includeStacktraces` property. * `includeStacktraces` property.
* *
* @return array<string, string|int|array<string|int|array<string>>>|string * @return array<array-key, string|int|array<string|int|array<string>>>
*/ */
protected function normalizeException(Throwable $e, int $depth = 0): array protected function normalizeException(Throwable $e, int $depth = 0): array
{ {

View File

@@ -248,7 +248,7 @@ class NormalizerFormatter implements FormatterInterface
} }
/** /**
* @return array<string, string|int|array<string|int|array<string>>>|string * @return array<array-key, string|int|array<string|int|array<string>>>
*/ */
protected function normalizeException(Throwable $e, int $depth = 0) protected function normalizeException(Throwable $e, int $depth = 0)
{ {