Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix return type JsonFormatter::normalizeException() #1924

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Monolog/Formatter/JsonFormatter.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php declare(strict_types=1);

Check failure on line 1 in src/Monolog/Formatter/JsonFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1)

Ignored error pattern #^Method Monolog\\Formatter\\JsonFormatter\:\:normalizeException\(\) return type has no value type specified in iterable type array\.$# (missingType.iterableValue) in path /home/runner/work/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php was not matched in reported errors.

Check failure on line 1 in src/Monolog/Formatter/JsonFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1)

Ignored error pattern #^PHPDoc tag @return with type array\<string, array\<array\<string\>\|int\|string\>\|int\|string\>\|string is not subtype of native type array\.$# (return.phpDocType) in path /home/runner/work/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php was not matched in reported errors.

Check failure on line 1 in src/Monolog/Formatter/JsonFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1)

Ignored error pattern #^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\(\)$# (method.childReturnType) in path /home/runner/work/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php was not matched in reported errors.

Check failure on line 1 in src/Monolog/Formatter/JsonFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (latest)

Ignored error pattern #^Method Monolog\\Formatter\\JsonFormatter\:\:normalizeException\(\) return type has no value type specified in iterable type array\.$# (missingType.iterableValue) in path /home/runner/work/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php was not matched in reported errors.

Check failure on line 1 in src/Monolog/Formatter/JsonFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (latest)

Ignored error pattern #^PHPDoc tag @return with type array\<string, array\<array\<string\>\|int\|string\>\|int\|string\>\|string is not subtype of native type array\.$# (return.phpDocType) in path /home/runner/work/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php was not matched in reported errors.

Check failure on line 1 in src/Monolog/Formatter/JsonFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (latest)

Ignored error pattern #^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\(\)$# (method.childReturnType) in path /home/runner/work/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php was not matched in reported errors.

/*
* This file is part of the Monolog package.
Expand Down Expand Up @@ -216,9 +216,9 @@
* Normalizes given exception with or without its own stack trace based on
* `includeStacktraces` property.
*
* @return array<string, string|int|array<string|int|array<string>>>|string
* @return array<array-key, string|int|array<string|int|array<string>>>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keys might be non-string when max depth exceeds, and maybe in case of JsonSerializable

*/
protected function normalizeException(Throwable $e, int $depth = 0): array

Check failure on line 221 in src/Monolog/Formatter/JsonFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1)

Return type (array<array<array<string>|int|string>|int|string>) 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()

Check failure on line 221 in src/Monolog/Formatter/JsonFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (latest)

Return type (array<array<array<string>|int|string>|int|string>) 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()
{
$data = parent::normalizeException($e, $depth);
if (!$this->includeStacktraces) {
Expand Down
Loading