Skip to content

API refactoring a bit [BC break]

Daniel Kurowski requested to merge class-in-namespace into master

(Breaking) changes overview:

  • ClassDecorator#decorate() params changed
    • from: (PhpNamespace $namespace, ClassType $classType, ClassDefinition $definition)
    • to: (ClassInNamespace $classInNamespace, ClassDefinition $definition)
    • ClassInNamespace is wrapper for namespace and class type
    • reason: we need to pass these information about class twice into decorators (because of #16 (closed)) – once for class currently being cooked, once for the class already cooked from previous scaffolding. It would be a mess to pass 5 params thus I've tried to squash them into wrappers
  • ClassDecorator#decorate() $classInNamespace param further renamed to $draft
    • reason: as we will be passing class currently being generated and already existent, I've decided to name them draft and current. Better name suggestions welcomed.
  • ClassDecorator#decorate() params swapped
    • from: (ClassInNamespace $classInNamespace, ClassDefinition $definition)
    • to: (ClassDefinition $definition, ClassInNamespace $classInNamespace)
    • reason: as there will be current as well, I thought of sorting it a bit. It made sense to me start with a recipe and then follow with meal on the cook – the one being cooked and then the one already cooked we take igredients from (ehm.. this simile doesn't make much sense)
  • ClassDecorator#decorate() – added ClassInNamespace $current param finally – so that we can process #16 (closed)
Edited by Daniel Kurowski

Merge request reports

Loading