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

deprecate TPositiveInt #7474

Merged
merged 1 commit into from Jan 23, 2022
Merged

deprecate TPositiveInt #7474

merged 1 commit into from Jan 23, 2022

Conversation

orklah
Copy link
Collaborator

@orklah orklah commented Jan 23, 2022

This will deprecate TPositiveInt for removal in Psalm 5

@orklah orklah added the release:deprecation The PR will be included in 'Deprecated' section of the release notes label Jan 23, 2022
@orklah orklah merged commit 8230efb into vimeo:4.x Jan 23, 2022
@asgrim
Copy link

asgrim commented Jan 28, 2022

Quick question on this; is this just an internal thing that's changing, or does this mean using the type positive-int is deprecated (e.g. @param positive-int $someValueThatMustBePositiveInteger)? If so, what would the migration route be? Maybe there is no sane upper bound for int<min, max>, so would something like int<0, > (or some other notation of not specifying an upper bound) be a reasonable replacement?

@orklah
Copy link
Collaborator Author

orklah commented Jan 28, 2022

Hi Asgrim,

The phpdoc type is not deprecated, it's just now an alias of int<0, max>. So yeah, there's no migration route to prepare. Psalm however won't ever suggest positive-int in errors or with Psalter anymore.

max is an undefined upper bound so it has no definite value, the same way TPositiveInt was technically not constrained to respect PHP_INT_MAX

@asgrim
Copy link

asgrim commented Jan 28, 2022

I understand - thank you for explaining that, really appreciate it @orklah 🤘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:deprecation The PR will be included in 'Deprecated' section of the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants