Change message 'typehint' to 'type' and 'typehint type' to 'type'.#270
Change message 'typehint' to 'type' and 'typehint type' to 'type'.#270Danack wants to merge 11 commits intophpstan:masterfrom Danack:types_not_hints
Conversation
|
This wouldn't be a good idea to do in minor version, but I'll keep this open and merge it once I open 1.0-dev. Thanks. |
Ooo. A 1.0? la-dee-dah. Going to close and reopen to retrigger the build, as apparently github actions don't trigger off new commits....which seems odd. |
f54fd5f to
eca550a
Compare
d45166a to
3526237
Compare
efd31ce to
0471f87
Compare
|
Hi, I just opened 1.0-dev, if you rebase this and make sure the nomenclature is correct everywhere, I'll merge it. Thanks. |
That still seems odd. |
|
That appears to be updated. I think the phrase |
There was a problem hiding this comment.
maybe
| 'Return type of function %s() has invalid type %%s.', | |
| 'Function %s() has invalid return type %%s.', |
(same for the method case below)
There was a problem hiding this comment.
That would match the suggestion I have for anonymous functions.
Yes, please, update all the four rules: about closures, about arrow functions, about functions, and about methods :) |
|
Something broken in the CI: Previously working - https://github.com/phpstan/phpstan-src/runs/3588423148?check_suite_focus=true#step:6:182 Broken now - https://github.com/phpstan/phpstan-src/runs/3599628069?check_suite_focus=true#step:6:182 It's not obviously my fault. Any suggestions? |
|
I guess the problem is related to: composer/composer#10102 |
e.g. 'Return type of anonymous function has invalid type %s.' => 'Anonymous function has invalid return type %s.',
|
I've rebased it and some relevant tests are now failing. |
|
Thank you! Merged as: e1ccc85 |
|
@ondrejmirtes fyi - I think there's one more to do:
in file tests/PHPStan/Levels/data/typehints-0.json However, I've just spent 15 minutes trying to figure out what is touching whitespace automatically in that file, as something keeps adding an extra line at the end of that file. |
That's me when I edit the file manually on my machine 😂 But since PHPUnit compares JSON against JSON, it doesn't matter. |
Not sure if you've chosen to keep 'typehint' rather than 'type', but it is my own personal windmill so here is a PR to avoid using legacy description of types.
Some of them were changed from:
To:
But they might be better as:
But I didn't do that change.
Also, didn't touch the internal classnames as they don't get shown to endusers in the error messages.