Page MenuHomekolab.org

Code de-duplication, API unification
ClosedPublic

Authored by machniak on Thu, Nov 18, 1:10 PM.

Details

Reviewers
mollekopf
Group Reviewers
Restricted Project
Commits
rK4211ad138d60: Code de-duplication, API unification
Test Plan

./phpunit

Diff Detail

Repository
rK kolab
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

machniak requested review of this revision.Thu, Nov 18, 1:10 PM
machniak created this revision.
machniak updated this revision to Diff 8669.Thu, Nov 18, 4:16 PM
  • De-duplicate code for handling status update process
machniak updated this revision to Diff 8675.Fri, Nov 19, 8:41 AM
  • Even more deduplication
mollekopf accepted this revision.Fri, Nov 19, 2:39 PM
mollekopf added a subscriber: mollekopf.
mollekopf added inline comments.
src/app/Http/Controllers/Controller.php
210

Personally I would prefer passing $objectProps as argument instead of $full, unless $objectProps becomes useful for other functions as well.

It would make it a bit clearer IMO what's going on: Either you serialize everything, or just the requested $objectProps.

That's not a blocker though.

This revision is now accepted and ready to land.Fri, Nov 19, 2:39 PM
machniak added inline comments.Fri, Nov 19, 2:53 PM
src/app/Http/Controllers/Controller.php
210

Yes, but this way we define the common props once (per object type), so we don't have to pass them all the time as an argument. This makes also the API responses unified "automatically", i.e. reseller, admin, user end-points, all of them return the same set of object properties.

This revision was automatically updated to reflect the committed changes.