Created
July 9, 2016 20:57
-
-
Save heiglandreas/c16fd1301bec0636ce5a7b1e9fc12cd7 to your computer and use it in GitHub Desktop.
First ideas for interfaces for console-commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface CommandInterface | |
{ | |
public function execute(InputInterface $input, OutputInterface $output); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface InputInterface | |
{ | |
public function getArgument($argName) : mixed; | |
public function getArguments() : array; | |
public function getOption($argName) : mixed; | |
public function getOptions() : array; | |
public function hasArgument($argName) : boolean; | |
public function hasOption($argName) : boolean; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface OutputInterface | |
{ | |
public function getVerbosity() : int; | |
/** | |
* @param string|array $message | |
*/ | |
public function write($message, bool $newline = false, int $options = 0) : void; | |
/** | |
* @param string|array $message | |
*/ | |
public function writeln($message, int $options = 0) : void; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment