| Conditions | 2 |
| Paths | 2 |
| Total Lines | 24 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 17 |
| CRAP Score | 2 |
| Changes | 5 | ||
| Bugs | 2 | Features | 0 |
| 1 | <?php |
||
| 17 | 2 | public function __construct($tokenFile = '~/.composer-init') |
|
| 18 | { |
||
| 19 | 2 | parent::__construct('Composer Init', '0.3'); |
|
| 20 | |||
| 21 | 2 | $packagist = new Client(['base_uri' => 'https://packagist.org']); |
|
| 22 | 2 | $token = new Token($tokenFile); |
|
| 23 | |||
| 24 | 2 | $githubOptions = ['base_uri' => 'https://api.github.com']; |
|
| 25 | |||
| 26 | 2 | if (null !== $token->get()) { |
|
| 27 | 1 | $githubOptions['query']['access_token'] = $token->get(); |
|
| 28 | 1 | } |
|
| 29 | |||
| 30 | 2 | $github = new Client($githubOptions); |
|
| 31 | |||
| 32 | 2 | $gitConfig = new GitConfig(); |
|
| 33 | 2 | $inflector = new Inflector(); |
|
| 34 | 2 | $prompts = new Prompts($gitConfig, $github, $inflector); |
|
| 35 | 2 | $template = new Template($github); |
|
| 36 | |||
| 37 | 2 | $this->add(new SearchCommand($packagist)); |
|
| 38 | 2 | $this->add(new UseCommand($template, $prompts, $packagist)); |
|
| 39 | 2 | $this->add(new TokenCommand($token)); |
|
| 40 | 2 | } |
|
| 41 | } |
||
| 42 |