I think this is an improvement for the following reasons:
The implicit use of the prototype Neos.Fusion:Matcher
in the Case has a few downsides:
- the php implementation is a bit hacky with the
MATCH_NORESULT
pattern- this seems a bit against how fusion objects are supposed to work as the
Neos.Fusion:Matcher
is not usable standalone. - not all fusion features like
@process
are working and cause odd (understandable) glitches
- this seems a bit against how fusion objects are supposed to work as the
- using the matcher as layer in between was probably only done to allow the use of
this
in thecondition
(at least there is a test for that)- using
this
is not that important in todays Fusion world withprops
andprivate
. - note that our proposed
@case
will not have access tothis
, but that should be understandable from the scope in other languages as the condition is separate.
- using
- for its main use-case, as we perceive it, mostly the
renderer
option is used instead oftype
andrendererPath
. That leads to additional boilerplate code. - the naming of the
Neos.Fusion:Matcher
has been there first but the introduction of theNeos.Fusion:Match
conflicts now with it and leads to conFusion. - the default case must be implemented via
condition = true
, which is a bit verbose as well. - its basically impossible to use the case and matcher in afx due to its structure: Neos.Fusion:Case in afx or should we have a Neos.Fusion:If?
- The
Neos.Fusion:Renderer
should in my opinion be split up into two more explicit prototypes (discussion). TheNeos.Fusion:Matcher
inheriting from it makes this a bit hard to completely get rid of therenderer
,renderPath
andtype
functionality in one object. So in my plan it would fit perfectly together to deprecate both and provide better dedicated replacements.
So in conclusion:
On long term we could replace the CaseImplementation and MatcherImplementation with one SwitchImplementation, which is easier to understand, has a more fitting naming and better usability due to less boilerplate code required by the fusion integrator.