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

feature: tighten return types of config helper by using dynamic analysis #229

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mr-feek
Copy link
Collaborator

@mr-feek mr-feek commented Jun 17, 2022

This PR should tighten the return types of the config helper to be the actual resolved type at runtime, rather than Repository|mixed.

This should result in proper types being returned, and reducing the number of PossiblyInvalidCast that psalm emits after using the config helper

@mr-feek mr-feek added the enhancement New feature or request label Jun 17, 2022
@mr-feek
Copy link
Collaborator Author

mr-feek commented Jun 17, 2022

Going to leave this open while i ponder how types might change depending on environment configuration

@mr-feek mr-feek changed the base branch from master to 1.x June 17, 2022 18:16
@mr-feek mr-feek changed the base branch from 1.x to master June 17, 2022 18:16
@mr-feek
Copy link
Collaborator Author

mr-feek commented Jun 17, 2022

note: always add the type of the default value to the return union type

@mr-feek
Copy link
Collaborator Author

mr-feek commented Jun 21, 2022

I made a preliminary PR to at least correct the basic typehint of config which i will ship first #230

@alies-dev alies-dev added release:feature for PRs only (used by release-drafter) release:minor for PRs only (used by release-drafter) and removed enhancement New feature or request labels Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:feature for PRs only (used by release-drafter) release:minor for PRs only (used by release-drafter)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants