| 1 | <?php |
||
| 15 | abstract class BaseCommand extends Command |
||
| 16 | { |
||
| 17 | |||
| 18 | /** @var ClientInterface */ |
||
| 19 | protected $client; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * GetClassifiersCommand constructor. |
||
| 23 | * |
||
| 24 | * @param null|string $name |
||
| 25 | * @param ClientInterface $client |
||
| 26 | */ |
||
| 27 | 8 | public function __construct($name = null, ClientInterface $client = null) |
|
| 33 | |||
| 34 | /** |
||
| 35 | * Configure command |
||
| 36 | */ |
||
| 37 | 8 | protected function configure() |
|
| 38 | { |
||
| 39 | 8 | $this |
|
| 40 | 8 | ->addArgument( |
|
| 41 | 8 | 'username', |
|
| 42 | 8 | InputArgument::REQUIRED, |
|
| 43 | 'IBM Watson Service credentials username.' |
||
| 44 | 8 | ) |
|
| 45 | 8 | ->addArgument( |
|
| 46 | 8 | 'password', |
|
| 47 | 8 | InputArgument::REQUIRED, |
|
| 48 | 'IBM Watson Service credentials password.' |
||
| 49 | 8 | ) |
|
| 50 | 8 | ->addOption( |
|
| 51 | 8 | 'version-date', |
|
| 52 | 8 | '-d', |
|
| 53 | 8 | InputOption::VALUE_REQUIRED, |
|
| 54 | 'API version date, defaults to current date i.e. latest release' |
||
| 55 | 8 | ); |
|
| 56 | 8 | } |
|
| 57 | |||
| 58 | /** |
||
| 59 | * @return ClientInterface |
||
| 60 | */ |
||
| 61 | 1 | public function getDefaultClient() |
|
| 65 | |||
| 66 | /** |
||
| 67 | * @return ClientInterface |
||
| 68 | */ |
||
| 69 | 1 | public function getClient() |
|
| 73 | } |
||
| 74 |