Skip to content

Remove ClassDefinitionBuilder

Jiří Pudil requested to merge remove-builder into master

Reacts to https://gitlab.grifart.cz/grifart/class-scaffolder/-/merge_requests/42#note_85152

Points of interest:

I've made the thatImplements() and decoratedBy() methods variadic, mainly because they were easier to use in tests that way, but I say let's see if we get used to it in application definition files as well.

I've added a little BC hack workaround (08399b83) so that the definition files and functions we have now in our applications should still work. I'll let you decide whether we keep this, or remove it and update the definitions in the application code. The original ClassDefinitionBuilder API is preserved, but triggers an E_USER_DEPRECATED error (211ee135).

As a side note, I think now the longer method names (step 3 of !43 (merged)) make even more sense. $builder->decorate($decorator) is not ideal, but still acceptable. $definition->decorate($decorator), however, totally reverses the order - it's the decorator that decorates the definition, but the code somewhat suggests the opposite.

cc @jkuchar1 @dkurowski

Edited by Jiří Pudil

Merge request reports