Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

Console package #76

Open
wants to merge 95 commits into
base: master
Choose a base branch
from
Open

Console package #76

wants to merge 95 commits into from

Conversation

alex-phillips
Copy link
Contributor

Console package for building command line applications.

$this->flags = new InputBag();
$this->options = new InputBag();

$this->output = Output::getInstance();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The input and output should probably be passed to the command from the console when the command is registered in the console.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Input and Output is now passed into the Console object which is passed into the command object when the command is added.

@milesj
Copy link
Member

milesj commented Mar 10, 2015

Added comments for basic syntax stuff. Still need to do another pass on the classes and architecture itself.

Could also use more tests granular unit tests :P

*
* @return void
*/
public function configure(): void;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps void returns should actually be this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can, but this function should really only be called internally anyway. Thoughts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine. I'm just not 100% sure how everything is used yet :P

@alex-phillips
Copy link
Contributor Author

I've updated the AsciiTable class to use the suggested output styling (similar to npm list). Run demo to check it out.

/**
* {@inheritdoc}
*/
public function handle(Input $input, Output $output, Next<Input, Output> $next): Output {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this function need to be added as an abstract method in the AbstractKernel? (I just did inheritdoc for now just in case).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's defined on the interface, so shouldn't be necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D'oh, didn't see it there.

@milesj
Copy link
Member

milesj commented Apr 6, 2015

Added a few more comments, we're almost there!

The major issue I have is that there aren't too many tests. Whenever I write tests, I try and be as granular as possible and test every method on every class. If you could somehow mock all the classes and test as much as possible, that would be great.

I'll also clone the repo and test it out on Windows again later today.

@alex-phillips
Copy link
Contributor Author

@milesj, ping me when you're on IRC next. Can't seem to get the tests to run.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants