-
Notifications
You must be signed in to change notification settings - Fork 680
refactor description of types in Atomic #7409
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
Conversation
@muglug do you have an opinion on this? I don't want to botch up this if it had a specific goal I'm missing... |
Sorry, I think this is a good idea! |
Occasionally |
6a1a05d
to
fee0b13
Compare
return '"' . mb_substr($no_newline_value, 0, 80) . '...' . '"'; | ||
return "'" . mb_substr($no_newline_value, 0, 80) . '...' . "'"; | ||
} | ||
|
||
return '"' . $no_newline_value . '"'; | ||
return "'" . $no_newline_value . "'"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@orklah Was this an intentional change? It caused one of my tests to fail when rebasing because $foo = "bar"
now has type 'bar'
instead of "bar"
. Could it affect plugins?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was indeed intended. I mentionned it in the PR
getId() on TLiteralString was using double quotes to display the types. This is not consistent with the rest of the types (in docblock for example) so I changed that
I didn't thought about plugins, I'll add this in UPGRADE file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR propose to refactor the description of types in Atomic.
I always thought it was messy.
For example:
Aaand I'm already lost. Adding to that the fact that no documentation exists on that, it didn't help.
What I changed:
$exact
who defaults to true. When true, it displays the most detailed type it can, otherwise, it displays a generic version (it depends widely on each type)almost every other change is a consequence of changing the things above. Mainly:
I'm still not completely satisfied. I think there is still too many redundancy between getId(), getKey(), toNamespacedString, toPhpString. I feel we should be able to go further but it's already a big step forward
@muglug Do you think this goes in the right direction? Maybe you have special insight here? I'm not sure what getId() was supposed to be. I also have difficulties understanding when getKey should be overrided and with what value