PHP code example of guillermoandrae / php-github

1. Go to this page and download the library: Download guillermoandrae/php-github library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

guillermoandrae / php-github example snippets


// create the client
$client = new GitHub\Client\Client();

// pick a resource and get some useful data, like so...
$users = $client->resource('user')->findAll();
foreach ($users as $user) {
    printf('%s has %d followers.', $user->getLogin(), $user->getNumFollowers());
    echo PHP_EOL;
}

// or like so...
$org = $client->resource('organization')->find('github');
echo $org->getLocation();

// .. and rejoice!
echo 'YEESSSSSSSSSSSS!';

{
    "  "guillermoandrae/php-github": "*"
    }
}