Magestead\Helper\Options::verifyAuth PHP Method

verifyAuth() protected method

protected verifyAuth ( $helper, Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : boolean | integer
$helper
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
return boolean | integer
    protected function verifyAuth($helper, InputInterface $input, OutputInterface $output)
    {
        $composerHome = (new Config($output))->getComposerHomeDir();
        $authFile = $composerHome . "/auth.json";
        $authObj = [];
        if (file_exists($authFile)) {
            $authJson = file_get_contents($authFile);
            $authObj = (array) json_decode($authJson, true);
            if (isset($authObj['http-basic']) && isset($authObj['http-basic']->{'repo.magento.com'})) {
                return true;
            }
        }
        $this->askForAuth($helper, $input, $output);
        $authObj['http-basic']['repo.magento.com']['username'] = $this->_m2Username;
        $authObj['http-basic']['repo.magento.com']['password'] = $this->_m2Password;
        $authJson = json_encode($authObj);
        return file_put_contents($authFile, $authJson);
    }