<commit_before><?php
/**
 * Example of retrieving an authentication token of the Github service
 *
 * PHP version 5.4
 *
 * @author     Lusitanian <<EMAIL>>
 * @author     <NAME> <<EMAIL>>
 * @copyright  Copyright (c) 2012 The authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 */
use OAuth\OAuth2\Service\GitHub;
use OAuth\Common\Storage\Memory;
use OAuth\Common\Consumer\Credentials;
use OAuth\Common\Http\Uri;

/**
 * Bootstrap the example
 */
require_once __DIR__ . '/bootstrap.php';

// In-memory storage
$storage = new Memory();

// Setup the credentials for the requests
$credentials = new Credentials(
    $servicesCredentials['github']['key'],
    $servicesCredentials['github']['secret'],
    $currentUri->getAbsoluteUri()
);

// Instantiate the google service using the credentials, http client and storage mechanism for the token
$gitHub = new GitHub($credentials, $httpClientProvider();, $storage, [ GitHub::SCOPE_USER ]);

if( !empty( $_GET['code'] ) ) {
    // This was a callback request from google, get the token
    $gitHub->requestAccessToken( $_GET['code'] );
    $result = json_decode( $gitHub->sendAuthenticatedRequest( new Uri( 'https://api.github.com/user/emails' ), [], 'GET' ), true );
    echo 'The first email on your github account is ' . $result[0];

} elseif( !empty($_GET['go'] ) && $_GET['go'] == 'go' ) {
    $url = $gitHub->getAuthorizationUrl();
    header('Location: ' . $url);

} else {
    $url = $currentUri->getRelativeUri() . '?go=go';
    echo "<a href='$url'>Login with Github!</a>";
}<commit_msg>Fixed typo<commit_after><?php
/**
 * Example of retrieving an authentication token of the Github service
 *
 * PHP version 5.4
 *
 * @author     Lusitanian <<EMAIL>>
 * @author     <NAME> <<EMAIL>>
 * @copyright  Copyright (c) 2012 The authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 */
use OAuth\OAuth2\Service\GitHub;
use OAuth\Common\Storage\Memory;
use OAuth\Common\Consumer\Credentials;
use OAuth\Common\Http\Uri;

/**
 * Bootstrap the example
 */
require_once __DIR__ . '/bootstrap.php';

// In-memory storage
$storage = new Memory();

// Setup the credentials for the requests
$credentials = new Credentials(
    $servicesCredentials['github']['key'],
    $servicesCredentials['github']['secret'],
    $currentUri->getAbsoluteUri()
);

// Instantiate the google service using the credentials, http client and storage mechanism for the token
$gitHub = new GitHub($credentials, $httpClientProvider(), $storage, [ GitHub::SCOPE_USER ]);

if( !empty( $_GET['code'] ) ) {
    // This was a callback request from google, get the token
    $gitHub->requestAccessToken( $_GET['code'] );
    $result = json_decode( $gitHub->sendAuthenticatedRequest( new Uri( 'https://api.github.com/user/emails' ), [], 'GET' ), true );
    echo 'The first email on your github account is ' . $result[0];

} elseif( !empty($_GET['go'] ) && $_GET['go'] == 'go' ) {
    $url = $gitHub->getAuthorizationUrl();
    header('Location: ' . $url);

} else {
    $url = $currentUri->getRelativeUri() . '?go=go';
    echo "<a href='$url'>Login with Github!</a>";
}
{'fraction_non_alphanumeric': 0.16508238276299111, 'fraction_numerical': 0.005069708491761723, 'mean_word_length': 4.125, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 27, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5174006', 'n_tokens_mistral': 998, 'n_tokens_neox': 978, 'n_words': 265}