Skip to content

Conversation

herndlm
Copy link
Contributor

@herndlm herndlm commented Aug 15, 2022

I was blindly following that comment (see diff), but tbh I did not fully understand it. Is it fine to do this or should it be rather deprecated via phpdoc?

Something should be done I think to avoid people using it instead of the static create function.

@herndlm herndlm marked this pull request as ready for review August 15, 2022 15:01
@ondrejmirtes
Copy link
Member

I'm delighted! I totally missed this when bumping to 7.2+ :)

It's fine to make it private because currently for new IntegerRangeType(1, 5) we report this:

 ------ ----------------------------------------------------------------------------------------------
  Line   test.php
 ------ ----------------------------------------------------------------------------------------------
  3      Creating new PHPStan\Type\IntegerRangeType is not covered by backward compatibility promise.
         The class might change in a minor PHPStan version.

@ondrejmirtes ondrejmirtes merged commit bd971db into phpstan:1.8.x Aug 16, 2022
@ondrejmirtes
Copy link
Member

Thank you.

@herndlm herndlm deleted the integer-range-type-constructor branch August 16, 2022 11:41
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