API refactoring a bit [BC break]
(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
- from:
-
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
andcurrent
. Better name suggestions welcomed.
- reason: as we will be passing class currently being generated and already existent, I've decided to name them
-
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)
- from:
-
ClassDecorator#decorate()
– addedClassInNamespace $current
param finally – so that we can process #16 (closed)
Edited by Daniel Kurowski