src/components/GitHub.php
public function createRepo(string $repo = null)
    {
        $end = $this->getVendorType() === 'org'
            ?'/orgs/' . $this->getVendor() . '/repos'
            : '/user/repos'
        ;
        $res = $this->request('POST', $end, [
            'name'        => $this->getName(),
            'description' => $this->getDescription(),
        ]);
        if (Helper::isResponseOk($res)) {
            echo "\ngit remote add origin git@github.com:{$this->getFullName()}.git\n";
            echo "git push -u origin master\n";
        }

        return $res;
    }
public function createRepo(string $repo = null)
    {
        $end = $this->getVendorType() === 'org'
            ?'/orgs/' . $this->getVendor() . '/repos'
            : '/user/repos'
        ;
        $res = $this->request('POST', $end, [
            'name'        => $this->getName(),
            'description' => $this->getDescription(),
        ]);
        if (Helper::isResponseOk($res)) {
            echo "\ngit remote add origin git@github.com:{$this->getFullName()}.git\n";
            echo "git push -u origin master\n";
        }

        return $res;
    }
public function createRepo ( string $ repo = null ) { $ end = $ this -> getVendorType ( ) === 'org' ? '/orgs/' . $ this -> getVendor ( ) . '/repos' : '/user/repos' ; $ res = $ this -> request ( 'POST' , $ end , [ 'name' => $ this -> getName ( ) , 'description' => $ this -> getDescription ( ) , ] ) ; if ( Helper :: isResponseOk ( $ res ) ) { echo "\ngit remote add origin git@github.com:{$this->getFullName()}.git\n" ; echo "git push -u origin master\n" ; } return $ res ; }
Create the repo on GitHub.
@return int exit code
Create the repo on GitHub .