Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So this PR attempts to fix a bug that I think was introduced in 5.4.16 (5d9b363), but only became visible in 5.4.19 (ebe568c)
It was identified in this issue: #19122
Basically if you run
make()
ormakeWith()
- they will both callresolve()
which will correctly set the parameter stack (using$this->with
).Depending on the path -
resolve()
may callbuild()
- so thebuild()
function uses the parameter stack as part of the process - which is all correct.But the problem is you can also call
build()
directly (it is apublic
method). In this situation the parameter stack is never set (because it is not used) - but the function assumes it was. When the check on the parameter stack occurs, it can returnfalse
if the array was empty.In 5.4.16 -> 5.4.18 this was not noticed, because the parameter stack would always have arrays (incorrectly) left over from previous use (that was the memory leak fixed in 5.4.19) - and thus would never return
false
. It would actually even possibly return an incorrect value from the previous build.But in 5.4.19 we stopped the eronous/incorrect population of the parameter stack when it was not used, and now you can sometimes have a situation where
build()
checks an empty parameter stack.Further - the reason all the test pass for 5.4.16 onwards is that there does not seem to be any
build()
tests in any of the framework unit tests? There are tests formake()
etc that can callbuild()
- but none forbuild()
itself which is a public method - which is how this slipped through.I've added a couple of tests that would fail without this change, to help prevent regression.