Skip to content

Begin refactoring Module\Item

As a first step I've split the two branches of the init() function into separate function. I've also lifted the $item_id variable that was local to each branch into a property on the Item controller object.

There's lots of more opportunities to split things into smaller, and more reusable functions to reduce duplication. I expect that to be a slow moving and gradual process.

Since this is a pretty vital module, I'll rather move slowly, and try to cover every change with tests before making them.

In the end I hope to remove the Item (entity) specific stuff from the module and into the entity class. I'm also thinking we should probably do something about naming, as having several classes with the same name (but in different namespaces) can quickly become confusing.

Anyways, one step at the time...

Merge request reports

Loading