@@ 81-94 (lines=14) @@ | ||
78 | * @param OutputInterface $output |
|
79 | * @return string |
|
80 | */ |
|
81 | protected function askApiKey(InputInterface $input, OutputInterface $output) |
|
82 | { |
|
83 | $question = (new Question('Enter API key: ')) |
|
84 | ->setValidator(function ($answer) { |
|
85 | if (is_null($answer)) { |
|
86 | throw new \InvalidArgumentException("API key can't be null."); |
|
87 | } |
|
88 | ||
89 | return $answer; |
|
90 | }) |
|
91 | ->setMaxAttempts(2); |
|
92 | ||
93 | return $this->getHelper('question')->ask($input, $output, $question); |
|
94 | } |
|
95 | ||
96 | /** |
|
97 | * Ask for secret key. |
|
@@ 103-116 (lines=14) @@ | ||
100 | * @param OutputInterface $output |
|
101 | * @return string |
|
102 | */ |
|
103 | protected function askSecretKey(InputInterface $input, OutputInterface $output) |
|
104 | { |
|
105 | $question = (new Question('Enter secret key: ')) |
|
106 | ->setValidator(function ($answer) { |
|
107 | if (is_null($answer)) { |
|
108 | throw new \InvalidArgumentException("Secret key can't be null."); |
|
109 | } |
|
110 | ||
111 | return $answer; |
|
112 | }) |
|
113 | ->setMaxAttempts(2); |
|
114 | ||
115 | return $this->getHelper('question')->ask($input, $output, $question); |
|
116 | } |
|
117 | ||
118 | /** |
|
119 | * Dump cache file of APIs list. |