Page MenuHomePhorge

Better structure for console commands, and unification of code/behavior
AbandonedPublic

Authored by vanmeeuwen on Oct 5 2020, 11:45 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Mar 27, 5:11 AM
Unknown Object (File)
Sun, Mar 17, 1:26 AM
Unknown Object (File)
Mon, Mar 11, 6:54 AM
Unknown Object (File)
Wed, Mar 6, 12:14 PM
Unknown Object (File)
Wed, Mar 6, 10:27 AM
Unknown Object (File)
Wed, Mar 6, 1:10 AM
Unknown Object (File)
Tue, Mar 5, 10:47 PM
Unknown Object (File)
Thu, Feb 29, 8:25 PM
Subscribers
Restricted Project

Details

Reviewers
machniak
Group Reviewers
Restricted Project
Summary

Merge branch 'master' into arcpatch-D1684

Standardize downloading a file

Demonstrate command restructuring with magic

Test Plan

./phpunit (tests not updated)

Diff Detail

Repository
rK kolab
Branch
arcpatch-D1684
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 31141
Build 11695: arc lint + arc unit

Event Timeline

vanmeeuwen created this revision.
  • Further reduce duplication
  • show-case implementation of 'relations'
  • Commentary and documentation
  • user:wallets translation to the new system
  • More magic
  • And... another iteration to experiment with.

Rebase on master

  • Some preliminary export commands
  • Add wallet:balances command
  • Merge branch 'master' into arcpatch-D1702
  • Move some commands to a scalpel namespace, add generic ObjectUpdateCommand
  • Move some more commands around
machniak subscribed.
machniak added inline comments.
src/app/Console/ObjectCreateCommand.php
77

This is redundant. create() method already returns the object on success.

src/app/Console/ObjectListCommand.php
43

You miss command prefix here.

src/app/Console/ObjectRelationListCommand.php
119

I think instead of ->each() you can use foreach for all above types and array. Also, \Illuminate\Database\Eloquent\Relations\Relation does not implement each() method itself, so I guess the check is not right. I'm not sure but mabe we could use is_countable() here as replacement for these three IFs.

src/app/Console/ObjectUpdateCommand.php
93 ↗(On Diff #5014)

Should we have an error printed here?

src/app/Domain.php
396

I think $this->error() in here is not correct. Also the TODO above.

This revision now requires changes to proceed.Dec 23 2020, 11:35 AM

I think this was already landed in some form.