Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.0] Refactor Commands #281

Open
carbontwelve opened this issue Jan 2, 2018 · 0 comments
Open

[2.0] Refactor Commands #281

carbontwelve opened this issue Jan 2, 2018 · 0 comments
Milestone

Comments

@carbontwelve
Copy link
Member

There are two commands that depend upon Tapestry to construct the Project class. To do so they both set the Input and Output for Tapestry and validate it. This isn't a problem given that neither code paths will ever be executed in the same cycle - however the duplicate code bothers me.

The shared code needs placing in once place:

        try {
            $this->tapestry->setInput($this->input);
            $this->tapestry->setOutput($this->output);
            $this->tapestry->validateInput();
        } catch (InvalidConsoleInputException $e) {
            $this->output->writeln('<error>[!]</error> '.$e->getMessage().' Doing nothing and exiting.');
            return 1;
        }

The very fact that this code is duplicated means that the way Tapestry works with relation to the command line is overly complex and requires a refactor.

The Tapestry class is both the Container and application, while the cli Application is separate. I feel that this also requires a refactor and is addressed in issue: #280

@carbontwelve carbontwelve added this to the 2.0.0 milestone Jan 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant