Skip to content

Improve typing of arrays and callables #56470

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

Draft
wants to merge 25 commits into
base: 12.x
Choose a base branch
from

Conversation

shaedrich
Copy link
Contributor

No description provided.

@@ -39,7 +39,7 @@ public function connect(array $servers, $connectionId = null, array $options = [
* Get a new Memcached instance.
*
* @param string|null $connectionId
* @param array $credentials
* @param array{string, string} $credentials
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Types taken from Memcached::setSaslAuthData()

@@ -287,6 +287,7 @@ protected function createDynamodbDriver(array $config)
/**
* Create new DynamoDb Client instance.
*
* @param array{region: string, endpoint?: string, key?: string, secret?: string, token?: string} $config
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Types taken from \Aws\DynamoDb\DynamoDbClient

@shaedrich
Copy link
Contributor Author

@browner12 What do you dislike about this PR?

@LjjGit
Copy link
Contributor

LjjGit commented Jul 30, 2025

Can PphStorm recognize these formats?

@shaedrich
Copy link
Contributor Author

As far as I'm concerned, they are recognized by PHPStan as well as psalm, which should cover the majority of the ecosystem. I don't have PHPStorm installed to check explicitly, but assuming, it follows common sense, that should work, I'd say.

@taylorotwell taylorotwell marked this pull request as draft July 30, 2025 15:29
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