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 enchant_broker_list_dicts() return type #257

Merged
merged 1 commit into from
Jun 24, 2020
Merged

Fix enchant_broker_list_dicts() return type #257

merged 1 commit into from
Jun 24, 2020

Conversation

villfa
Copy link
Contributor

@villfa villfa commented Jun 24, 2020

enchant_broker_list_dicts() returns an array. See: https://www.php.net/manual/en/function.enchant-broker-list-dicts.php

@ondrejmirtes
Copy link
Member

Hi,

  1. The function can also return false: https://www.php.net/manual/en/function.enchant-broker-list-dicts.php
  2. Based on https://www.php.net/manual/en/function.enchant-broker-list-dicts.php, you could write a more specific array shape: https://phpstan.org/writing-php-code/phpdoc-types#array-shapes (the functionMap types are parsed through the same parser as PHPDocs)

@villfa
Copy link
Contributor Author

villfa commented Jun 24, 2020

I've updated the return type to be more precise

@ondrejmirtes
Copy link
Member

Looks great! Thank you.

@ondrejmirtes ondrejmirtes merged commit cdf5b85 into phpstan:master Jun 24, 2020
@villfa villfa deleted the fix/enchant_broker_list_dicts branch June 24, 2020 14:07
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.

2 participants