镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Use more precise return type for StreamInterface::getMetadata - #103

Open
jtojnar wants to merge 1 commit into
php-fig:masterfrom
jtojnar:stream-metadata
Open

jtojnar wants to merge 1 commit into
php-fig:masterfrom
jtojnar:stream-metadata

Conversation

@jtojnar

@jtojnar jtojnar commented Mar 8, 2023

Copy link
Copy Markdown

The array keys are always strings.

And when null is passed as $key argument, it should always return an array. But that can be only concisely expressed in PHPStan – Psalm requires a template type for conditional types. So let’s use prefixed annotation.

The array keys are always strings.

And when `null` is passed as `$key` argument, it should always return an array. But that can be only concisely expressed in PHPStan – Psalm requires a template type for conditional types. So let’s use prefixed annotation.
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.

1 participant