Skip to content

Fix enchant_broker_list_dicts() return type#257

Merged
ondrejmirtes merged 1 commit intophpstan:masterfrom
villfa:fix/enchant_broker_list_dicts
Jun 24, 2020
Merged

Fix enchant_broker_list_dicts() return type#257
ondrejmirtes merged 1 commit intophpstan:masterfrom
villfa:fix/enchant_broker_list_dicts

Conversation

@villfa
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

villfa commented Jun 24, 2020

I've updated the return type to be more precise

@ondrejmirtes
Copy link
Copy Markdown
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