-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
fix: assert_line_count on multiline #265
Conversation
28e0735
to
4925501
Compare
@@ -318,8 +318,9 @@ function assert_greater_or_equal_than() { | |||
|
|||
function assert_line_count() { |
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.
I feel sorry for opening this can of worms :-).
thanks for working thru all these problem.
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.
You opened a pandora box... nah, it is also fun - even though I really dislike bash 😝
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.
"you just need to count the lines" - they said
📚 Description
Issue: phpstan/phpstan-src#3160 (comment)
Multiline strings are passes as multiple args to
assert_line_count
which makes it complicated to pass around and manipulate as unique string.🔖 Changes
assert_line_count
uses first arg for the expected and the rest (think about avariadic ...string arg
) will be the string itself that will be use to count its lines.💡 Extra
Tradeoff: I had to rollback #262 in order to make it working. I think I can make it back again, but it might take another couple of hours... so, I thought to ship this first, make it work, and then in a follow up make it better.