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

Clarify type of 2nd argument context #74

Merged
merged 3 commits into from
May 3, 2021
Merged

Conversation

Jeckerson
Copy link
Contributor

According to psalm, there is an error:

ERROR: MethodSignatureMismatch - ide/5.0.0-alpha.1/Phalcon/DataMapper/Pdo/Profiler/MemoryLogger.zep.php:21:7 - Argument 2 of Psr\Log\AbstractLogger::alert has wrong type 'mixed', expecting 'array<array-key, mixed>' as defined by Psr\Log\LoggerInterface::alert (see https://psalm.dev/042)

This blocks phalcon/cphalcon#15362

Copy link
Member

@Jean85 Jean85 left a comment

Choose a reason for hiding this comment

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

Sorry but I'm 👎 on this change: you're making the type more generic without any reason.

@Jeckerson
Copy link
Contributor Author

Then implementation must be compliant with this "not generic" type.

* @param array $context

@Jean85
Copy link
Member

Jean85 commented May 3, 2021

The issue is in the AbstractLogger then. By spec, the $context is an array of mixed, unspecified data: https://www.php-fig.org/psr/psr-3/

So mixed[] is correct.

@Jean85 Jean85 requested a review from Seldaek May 3, 2021 08:33
@Seldaek Seldaek merged commit d49695b into php-fig:master May 3, 2021
@Seldaek
Copy link
Collaborator

Seldaek commented May 3, 2021

Thanks, looks good to me like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants