[TASK] Have comsumeWhiteSpace() return the consumed - #1477
Conversation
98780e0 to
c8662b8
Compare
954a108 to
299c2ea
Compare
299c2ea to
aae0448
Compare
|
I hope David Gilmour will appreciate this. |
Instead, have the comments array passed by reference to be appended to. This avoids various methods having to do an `array_merge`. Also, knowing if any whitespace was consumed will be needed for #1471.
aae0448 to
bf1bff3
Compare
I don't understand the connection to this PR. 😢 Can you help me out? |
oliverklee
left a comment
There was a problem hiding this comment.
Looks very good code-wise. Maybe we can add some human-readable description explaining how the method works.
Add a test to confirm non-whitespace is not consumed. Tighten up a type annotation.
I've added some description to the DocBlock for the method. I've also added a test to confirm non-whitespace is not consumed, and tightened up a type annotation. |
While writing the tests, I had Pink Floyd's Wish You Were Hear as an earworm, so when constructing some test comments, I put in some of the lyrics from it. (It's akin to the Hello Dolly example plugin that comes preinstalled with WordPress.) |
Instead, have the comments array passed by reference to be appended to. This avoids various methods having to do an
array_merge. Also, knowing if any whitespace was consumed will be needed for #1471.