@@ 91-104 (lines=14) @@ | ||
88 | * @param OutputInterface $output |
|
89 | * @return string |
|
90 | */ |
|
91 | protected function askApiKey(InputInterface $input, OutputInterface $output) |
|
92 | { |
|
93 | $question = (new Question('Enter API key: ')) |
|
94 | ->setValidator(function ($answer) { |
|
95 | if (is_null($answer)) { |
|
96 | throw new \InvalidArgumentException("API key can't be null."); |
|
97 | } |
|
98 | ||
99 | return $answer; |
|
100 | }) |
|
101 | ->setMaxAttempts(2); |
|
102 | ||
103 | return $this->getHelper('question')->ask($input, $output, $question); |
|
104 | } |
|
105 | ||
106 | /** |
|
107 | * Ask for secret key. |
|
@@ 113-126 (lines=14) @@ | ||
110 | * @param OutputInterface $output |
|
111 | * @return string |
|
112 | */ |
|
113 | protected function askSecretKey(InputInterface $input, OutputInterface $output) |
|
114 | { |
|
115 | $question = (new Question('Enter secret key: ')) |
|
116 | ->setValidator(function ($answer) { |
|
117 | if (is_null($answer)) { |
|
118 | throw new \InvalidArgumentException("Secret key can't be null."); |
|
119 | } |
|
120 | ||
121 | return $answer; |
|
122 | }) |
|
123 | ->setMaxAttempts(2); |
|
124 | ||
125 | return $this->getHelper('question')->ask($input, $output, $question); |
|
126 | } |
|
127 | ||
128 | /** |
|
129 | * Dump cache file of APIs list. |