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)
Fri, Apr 12, 9:31 AM
Unknown Object (File)
Mon, Apr 8, 3:58 AM
Unknown Object (File)
Mon, Apr 8, 3:27 AM
Unknown Object (File)
Mon, Apr 8, 2:28 AM
Unknown Object (File)
Wed, Apr 3, 3:12 AM
Unknown Object (File)
Wed, Apr 3, 2:45 AM
Unknown Object (File)
Fri, Mar 29, 6:21 PM
Unknown Object (File)
Fri, Mar 29, 2:01 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-D1702
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 31690
Build 12040: 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
94

Should we have an error printed here?

src/app/Domain.php
435

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.