Closed DanielBadura closed 1 year ago
This is valid and expected in BetterReflection.
Yup, we don't allow getting values for initializer expressions, since they can trigger autoloading, and avoiding autoloading is the primary purpose of this library.
Should I open another issue then for BC-Check?
Also the one error in between the new initialize errors is about a default enum value. This should be possible to solve, right?
Yeah, I think the @throws
in roave/backward-compatibility-check
is not handled.
I suggest raising a PR directly, perhaps.
Also the one error in between the new initialize errors is about a default enum value. This should be possible to solve, right?
Fetching an enum still causes it to autoload, heh
Yeah, I think the
@throws
inroave/backward-compatibility-check
is not handled.I suggest raising a PR directly, perhaps.
If i would know exactly what to do, sure. Already looking into it..
Fetching an enum still causes it to autoload, heh
True...
Fetching an enum still causes it to autoload, heh
No, I think this should be resolved without autoload.
@DanielBadura Can you try different enum case? There may be problem with the name New
.
Tried it already here https://github.com/patchlevel/event-sourcing/pull/331/commits/8384f5b5667b364941a97834d3ee850020cb570b
But there the "base" was still having the enum with New
so could also possibly that why it was still failing.
My bad, @Ocramius is right. Enum::SOME_CASE
returns instance, so it cannot be resolved. It looks like a constant access, but it's not.
Yeah, getting the string
value might be possible but this would not be the real value passed to the method. So i guess this is not possible without autoloading and could also be handled somehow in roave/backward-compatibility-check
so that it will not produce errors there.
Again, coming originally from
BackwardsCompatibilityCheck
. Running it results right now to some Skipped checks due to an error inBetterReflection
. Here the output from BC-Check:So I tried to get an reproducer for this and came up with this TestCase:
Which leads to this error:
This is due to https://github.com/Roave/BetterReflection/blob/6.5.x/src/NodeCompiler/CompileNodeToValue.php#L61-L63.
I will try to provide a patch for it.