master 2e955389cae3 cached
171 files
833.5 KB
232.8k tokens
843 symbols
1 requests
Download .txt
Showing preview only (891K chars total). Download the full file or copy to clipboard to get everything.
Repository: NicklasWallgren/PokemonGoAPI-PHP
Branch: master
Commit: 2e955389cae3
Files: 171
Total size: 833.5 KB

Directory structure:
gitextract_xjegl40a/

├── .gitattributes
├── .gitignore
├── LICENSE.txt
├── README.md
├── composer.json
├── examples/
│   ├── AuthenticationExample.php
│   ├── CheckChallengeExample.php
│   ├── GUI_BestCpPokemonDetails.php
│   ├── ProxyExample.php
│   ├── ReleaseOnePidgeExample.php
│   ├── RetrieveAppliedItemsExample.php
│   ├── RetrieveJournalExample.php
│   ├── RetrievePlayerPokedexExample.php
│   ├── RetrievePlayerProfileExample.php
│   ├── RetrievePlayerStatsExample.php
│   ├── RetrievePokemonCandyCountExample.php
│   ├── RetrievePokemonCountExample.php
│   ├── RetrievePokemonTraitExample.php
│   └── VerifyChallengeExample.php
├── includes/
│   ├── config.php
│   └── protocolbuffers.inc.php
├── phpunit.xml.dist
├── src/
│   ├── Api/
│   │   ├── Data/
│   │   │   ├── Data.php
│   │   │   ├── Device.php
│   │   │   └── Location.php
│   │   ├── Map/
│   │   │   ├── Data/
│   │   │   │   ├── Resource.php
│   │   │   │   ├── Resources/
│   │   │   │   │   ├── CatchablePokemon.php
│   │   │   │   │   ├── Fort.php
│   │   │   │   │   ├── NearbyPokemon.php
│   │   │   │   │   ├── SpawnPoint.php
│   │   │   │   │   └── WildPokemon.php
│   │   │   │   └── Results/
│   │   │   │       └── PokestopSpinResult.php
│   │   │   ├── Map.php
│   │   │   ├── Pokestop.php
│   │   │   └── Support/
│   │   │       └── S2.php
│   │   ├── Player/
│   │   │   ├── CheckChallenge.php
│   │   │   ├── Data/
│   │   │   │   ├── CheckChallenge/
│   │   │   │   │   └── CheckChallengeData.php
│   │   │   │   ├── Inventory/
│   │   │   │   │   ├── AppliedItem.php
│   │   │   │   │   ├── AppliedItems.php
│   │   │   │   │   ├── CandyBank.php
│   │   │   │   │   ├── CandyItem.php
│   │   │   │   │   ├── EggIncubator.php
│   │   │   │   │   ├── EggIncubators.php
│   │   │   │   │   ├── EggPokemon.php
│   │   │   │   │   ├── Item.php
│   │   │   │   │   ├── Items.php
│   │   │   │   │   ├── PokeBank.php
│   │   │   │   │   ├── Pokedex.php
│   │   │   │   │   ├── PokedexItem.php
│   │   │   │   │   ├── PokemonItem.php
│   │   │   │   │   └── Stats.php
│   │   │   │   ├── Journal/
│   │   │   │   │   ├── Fort.php
│   │   │   │   │   ├── Item.php
│   │   │   │   │   ├── Log.php
│   │   │   │   │   └── Pokemon.php
│   │   │   │   └── Profile/
│   │   │   │       ├── Avatar.php
│   │   │   │       ├── Badge.php
│   │   │   │       ├── ContactSettings.php
│   │   │   │       ├── Currencies.php
│   │   │   │       ├── Currency.php
│   │   │   │       ├── DailyBonus.php
│   │   │   │       ├── ProfileData.php
│   │   │   │       └── TutorialState.php
│   │   │   ├── Inventory.php
│   │   │   ├── Journal.php
│   │   │   └── Profile.php
│   │   ├── Pokemon/
│   │   │   ├── Collection/
│   │   │   │   └── PokemonCollection.php
│   │   │   ├── Data/
│   │   │   │   ├── MovementType.php
│   │   │   │   ├── PokemonClass.php
│   │   │   │   ├── PokemonMeta.php
│   │   │   │   ├── PokemonMetaRegistry.php
│   │   │   │   └── PokemonMove.php
│   │   │   ├── Pokemon.php
│   │   │   └── Support/
│   │   │       ├── BasePokemonRetriever.php
│   │   │       ├── CombatPointsCalculator.php
│   │   │       └── PokemonDetailsTrait.php
│   │   ├── PokemonGoApi.php
│   │   ├── Procedure.php
│   │   └── Support/
│   │       ├── Enums/
│   │       │   ├── AbstractEnum.php
│   │       │   ├── GenericEnum.php
│   │       │   ├── ItemId.php
│   │       │   ├── PokemonFamilyId.php
│   │       │   ├── PokemonId.php
│   │       │   ├── PokemonMove.php
│   │       │   └── PokemonType.php
│   │       └── Traits/
│   │           ├── MakeApiResourcesAvailable.php
│   │           └── MakeDataPropertiesCallable.php
│   ├── Authentication/
│   │   ├── AccessToken.php
│   │   ├── Config/
│   │   │   └── Config.php
│   │   ├── Contracts/
│   │   │   └── Authenticator.php
│   │   ├── Exceptions/
│   │   │   ├── AuthenticationException.php
│   │   │   ├── IllegalAuthenticationTypeException.php
│   │   │   └── ResponseException.php
│   │   ├── Factory/
│   │   │   └── Factory.php
│   │   ├── Manager.php
│   │   └── Managers/
│   │       ├── Google/
│   │       │   ├── AuthenticationCode/
│   │       │   │   ├── Authenticator.php
│   │       │   │   ├── Clients/
│   │       │   │   │   └── AuthenticationClient.php
│   │       │   │   └── Parsers/
│   │       │   │       ├── OauthTokenParser.php
│   │       │   │       ├── Parser.php
│   │       │   │       └── Results/
│   │       │   │           ├── AuthenticationTokenResult.php
│   │       │   │           └── Result.php
│   │       │   ├── AuthenticationCodeManager.php
│   │       │   ├── AuthenticationCredentials/
│   │       │   │   ├── Authenticator.php
│   │       │   │   ├── Clients/
│   │       │   │   │   └── AuthenticationClient.php
│   │       │   │   ├── Parsers/
│   │       │   │   │   ├── OauthTokenParser.php
│   │       │   │   │   ├── Parser.php
│   │       │   │   │   ├── Results/
│   │       │   │   │   │   ├── AuthenticationTokenResult.php
│   │       │   │   │   │   └── Result.php
│   │       │   │   │   └── TokenParser.php
│   │       │   │   └── Support/
│   │       │   │       └── Signature.php
│   │       │   ├── AuthenticationCredentialsManager.php
│   │       │   ├── AuthenticationOauthTokenManager.php
│   │       │   ├── AuthenticationRefreshToken/
│   │       │   │   ├── Authenticator.php
│   │       │   │   ├── Clients/
│   │       │   │   │   └── AuthenticationClient.php
│   │       │   │   └── Parsers/
│   │       │   │       ├── OauthTokenParser.php
│   │       │   │       ├── Parser.php
│   │       │   │       └── Results/
│   │       │   │           ├── AuthenticationTokenResult.php
│   │       │   │           └── Result.php
│   │       │   └── AuthenticationRefreshTokenManager.php
│   │       └── PTC/
│   │           ├── AuthenticationCredentials/
│   │           │   ├── Authenticator.php
│   │           │   ├── Clients/
│   │           │   │   └── AuthenticationClient.php
│   │           │   └── Parsers/
│   │           │       ├── AuthenticationInformationParser.php
│   │           │       ├── Parser.php
│   │           │       ├── Results/
│   │           │       │   ├── AuthenticationInformationResult.php
│   │           │       │   ├── Result.php
│   │           │       │   ├── TicketResult.php
│   │           │       │   └── TokenResult.php
│   │           │       ├── TicketParser.php
│   │           │       └── TokenParser.php
│   │           ├── AuthenticationCredentialsManager.php
│   │           └── AuthenticationOauthTokenManager.php
│   ├── Clients/
│   │   └── Proxies/
│   │       └── ClientProxy.php
│   ├── Facades/
│   │   ├── App.php
│   │   └── Log.php
│   ├── Handlers/
│   │   ├── RequestHandler/
│   │   │   └── Exceptions/
│   │   │       ├── AuthenticationException.php
│   │   │       └── ResponseException.php
│   │   ├── RequestHandler.php
│   │   └── Session.php
│   ├── Kernels/
│   │   ├── ApplicationKernel.php
│   │   └── Kernel.php
│   ├── Providers/
│   │   ├── PokemonGoApiServiceProvider.php
│   │   ├── RequestHandlerServiceProvider.php
│   │   └── ServiceProvider.php
│   ├── Requests/
│   │   ├── AuthenticateRequest.php
│   │   ├── CheckChallengeRequest.php
│   │   ├── Envelops/
│   │   │   ├── AuthInfoEnvelope.php
│   │   │   └── Factory.php
│   │   ├── EvolvePokemonRequest.php
│   │   ├── FortSearchRequest.php
│   │   ├── GetInventoryRequest.php
│   │   ├── GetJournalRequest.php
│   │   ├── GetMapResourcesRequest.php
│   │   ├── GetPlayerRequest.php
│   │   ├── RecycleInventoryItemRequest.php
│   │   ├── RenamePokemonRequest.php
│   │   ├── Request.php
│   │   ├── SetFavoritePokemonRequest.php
│   │   ├── TransferPokemonRequest.php
│   │   ├── UpgradePokemonRequest.php
│   │   ├── UseIncenseRequest.php
│   │   ├── UseItemXpBoostRequest.php
│   │   └── VerifyChallengeRequest.php
│   └── Services/
│       ├── Request/
│       │   ├── CheckChallengeRequestService.php
│       │   ├── InventoryRequestService.php
│       │   ├── JournalRequestService.php
│       │   ├── MapRequestService.php
│       │   ├── PlayerRequestService.php
│       │   ├── PokemonRequestService.php
│       │   └── PokestopRequestService.php
│       └── RequestService.php
└── tests/
    └── Api/
        └── Pokemon/
            └── PokemonTest.php

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitattributes
================================================
# Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

# Ignore all test and documentation with "export-ignore".
/.gitattributes     export-ignore
/.gitignore         export-ignore
/phpunit.xml.dist   export-ignore
/tests              export-ignore


================================================
FILE: .gitignore
================================================
.env
vendor
composer.lock
storage/logs
.idea
build


================================================
FILE: LICENSE.txt
================================================
Copyright (c) 2016, Nicklas Wallgren
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: 

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer. 
2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution. 

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


================================================
FILE: README.md
================================================
# PokemonGoAPI-PHP

[![Total Downloads][ico-downloads]][link-packagist]
[![PHP7 Ready](https://img.shields.io/badge/PHP7-ready-green.svg)][link-packagist]

Pokemon GO PHP API library

# Install
Run the command `composer require nicklasw/pkm-go-api`.

# Usage
EG:
```php
 // Create the authentication config
$config = new Config();
$config->setProvider(Factory::PROVIDER_PTC);
$config->setUser('INSERT_USER');
$config->setPassword('INSERT_PASSWORD');

// Create the authentication manager
$manager = Factory::create($config);

// Add a event listener,
$manager->addListener(function ($event, $value) {
    if ($event === Manager::EVENT_ACCESS_TOKEN) {
        /** @var AccessToken $accessToken */
        $accessToken = $value;

        // Persist the access token in session storage, cache or whatever.
    }
});

// Initialize the pokemon go application
$application = new ApplicationKernel($manager);

// Retrieve the pokemon go api instance
$pokemonGoApi = $application->getPokemonGoApi();

// Retrieve the inventory
$inventory = $pokemonGoApi->getInventory();

// Retrieve the poke bank
$pokeBank = $inventory->getPokeBank();

// Retrieve a pokemon of type pidgey
$pokemon = $pokeBank->getPokemonsByType(PokemonId::PIDGEY)->first();

// Transfer / Release the pokemon (Send to the meat grinder)
$pokemon->transfer();
```

## TODO
  - Implement the Map API
  - Improve logging

## Contributors
  - [Nicklas Wallgren](https://github.com/NicklasWallgren)
  - [Ni42](https://github.com/Ni42)
  - [All Contributors][link-contributors]

## Testing

``` bash
$ composer test
```

## Slack Chat

We use [Slack](https://slack.com) for community discussions. You can find our team here: https://pokemongoapi-php.slack.com

## Credits
- [Grover-c13](https://github.com/Grover-c13) for the inspiration
- [AeonLucid](https://github.com/AeonLucid/POGOProtos) for improved protos

[ico-downloads]: https://img.shields.io/packagist/dt/nicklasw/pkm-go-api.svg?style=flat-square

[link-packagist]: https://packagist.org/packages/nicklasw/pkm-go-api
[link-contributors]: ../../contributors


================================================
FILE: composer.json
================================================
{
    "name": "nicklasw/pkm-go-api",
    "description": "The Pokemon Go API library.",
    "keywords": ["Pokemon Go API"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.6",
        "paquettg/php-html-parser": "1.7",
        "guzzlehttp/guzzle": "^6.2.1",
        "jeremeamia/xstatic": "^1.0",
        "php-di/php-di": "^5.3",
        "phpseclib/phpseclib": "^2.0",
        "nicklasw/s2-geometry-library-php": "^v2.0",
        "nicklasw/pogoprotos-php": "^v2.0",
        "psr/log": "^1.0",
        "illuminate/support": "^5.2"
    },
    "require-dev": {
        "phpunit/phpunit": "~4.0||~5.0"
    },
    "autoload": {
        "psr-4": {
            "NicklasW\\PkmGoApi\\": "src/"
        },
        "files": [
            "includes/config.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "NicklasW\\PkmGoApi\\Test\\": "tests/"
        }
    },
    "scripts": {
        "test": "phpunit"
    }
}


================================================
FILE: examples/AuthenticationExample.php
================================================
<?php

require __DIR__ . '/../vendor/autoload.php';

use NicklasW\PkmGoApi\Authentication\AccessToken;
use NicklasW\PkmGoApi\Authentication\Config\Config;
use NicklasW\PkmGoApi\Authentication\Factory\Factory;
use NicklasW\PkmGoApi\Authentication\Manager;
use NicklasW\PkmGoApi\Kernels\ApplicationKernel;

class AuthenticationExample {

    /**
     * Run the example.
     */
    public function run()
    {
        echo "This is not a runnable script.";

        // EXAMPLE Authentication via Google user credentials
        $config = new Config();
        $config->setProvider(Factory::PROVIDER_GOOGLE);
        $config->setUser('INSERT_EMAIL');
        $config->setPassword('INSERT_PASSWORD');

        // Create the authentication manager
        $manager = Factory::create($config);

        // EXAMPLE Authentication via PTC user credentials
        $config = new Config();
        $config->setProvider(Factory::PROVIDER_PTC);
        $config->setUser('INSERT_USER');
        $config->setPassword('INSERT_PASSWORD');

        // Create the authentication manager
        $manager = Factory::create($config);

        // EXAMPLE Authentication via Google authentication code
        $config = new Config();
        $config->setProvider(Factory::PROVIDER_GOOGLE);
        $config->setAuthToken('INSERT_AUTHENTICATION_CODE');

        // EXAMPLE Authentication via Google refresh token
        $config = new Config();
        $config->setProvider(Factory::PROVIDER_GOOGLE);
        $config->setRefreshToken('INSERT_AUTHENTICATION_REFRESH_TOKEN');

        // Add a event listener,
        $manager->addListener(function ($event, $value) {

            if ($event === Manager::EVENT_ACCESS_TOKEN) {
                /** @var AccessToken $accessToken */
                $accessToken = $value;

                // Persist the access token in session storage, cache or whatever.
                // The persisted access token should be passed to the Authentication factory for authentication
            }

        });

        // Initialize the pokemon go application
        $application = new ApplicationKernel($manager);
    }

}

echo "This is not a runnable example script.";


================================================
FILE: examples/CheckChallengeExample.php
================================================
<?php
require __DIR__ . '/../vendor/autoload.php';

use NicklasW\PkmGoApi\Authentication\AccessToken;
use NicklasW\PkmGoApi\Authentication\Config\Config;
use NicklasW\PkmGoApi\Authentication\Factory\Factory;
use NicklasW\PkmGoApi\Authentication\Manager;
use NicklasW\PkmGoApi\Kernels\ApplicationKernel;

class CheckChallengeRequest {

    /**
     * Run the example.
     */
    public function run()
    {
        // Initialize the error string
        $error = null;

        // EXAMPLE Authentication via PTC user credentials
        $config = new Config();
        $config->setProvider(Factory::PROVIDER_PTC);
        $config->setUser('');
        $config->setPassword('');

        // Create the authentication manager
        $manager = Factory::create($config);

        // Initialize the example application
        $application = new ApplicationKernel($manager);

        // Bookmarklet Config - load your own bookmarklet source to customize RECaptcha iframe injection logic
        $bookmarkletUrl = "https://aa2e9e20ba653c1903e8-f9a24a1a98160d8ae95f4a0da76ebd6d.ssl.cf1.rackcdn.com/js/pgo-captcha.js?v=1";
        $bookmarkletScript = "javascript:(function(){document.body.appendChild(document.createElement('script')).src='" . $bookmarkletUrl . "';})();";

        if ($application)
        {
            $pogoApi = $application->getPokemonGoApi();
            // Ensure api and user are not empty
            if ($pogoApi && $config->getUser())
            {
                try {
                    $checkChallenge = $pogoApi->checkChallenge()->getData();
                } catch (Exception $e) {
                    // DEBUG
                    // 498 - invalid_grant in body response (missing token/expires values)
                    // 503 - Oops! It seems that Pokemon.com has had an unexpected error.
                    // 0   - default error code
                    $error = 'ERROR ' . $e->getCode() . ': ' . $e->getMessage() . '\n';
                    $checkChallenge = FALSE;
                }
                
                if ($checkChallenge)
                {
                    // Convert showChallenge boolean to string equiv
                    $flagged = var_export($checkChallenge->getShowChallenge(), true);

                    // Get challengeUrl value - appears to return " " (space) when user is not flagged for captcha
                    $challengeUrl = $checkChallenge->getChallengeUrl();

                    // If challengeUrl empty, hide "SHOW CHALLANGE" html
                    $showUrl = empty(trim($challengeUrl)) ? 'hidden' : '';

                    echo <<<EOBODY
<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Check Challenge Example</title>
        <meta name="referrer" content="no-referrer" />
    </head>
    <body>
        <div class="container">
            <h1 class="text-center">Check Challenge Example</h1>
            <pre>USER: {$config->getUser()} </pre>
            <pre>SHOW CHALLANGE: {$flagged} </pre>
            <pre class="{$showUrl}">CHALLENGE URL: <a target="_blank" rel="noreferrer" href="{$challengeUrl}">{$challengeUrl}</a></pre>
            <pre>BOOKMARKLET: <a class="btn btn-primary btn-lg" class="button" href="{$bookmarkletScript}">PGO-Captcha</a></pre>

            <div id="instructions">
                <h2>Instructions:</h2>
                <ol>
                    <li><b>Drag and Drop the [ PGO-Captcha ] bookmarklet</b> button above to your browser's bookmark toolbar.</li>
                    <li><b>Open the CHALLENGE URL</b> in a new tab.</li>
                    <li><b>Execute the PGO-Captcha bookmarklet</b> against the challenge page to display the modified captcha form.</li>
                    <li><b>Solve the captcha</b> that is displayed to generate a unique challenge token and copy it to your clipboard.</li>
                    <li><b>Post the challenge token back</b> through the api using the script @ <a href='VerifyChallengeExample.php' target=_blank>VerifyChallengeExample.php</a></li>
                </ol>

                <h3>Alternatively to the bookmarklet, execute this JS using your browser's developer tools:</h3>
                <pre>
function captchaResponse(challengeToken){
    var responseDiv=document.createElement('div');
    responseDiv.id='response';
    document.getElementsByTagName('body')[0].appendChild(responseDiv);
    document.getElementById('response').innerHTML=challengeToken;
}
var captchaHTML='&lt;form action="?" method="POST">&lt;div class="g-recaptcha" data-size="compact" data-sitekey="6LeeTScTAAAAADqvhqVMhPpr_vB9D364Ia-1dSgK" data-callback="captchaResponse">&lt;/div>&lt;/form>';
document.body.parentElement.innerHTML=captchaHTML;
var script=document.createElement('script');
script.src='https://www.google.com/recaptcha/api.js?hl=en';
script.type='text/javascript';
document.getElementsByTagName('head')[0].appendChild(script);
                </pre>

            </div><!-- //END #instructions -->
        </div><!-- //END .container -->
        <link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
    </body>
</html>
EOBODY;
                    exit;
                }
                
            }else
                $error = "Failed to initialize the PokemonGo API! Did you forget to set your credentials?";
        }else
            $error = "Failed to initialize the application kernel!";

        if ($error)
        {
            echo <<<EOERROR
<!doctype html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
    </head>
    <body>
        <div class="alert alert-danger">{$error}</div>
    </body>
</html>
EOERROR;
        }

    }//END run()
}//END CheckChallengeRequestExample

$checkChallengeRequest = new CheckChallengeRequest();
$checkChallengeRequest->run();

?>

================================================
FILE: examples/GUI_BestCpPokemonDetails.php
================================================
<?php

require __DIR__ . '/../vendor/autoload.php';

use NicklasW\PkmGoApi\Authentication\Config\Config;
use NicklasW\PkmGoApi\Authentication\Factory\Factory;
use NicklasW\PkmGoApi\Kernels\ApplicationKernel;
use POGOProtos\Enums\PokemonFamilyId;
use POGOProtos\Enums\PokemonId;

$config = new Config();
$config->setProvider(Factory::PROVIDER_PTC);
$config->setUser('INSERT_USER');
$config->setPassword('INSERT_PASSWORD');

$manager = Factory::create($config);

$application = new ApplicationKernel($manager);
$error = null;

if ($application)
{
	$pokemonGoApi = $application->getPokemonGoApi();
	if ($pokemonGoApi)
	{
		$pokez = $pokemonGoApi->getInventory()->getPokeBank()->getPokemons();
		$pokes = $pokez->sortByCp(true);
		if ($pokes)
		{
			$best = $pokes->first();
			if ($best)
			{
				html_header();
				html_start();

				$perc = round($best->getStamina()/$best->getStaminaMax() * 100);
				$fname = normalize(PokemonFamilyId::toString($best->getFamilyId()));

				echo "<table class='table table-bordered'>";
				echo "<tr><td colspan='2' class='text-center'>";
				echo "<h3>Pokemon '{$best->getName()}' details</h3>";
				echo "<img src='http://veekun.com/dex/media/pokemon/main-sprites/omegaruby-alphasapphire/{$best->getPokemonId()}.png' title='{$fname}'>";
				echo "<div class='progress center-block' style='width:200px;'>";
				echo "<div class='progress-bar progress-bar-success' role='progressbar' aria-valuenow='{$best->getStamina()}' aria-valuemin='0' aria-valuemax='{$best->getStaminaMax()}' style='width: {$perc}%;'><div>{$best->getStamina()}/{$best->getStaminaMax()}</div></div>";
				echo "</div>";
				echo "</td></tr>";

				make_row("FamilyName", $fname);
				make_row("FamilyId", $best->getFamilyId());
				make_row("Name", $best->getName());
				make_row("Id", $best->getId());
				make_row("PokemonId", $best->getPokemonId());
				make_row("Type", normalize($best->getType1String()));
				make_row("Favorite", $best->getFavorite() ? "Yes" : "No");
				make_row("LVL", $best->getLevel());
				make_row("CP", $best->getCp());
				make_row("IV", number_format($best->getIvRatio()*100, 2)."%");
				make_row("HP", $best->getStamina()."/".$best->getStaminaMax());
				make_row("Attack 1", normalize($best->getMove1String()));
				make_row("Attack 2", normalize($best->getMove2String()));
				make_row("Height", number_format($best->getHeightM(), 2)." m");
				make_row("Weight", number_format($best->getWeightKg(), 2)." kg");
				make_row("Powerup cost", $best->getStardustCostsForPowerup()." stardust, ".$best->getCandyCostForPowerup()." candies");
				if ($best->getCandiesToEvolve() > 0)
					make_row("Evolve cost", $best->getCandiesToEvolve());
				else
					make_row("Evolve", "Cannot be evolved");

				echo "</table>";

				html_footer();
			}
			else
				$error = "There is problem with getting best Pokemon from PokeBank.";
		}
		else
			$error = "There is problem with your PokeBank.";
	}
	else
		$error = "There is problem with PokemonGo API.";
}
else
	$error = "Cannot connect with PokemonGo servers.";

if ($error)
{
	html_header();
	show_error($error);
	html_footer();
}

function normalize($text)
{
	return ucfirst(strtolower(str_replace("_", " ", str_replace(array("FAMILY_", "POKEMON_TYPE_"), "", $text))));
}

function make_row($k, $v)
{
	echo "\n<tr>\n<td>$k</td>\n<td>$v</td>\n</tr>\n";
}

function show_error($txt)
{
	echo "<div class='alert alert-danger'>{$txt}</div>";
}

function html_start()
{
	?>
	<div class="container">
		<div class="header clearfix"><h3 class="text-muted">PokemonGoAPI-PHP</h3></div>
	<?php
}

function html_stop()
{
	?>
	</div>
	<?php
}

function html_header()
{
	?>
	<!doctype html>
	<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta name="Author" content="Gandaflux">
		<link href="http://getbootstrap.com/examples/jumbotron-narrow/jumbotron-narrow.css" rel="stylesheet">
		<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
	</head>
	<body>
	<?php
}

function html_footer()
{
	?>
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
	</body>
	</html>
	<?php
}

?>

================================================
FILE: examples/ProxyExample.php
================================================
<?php

require __DIR__ . '/../vendor/autoload.php';

use GuzzleHttp\Client;
use NicklasW\PkmGoApi\Authentication\Config\Config;
use NicklasW\PkmGoApi\Authentication\Factory\Factory;
use NicklasW\PkmGoApi\Kernels\ApplicationKernel;
use GuzzleHttp\RequestOptions;

class ProxyExample {

    /**
     * Run the example.
     */
    public function run()
    {
        // Create the authentication config
        $config = new Config();
        $config->setProvider(Factory::PROVIDER_PTC);
        $config->setUser('INSERT_USER');
        $config->setPassword('INSERT_PASSWORD');

        // Create the authentication manager
        $manager = Factory::create($config);

        // Initialize the pokemon go application
        $application = new ApplicationKernel($manager);

        // Pass a custom client to the library
        $application->setClient(new Client(array(RequestOptions::PROXY => 'INSERT_PROXY')));

        // Retrieve the pokemon go api instance
        $pokemonGoApi = $application->getPokemonGoApi();

        // Retrieve the profile
        $profile = $pokemonGoApi->getProfile();

        // Retrieve the profile data
        $profileData = $profile->getData();

        echo sprintf('The profile data: %s', print_r($profileData, true));
    }

}

$example = new RetrievePlayerProfileExample();
$example->run();

================================================
FILE: examples/ReleaseOnePidgeExample.php
================================================
<?php

require __DIR__ . '/../vendor/autoload.php';

use NicklasW\PkmGoApi\Authentication\Config\Config;
use NicklasW\PkmGoApi\Authentication\Factory\Factory;
use NicklasW\PkmGoApi\Kernels\ApplicationKernel;
use POGOProtos\Enums\PokemonId;

class ReleaseOnePidgeExample {

    /**
     * Run the example.
     */
    public function run()
    {
        // Create the authentication config
        $config = new Config();
        $config->setProvider(Factory::PROVIDER_PTC);
        $config->setUser('INSERT_USER');
        $config->setPassword('INSERT_PASSWORD');

        // Create the authentication manager
        $manager = Factory::create($config);

        // Initialize the pokemon go application
        $application = new ApplicationKernel($manager);

        // Retrieve the pokemon go api instance
        $pokemonGoApi = $application->getPokemonGoApi();

        // Retrieve the inventory
        $inventory = $pokemonGoApi->getInventory();

        // Retrieve the poke bank
        $pokeBank = $inventory->getPokeBank();

        // Retrieve a pokemon of type pidgey
        $pokemon = $pokeBank->getPokemonsByType(PokemonId::PIDGEY)->first();

        // Check if we retrieved a pokemon
        if (!$pokemon) {
            throw new Exception('No pokemon of type pidgey found. Please check your inventory');
        }

        // Transfer / Release the pokemon
        $pokemon->transfer();
    }

}

$example = new ReleaseOnePidgeExample();
$example->run();

================================================
FILE: examples/RetrieveAppliedItemsExample.php
================================================
<?php

require __DIR__ . '/../vendor/autoload.php';

use NicklasW\PkmGoApi\Api\Player\Data\Inventory\ItemMetaRegistry;
use NicklasW\PkmGoApi\Api\Support\Enums\ItemId;
use NicklasW\PkmGoApi\Authentication\Config\Config;
use NicklasW\PkmGoApi\Authentication\Factory\Factory;
use NicklasW\PkmGoApi\Kernels\ApplicationKernel;

class RetrieveAppliedItemsExample {

    /**
     * Run the example.
     */
    public function run()
    {
        // Create the authentication config
        $config = new Config();
        $config->setProvider(Factory::PROVIDER_PTC);
        $config->setUser('INSERT_USER');
        $config->setPassword('INSERT_PASSWORD');

        // Create the authentication manager
        $manager = Factory::create($config);

        // Initialize the pokemon go application
        $application = new ApplicationKernel($manager);

        // Retrieve the pokemon go api instance
        $pokemonGoApi = $application->getPokemonGoApi();

        // Retrieve the inventory
        $inventory = $pokemonGoApi->getInventory();

        // Retrieve the applied items instance
        $appliedItems = $inventory->getAppliedItems();

        // Retrieve the items within the applied items instance
        $items = $appliedItems->getAppliedItems();

        foreach($items as $item)
        {
            // Retrieve item name
            $item->setName(ItemId::name($item->getItemId()));

            echo sprintf('Applied item: %s', print_r($item, true));
        }
    }
}

$example = new RetrieveAppliedItemsExample();
$example->run();


================================================
FILE: examples/RetrieveJournalExample.php
================================================
<?php

require __DIR__ . '/../vendor/autoload.php';

use NicklasW\PkmGoApi\Api\Support\Enums\ItemId;
use NicklasW\PkmGoApi\Api\Support\Enums\PokemonId;
use NicklasW\PkmGoApi\Authentication\Config\Config;
use NicklasW\PkmGoApi\Authentication\Factory\Factory;
use NicklasW\PkmGoApi\Kernels\ApplicationKernel;

class RetrieveJournalExample {

    /**
     * Run the example.
     */
    public function run()
    {
        // Create the authentication config
        $config = new Config();
        $config->setProvider(Factory::PROVIDER_PTC);
        $config->setUser('INSERT_USER');
        $config->setPassword('INSERT_PASSWORD');

        // Create the authentication manager
        $manager = Factory::create($config);

        // Initialize the pokemon go application
        $application = new ApplicationKernel($manager);

        // Retrieve the pokemon go api instance
        $pokemonGoApi = $application->getPokemonGoApi();

        // Retrieve the journal data
        $journal = $pokemonGoApi->getJournal();

        // Loop across all Pokemon encounters
        foreach($journal->getPokemons() as $pkmn) {
            echo sprintf("[%s] [Pokemon] #%s %s, Result: %s, %s CP\n",
                (new DateTime('@'.floor($pkmn->getTimestampMs()/1000)))->format('d.m.Y H:i'),
                $pkmn->getPokemonId(), PokemonId::name($pkmn->getPokemonId()), $pkmn->getResult() == 2 ? 'flee' : 'captured',
                $pkmn->getCombatPoints());
        }

        // Loop across all Pokestop interactions
        foreach($journal->getForts() as $fort) {
           echo sprintf("[%s] [Fort] Eggs: %s, Items: %s\n",
               (new DateTime('@'.floor($fort->getTimestampMs()/1000)))->format('d.m.Y H:i'),
               $fort->getEggs(),
               array_reduce(
                   $fort->getItems(),
                   function($val, $e) {
                       if($val) $val.=', ';
                       return $val.$e->getCount().'x '.ItemId::name($e->getItemId());
                   }
               )
           );
        }
    }

}

$example = new RetrieveJournalExample();
$example->run();

================================================
FILE: examples/RetrievePlayerPokedexExample.php
================================================
<?php

require __DIR__ . '/../vendor/autoload.php';

use NicklasW\PkmGoApi\Api\Pokemon\Data\PokemonMetaRegistry;
use NicklasW\PkmGoApi\Authentication\Config\Config;
use NicklasW\PkmGoApi\Authentication\Factory\Factory;
use NicklasW\PkmGoApi\Kernels\ApplicationKernel;

class RetrievePlayerPokedexExample {

    /**
     * Run the example.
     */
    public function run()
    {
        // Create the authentication config
        $config = new Config();
        $config->setProvider(Factory::PROVIDER_PTC);
        $config->setUser('INSERT_USER');
        $config->setPassword('INSERT_PASSWORD');

        // Create the authentication manager
        $manager = Factory::create($config);

        // Initialize the pokemon go application
        $application = new ApplicationKernel($manager);

        // Retrieve the pokemon go api instance
        $pokemonGoApi = $application->getPokemonGoApi();

        // Retrieve the inventory
        $inventory = $pokemonGoApi->getInventory();

        // Retrieve the pokedex
        $pokedex = $inventory->getPokedex();

        // Show info about pokemons
        for($i=1; $i<= 151; $i++)
        {
            // Retrieve MetaRegistry for pokemon
            $pokemonmeta = PokemonMetaRegistry::getByPokemonId($i);

            // Retrieve Pokedex entry for pokemon
            $pokemondata = $pokedex->get($i);

            // If pokedex is empty we don't 'know' that creature
            if($pokemondata !== null)
            {
                echo sprintf("Informations about Pokemon %d. Name: %s \n", $i, $pokemonmeta->getuniqueId());
            }
            else
                echo sprintf("No information about id: %d \n", $i);
        }
    }
}

$example = new RetrievePlayerPokedexExample();
$example->run();


================================================
FILE: examples/RetrievePlayerProfileExample.php
================================================
<?php

require __DIR__ . '/../vendor/autoload.php';

use NicklasW\PkmGoApi\Authentication\Config\Config;
use NicklasW\PkmGoApi\Authentication\Factory\Factory;
use NicklasW\PkmGoApi\Kernels\ApplicationKernel;

class RetrievePlayerProfileExample {

    /**
     * Run the example.
     */
    public function run()
    {
        // Create the authentication config
        $config = new Config();
        $config->setProvider(Factory::PROVIDER_PTC);
        $config->setUser('INSERT_USER');
        $config->setPassword('INSERT_PASSWORD');

        // Create the authentication manager
        $manager = Factory::create($config);

        // Initialize the pokemon go application
        $application = new ApplicationKernel($manager);

        // Retrieve the pokemon go api instance
        $pokemonGoApi = $application->getPokemonGoApi();

        // Retrieve the profile
        $profile = $pokemonGoApi->getProfile();

        // Retrieve the profile data
        $profileData = $profile->getData();

        echo sprintf('The profile data: %s', print_r($profileData, true));
    }

}

$example = new RetrievePlayerProfileExample();
$example->run();

================================================
FILE: examples/RetrievePlayerStatsExample.php
================================================
<?php

require __DIR__ . '/../vendor/autoload.php';

use NicklasW\PkmGoApi\Authentication\Config\Config;
use NicklasW\PkmGoApi\Authentication\Factory\Factory;
use NicklasW\PkmGoApi\Kernels\ApplicationKernel;

class RetrievePlayerStatsExample {

    /**
     * Run the example.
     */
    public function run()
    {
        // Create the authentication config
        $config = new Config();
        $config->setProvider(Factory::PROVIDER_PTC);
        $config->setUser('INSERT_USER');
        $config->setPassword('INSERT_PASSWORD');

        // Create the authentication manager
        $manager = Factory::create($config);

        // Initialize the pokemon go application
        $application = new ApplicationKernel($manager);

        // Retrieve the pokemon go api instance
        $pokemonGoApi = $application->getPokemonGoApi();

        // Retrieve the inventory
        $inventory = $pokemonGoApi->getInventory();

        // Retrieve the player stats
        $playerStats = $inventory->getStats();

        echo sprintf('The player level: %s', $playerStats->getLevel());
    }

}

$example = new RetrievePlayerStatsExample();
$example->run();

================================================
FILE: examples/RetrievePokemonCandyCountExample.php
================================================
<?php

require __DIR__ . '/../vendor/autoload.php';

use NicklasW\PkmGoApi\Authentication\Config\Config;
use NicklasW\PkmGoApi\Authentication\Factory\Factory;
use NicklasW\PkmGoApi\Kernels\ApplicationKernel;
use POGOProtos\Enums\PokemonFamilyId;

class RetrievePokemonCandyCountExample {

    /**
     * Run the example.
     */
    public function run()
    {
        // Create the authentication config
        $config = new Config();
        $config->setProvider(Factory::PROVIDER_PTC);
        $config->setUser('INSERT_USER');
        $config->setPassword('INSERT_PASSWORD');

        // Create the authentication manager
        $manager = Factory::create($config);

        // Initialize the pokemon go application
        $application = new ApplicationKernel($manager);

        // Retrieve the pokemon go api instance
        $pokemonGoApi = $application->getPokemonGoApi();

        // Retrieve the inventory
        $inventory = $pokemonGoApi->getInventory();

        // Retrieve the candy bank
        $candyBank = $inventory->getCandyBank();

        // Retrieve the pidgey candy item
        $candyItem = $candyBank->get(PokemonFamilyId::FAMILY_PIDGEY);

        echo sprintf('Number or pidgey candies \'%s\'', $candyItem->getCount());
    }

}

$example = new RetrievePokemonCandyCountExample();
$example->run();

================================================
FILE: examples/RetrievePokemonCountExample.php
================================================
<?php

require __DIR__ . '/../vendor/autoload.php';

use NicklasW\PkmGoApi\Authentication\Config\Config;
use NicklasW\PkmGoApi\Authentication\Factory\Factory;
use NicklasW\PkmGoApi\Kernels\ApplicationKernel;
use POGOProtos\Enums\PokemonId;

class RetrievePokemonCountExample {

    /**
     * Run the example.
     */
    public function run()
    {
        // Create the authentication config
        $config = new Config();
        $config->setProvider(Factory::PROVIDER_PTC);
        $config->setUser('INSERT_USER');
        $config->setPassword('INSERT_PASSWORD');

        // Create the authentication manager
        $manager = Factory::create($config);

        // Initialize the pokemon go application
        $application = new ApplicationKernel($manager);

        // Retrieve the pokemon go api instance
        $pokemonGoApi = $application->getPokemonGoApi();

        // Retrieve the inventory
        $inventory = $pokemonGoApi->getInventory();

        // Retrieve the poke bank
        $pokeBank = $inventory->getPokeBank();

        // Retrieve a pokemons of type pidgey
        $pokemons = $pokeBank->getPokemonsByType(PokemonId::PIDGEY);

        echo sprintf('Number of pokemon of type pidgey: \'%s\'', sizeof($pokemons));
    }

}

$example = new RetrievePokemonCountExample();
$example->run();

================================================
FILE: examples/RetrievePokemonTraitExample.php
================================================
<?php

require __DIR__ . '/../vendor/autoload.php';

use NicklasW\PkmGoApi\Authentication\Config\Config;
use NicklasW\PkmGoApi\Authentication\Factory\Factory;
use NicklasW\PkmGoApi\Kernels\ApplicationKernel;
use POGOProtos\Enums\PokemonId;

class RetrievePokemonTraitExample {

    /**
     * Run the example.
     */
    public function run()
    {
        // Create the authentication config
        $config = new Config();
        $config->setProvider(Factory::PROVIDER_PTC);
        $config->setUser('INSERT_USER');
        $config->setPassword('INSERT_PASSWORD');

        // Create the authentication manager
        $manager = Factory::create($config);

        // Initialize the pokemon go application
        $application = new ApplicationKernel($manager);

        // Retrieve the pokemon go api instance
        $pokemonGoApi = $application->getPokemonGoApi();

        // Retrieve the inventory
        $inventory = $pokemonGoApi->getInventory();

        // Retrieve the poke bank
        $pokeBank = $inventory->getPokeBank();

        // Retrieve a pokemon of type pidgey
        $pokemon = $pokeBank->getPokemons()->first();

        // Check if we retrieved a pokemon
        if (!$pokemon) {
            throw new Exception('Cannot find any pokemons in your PokeBank.');
        }

        echo sprintf("Pokemon %s, Id: %s, Cp: %d, type: %s, attacks: %s and %s, ", $pokemon->getName(), $pokemon->getId(), $pokemon->getCp(), $pokemon->getType1String(), $pokemon->getMove1String(), $pokemon->getMove2String());

    }

}

$example = new RetrievePokemonTraitExample();
$example->run();

================================================
FILE: examples/VerifyChallengeExample.php
================================================
<?php
require __DIR__ . '/../vendor/autoload.php';

use NicklasW\PkmGoApi\Authentication\AccessToken;
use NicklasW\PkmGoApi\Authentication\Config\Config;
use NicklasW\PkmGoApi\Authentication\Factory\Factory;
use NicklasW\PkmGoApi\Authentication\Manager;
use NicklasW\PkmGoApi\Kernels\ApplicationKernel;

class VerifyChallengeRequest {
    
    /**
     * Display the verifyChallenge html form.
     */
    public function showForm()
    {
        echo <<<EOFORM
<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Verify Challenge Example</title>
        <meta name="referrer" content="no-referrer" />
    </head>
    <body>
        <div class="container">
            <h1 class="text-center">Verify Challenge Example</h1>
            <form id="challengeForm" role="form">
                <div class="form-group">
                    <label class="control-label" for="token">RECaptcha Challenge Token</label>
                    <textarea class="form-control" cols="40" id="token" name="token" rows="10"></textarea>
                    <p class="help-block">
                        The RECaptcha challenge token can be obtained by using the <a href="CheckChallengeExample.php" target="_blank">CheckChallengeExample.php</a> script and PGO-Captcha bookmarklet.
                    </p>
                    <small>
                        Ex POST: <code>\$_POST['token']</code><br/>
                        Ex Response: <code>"{\"user\":\"YOURUSERNAME\",\"success\":true}"</code>
                    </small>
                </div>
                <div class="form-group text-center">
                    <button id="form-submit" type="submit" class="btn btn-lg btn-success">SUBMIT</button>
                </div>
            </form>
            <div id="results"></div>
        </div>
        <link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
        <script>
            $("#challengeForm").submit(function(event){
                event.preventDefault();
                submitForm();
            });
            function submitForm(){
                var token = $("#token").val();
                $.ajax({
                    type: "POST",
                    url: "VerifyChallengeExample.php",
                    data: "token=" + token,
                    beforeSend: function(){
                        $("#results").html("<pre>... LOADING ...</pre>");
                    },
                    success : function(response){
                        if (response){
                            $("#results").html("<pre>" + JSON.stringify(response) + "</pre>");
                        }
                    }
                });
            }
        </script>
    </body>
</html>
EOFORM;
        exit;
    }
    
    /**
     * Authenticate and submit the user supplied challenge token through API.
     */
    public function processRequest($token)
    {
        // Initialize error string
        $error = null;
        
        // EXAMPLE Authentication via PTC user credentials
        $config = new Config();
        $config->setProvider(Factory::PROVIDER_PTC);
        $config->setUser('');
        $config->setPassword('');

        // Create the authentication manager
        $manager = Factory::create($config);

        // Initialize the pokemon go application kernel
        $application = new ApplicationKernel($manager);
        if ($application)
        {
            // Initialize the pokemon go api
            $pogoApi = $application->getPokemonGoApi();
            if ($pogoApi)
            {
                // Process api request
                $success = $pogoApi->verifyChallenge($token);

                $challengeResponse = [
                    "user" => $config->getUser(),
                    "success" => $success,
                ];

                // return JSON encoded challengeResponse
                return json_encode($challengeResponse);
                
            }else
                $error = "Failed to initialize the PokemonGo API!";
        }else
            $error = "Failed to initialize the application kernel!";
            
        if ($error) { return json_encode(array("error", $error)); }
        
    }//END sendToken()
    
}//END VerifyChallengeRequest

// Initialize VerifyChallengeRequest
$verifyChallengeRequest = new VerifyChallengeRequest();

// Sanatize User Supplied Post Input
$_POST = !empty($_POST) ? filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING) : null;

// Check For Post
if(!$_POST) {
    // Display challengeForm if no postback detected
    $verifyChallengeRequest->showForm();
}else {
    // Check for challenge token
    if($_POST['token']) {
        // Process request
        echo $verifyChallengeRequest->processRequest($_POST['token']);
    }
    else {
        // POST received but token not specified.
        echo json_encode(array("error", "POST detected but no valid TOKEN value supplied!"));
    }
}
?>

================================================
FILE: includes/config.php
================================================
<?php

use Illuminate\Support\Str;

if (!function_exists('env')) {
    /**
     * Gets the value of an environment variable. Supports boolean, empty and null.
     *
     * @param  string $key
     * @param  mixed  $default
     * @return mixed
     */
    function env($key, $default = null)
    {
        $value = getenv($key);

        if ($value === false) {
            return value($default);
        }

        switch (strtolower($value)) {
            case 'true':
            case '(true)':
                return true;

            case 'false':
            case '(false)':
                return false;

            case 'empty':
            case '(empty)':
                return '';

            case 'null':
            case '(null)':
                return;
        }

        if (strlen($value) > 1 && Str::startsWith($value, '"') && Str::endsWith($value, '"')) {
            return substr($value, 1, -1);
        }

        return $value;
    }
}

================================================
FILE: includes/protocolbuffers.inc.php
================================================
<?php
/****
 * PHP Protocol Buffer Parser
 * https://github.com/bramp/protoc-gen-php
 * Licence (Simplified BSD License)
 * --------------------------------
 * Copyright (c) 2010-2016, Andrew Brampton
 * All rights reserved.
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the documentation
 *    and/or other materials provided with the distribution.
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

if (PHP_INT_SIZE !== 8) {
	echo 'For now we only support PHP on 64bit platforms \n';

    die();
}

function checkArgument($exp, $message)
{
    if (!$exp) {
        throw new InvalidArgumentException($message);
    }
}

abstract class ProtobufIO {

    public static function toStream($in, &$limit = PHP_INT_MAX)
    {
        // If the input is a string, turn it into a stream and decode it
        if (is_string($in)) {
            $limit = min($limit, strlen($in));
            $fp = fopen('php://temp', 'w+b');
            fwrite($fp, $in, $limit);
            rewind($fp);
            return $fp;
        }

        checkArgument(get_resource_type($in) === 'stream', 'fp must be a string or file resource');
        return $in;
    }
}

abstract class ProtobufEnum {

    public static function toString($value)
    {
        checkArgument(is_int($value), 'value must be a integer');

        if (array_key_exists($value, self::$_values))
            return self::$_values[$value];

        return 'UNKNOWN';
    }
}

abstract class ProtobufMessage {

    private $_unknown;

    function __construct($fp = null, &$limit = PHP_INT_MAX)
    {
        // Zero arguments, so construct a empty one
        if ($fp === null) {
            return;
        }

        // Decode
        $this->read($fp, $limit);
    }

    // Reads the protobuf
    public function read($in, &$limit = PHP_INT_MAX)
    {
        $fp = ProtobufIO::toStream($in, $limit);
        while (!feof($fp) && $limit > 0) {
            $tag = self::read_varint($fp, $limit);
            if ($tag === false) break;
            $wire = $tag & 0x07;
            $field = $tag >> 3;

            $field_idx = $field . '-' . self::get_wiretype($wire);
            $this->_unknown[$field_idx][] = self::read_field($fp, $wire, $limit);
        }
    }

    abstract public function write($fp);

    abstract public function size();


    // TODO Rename this
    public function toProtobuf()
    {
        $fp = fopen('php://temp', 'w+b');
        $this->write($fp);
        rewind($fp);
        return stream_get_contents($fp);
    }
}

/**
 * Class to aid in the parsing and creating of Protocol Buffer Messages
 * This class should be included by the developer before they use a
 * generated protobuf class.
 *
 * @author Andrew Brampton
 */
abstract class Protobuf {

    const TYPE_DOUBLE = 1;   // double, exactly eight bytes on the wire.

    const TYPE_FLOAT = 2;   // float, exactly four bytes on the wire.

    const TYPE_INT64 = 3;   // int64, varint on the wire.  Negative numbers

    // take 10 bytes.  Use TYPE_SINT64 if negative
    // values are likely.
    const TYPE_UINT64 = 4;   // uint64, varint on the wire.

    const TYPE_INT32 = 5;   // int32, varint on the wire.  Negative numbers

    // take 10 bytes.  Use TYPE_SINT32 if negative
    // values are likely.
    const TYPE_FIXED64 = 6;   // uint64, exactly eight bytes on the wire.

    const TYPE_FIXED32 = 7;   // uint32, exactly four bytes on the wire.

    const TYPE_BOOL = 8;   // bool, varint on the wire.

    const TYPE_STRING = 9;   // UTF-8 text.

    const TYPE_GROUP = 10;  // Tag-delimited message.  Deprecated.

    const TYPE_MESSAGE = 11;  // Length-delimited message.

    const TYPE_BYTES = 12;  // Arbitrary byte array.

    const TYPE_UINT32 = 13;  // uint32, varint on the wire

    const TYPE_ENUM = 14;  // Enum, varint on the wire

    const TYPE_SFIXED32 = 15;  // int32, exactly four bytes on the wire

    const TYPE_SFIXED64 = 16;  // int64, exactly eight bytes on the wire

    const TYPE_SINT32 = 17;  // int32, ZigZag-encoded varint on the wire

    const TYPE_SINT64 = 18;  // int64, ZigZag-encoded varint on the wire

    const MIN_INT32 = -2147483648;

    const MAX_INT32 = 2147483647;

    const MIN_UINT32 = 0;

    const MAX_UINT32 = 4294967296;

    const MIN_INT64 = -9223372036854775808;

    const MAX_INT64 = 9223372036854775807;

    const MIN_UINT64 = 0;

    const MAX_UINT64 = 18446744073709551616;

    const MAX_VARINT_LEN = 10;

    const MAX_PHP_INT_VARINT_LEN = 9; // The length of the longest varint that represents a valid PHP int

    /**
     * Returns a string representing this wiretype
     * // TODO Rename to something enum related
     */
    public static function get_wiretype($wire_type)
    {
        checkArgument(is_int($wire_type), 'wire_type must be a integer');

        switch ($wire_type) {
            case 0:
                return '(0) varint';
            case 1:
                return '(1) 64-bit';
            case 2:
                return '(2) length-delimited';
            case 3:
                return '(3) group start';
            case 4:
                return '(4) group end';
            case 5:
                return '(5) 32-bit';
            default:
                return 'unknown';
        }
    }


    /**
     * Returns how big (in bytes) this number would be as a varint
     */
    public static function size_varint($value)
    {
        // TODO Assert 64bit doubles
        checkArgument(is_int($value) || is_float($value), 'value must be a integer or float');

        // TODO Rearrange to make a binary search
        if ($value < 0) return self::MAX_VARINT_LEN; // Negitive numbers are signed extended and always take 10 bytes
        if ($value < 0x80) return 1; // 2^7
        if ($value < 0x4000) return 2; // 2^14
        if ($value < 0x200000) return 3; // 2^21
        if ($value < 0x10000000) return 4; // 2^28
        if ($value < 0x800000000) return 5; // 2^35
        if ($value < 0x40000000000) return 6; // 2^42
        if ($value < 0x2000000000000) return 7; // 2^49
        if ($value < 0x100000000000000) return 8; // 2^56

        if (is_int($value)) {
            // A PHP int can't be compared to 2^63, so compare to 2^63-1
            if ($value <= 0x7FFFFFFFFFFFFFFF) return 9;
        } else {
            // However, a float can't exactly represent 2^63-1, so in that case compare to 2^63 (which it can represent)
            if ($value < 0x8000000000000000) return 9;
        }

        return self::MAX_VARINT_LEN;
    }

    /**
     * Parses the raw bytes of a varint, and returns the number it represents
     *
     * @param value the raw bytes int to decode
     * @returns the decoded int
     */
    public static function decode_varint($encoded)
    {
        checkArgument(is_string($encoded), 'encoded value must be a string of bytes');

        $len = strlen($encoded);
        if ($len <= self::MAX_PHP_INT_VARINT_LEN) { // TODO lower this on PHP32.
            return self::decode_varint_int($encoded, $len);
        } else {
            return self::decode_varint_float($encoded, $len);
        }
    }

    public static function decode_signed_varint($encoded)
    {
        checkArgument(is_string($encoded), 'encoded value must be a string of bytes');
        checkArgument($encoded !== '', 'encoded value contains no bytes');

        $len = strlen($encoded);
        if ($len === self::MAX_VARINT_LEN) {
            // Negative number
            // Because PHP only has signed types, there is no native way to do
            // signed extension. To help maintain a accuracy we do it manually
            // over the bytes of the varint, by flipping the bits and adding one.

            $len--;
            for ($i = 0; $i < $len; $i++) {
                $encoded[$i] = chr(~(ord($encoded[$i]) & 0x7F));
            }

            // Drop the last digit as it's above 64bit and not used
            $encoded = substr($encoded, 0, $len);
            $encoded = rtrim($encoded, "\x80"); // TODO change this to rtrim(\xff) and move above the loop

            return -self::decode_varint($encoded) - 1;
        } else {
            return self::decode_varint($encoded);
        }
    }


    public static function decode_varint_int($encoded, $len)
    {
        $result = 0;
        $shift = 0;
        for ($i = 0; $i < $len; $i++) {
            $result |= ((ord($encoded[$i]) & 0x7F) << $shift);
            $shift += 7;
        }

        return $result;
    }

    /**
     * Slower implementation that uses math instead of bit operators (as they don't work on floats)
     */
    public static function decode_varint_float($encoded, $len)
    {
        $result = 0.0;
        $shift = 1.0;
        for ($i = 0; $i < $len; $i++) {
            $result += (ord($encoded[$i]) & 0x7F) * $shift;
            $shift *= 128;
        }

        return $result;
    }

    public static function decode_varint_bc($encoded, $len)
    {
        $result = 0;
        $shift = 1;
        for ($i = 0; $i < $len; $i++) {
            $result = bcadd($result, bcmul(ord($encoded[$i]) & 0x7F, $shift));
            $shift = bcmul($shift, 128);
        }
        return $result;
    }

    public static function decode_varint_gmp($encoded, $len)
    {
        $i128 = gmp_init(128);
        $result = gmp_init(0);
        $shift = gmp_init(1);
        for ($i = 0; $i < $len; $i++) {
            $result = gmp_add($result, gmp_mul(ord($encoded[$i]) & 0x7F, $shift));
            $shift = gmp_mul($shift, $i128);
        }
        return gmp_strval($result);
    }

    public static function read_bytes($fp, $len, &$limit = PHP_INT_MAX)
    {

        if ($len <= 0) {
            return;
        }

        checkArgument(get_resource_type($fp) === 'stream', 'fp must be a file resource');
        checkArgument(is_integer($len) && $len >= 0, 'len must be a postitive integer');
        checkArgument(is_integer($limit) && $limit >= 0, 'limit must be a postitive integer');

        if ($limit < $len) {
            throw new Exception('read_bytes(): Unexpected end of stream');
        }

        $bytes = fread($fp, $len);
        if ($bytes === '' && feof($fp)) {
            return false;
        }

        if ($bytes === false) {
            throw new Exception('read_bytes(): Error reading byte');
        }

        if (strlen($bytes) !== $len) {
            throw new Exception('read_bytes(): Unexpected end of stream');
        }

        $limit -= $len;
        return $bytes;
    }

    /**
     * Reads a varint but does not decode.
     *
     * @param  resource $fp    Resource stream to read from
     * @param  int      $limit Max bytes to read, passed by reference and will be decremented by the number of read bytes
     * @return string|bool Returns the read varint bytes, or false on EOF.
     * @throws exception if stream error occurs
     */
    public static function read_varint_bytes($fp, &$limit = PHP_INT_MAX)
    {
        $value = '';
        do { // Keep reading until we find the last byte
            $b = self::read_bytes($fp, 1, $limit);
            if ($b === false) {
                return false;
            }

            $value .= $b;
        } while ($b >= "\x80");

        return $value;
    }

    /**
     * Tries to read a varint from $fp.
     *
     * @returns the decoded varint in the range [0,2^64-1] from the stream, or false if the stream has reached eof.
     * @throws exception if stream error occurs
     */
    public static function read_varint($fp, &$limit = PHP_INT_MAX)
    {
        $value = self::read_varint_bytes($fp, $limit);
        if ($value === false) {
            return false;
        }
        return self::decode_varint($value);
    }

    public static function read_signed_varint($fp, &$limit = PHP_INT_MAX)
    {
        $value = self::read_varint_bytes($fp, $limit);
        if ($value === false) {
            return false;
        }
        return self::decode_signed_varint($value);
    }

    /**
     * @returns a integer as specified by the pack variable.
     * On EOF false is returned, otherwise Exception is thrown on stream error or invalid argument.
     */
    protected static function read_unpack($fp, $len, $pack, &$limit = PHP_INT_MAX)
    {
        checkArgument(is_string($pack), 'pack must be a valid string');

        $bytes = self::read_bytes($fp, $len, $limit);
        if ($bytes === false) {
            return false;
        }

        return unpack($pack, $bytes)[1];
    }

    public static function read_float($fp, &$limit = PHP_INT_MAX)
    {
        return self::read_unpack($fp, 4, 'f', $limit);
    } // BUG We need to convert from little order to machine order first

    public static function read_double($fp, &$limit = PHP_INT_MAX)
    {
        return self::read_unpack($fp, 8, 'd', $limit);
    } // BUG We need to convert from little order to machine order first

    public static function read_int32($fp, &$limit = PHP_INT_MAX)
    {
        return self::read_unpack($fp, 4, 'l', $limit);
    } // BUG We need to convert from little order to machine order first

    public static function read_uint32($fp, &$limit = PHP_INT_MAX)
    {
        return self::read_unpack($fp, 4, 'V', $limit);
    }

    // unpack 'q' and 'P' are only supported since PHP 5.6.3
    public static function read_int64($fp, &$limit = PHP_INT_MAX)
    {
        return self::read_unpack($fp, 8, 'q', $limit);
    } // BUG We need to convert from little order to machine order first

    public static function read_uint64($fp, &$limit = PHP_INT_MAX)
    {
        return self::read_unpack($fp, 8, 'P', $limit);
    }

    public static function read_zint32($fp, &$limit = PHP_INT_MAX)
    {
        $i = self::read_varint($fp, $limit);
        if ($i === false) {
            return false;
        }

        return (!($i & 0x1) ? ($i >> 1) : (($i >> 1) ^ (~0)));
    }

    public static function read_zint64($fp, &$limit = PHP_INT_MAX)
    {
        $i = self::read_varint($fp, $limit);
        if ($i === false) {
            return false;
        }

        return (!($i & 0x1) ? ($i >> 1) : (($i >> 1) ^ (~0)));
    }

    /**
     * Read a unknown field from the stream and decodes the value if possible.
     */
    public static function read_field($fp, $wire_type, &$limit = PHP_INT_MAX)
    {
        checkArgument(get_resource_type($fp) === 'stream', 'fp must be a file resource');
        checkArgument(is_integer($limit) && $limit >= 0, 'limit must be a postitive integer');

        switch ($wire_type) {
            case 0: // varint
                return self::read_varint_bytes($fp, $limit);

            case 1: // 64bit
                return self::read_bytes($fp, 8, $limit);

            case 2: // length delimited
                $len = self::read_varint($fp, $limit);
                if ($len <= 0) {
                    throw new Exception('read_field(' . self::get_wiretype($wire_type) . '): Invalid length: $len it must be >= 0');
                }
                return self::read_bytes($fp, $len, $limit);

            //case 3: // Start group TODO we must keep looping until we find the closing end grou
            //case 4: // End group - We should never skip a end group!
            //	return 0; // Do nothing

            case 5: // 32bit
                return self::read_bytes($fp, 4, $limit);

            default:
                throw new Exception('read_field(' . self::get_wiretype($wire_type) . '): Unsupported wire_type');
        }
    }

    /**
     * Varint encodes a integer, using a loop-less bitwise method.
     *
     * @param int|float $value The number to encode
     * @return string the bytes of the encoded value
     */
    public static function encode_varint_slide($value)
    {
        checkArgument(is_int($value), 'value must be a integer');
        checkArgument($value >= 0, 'value must be positive');

        // Code adapted from CodedOutputStream::WriteVarint64ToArrayInline in
        // coded_stream.cc original protobuf source
        $target = "\0\0\0\0\0\0\0\0\0\0";

        $part0 = $value & 0xffffffff;
        $part1 = ($value >> 28) & 0xffffffff;
        $part2 = ($value >> 56) & 0xffffffff;

        if ($part2 === 0) {
            if ($part1 === 0) {
                if ($part0 < (1 << 14)) {
                    if ($part0 < (1 << 7)) {
                        $size = 1;
                        goto size1;
                    } else {
                        $size = 2;
                        goto size2;
                    }
                } else {
                    if ($part0 < (1 << 21)) {
                        $size = 3;
                        goto size3;
                    } else {
                        $size = 4;
                        goto size4;
                    }
                }
            } else {
                if ($part1 < (1 << 14)) {
                    if ($part1 < (1 << 7)) {
                        $size = 5;
                        goto size5;
                    } else {
                        $size = 6;
                        goto size6;
                    }
                } else {
                    if ($part1 < (1 << 21)) {
                        $size = 7;
                        goto size7;
                    } else {
                        $size = 8;
                        goto size8;
                    }
                }
            }
        } else {
            if ($part2 < (1 << 7)) {
                $size = 9;
                goto size9;
            } else {
                $size = 10;
                goto size10;
            }
        }

        assert(false, 'reached a line we should never get to');

        // Slide
        size10:
        $target[9] = chr(($part2 >> 7) | 0x80);
        size9 :
        $target[8] = chr(($part2) | 0x80);
        size8 :
        $target[7] = chr(($part1 >> 21) | 0x80);
        size7 :
        $target[6] = chr(($part1 >> 14) | 0x80);
        size6 :
        $target[5] = chr(($part1 >> 7) | 0x80);
        size5 :
        $target[4] = chr(($part1) | 0x80);
        size4 :
        $target[3] = chr(($part0 >> 21) | 0x80);
        size3 :
        $target[2] = chr(($part0 >> 14) | 0x80);
        size2 :
        $target[1] = chr(($part0 >> 7) | 0x80);
        size1 :
        $target[0] = chr(($part0) | 0x80);

        $target[$size - 1] = chr(ord($target[$size - 1]) & 0x7F);

        return substr($target, 0, $size);
    }

    /**
     * Varint encodes a integer, using a bitwise method.
     *
     * @param int|float $value The number to encode
     * @return string the bytes of the encoded value
     */
    public static function encode_varint_int($value)
    {
        checkArgument(is_int($value), 'value must be a integer');
        checkArgument($value >= 0, 'value must be positive');

        $buf = '';
        while ($value > 0x7F) {
            $buf .= chr(($value & 0x7F) | 0x80);
            $value = $value >> 7;
        }
        return $buf . chr($value & 0x7F);
    }

    /**
     * Varint encodes a float, using a arithmetic method.
     *
     * @param int|float $value The number to encode
     * @return string the bytes of the encoded value
     */
    public static function encode_varint_float($value)
    {
        checkArgument(is_int($value) || is_float($value), 'value must be a integer or float');
        checkArgument($value >= 0 && $value <= self::MAX_UINT64, 'value must be in the range [0, 2^64-1]');

        $buf = '';
        while ($value > 0x7F) {
            $buf .= chr(($value & 0x7F) | 0x80); // TODO Test if mod/+ is faster than and/or
            $value = floor($value / 128.0); // TODO Test if ($a - $a % $b) / $b; is faster
        }
        return $buf . chr($value & 0x7F);
    }

    public static function encode_varint_bc($value)
    {
        checkArgument(is_numeric($value), 'value must be numeric');
        checkArgument(bccomp($value, 0) >= 0 && bccomp($value, "18446744073709551615") <= 0, 'value must be in the range [0, 2^64-1]');

        $buf = '';
        while (bccomp($value, 128) >= 0) {
            $buf .= chr(bcadd(bcmod($value, 128), 128));
            $value = bcdiv($value, 128, 0);
        }

        return $buf . chr(bcmod($value, 128));
    }

    public static function encode_varint_gmp($value)
    {
        checkArgument(is_numeric($value), 'value must be numeric');

        $value = gmp_init($value);
        checkArgument(gmp_cmp($value, 0) >= 0 && gmp_cmp($value, "18446744073709551615") <= 0, 'value must be in the range [0, 2^64-1]');

        $i128 = gmp_init(128);

        $buf = '';
        while (gmp_cmp($value, $i128) >= 0) {
            $buf .= chr(gmp_intval(gmp_add(gmp_mod($value, $i128), $i128)));
            $value = gmp_div($value, $i128, GMP_ROUND_ZERO); // TODO Consider changing to gmp_div_qr so we can avoid a mod
        }

        return $buf . chr(gmp_intval(gmp_mod($value, $i128)));
    }

    /**
     * Varint encodes a number.
     * Depending on the type of value, either the the bitwise or
     * arithmetic method is used. Typically bitwise is faster, but
     * only works with ints, thus to encode floats a arithmetic method
     * is used instead.
     *
     * @param int|float $value The number to encode
     * @return string the bytes of the encoded value
     * @throws InvalidArgumentException if the $value is not a integer of float
     */
    public static function encode_varint($value)
    {

        if ($value < 0) {
            $value = -($value + 1);
            $negative = true;
        } else {
            $negative = false;
        }

        if (is_int($value)) {
            $encoded = self::encode_varint_int($value);
        } elseif (is_float($value)) {
            $encoded = self::encode_varint_float($value);
        } else {
            throw new InvalidArgumentException('value must be a integer or float');
        }

        if ($negative) {
            $len = strlen($encoded);
            for ($i = $len - 1; $i >= 0; $i--) {
                $encoded[$i] = chr(~(ord($encoded[$i])) | 0x80);
            }

            // Now sign extend
            $encoded = str_pad($encoded, 9, "\xff", STR_PAD_RIGHT) . "\x01";
        }

        return $encoded;
    }

    /**
     * Writes a unsigned varint to $fp
     * returns the number of bytes written
     *
     * @param $fp
     * @param $value The int to encode and write
     * @return The number of bytes written
     */
    public static function write_varint($fp, $value)
    {
        checkArgument(get_resource_type($fp) === 'stream', 'fp must be a file resource');

        $buf = self::encode_varint($value);
        $len = strlen($buf);

        if (fwrite($fp, $buf) !== $len)
            throw new Exception('write_varint(): Error writing byte');

        return $len;
    }

    /**
     * Writes a packed value to $fp
     * returns the number of bytes written
     *
     * @param $fp
     * @param $value The int to encode and write
     * @param $pack  The pack format
     * @return The number of bytes written
     */
    protected static function write_pack($fp, $value, $pack)
    {
        checkArgument(get_resource_type($fp) === 'stream', 'fp must be a file resource');
        checkArgument(is_integer($value) || is_float($value), 'value must be numeric');
        checkArgument(is_string($pack), 'pack must be a valid string');

        $encoded = pack($pack, $value);
        $len = strlen($encoded);

        $wrote = fwrite($fp, $encoded, $len);
        if ($wrote === false || $wrote !== $len) {
            throw new Exception('write_pack(): Error writing byte');
        }

        return $len;
    }

    public static function write_float($fp, $f)
    {
        return self::write_pack($fp, $f, 'f');
    } // BUG We need to convert from machine order to little order first

    public static function write_double($fp, $d)
    {
        return self::write_pack($fp, $d, 'd');
    } // BUG We need to convert from machine order to little order first

    public static function write_int32($fp, $i)
    {
        return self::write_pack($fp, $i, 'l');
    } // BUG We need to convert from machine order to little order first

    public static function write_uint32($fp, $i)
    {
        return self::write_pack($fp, $i, 'V');
    }

    // unpack 'q' and 'P' are only supported since PHP 5.6.3
    public static function write_int64($fp, $i)
    {
        return self::write_pack($fp, $i, 'q');
    } // BUG We need to convert from machine order to little order first

    public static function write_uint64($fp, $i)
    {
        return self::write_pack($fp, $i, 'P');
    }

    public static function write_zint32($fp, $i)
    {
        return self::write_varint($fp, ($i >= 0 ? ($i << 1) : (($i << 1) ^ ~0)));
    }

    public static function write_zint64($fp, $i)
    {
        return self::write_varint($fp, ($i >= 0 ? ($i << 1) : (($i << 1) ^ ~0)));
    }

    /**
     * Seek past a varint
     */
    public static function skip_varint($fp)
    {
        checkArgument(get_resource_type($fp) === 'stream', 'fp must be a file resource');

        $value = self::read_varint_bytes($fp);
        if ($value === false) {
            return false;
        }
    }

    /**
     * Seek past the current field
     * TODO Rewrite this to be safer
     */
    public static function skip_field($fp, $wire_type, &$limit = PHP_INT_MAX)
    {
        checkArgument(get_resource_type($fp) === 'stream', 'fp must be a file resource');
        checkArgument(is_int($wire_type), 'wire_type must be a integer');

        switch ($wire_type) {
            case 0: // varint
                $tmp = self::skip_varint($fp, $limit);
                if ($tmp === false) throw new \Exception('Protobuf::skip_varint returned false');

            case 1: // 64bit
                if (fseek($fp, 8, SEEK_CUR) === -1)
                    throw new Exception('skip(' . self::get_wiretype(1) . '): Error seeking');
                $limit -= 8;

            case 2: // length delimited
                $len = self::read_varint($fp, $limit);
                if ($len === false) throw new \Exception('Protobuf::read_varint returned false');
                if (fseek($fp, $len, SEEK_CUR) === -1)
                    throw new Exception('skip(' . self::get_wiretype(2) . '): Error seeking');
                $limit -= $len;

            //case 3: // Start group TODO we must keep looping until we find the closing end grou
            //case 4: // End group - We should never skip a end group!
            //	return 0; // Do nothing

            case 5: // 32bit
//				if (fseek($fp, 4, SEEK_CUR) === -1)
//					throw new Exception('skip('. self::get_wiretype(5) . '): Error seeking');
//				$limit -= 4;

            default:
//				throw new Exception('skip('. self::get_wiretype($wire_type) . '): Unsupported wire_type');
        }
    }

    /**
     * TODO Decide to delete toString(). It used when printing unknown fields
     * Used to aid in pretty printing of Protobuf objects
     * TODO Decode enums
     */
    private static $print_depth = 0;

    private static $indent_char = "\t";

    private static $print_limit = 50;

    public static function toString($key, $value, $default = null)
    {
        if ($value === $default)
            return;

        $ret = str_repeat(self::$indent_char, self::$print_depth) . "$key=>";
        if (is_array($value)) {
            $ret .= "array(\n";
            self::$print_depth++;
            foreach ($value as $i => $v)
                $ret .= self::toString("[$i]", $v);
            self::$print_depth--;
            $ret .= str_repeat(self::$indent_char, self::$print_depth) . ")\n";

        } elseif (is_object($value)) {
            self::$print_depth++;
            $ret .= get_class($value) . "(\n";
            $ret .= $value->__toString() . "\n";
            self::$print_depth--;
            $ret .= str_repeat(self::$indent_char, self::$print_depth) . ")\n";

        } elseif (is_string($value)) {
            $safevalue = addcslashes($value, "\0..\37\177..\377");
            if (strlen($safevalue) > self::$print_limit) {
                $safevalue = substr($safevalue, 0, self::$print_limit) . '...';
            }

            $ret .= '"' . $safevalue . '" (' . strlen($value) . " bytes)\n";

        } elseif (is_bool($value)) {
            $ret .= ($value ? 'true' : 'false') . "\n";

        } else {
            $ret .= (string)$value . "\n";
        }
        return $ret;
    }
}


================================================
FILE: phpunit.xml.dist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php"
         backupGlobals="false"
         backupStaticAttributes="false"
         colors="true"
         verbose="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="false"
         stopOnFailure="false">
    <testsuites>
        <testsuite name="PokemonGoAPI-PHP Test Suite">
            <directory>tests</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist>
            <directory suffix=".php">src/</directory>
        </whitelist>
    </filter>
    <logging>
        <log type="tap" target="build/report.tap"/>
        <log type="junit" target="build/report.junit.xml"/>
    </logging>
</phpunit>


================================================
FILE: src/Api/Data/Data.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Data;

use Google\Protobuf\Internal\Message;
use ReflectionClass;

abstract class Data {

    /**
     * Creates a data instance from a Protobuf Message.
     *
     * @param Message $data
     * @return static
     */
    public static function create($data)
    {
        // Check if we retrieved valid data
        if ($data == null) {
            return;
        }

        $instance = new static();

        // Retrieve the properties within the protobuf message class
        $dataProperties = self::getClassProperties($data);

        // Retrieve the properties within the data class
        $properties = self::getClassDefaultProperties($instance);

        foreach ($dataProperties as $property) {
            // Retrieve the property name
            $propertyName = camel_case($property->getName());

            // Check if the same property exists within the data class
            if (!array_key_exists($propertyName, $properties)) {
                continue;
            }

            // Sets the property value
            $instance->{'set' . $propertyName}($data->{'get' . $propertyName}());
        }

        return $instance;
    }

    /**
     * @param $name
     * @param $arguments
     */
    public function __call($name, $arguments)
    {
        if ($this->isSetMethod($name)) {
            $attribute = $this->getAttribute($name);

            $this->{$attribute} = current($arguments);

        } elseif ($this->isGetMethod($name)) {
            $attribute = $this->getAttribute($name);

            return $this->{$attribute};
        }
    }

    /**
     * Returns the class properties of a class.
     *
     * @param mixed $instance
     * @return array
     */
    protected static function getClassProperties($instance)
    {
        $reflection = new ReflectionClass($instance);

        return $reflection->getProperties();
    }

    /**
     * Returns the class properties of a class.
     *
     * @param mixed $instance
     * @return array
     */
    protected static function getClassDefaultProperties($instance)
    {
        $reflection = new ReflectionClass($instance);

        return $reflection->getDefaultProperties();
    }

    /**
     * Returns the corresponding attribute.
     *
     * @param $method
     * @return string
     */
    protected function getAttribute($method)
    {
        return lcfirst(substr($method, 3));
    }

    /**
     * Returns true if the method corresponds to a setter method, false otherwise.
     *
     * @param string $method
     * @return boolean
     */
    protected function isSetMethod($method)
    {
        return strpos($method, 'set') !== FALSE;
    }

    /**
     * Returns true if the method corresponds to a getter method, false otherwise.
     *
     * @param string $method
     * @return boolean
     */
    protected function isGetMethod($method)
    {
        return strpos($method, 'get') !== FALSE;
    }


}

================================================
FILE: src/Api/Data/Device.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Data;

class Device extends Data
{
    /**
     * @var string
     */
    protected $deviceId = "";

    /**
     * @var string
     */
    protected $androidBoardName = "";

    /**
     * @var string
     */
    protected $androidBootloader = "";

    /**
     * @var string
     */
    protected $deviceBrand = "";

    /**
     * @var string
     */
    protected $deviceModel = "";

    /**
     * @var string
     */
    protected $deviceModelIdentifier = "";

    /**
     * @var string
     */
    protected $deviceModelBoot = "";

    /**
     * @var string
     */
    protected $hardwareManufacturer = "";

    /**
     * @var string
     */
    protected $hardwareModel = "";

    /**
     * @var string
     */
    protected $firmwareBrand = "";

    /**
     * @var string
     */
    protected $firmwareTags = "";

    /**
     * @var string
     */
    protected $firmwareType = "";

    /**
     * @var string
     */
    protected $firmwareFingerprint = "";

}

================================================
FILE: src/Api/Data/Location.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Data;

/**
 * @method void setLatitude(double $latitude)
 * @method void setLongitude(double $longitude)
 *
 * @method double getLatitude()
 * @method double getLongitude()
 */
class Location extends Data {

    /**
     * @var double
     */
    protected $latitude;

    /**
     * @var double
     */
    protected $longitude;

    /**
     * Location constructor.
     *
     * @param double $latitude
     * @param double $longitude
     */
    public function __construct($latitude = 0.0, $longitude = 0.0)
    {
        $this->latitude = $latitude;
        $this->longitude = $longitude;
    }

}

================================================
FILE: src/Api/Map/Data/Resource.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Map\Data;

use GetMapObjectsResponse;
use NicklasW\PkmGoApi\Api\Data\Data;
use NicklasW\PkmGoApi\Api\Map\Data\Resources\CatchablePokemon;
use NicklasW\PkmGoApi\Api\Map\Data\Resources\Fort;
use NicklasW\PkmGoApi\Api\Map\Data\Resources\NearbyPokemon;
use NicklasW\PkmGoApi\Api\Map\Data\Resources\SpawnPoint;
use NicklasW\PkmGoApi\Api\Map\Data\Resources\WildPokemon as WildPokemonData;
use NicklasW\PkmGoApi\Api\Map\Pokestop;
use POGOProtos\Map\Fort\FortData;
use POGOProtos\Map\Fort\FortType;
use POGOProtos\Map\Pokemon\MapPokemon;
use POGOProtos\Map\Pokemon\WildPokemon;
use POGOProtos\Map\SpawnPoint as SpawnPointData;

class Resource extends Data {

    /**
     * @var Fort[]
     */
    protected $pokestops = array();

    /**
     * @var Fort[]
     */
    protected $gyms = array();

    /**
     * @var SpawnPoint[]
     */
    protected $spawnPoints = array();

    /**
     * @var CatchablePokemon[]
     */
    protected $catchablePokemons = array();

    /**
     * @var WildPokemonData[]
     */
    protected $wildPokemons = array();

    /**
     * @var NearbyPokemon[]
     */
    protected $nearbyPokemons = array();

    /**
     * Creates a data instance from a Protobuf Message.
     *
     * @param GetMapObjectsResponse $data
     * @return static
     */
    public static function create($data)
    {
        $instance = new static();

        // Iterate through the list of map cells
        foreach ($data->getMapCellsArray() as $mapCell) {
            // Add forts to the list of forts
            $instance->addForts($mapCell->getFortsArray());

            // Add spawn points to the list of spawn points
            $instance->addSpawnPoints($mapCell->getSpawnPointsArray());

            // Add catchable pokemons to the list of catchable pokemons
            $instance->addCatchablePokemons($mapCell->getCatchablePokemonsArray());

            // Add wild pokemons to the list of catchable pokemons
            $instance->addCatchablePokemons($mapCell->getWildPokemonsArray());

            // Add wild pokemons to the list of wild pokemons
            $instance->addWildPokemons($mapCell->getWildPokemonsArray());

            // Add nearby pokemons to the list of nearby pokemons
            $instance->addNearbyPokemons($mapCell->getNearbyPokemonsArray());

        }

        return $instance;
    }

    /**
     * Add a new fort.
     *
     * @param FortData[] $forts
     */
    public function addForts($forts)
    {
        foreach ($forts as $fort) {
            // Create the fort instance
            $instance = Fort::create($fort);

            switch ($fort->getType()) {
                case FortType::CHECKPOINT:
                    // Add the fort to the list of pokestop
                    $this->pokestops[] = new Pokestop($instance);

                    break;
                case FortType::GYM:
                    // Add the fort to the list of gym
                    $this->gyms[] = $instance;

                    break;
            }
        }
    }

    /**
     * Adds a spawn point to the list of spawns points.
     *
     * @param SpawnPointData[] $spawnPoints
     */
    public function addSpawnPoints($spawnPoints)
    {
        foreach ($spawnPoints as $spawnPoint) {
            // Add spawn point to the list of spawn points
            $this->spawnPoints[] = SpawnPoint::create($spawnPoint);
        }
    }

    /**
     * Adds catchable pokemon to the list of catchable pokemons.
     *
     * @param MapPokemon $catchablePokemons
     */
    public function addCatchablePokemons($catchablePokemons)
    {
        foreach ($catchablePokemons as $catchablePokemon) {
            $this->catchablePokemons[] = CatchablePokemon::create($catchablePokemon);
        }
    }
    /**
     * Adds catchable pokemon to the list of catchable pokemons.
     *
     * @param WildPokemon $wildPokemons
     */
    public function addWildPokemons($wildPokemons)
    {
        foreach ($wildPokemons as $wildPokemon) {
            $this->wildPokemons[] = WildPokemonData::create($wildPokemon);
        }
    }

    /**
     * Adds nearby pokemon to the list of nearby pokemons.
     *
     * @param MapPokemon $nearbyPokemons
     */
    public function addNearbyPokemons($nearbyPokemons)
    {
        foreach ($nearbyPokemons as $nearbyPokemon) {
            $this->nearbyPokemons[] = NearbyPokemon::create($nearbyPokemon);
        }
    }

}

================================================
FILE: src/Api/Map/Data/Resources/CatchablePokemon.php
================================================
<?php


namespace NicklasW\PkmGoApi\Api\Map\Data\Resources;

use NicklasW\PkmGoApi\Api\Data\Data;
use POGOProtos\Enums\PokemonId;

class CatchablePokemon extends Data {

    /**
     * @var string
     */
    protected $spawnPointId = "";

    /**
     * @var int
     */
    protected $encounterId = 0;

    /**
     * @var
     */
    protected $pokemonId = PokemonId::MISSINGNO;

    /**
     * @var int
     */
    protected $expirationTimestampMs = 0;

    /**
     * @var double
     */
    protected $latitude = 0;

    /**
     * @var double
     */
    protected $longitude = 0;

}

================================================
FILE: src/Api/Map/Data/Resources/Fort.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Map\Data\Resources;

use NicklasW\PkmGoApi\Api\Data\Data;
use POGOProtos\Enums\PokemonId;
use POGOProtos\Enums\TeamColor;
use POGOProtos\Map\Fort\FortRenderingType;
use POGOProtos\Map\Fort\FortSponsor;
use POGOProtos\Map\Fort\FortType;


/**
 * @method void setId(string $id)
 * @method void setLastModifiedTimestampMs(int $lastModifiedTimestampMs)
 * @method void setLatitude(int $latitude)
 * @method void setLongitude(int $longitude)
 * @method void setEnabled(boolean $enabled)
 * @method void setType(int $type)
 * @method void setOwnedByTeam(int $ownedByTeam)
 * @method void setGuardPokemonId(int $candies)
 * @method void setGuardPokemonCp(int $candies)
 * @method void setGymPoints(int $gymPoints)
 * @method void setIsInBattle(boolean $isInBattle)
 * @method void setCooldownCompleteTimestampMs(int $cooldownCompleteTimestampMs)
 * @method void setRenderingType(int $candies)
 * @method void setActiveFortModifier(int $activeFortModifier)
 * @method void setLureInfo($lureInfo)
 *
 * @method string getId()
 * @method int getLastModifiedTimestampMs()
 * @method int getLatitude()
 * @method int getLongitude()
 * @method boolean getEnabled()
 * @method int getType()
 * @method int getOwnedByTeam()
 * @method int getGuardPokemonId()
 * @method int getGuardPokemonCp()
 * @method int getGymPoints()
 * @method boolean getIsInBattle()
 * @method int getCooldownCompleteTimestampMs()
 * @method int getRenderingType()
 * @method int getActiveFortModifier()
 * @method void getLureInfo()
*/
class Fort extends Data {

    /**
     * @var string
     */
    protected $id = "";

    /**
     * @var int
     */
    protected $lastModifiedTimestampMs = 0;

    /**
     * @var int
     */
    protected $latitude = 0;

    /**
     * @var int
     */
    protected $longitude = 0;

    /**
     * @var bool
     */
    protected $enabled = false;

    /**
     * @var
     */
    protected $type = FortType::GYM;

    /**
     * @var
     */
    protected $ownedByTeam = TeamColor::NEUTRAL;

    /**
     * @var
     */
    protected $guardPokemonId = PokemonId::MISSINGNO;

    /**
     * @var int
     */
    protected $guardPokemonCp = 0;

    /**
     * @var int
     */
    protected $gymPoints = 0;

    /**
     * @var bool
     */
    protected $isInBattle = false;

    /**
     * @var int
     */
    protected $cooldownCompleteTimestampMs = 0;

    /**
     * @var
     */
    protected $sponsor = FortSponsor::UNSET_SPONSOR;

    /**
     * @var
     */
    protected $renderingType = FortRenderingType::DEFAULT;

    /**
     * @var string
     */
    protected $activeFortModifier = "";

    /**
     * @var
     */
    protected $lureInfo = null;

}

================================================
FILE: src/Api/Map/Data/Resources/NearbyPokemon.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Map\Data\Resources;

use NicklasW\PkmGoApi\Api\Data\Data;
use POGOProtos\Enums\PokemonId;

class NearbyPokemon extends Data {

    /**
     * @var
     */
    protected $pokemonId = PokemonId::MISSINGNO;

    /**
     * @var int
     */
    protected $distanceInMeters = 0;

    /**
     * @var int
     */
    protected $encounterId = 0;

}

================================================
FILE: src/Api/Map/Data/Resources/SpawnPoint.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Map\Data\Resources;

use NicklasW\PkmGoApi\Api\Data\Data;

class SpawnPoint extends Data {

    






    



}

================================================
FILE: src/Api/Map/Data/Resources/WildPokemon.php
================================================
<?php


namespace NicklasW\PkmGoApi\Api\Map\Data\Resources;

use NicklasW\PkmGoApi\Api\Data\Data;

class WildPokemon extends Data {

    /**
     * @var int
     */
    protected $encounterId = 0; // optional fixed64 encounter_id = 1

    /**
     * @var int
     */
    protected $lastModifiedTimestampMs = 0; // optional int64 last_modified_timestamp_ms = 2

    /**
     * @var int
     */
    protected $latitude = 0; // optional double latitude = 3

    /**
     * @var int
     */
    protected $longitude = 0; // optional double longitude = 4

    /**
     * @var string
     */
    protected $spawnPointId = ""; // optional string spawn_point_id = 5

    /**
     * @var null
     */
    protected $pokemonData = null; // optional .POGOProtos.Data.PokemonData pokemon_data = 7

    /**
     * @var int
     */
    protected $timeTillHiddenMs = 0; // optional int32 time_till_hidden_ms = 11

}

================================================
FILE: src/Api/Map/Data/Results/PokestopSpinResult.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Map\Data\Results;

use NicklasW\PkmGoApi\Api\Data\Data;
use POGOProtos\Networking\Responses\FortSearchResponse_Result;

class PokestopSpinResult extends Data {

    /**
     * @var int
     */
    private $result = FortSearchResponse_Result::NO_RESULT_SET;

    /**
     * @var array
     */
    protected $itemsAwarded = array(); // repeated .POGOProtos.Inventory.Item.ItemAward items_awarded = 2

    /**
     * @var int
     */
    protected $gemsAwarded = 0; // optional int32 gems_awarded = 3

    /**
     * @var null
     */
    protected $pokemonDataEgg = null; // optional .POGOProtos.Data.PokemonData pokemon_data_egg = 4

    /**
     * @var int
     */
    protected $experienceAwarded = 0; // optional int32 experience_awarded = 5

    /**
     * @var int
     */
    protected $cooldownCompleteTimestampMs = 0; // optional int64 cooldown_complete_timestamp_ms = 6

    /**
     * @var int
     */
    protected $chainHackSequenceNumber = 0;

    /**
     * @return int
     */
    public function getResult()
    {
        return $this->result;
    }

    /**
     * @return array
     */
    public function getItemsAwarded()
    {
        return $this->itemsAwarded;
    }

    /**
     * @return int
     */
    public function getGemsAwarded()
    {
        return $this->gemsAwarded;
    }

    /**
     * @return null
     */
    public function getPokemonDataEgg()
    {
        return $this->pokemonDataEgg;
    }

    /**
     * @return int
     */
    public function getExperienceAwarded()
    {
        return $this->experienceAwarded;
    }

    /**
     * @return int
     */
    public function getCooldownCompleteTimestampMs()
    {
        return $this->cooldownCompleteTimestampMs;
    }

    /**
     * @return int
     */
    public function getChainHackSequenceNumber()
    {
        return $this->chainHackSequenceNumber;
    }

}

================================================
FILE: src/Api/Map/Map.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Map;

use Exception;
use NicklasW\PkmGoApi\Api\Map\Data\Resource;
use NicklasW\PkmGoApi\Api\Map\Data\Resources\Fort;
use NicklasW\PkmGoApi\Api\Map\Support\S2;
use NicklasW\PkmGoApi\Api\Procedure;
use NicklasW\PkmGoApi\Services\Request\MapRequestService;
use POGOProtos\Networking\Responses\GetMapObjectsResponse;

class Map extends Procedure {

    /**
     * Map constructor.
     */
    public function __construct()
    {
        $this->data = new Resource();
    }

    /**
     * Returns the pokestops.
     *
     * @return Fort[]
     */
    public function getPokestops()
    {
        return $this->data->getPokestops();
    }

    /**
     * Returns gyms.
     *
     * @return Fort[]
     */
    public function getGyms()
    {
        return $this->data->getGyms();
    }

    /**
     * Returns the catchable pokemon located on the map.
     */
    public function getCatchablePokemon()
    {


    }

    /**
     * Returns the map resources.
     *
     * @throws Exception
     */
    public function update()
    {
        // Retrieve the map resources
        $resources = $this->getMapResources();

        // Create the resource data instance
        $this->data = Resource::create($resources);
    }

    /**
     * Returns the map resources.
     *
     * @return GetMapObjectsResponse
     */
    protected function getMapResources()
    {
        // Retrieved the latitude
        $latitude = $this->getApplication()->getLatitude();

        // Retrieved the longitude
        $longitude = $this->getApplication()->getLongitude();

        // Retrieve a list of cell ids from the latitude and longitude
        $cellIds = S2::getCellIds($latitude, $longitude);

        // Retrieve the map resources
        return $this->getRequestService()->getResources($latitude, $longitude, $cellIds);
    }

    /**
     * Returns the request service.
     *
     * @return MapRequestService
     */
    protected function getRequestService()
    {
        return new MapRequestService();
    }

}

================================================
FILE: src/Api/Map/Pokestop.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Map;

use NicklasW\PkmGoApi\Api\Map\Data\Resources\Fort;
use NicklasW\PkmGoApi\Api\Map\Data\Results\PokestopSpinResult;
use NicklasW\PkmGoApi\Api\Procedure;
use NicklasW\PkmGoApi\Services\Request\PokestopRequestService;
use POGOProtos\Networking\Responses\FortSearchResponse_Result;
use S2\S2LatLng;

/**
 * @method void setId(string $id)
 * @method void setLastModifiedTimestampMs(int $lastModifiedTimestampMs)
 * @method void setLatitude(int $latitude)
 * @method void setLongitude(int $longitude)
 * @method void setEnabled(boolean $enabled)
 * @method void setType(int $type)
 * @method void setOwnedByTeam(int $ownedByTeam)
 * @method void setGuardPokemonId(int $candies)
 * @method void setGuardPokemonCp(int $candies)
 * @method void setGymPoints(int $gymPoints)
 * @method void setIsInBattle(boolean $isInBattle)
 * @method void setCooldownCompleteTimestampMs(int $cooldownCompleteTimestampMs)
 * @method void setRenderingType(int $candies)
 * @method void setActiveFortModifier(int $activeFortModifier)
 * @method void setLureInfo($lureInfo)
 * @method string getId()
 * @method int getLastModifiedTimestampMs()
 * @method int getLatitude()
 * @method int getLongitude()
 * @method boolean getEnabled()
 * @method int getType()
 * @method int getOwnedByTeam()
 * @method int getGuardPokemonId()
 * @method int getGuardPokemonCp()
 * @method int getGymPoints()
 * @method boolean getIsInBattle()
 * @method int getCooldownCompleteTimestampMs()
 * @method int getRenderingType()
 * @method int getActiveFortModifier()
 * @method void getLureInfo()
 */
class Pokestop extends Procedure {

    /**
     * @var int The loot distance
     */
    protected static $LOOT_DISTANCE = 30;

    /**
     * @var int The fort cooldown timestamp
     */
    protected $cooldownTimestamp = 0;

    /**
     * Pokestop constructor.
     *
     * @param Fort $fortData
     */
    public function __construct($fortData)
    {
        $this->data = $fortData;
    }

    /**
     * Returns true if within range of the pokestop, false otherwise.
     *
     * @return boolean
     */
    public function isInRange()
    {
        // Retrieve the pokestop location
        $pokestopLocation = S2LatLng::fromDegrees($this->getLatitude(), $this->getLongitude());

        // The current player location
        $playerLocation = S2LatLng::fromDegrees($this->getCurrentLatitude(), $this->getCurrentLongitude());

        // Check if the distance is within the loot interval
        return $pokestopLocation->getEarthDistance($playerLocation) < self::$LOOT_DISTANCE;
    }

    /**
     * Returns true if available for spin, false otherwise.
     *
     * @return boolean
     */
    public function canSpin()
    {
        // Check if the pokestop is on cooldown
        $active = $this->cooldownTimestamp < microtime();

        return $this->isInRange() && $active;
    }

    /**
     * Spin the pokestop.
     *
     * @return PokestopSpinResult
     */
    public function spin()
    {
        // Retrieve the map resources
        $fortResponse = $this->getRequestService()->spin($this->getId(),
            $this->getLatitude(), $this->getLongitude());

        switch ($fortResponse->getResult()) {

            case FortSearchResponse_Result::SUCCESS:
                // Update inventory

                // Set the cooldown timestamp
                $this->cooldownTimestamp = $fortResponse->getCooldownCompleteTimestampMs();

                break;
        }

        return PokestopSpinResult::create($fortResponse);
    }

    public function hasLure()
    {

    }

    public function addLure()
    {

    }

    /**
     * Returns the pokestop details.
     */
    public function getDetails()
    {

    }

    /**
     * Returns the current latitude.
     *
     * @return double
     */
    protected function getCurrentLatitude()
    {
        return $this->getApplication()->getLocation()->getLatitude();
    }

    /**
     * Returns the current longitude.
     *
     * @return double
     */
    protected function getCurrentLongitude()
    {
        return $this->getApplication()->getLocation()->getLongitude();
    }

    /**
     * Returns the request service.
     *
     * @return PokestopRequestService
     */
    protected function getRequestService()
    {
        return new PokestopRequestService();
    }

}

================================================
FILE: src/Api/Map/Support/S2.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Map\Support;

use S2\S2CellId;
use S2\S2LatLng;

class S2 {

    /**
     * Returns a list of cell ids for latitue and longitude.
     *
     * @param double $latitude
     * @param double $longitude
     * @param int    $width
     * @return array
     */
    public static function getCellIds($latitude, $longitude, $width = 9)
    {
        // Create s2 instance from latitude and longitude
        $s2latLng = S2LatLng::fromDegrees($latitude, $longitude);

        // Get s2 cell id from latitude and longitude
        $cellId = S2CellId::fromLatLng($s2latLng)->parent(15);

        // Calculate the size
        $size = 1 * (2 ** (S2CellId::MAX_LEVEL - $cellId->level()));

        $index = 0;
        $jindex = 0;

        $face = $cellId->toFaceIJOrientation($index, $jindex);

        $cells = array();

        $halfWidth = (int)floor($width / 2);

        for ($x = -$halfWidth; $x <= $halfWidth; $x++) {
            for ($y = -$halfWidth; $y <= $halfWidth; $y++) {
                $s2CellID = S2CellId::fromFaceIJ($face, $index + $x * $size, $jindex + $y * $size);

                $cells[] = $s2CellID->parent(15)->id();
            }
        }

        return $cells;
    }

}

================================================
FILE: src/Api/Player/CheckChallenge.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Player;

use NicklasW\PkmGoApi\Api\Player\Data\CheckChallenge\CheckChallengeData;
use NicklasW\PkmGoApi\Api\Procedure;
use NicklasW\PkmGoApi\Services\Request\CheckChallengeRequestService;

/**
 * @method array checkChallenge()
 */
class CheckChallenge extends Procedure {

    /**
     * Returns the request data.
     *
     * @returns CheckChallengeData
     */
    public function getData()
    {
        return parent::getData();
    }

    /**
     * Updates the player CheckChallenge with the latest data.
     */
    public function update()
    {
        // Retrieves the checkChallenge metadata
        $data = $this->getRequestService()->checkChallenge();

        // Set the checkChallenge data
        $this->data = CheckChallengeData::create($data); 
    }

    /**
     * Returns the request service.
     *
     * @return CheckChallengeRequestService
     */
    protected function getRequestService()
    {
        return new CheckChallengeRequestService();
    }
}



================================================
FILE: src/Api/Player/Data/CheckChallenge/CheckChallengeData.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Player\Data\CheckChallenge;

use NicklasW\PkmGoApi\Api\Data\Data;
use POGOProtos\Networking\Responses\CheckChallengeResponse;

class CheckChallengeData extends Data {

    /**
     * @var bool The showChallenge value
     */
    protected $showChallenge;

    /**
     * @var string The challengeUrl
     */
    protected $challengeUrl;

    /**
     * Creates a data instance from a Protobuf Message.
     *
     * @param CheckChallengeData $data
     * @return static
     */
    public static function create($data)
    {
        // Check if we retrieved valid data
        if ($data == null) {
            return;
        }

        // Creates a instance of CheckChallengeData
        $instance = new static();

        // Set the showChallenge
        $instance->showChallenge = $data->getShowChallenge();

        // Set the challengeUrl
        $instance->challengeUrl = $data->getChallengeUrl();

        return $instance;
    }
}



================================================
FILE: src/Api/Player/Data/Inventory/AppliedItem.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Player\Data\Inventory;

use NicklasW\PkmGoApi\Api\Data\Data;
use POGOProtos\Inventory\Item\ItemId;
use POGOProtos\Inventory\Item\ItemType;

/**
 * @method void setItemId(int $itemId)
 * @method void setItemType(int $itemType)
 * @method void setExpireMs(int $expireMs)
 * @method void setAppliedMs(int $appliedMs)

 * @method int getItemId()
 * @method int getItemType()
 * @method int getExpireMs()
 * @method int getAppliedMs()
 */
class AppliedItem extends Data {

    /**
     * @var int
     */
    protected $itemId = ItemId::ITEM_UNKNOWN;

    /**
     * @var int
     */
    protected $itemType = ItemType::ITEM_TYPE_NONE;

    /**
     * @var int
     */
    protected $expireMs = 0;

    /**
     * @var int
     */
    protected $appliedMs = 0;

}

================================================
FILE: src/Api/Player/Data/Inventory/AppliedItems.php
================================================
<?php


namespace NicklasW\PkmGoApi\Api\Player\Data\Inventory;

use NicklasW\PkmGoApi\Api\Data\Data;
use POGOProtos\Inventory\AppliedItem as AppliedItemData;
use POGOProtos\Inventory\AppliedItems as AppliedItemsData;

/**
 * @method void setAppliedItems(AppliedItem[] $candies)
 * @method AppliedItem[] getAppliedItems()
 */
class AppliedItems extends Data {

    /**
     * @var AppliedItem[]
     */
    protected $appliedItems = array();

    /**
     * Add applied item to the list of applied items.
     *
     * @param AppliedItemData $appliedItem
     */
    public function add($appliedItem)
    {
        // Add the applied item to the list of applied items
        $this->appliedItems[] = AppliedItem::create($appliedItem);
    }

    /**
     * Creates a data instance from a Protobuf Message.
     *
     * @param AppliedItemsData $data
     * @return static
     */
    public static function create($data)
    {
        // Create a instance
        $instance = new static();

        // Retrieve the items
        $items = $data->getItem();

        // Iterate through the list of items
        foreach ($items as $item) {
            // Add a applied item to the list of applied items
            $instance->add($item);
        }

        return $instance;
    }

}

================================================
FILE: src/Api/Player/Data/Inventory/CandyBank.php
================================================
<?php


namespace NicklasW\PkmGoApi\Api\Player\Data\Inventory;

use Exception;
use NicklasW\PkmGoApi\Api\Data\Data;
use NicklasW\PkmGoApi\Api\Support\Enums\PokemonFamilyId;
use POGOProtos\Inventory\Candy;
use POGOProtos\Inventory\PokemonFamily;

/**
 * @method void setCandies(CandyItem[] $candies)
 * @method CandyItem[] getCandies()
 */
class CandyBank extends Data {

    /**
     * @var CandyItem[]
     */
    protected $candies = array();

    /**
     * @param Candy $data
     */
    public function add($data)
    {
        // Create a candy item from pokemon family data
        $candyItem = CandyItem::create($data);

        // Check if a candy item with the family id already exists
        if (array_key_exists($candyItem->getFamilyId(), $this->candies)) {
            // Retrieve the candy item
            $storedCandyItem = $this->candies[$candyItem->getFamilyId()];

            // Update the number of candy item
            $storedCandyItem->setCandy($storedCandyItem->getCandy() + $candyItem->getCandy());
        } else {
            $this->candies[$candyItem->getFamilyId()] = $candyItem;
        }
    }

    /**
     * Gets candy item by pokemon family id.
     *
     * @param integer $familyId
     * @return CandyItem
     * @throws Exception
     */
    public function get($familyId)
    {
        // Check if the provided family id is valid
        if (!PokemonFamilyId::isValid($familyId)) {
            throw new Exception(sprintf('Invalid pokemon family id provided. Pokemon family id \'%s\'', $familyId));
        }

        // Check if the candy bank contains the pokemon family id
        if (!array_key_exists($familyId, $this->candies)) {
            throw new Exception(sprintf('The candy bank does not contain candy for the pokemon family. Pokemon family id \'%s\'', $familyId));
        }

        return $this->candies[$familyId];
    }

}

================================================
FILE: src/Api/Player/Data/Inventory/CandyItem.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Player\Data\Inventory;

use NicklasW\PkmGoApi\Api\Data\Data;
use POGOProtos\Enums\PokemonFamilyId;

/**
 * @method void setFamilyId(integer $familyId)
 * @method void setCandy(integer $candy)
 * @method integer getFamilyId()
 * @method integer getCandy()
 */
class CandyItem extends Data {

    /**
     * @var integer
     */
    protected $familyId = PokemonFamilyId::FAMILY_UNSET;

    /**
     * @var integer
     */
    protected $candy = 0;

    /**
     * Returns the number of candies.
     *
     * @return int
     */
    public function getCount()
    {
        return $this->candy;
    }

}

================================================
FILE: src/Api/Player/Data/Inventory/EggIncubator.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Player\Data\Inventory;

use NicklasW\PkmGoApi\Api\Data\Data;
use POGOProtos\Inventory\EggIncubatorType;
use POGOProtos\Inventory\Item\ItemId;

/**
 * @method void setId(string $id)
 * @method void setItemId(int $itemId)
 * @method void setIncubatorType(int $incubatorType)
 * @method void setUsesRemaining(int $usesRemaining)
 * @method void setPokemonId(int $pokemonId)
 * @method void setStartKmWalked(int $startKmWalked)
 * @method void setTargetKmWalked(int $targetKmWalked)

 * @method string getId()
 * @method int getItemId()
 * @method int getIncubatorType()
 * @method int getUsesRemaining()
 * @method int getPokemonId()
 * @method int getStartKmWalked()
 * @method int getTargetKmWalked()
 */
class EggIncubator extends Data {

    /**
     * @var string
     */
    protected $id = "";

    /**
     * @var int
     */
    protected $itemId = ItemId::ITEM_UNKNOWN;

    /**
     * @var int
     */
    protected $incubatorType = EggIncubatorType::INCUBATOR_UNSET;

    /**
     * @var int
     */
    protected $usesRemaining = 0;

    /**
     * @var int
     */
    protected $pokemonId = 0;

    /**
     * @var int
     */
    protected $startKmWalked = 0;

    /**
     * @var int
     */
    protected $targetKmWalked = 0;

}

================================================
FILE: src/Api/Player/Data/Inventory/EggIncubators.php
================================================
<?php


namespace NicklasW\PkmGoApi\Api\Player\Data\Inventory;

use NicklasW\PkmGoApi\Api\Data\Data;

use POGOProtos\Inventory\EggIncubator as EggIncubatorData;
use POGOProtos\Inventory\EggIncubators as EggIncubatorsData;

/**
 * @method void setEggIncubators(EggIncubator[] $eggIncubators)
 * @method EggIncubator[] getEggIncubators()
 */
class EggIncubators extends Data {

    /**
     * @var EggIncubator[]
     */
    protected $eggIncubators = array();

    /**
     * @param EggIncubatorData $eggIncubator
     */
    public function add($eggIncubator)
    {
        // Add the egg incubator to the list of egg incubators
        $this->eggIncubators[] = EggIncubator::create($eggIncubator);
    }

    /**
     * Creates a data instance from a Protobuf Message.
     *
     * @param EggIncubatorsData $data
     * @return static
     */
    public static function create($data)
    {
        // Create a instance
        $instance = new static();

        // Iterate through the list of egg incubators
        foreach ($data->getEggIncubator() as $eggIncubator) {
            // Add a egg incubator to the list of egg incubators
            $instance->add($eggIncubator);
        }

        return $instance;
    }


}

================================================
FILE: src/Api/Player/Data/Inventory/EggPokemon.php
================================================
<?php


namespace NicklasW\PkmGoApi\Api\Player\Data\Inventory;

use NicklasW\PkmGoApi\Api\Data\Data;

/**
 * @method void setId(long $id)
 * @method void setEggKmWalkedTarget(double $eggKmWalkedTarget)
 * @method void setCapturedCellId(long $capturedCellId)
 * @method void setCreationTimeMs(long $creationTimeMs)
 * @method void setEggIncubatorId(string $eggIncubatorId)

 * @method long getId()
 * @method double getEggKmWalkedTarget()
 * @method long getCapturedCellId()
 * @method long getCreationTimeMs()
 * @method string getEggIncubatorId()
 */
class EggPokemon extends Data {

    /**
     * @var long
     */
    protected $id;

    /**
     * @var double
     */
    protected $eggKmWalkedTarget;

    /**
     * @var long
     */
    protected $capturedCellId;

    /**
     * @var long
     */
    protected $creationTimeMs;

    /**
     * @var string
     */
    protected $eggIncubatorId;

}

================================================
FILE: src/Api/Player/Data/Inventory/Item.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Player\Data\Inventory;

use NicklasW\PkmGoApi\Api\Data\Data;

/**
 * @method void setItemId(integer $itemId)
 * @method void setCount(integer $count)
 * @method void setUnseen(boolean $unseen)
 *
 * @method integer getItemId()
 * @method integer getCount()
 * @method boolean getUnseen()
 */

class Item extends Data {

    /**
     * @var integer The item id, POGOProtos\Inventory\ItemId
     */
    protected $itemId;

    /**
     * @var integer
     */
    protected $count;

    /**
     * @var boolean
     */
    protected $unseen;

}

================================================
FILE: src/Api/Player/Data/Inventory/Items.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Player\Data\Inventory;

use Exception;
use NicklasW\PkmGoApi\Api\Data\Data;
use NicklasW\PkmGoApi\Api\Support\Enums\ItemId;
use NicklasW\PkmGoApi\Facades\Log;
use POGOProtos\Inventory\InventoryDelta;
use POGOProtos\Inventory\InventoryItem;
use POGOProtos\Inventory\InventoryItemData;

/**
 * @method void setPokeBank(PokeBank $pokeBank)
 * @method void setItems(Item[] $items)
 * @method void setCandyBank(CandyBank $candyBank)
 * @method void setPokedex(Pokedex $pokedex)
 * @method void setAppliedItems(AppliedItems $appliedItems)
 * @method void setStats(Stats $stats)
 * @method void setEggPokemon(EggPokemon[] $eggPokemon)
 * @method PokeBank getPokeBank()
 * @method Item[] getItems()
 * @method CandyBank getCandyBank()
 * @method Pokedex getPokedex()
 * @method EggIncubators getEggIncubators()
 * @method AppliedItems getAppliedItems()
 * @method Stats getStats()
 * @method EggPokemon[] getEggPokemon()
 */
class Items extends Data {

    /**
     * @var PokeBank
     */
    protected $pokeBank;

    /**
     * @var Item[]
     */
    protected $items;

    /**
     * @var CandyBank
     */
    protected $candyBank;

    /**
     * @var Pokedex
     */
    protected $pokedex;

    /**
     * @var EggIncubators
     */
    protected $eggIncubators;

    /**
     * @var AppliedItems
     */
    protected $appliedItems;

    /**
     * @var Stats
     */
    protected $stats;

    /**
     * @var EggPokemon[]
     */
    protected $eggPokemon = array();

    /**
     * Items constructor.
     */
    public function __construct()
    {
        $this->pokeBank = new PokeBank();
        $this->candyBank = new CandyBank();
        $this->pokedex = new Pokedex();
        $this->eggIncubators = new EggIncubators();
        $this->appliedItems = new AppliedItems();
    }

    /**
     * Creates a data instance from a Protobuf Message.
     *
     * @param InventoryDelta $data
     * @return static
     */
    public static function create($data)
    {
        // Initialize the Items instance
        $instance = new static();

        /** @var InventoryItem[] $items */
        $items = $data->getInventoryItems();

        // Iterate through the inventory items
        foreach ($items as $item) {
            // Create the corresponding item type
            $instance->createItemData($item->getInventoryItemData());
        }

        return $instance;
    }

    /**
     * Creates item data.
     *
     * @param InventoryItemData $itemData
     * @throws Exception
     */
    protected function createItemData($itemData)
    {
        if (self::isItem($itemData)) {
            // Retrieve the item data instance
            $item = $itemData->getItem();

            // Retrieve the item data
            $this->items[$item->getItemId()] = Item::create($item);
        } elseif (self::isEggPokemon($itemData)) {
            // Retrieve the applied items data
            $this->eggPokemon[] = EggPokemon::create($itemData->getPokemonData());

        } elseif (self::isPokemon($itemData)) {
            // Retrieve the pokemon data
            $this->pokeBank->add($itemData->getPokemonData());

        } elseif (self::isCandy($itemData)) {
            // Retrieve the candy item data
            $this->candyBank->add($itemData->getCandy());

        } elseif (self::isPokedexItem($itemData)) {
            // Retrieve the pokedex item data
            $this->pokedex->add($itemData->getPokedexEntry());

        } elseif (self::isEggIncubators($itemData)) {
            // Retrieve the egg incubators item data
            $this->eggIncubators = EggIncubators::create($itemData->getEggIncubators());

        } elseif (self::isAppliedItems($itemData)) {
            // Retrieve the applied items data
            $this->appliedItems = AppliedItems::create($itemData->getAppliedItems());

        } elseif (self::isPlayerStats($itemData)) {
            // Retrieve the applied items data
            $this->stats = Stats::create($itemData->getPlayerStats());
        } else {
            Log::warning('Unknown item type encountered', array('item' => $itemData));
        }

    }

    /**
     * Returns item instance or null.
     *
     * @param integer $id
     * @return Item
     * @throws Exception
     */
    public function getItemById($id)
    {
        // Check if we retrieved a valid item id
        if (!ItemId::isValid($id)) {
            throw new Exception(sprintf('Invalid item id provided. Id \'%s\'', $id));
        }

        // Check if we have that particular item in the inventory
        if (!array_key_exists($id, $this->items)) {
            return null;
        }

        return $this->items[$id];
    }

    /**
     * Returns true if the item data is of type item, false otherwise.
     *
     * @param InventoryItemData $itemData
     * @return boolean
     */
    protected static function isItem($itemData)
    {
        return $itemData->getItem() != null;
    }

    /**
     * Returns true if the item data is of type pokemon, false otherwise.
     *
     * @param InventoryItemData $itemData
     * @return boolean
     */
    protected static function isPokemon($itemData)
    {
        return $itemData->getPokemonData() != null;
    }

    /**
     * Returns true if the item data is of type candy, false otherwise.
     *
     * @param InventoryItemData $itemData
     * @return boolean
     */
    protected static function isCandy($itemData)
    {
        return $itemData->getCandy() != null;
    }

    /**
     * Returns true if the item data is of type pokedex item, false otherwise.
     *
     * @param InventoryItemData $itemData
     * @return boolean
     */
    protected static function isPokedexItem($itemData)
    {
        return $itemData->getPokedexEntry() != null;
    }

    /**
     * Returns true if the item data is of type pokedex item, false otherwise.
     *
     * @param InventoryItemData $itemData
     * @return boolean
     */
    protected static function isEggIncubators($itemData)
    {
        return $itemData->getEggIncubators() != null;
    }

    /**
     * Returns true if the item data is of type pokedex item, false otherwise.
     *
     * @param InventoryItemData $itemData
     * @return boolean
     */
    protected static function isAppliedItems($itemData)
    {
        return $itemData->getAppliedItems() != null;
    }

    /**
     * Returns true if the item data is of type pokedex item, false otherwise.
     *
     * @param InventoryItemData $itemData
     * @return boolean
     */
    protected static function isPlayerStats($itemData)
    {
        return $itemData->getPlayerStats() != null;
    }

    /**
     * Returns true if the item data is of type egg pokemon item, false otherwise.
     *
     * @param InventoryItemData $itemData
     * @return boolean
     */
    protected static function isEggPokemon($itemData)
    {
        return $itemData->getPokemonData() != null && $itemData->getPokemonData()->getIsEgg();
    }

}

================================================
FILE: src/Api/Player/Data/Inventory/PokeBank.php
================================================
<?php


namespace NicklasW\PkmGoApi\Api\Player\Data\Inventory;

use Exception;
use NicklasW\PkmGoApi\Api\Data\Data;
use NicklasW\PkmGoApi\Api\Pokemon\Collection\PokemonCollection;
use NicklasW\PkmGoApi\Api\Pokemon\Pokemon;
use NicklasW\PkmGoApi\Api\Support\Enums\PokemonFamilyId;
use NicklasW\PkmGoApi\Api\Support\Enums\PokemonId;
use POGOProtos\Data\PokemonData;

/**
 * @method void setPokemons(PokemonCollection $pokemons)
 * @method PokemonCollection getPokemons()
 */
class PokeBank extends Data {

    /**
     * @var PokemonCollection
     */
    protected $pokemons = array();

    /**
     * PokeBank constructor.
     */
    public function __construct()
    {
        $this->pokemons = new PokemonCollection();
    }

    /**
     * Add a pokemon to the poke bank by pokemon data.
     *
     * @param PokemonData $data
     */
    public function add($data)
    {
        // Create a new pokemon instance
        $pokemon = new Pokemon(PokemonItem::create($data));

        // Add the pokemon to the list of pokemons
        $this->pokemons->put($pokemon->getId(), $pokemon);
    }

    /**
     * Add a pokemon to the poke bank.
     *
     * @param Pokemon $pokemon
     */
    public function addPokemon($pokemon)
    {
        // Add the pokemon to the list of pokemons
        $this->pokemons->put($pokemon->getId(), $pokemon);
    }

    /**
     * Remove the pokemon from the poke bank by pokemon id.
     *
     * @param integer $id
     * @return boolean
     */
    public function removeBydId($id)
    {
        // Check if the poke bank contains the pokemon
        if (!$this->pokemons->offsetExists($id)) {
            return false;
        }

        // Remove the pokemon from the poke bank
        $this->pokemons->forget($id);

        return true;
    }

    /**
     * Remove the pokemon from the poke bank.
     *
     * @param Pokemon $pokemon
     * @return boolean
     */
    public function removePokemon($pokemon)
    {
        return $this->removeBydId($pokemon->getPokemonId());
    }

    /**
     * Returns a pokemon by pokemon id.
     *
     * @param integer $id
     * @return Pokemon
     */
    public function getPokemonById($id)
    {
        // Check if the pokemon exists within the poke bank
        if (!$this->pokemons->offsetExists($id)) {
            return null;
        }

        return $this->pokemons->get($id);
    }

    /**
     * Returns pokemons by pokemon type.
     *
     * @param integer $typeId
     * @return PokemonCollection
     * @throws Exception
     */
    public function getPokemonsByType($typeId)
    {
        // Check if we retrieved a valid pokemon type id
        if (!PokemonId::isValid($typeId)) {
            throw new Exception(sprintf('Invalid pokemon type id provided. Provided pokemon type id: \'%s\'', $typeId));
        }
        return $this->pokemons->filter(function (Pokemon $pokemon) use ($typeId) {
            return $pokemon->getPokemonId() == $typeId;
        });
    }

    /**
     * Returns pokemons by pokemon family.
     *
     * @param integer $familyId
     * @return PokemonCollection
     * @throws Exception
     */
    public function getPokemonsByFamily($familyId)
    {
        // Check if we retrieved a valid pokemon family id
        if (!PokemonFamilyId::isValid($familyId)) {
            throw new Exception(sprintf('Invalid pokemon family id provided. Provided pokemon family id: \'%s\'', $familyId));
        }

        return $this->pokemons->filter(function (Pokemon $pokemon) use ($familyId) {
            return $pokemon->getFamilyId() == $familyId;
        });
    }

}


================================================
FILE: src/Api/Player/Data/Inventory/Pokedex.php
================================================
<?php


namespace NicklasW\PkmGoApi\Api\Player\Data\Inventory;

use NicklasW\PkmGoApi\Api\Data\Data;
use NicklasW\PkmGoApi\Api\Support\Enums\PokemonId;
use POGOProtos\Data\PokedexEntry;

/**
 * @method void setItems(PokedexItem[] $items)
 * @method PokedexItem[] getItems()
 */
class Pokedex extends Data {

    /**
     * @var array
     */
    protected $items = array();

    /**
     * Add pokedex item.
     *
     * @param PokedexEntry $pokedexEntry
     */
    public function add($pokedexEntry)
    {
        // Create the pokedex item
        $item = PokedexItem::create($pokedexEntry);

        // Add the pokedex item to the list of pokedex items
        $this->items[$item->getPokemonId()] = $item;
    }

    /**
     * Gets the pokedex item by pokemon id
     *
     * @param integer $pokemonId
     * @return PokedexItem|null
     */
    public function get($pokemonId)
    {
        // Check whether a valid pokemon id was provided
        if (!PokemonId::isValid($pokemonId)) {
            return null;
        }

        // Check if the pokemon exists within the pokedex
        if (array_key_exists($pokemonId, $this->items)) {
            return $this->items[$pokemonId];
        }

        return $this->createEmptyItem($pokemonId);
    }

    /**
     * Creates a empty PokedexItem.
     *
     * @param integer $pokemonId
     * @return PokedexItem
     */
    protected function createEmptyItem($pokemonId)
    {
        // Create a new pokedex item
        $entry = new PokedexItem();

        // Set the pokemon id
        $entry->setPokemonId($pokemonId);

        return $entry;
    }

}

================================================
FILE: src/Api/Player/Data/Inventory/PokedexItem.php
================================================
<?php


namespace NicklasW\PkmGoApi\Api\Player\Data\Inventory;


use NicklasW\PkmGoApi\Api\Data\Data;

/**
 * @method void setPokemonId(integer $pokemonId)
 * @method void setTimesEncountered(integer $timesEncountered)
 * @method void setTimesCaptured(integer $timesCaptured)
 * @method void setEvolutionStonePieces(integer $evolutionStonePieces)
 * @method void setEvolutionStones(integer $evolutionStones)
 *
 * @method int getPokemonId()
 * @method int getTimesEncountered()
 * @method int getTimesCaptured()
 * @method int getEvolutionStonePieces()
 * @method int getEvolutionStones()
 */
class PokedexItem extends Data {

    /**
     * @var int
     */
    protected $pokemonId = 0;

    /**
     * @var int
     */
    protected $timesEncountered = 0;

    /**
     * @var int
     */
    protected $timesCaptured = 0;

    /**
     * @var int
     */
    protected $evolutionStonePieces = 0;

    /**
     * @var int
     */
    protected $evolutionStones = 0;


}

================================================
FILE: src/Api/Player/Data/Inventory/PokemonItem.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Player\Data\Inventory;

use NicklasW\PkmGoApi\Api\Data\Data;
use POGOProtos\Enums\PokemonId;
use POGOProtos\Enums\PokemonMove;

/**
 * @method void setId(int $id)
 * @method void setPokemonId(int $pokemonId)
 * @method void setCp(int $cp)
 * @method void setStamina(int $stamina)
 * @method void setStaminaMax(int $staminaMax)
 * @method void setMove1(int $move1)
 * @method void setMove2(int $move2)
 * @method void setDeployedFortId(int $deployedFortId)
 * @method void setOwnerName(string $ownerName)
 * @method void setIsEgg(boolean $isEgg)
 * @method void setEggKmWalkedTarget(int $eggKmWalkedTarget)
 * @method void setEggKmWalkedStart(int $eggKmWalkedStart)
 * @method void setOrigin(int $origin)
 * @method void setHeightM(int $heightM)
 * @method void setWeightKg(int $weightKg)
 * @method void setIndividualAttack(int $individualAttack)
 * @method void setIndividualDefense(int $individualDefense)
 * @method void setIndividualStamina(int $individualStamina)
 * @method void setCpMultiplier(int $cpMultiplier)
 * @method void setPokeball(int $pokeball)
 * @method void setCapturedCellId(int $capturedCellId)
 * @method void setBattlesAttacked(int $battlesAttacked)
 * @method void setBattlesDefended(int $battlesDefended)
 * @method void setEggIncubatorId(string $eggIncubatorId)
 * @method void setCreationTimeMs(int $creationTimeMs)
 * @method void setNumUpgrades(int $numUpgrades)
 * @method void setAdditionalCpMultiplier(int $additionalCpMultiplier)
 * @method void setFavorite(int $favorite)
 * @method void setNickname(string $nickname)
 * @method void setFromFort(int $fromFort)
 *
 * @method int getId()
 * @method int getPokemonId()
 * @method int getCp()
 * @method int getStamina()
 * @method int getStaminaMax()
 * @method int getMove1()
 * @method int getMove2()
 * @method int getDeployedFortId()
 * @method string getOwnerName()
 * @method boolean getIsEgg()
 * @method int getEggKmWalkedTarget()
 * @method int getEggKmWalkedStart()
 * @method int getOrigin()
 * @method int getHeightM()
 * @method int getWeightKg()
 * @method int getIndividualAttack()
 * @method int getIndividualDefense()
 * @method int getIndividualStamina()
 * @method int getCpMultiplier()
 * @method int getPokeball()
 * @method int getCapturedCellId()
 * @method int getBattlesAttacked()
 * @method int getBattlesDefended()
 * @method string getEggIncubatorId()
 * @method int getCreationTimeMs()
 * @method int getNumUpgrades()
 * @method int getAdditionalCpMultiplier()
 * @method int getFavorite()
 * @method string getNickname()
 * @method int getFromFort()
 */
class PokemonItem extends Data {

    /**
     * @var int
     */
    protected $id = 0;

    /**
     * @var int
     */
    protected $pokemonId = PokemonId::MISSINGNO;

    /**
     * @var int
     */
    protected $cp = 0;

    /**
     * @var int
     */
    protected $stamina = 0;

    /**
     * @var int
     */
    protected $staminaMax = 0;

    /**
     * @var int
     */
    protected $move1 = PokemonMove::MOVE_UNSET;

    /**
     * @var int
     */
    protected $move2 = PokemonMove::MOVE_UNSET;

    /**
     * @var int
     */
    protected $deployedFortId = 0;

    /**
     * @var string
     */
    protected $ownerName = "";

    /**
     * @var bool
     */
    protected $isEgg = false;

    /**
     * @var int
     */
    protected $eggKmWalkedTarget = 0;

    /**
     * @var int
     */
    protected $eggKmWalkedStart = 0;

    /**
     * @var int
     */
    protected $origin = 0;

    /**
     * @var int
     */
    protected $heightM = 0;

    /**
     * @var int
     */
    protected $weightKg = 0;

    /**
     * @var int
     */
    protected $individualAttack = 0;

    /**
     * @var int
     */
    protected $individualDefense = 0;

    /**
     * @var int
     */
    protected $individualStamina = 0;

    /**
     * @var int
     */
    protected $cpMultiplier = 0;

    /**
     * @var int
     */
    protected $pokeball = 0;

    /**
     * @var int
     */
    protected $capturedCellId = 0;

    /**
     * @var int
     */
    protected $battlesAttacked = 0;

    /**
     * @var int
     */
    protected $battlesDefended = 0;

    /**
     * @var string
     */
    protected $eggIncubatorId = "";

    /**
     * @var int
     */
    protected $creationTimeMs = 0;

    /**
     * @var int
     */
    protected $numUpgrades = 0;

    /**
     * @var int
     */
    protected $additionalCpMultiplier = 0;

    /**
     * @var int
     */
    protected $favorite = 0;

    /**
     * @var string
     */
    protected $nickname = "";

    /**
     * @var int
     */
    protected $fromFort = 0;
    
}

================================================
FILE: src/Api/Player/Data/Inventory/Stats.php
================================================
<?php


namespace NicklasW\PkmGoApi\Api\Player\Data\Inventory;

use NicklasW\PkmGoApi\Api\Data\Data;
use POGOProtos\Inventory\AppliedItem as AppliedItemData;
use POGOProtos\Inventory\AppliedItems as AppliedItemsData;

/**
 * @method void setLevel(int $candies)
 * @method void setExperience(int $experience)
 * @method void setPrevLevelXp(int $prevLevelXp)
 * @method void setNextLevelXp(int $nextLevelXp)
 * @method void setKmWalked(int $kmWalked)
 * @method void setPokemonsEncountered(int $pokemonsEncountered)
 * @method void setAppliedItems(int $candies)
 * @method void setUniquePokedexEntries(int $uniquePokedexEntries)
 * @method void setPokemonsCaptured(int $pokemonsCaptured)
 * @method void setEvolutions(int $evolutions)
 * @method void setPokeStopVisits(int $pokeStopVisits)
 * @method void setPokeballsThrown(int $pokeballsThrown)
 * @method void setEggsHatched(int $eggsHatched)
 * @method void setBigMagikarpCaught(int $bigMagikarpCaught)
 * @method void setBattleAttackWon(int $battleAttackWon)
 * @method void setBattleAttackTotal(int $battleAttackTotal)
 * @method void setBattleDefendedWon(int $battleDefendedWon)
 * @method void setBattleTrainingWon(int $battleTrainingWon)
 * @method void setBattleTrainingTotal(int $battleTrainingTotal)
 * @method void setPrestigeRaisedTotal(int $prestigeRaisedTotal)
 * @method void setPrestigeDroppedTotal(int $prestigeDroppedTotal)
 * @method void setPokemonDeployed(int $pokemonDeployed)
 * @method void setPokemonCaughtByType(string $pokemonCaughtByType)
 * @method void setSmallRattataCaught(int $smallRattataCaught)
 
 * @method int getLevel()
 * @method int getExperience()
 * @method int getPrevLevelXp()
 * @method int getNextLevelXp()
 * @method int getKmWalked()
 * @method int getPokemonsEncountered()
 * @method int getAppliedItems()
 * @method int getUniquePokedexEntries()
 * @method int getPokemonsCaptured()
 * @method int getEvolutions()
 * @method int getPokeStopVisits()
 * @method int getPokeballsThrown()
 * @method int getEggsHatched()
 * @method int getBigMagikarpCaught()
 * @method int getBattleAttackWon()
 * @method int getBattleAttackTotal()
 * @method int getBattleDefendedWon()
 * @method int getBattleTrainingWon()
 * @method int getBattleTrainingTotal()
 * @method int getPrestigeRaisedTotal()
 * @method int getPrestigeDroppedTotal()
 * @method int getPokemonDeployed()
 * @method int getPokemonCaughtByType()
 * @method int getSmallRattataCaught()
 */
class Stats extends Data {

    /**
     * @var int
     */
    protected $level = 0;

    /**
     * @var int
     */
    protected $experience = 0;

    /**
     * @var int
     */
    protected $prevLevelXp = 0;

    /**
     * @var int
     */
    protected $nextLevelXp = 0;

    /**
     * @var int
     */
    protected $kmWalked = 0;

    /**
     * @var int
     */
    protected $pokemonsEncountered = 0;

    /**
     * @var int
     */
    protected $uniquePokedexEntries = 0;

    /**
     * @var int
     */
    protected $pokemonsCaptured = 0;

    /**
     * @var int
     */
    protected $evolutions = 0;

    /**
     * @var int
     */
    protected $pokeStopVisits = 0;

    /**
     * @var int
     */
    protected $pokeballsThrown = 0;

    /**
     * @var int
     */
    protected $eggsHatched = 0;

    /**
     * @var int
     */
    protected $bigMagikarpCaught = 0;

    /**
     * @var int
     */
    protected $battleAttackWon = 0;

    /**
     * @var int
     */
    protected $battleAttackTotal = 0;

    /**
     * @var int
     */
    protected $battleDefendedWon = 0;

    /**
     * @var int
     */
    protected $battleTrainingWon = 0;

    /**
     * @var int
     */
    protected $battleTrainingTotal = 0;

    /**
     * @var int
     */
    protected $prestigeRaisedTotal = 0;

    /**
     * @var int
     */
    protected $prestigeDroppedTotal = 0;

    /**
     * @var int
     */
    protected $pokemonDeployed = 0;

    /**
     * @var string
     */
    protected $pokemonCaughtByType = "";

    /**
     * @var int
     */
    protected $smallRattataCaught = 0;

    /**
     * @var int[]
     */
    protected static $requiredXp = [
        0, 1000, 3000, 6000, 10000, 15000, 21000, 28000, 36000, 45000, 55000, 65000, 75000, 85000, 100000, 120000,
        140000, 160000, 185000, 210000, 260000, 335000, 435000, 560000, 710000, 900000, 1100000, 1350000, 1650000,
        2000000, 2500000, 3000000, 3750000, 4750000, 6000000, 7500000, 9500000, 12000000, 15000000, 20000000];

    /**
     * Return the XP required for the given level.
     *
     * @param int $level
     * @return int
     */
    public function getLevelXp($level = 1) {
        return isset(self::$requiredXp[$level-1]) ? self::$requiredXp[$level-1] : 0;
    }

    /**
     * Return the XP required for the current level.
     *
     * @return int
     */
    public function getCurrentLevelXp() {
        return $this->getLevelXp($this->getLevel());
    }

    /**
     * Return the XP earned on the current level.
     *
     * @return number
     */
    public function getCurrentLevelProgressXp() {
        return $this->getExperience() - $this->getCurrentLevelXp();
    }

}

================================================
FILE: src/Api/Player/Data/Journal/Fort.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Player\Data\Journal;

use NicklasW\PkmGoApi\Api\Data\Data;
use POGOProtos\Data\Logs\FortSearchLogEntry;

class Fort extends Data {

    /**
     * @var integer
     */
    protected $timestampMs;

    /**
     * @var integer
     */
    protected $result;

    /**
     * @var string
     */
    protected $fortId;

    /**
     * @var integer
     */
    protected $eggs;

    /**
     * @var Item[]
     */
    protected $items;

    /**
     * Creates a data instance from a Protobuf Message.
     *
     * @param FortSearchLogEntry $data
     * @return static
     */
    public static function create($data)
    {
        // Check if we retrieved valid data
        if ($data == null) {
            return;
        }

        $instance = new static();

        // Set the result status
        $instance->result = $data->getResult();

        // Set the fort id
        $instance->fortId = $data->getFortId();

        // Set the egg count
        $instance->eggs = $data->getEggs();

        foreach ($data->getItems() as $item) {
            // Add the item to the list of items
            $instance->items[] = Item::create($item);
        }

        return $instance;
    }

}

================================================
FILE: src/Api/Player/Data/Journal/Item.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Player\Data\Journal;

use NicklasW\PkmGoApi\Api\Data\Data;

class Item extends Data {

    /**
     * @var integer
     */
    protected $itemId;

    /**
     * @var integer
     */
    protected $count;

    /**
     * @var boolean
     */
    protected $unseen;

    /**
     * Returns the item id.
     *
     * @return int
     */
    public function getItemId()
    {
        return $this->itemId;
    }

    /**
     * Returns the count.
     *
     * @return int
     */
    public function getCount()
    {
        return $this->count;
    }

    /**
     * Return true if unseen, false otherwise.
     *
     * @return boolean
     */
    public function isUnseen()
    {
        return $this->unseen;
    }
    

}

================================================
FILE: src/Api/Player/Data/Journal/Log.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Player\Data\Journal;

use NicklasW\PkmGoApi\Api\Data\Data;
use POGOProtos\Data\Logs\ActionLogEntry;

class Log extends Data
{

    /**
     * @var Fort[]
     */
    protected $forts = array();

    /**
     * @var Pokemon[]
     */
    protected $pokemons = array();

    /**
     * @return Fort[]
     */
    public function getForts()
    {
        return $this->forts;
    }

    /**
     * @return Pokemon[]
     */
    public function getPokemons()
    {
        return $this->pokemons;
    }

    /**
     * Creates a data instance from a Protobuf Message.
     *
     * @param ActionLogEntry[] $data
     * @return static
     */
    public static function create($data)
    {
        $instance = new static();

        // Check if we retrieved valid data
        if ($data == null) {
            return $instance;
        }

        foreach ($data as $logEntry) {
            if ($logEntry->getCatchPokemon()) {
                $element = Pokemon::create($logEntry->getCatchPokemon());
                $element->setTimestampMs($logEntry->getTimestampMs());

                // Adds pokemon to the list of pokemon log entries
                $instance->pokemons[] = $element;
            } elseif ($logEntry->getFortSearch()) {
                $element = Fort::create($logEntry->getFortSearch());;
                $element->setTimestampMs($logEntry->getTimestampMs());

                // Add fort to the list of fort log entries
                $instance->forts[] = $element;
            }
        }

        return $instance;
    }


}

================================================
FILE: src/Api/Player/Data/Journal/Pokemon.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Player\Data\Journal;

use NicklasW\PkmGoApi\Api\Data\Data;
use NicklasW\PkmGoApi\Api\Player\Data\Inventory\PokedexItem;
use NicklasW\PkmGoApi\Api\Pokemon\Data\PokemonMeta;
use NicklasW\PkmGoApi\Api\Pokemon\Data\PokemonMetaRegistry;
use NicklasW\PkmGoApi\Api\Support\Traits\MakeApiResourcesAvailable;

class Pokemon extends Data {

    use MakeApiResourcesAvailable;

    /**
     * @var integer
     */
    protected $timestampMs;

    /**
     * @var integer
     */
    protected $result;

    /**
     * @var integer
     */
    protected $pokemonId;

    /**
     * @var integer
     */
    protected $combatPoints;

    /**
     * @var integer
     */
    protected $pokemonDataId;

    /**
     * Returns the timestamp (in ms) of this log entry.
     *
     * @return integer
     */
    public function getTimestampMs() {
        return $this->timestampMs;
    }

    /**
     * Returns the catch result.
     * (1=success, 2=escaped)
     * @return int
     */
    public function getResult()
    {
        return $this->result;
    }

    /**
     * Returns pokemon id.
     *
     * @return int
     */
    public function getPokemonId()
    {
        return $this->pokemonId;
    }

    /**
     * Returns the combat points.
     *
     * @return int
     */
    public function getCombatPoints()
    {
        return $this->combatPoints;
    }

    /**
     * Returns the pokemon data id.
     *
     * @return int
     */
    public function getPokemonDataId()
    {
        return $this->pokemonDataId;
    }

    /**
     * Returns the pokemon metadata.
     *
     * @return PokemonMeta
     */
    public function getPokemonMeta()
    {
        return PokemonMetaRegistry::getByPokemonId($this->pokemonId);
    }

    /**
     * Returns the pokedex entry.
     *
     * @return PokedexItem
     */
    public function getPokedexEntry()
    {
        return $this->pokedex()->get($this->pokemonId);
    }


}

================================================
FILE: src/Api/Player/Data/Profile/Avatar.php
================================================
<?php


namespace NicklasW\PkmGoApi\Api\Player\Data\Profile;

use NicklasW\PkmGoApi\Api\Data\Data;

/**
 * @method void setSkin(int $skin)
 * @method void setHair(int $hair)
 * @method void setShirt(int $shirt)
 * @method void setPants(int $pants)
 * @method void setHat(int $hat)
 * @method void setShoes(int $shoes)
 * @method void setGender(int $gender)
 * @method void setEyes(int $eyes)
 * @method void setBackpack(int $backpack)
 *
 * @method integer getSkin()
 * @method integer getHair()
 * @method integer getShirt()
 * @method integer getPants()
 * @method integer getHat()
 * @method integer getShoes()
 * @method integer getGender()
 * @method integer getEyes()
 * @method integer getBackpack()
 */
class Avatar extends Data {

    /**
     * @var integer
     */
    protected $skin;

    /**
     * @var integer
     */
    protected $hair;

    /**
     * @var integer
     */
    protected $shirt;

    /**
     * @var integer
     */
    protected $pants;

    /**
     * @var integer
     */
    protected $hat;

    /**
     * @var integer
     */
    protected $shoes;

    /**
     * @var integer
     */
    protected $gender;

    /**
     * @var integer
     */
    protected $eyes;

    /**
     * @var integer
     */
    protected $backpack;

}

================================================
FILE: src/Api/Player/Data/Profile/Badge.php
================================================
<?php


namespace NicklasW\PkmGoApi\Api\Player\Data\Profile;

use NicklasW\PkmGoApi\Api\Data\Data;

/**
 * @method void setBadgeType(int $badgeType)
 * @method void setLevel(int $level)
 * @method void setNextEquipChangeAllowedTimestampMs(int $nextEquipChangeAllowedTimestampMs)
 *
 * @method integer getBadgeType()
 * @method integer getLevel()
 * @method integer getNextEquipChangeAllowedTimestampMs()
 */
class Badge extends Data {

    /**
     * @var integer
     */
    protected $badgeType;
    /**
     * @var array
     */
    protected $level;

    /**
     * @var integer
     */
    protected $nextEquipChangeAllowedTimestampMs;

}

================================================
FILE: src/Api/Player/Data/Profile/ContactSettings.php
================================================
<?php


namespace NicklasW\PkmGoApi\Api\Player\Data\Profile;

use NicklasW\PkmGoApi\Api\Data\Data;

/**
 * @method void setSendMarketingEmails(int $sendMarketingEmails)
 * @method void setSendPushNotifications(int $sendPushNotifications)
 *
 * @method integer getSendMarketingEmails()
 * @method integer getSendPushNotifications()
 */
class ContactSettings extends Data {

    /**
     * @var integer
     */
    protected $sendMarketingEmails;

    /**
     * @var integer
     */
    protected $sendPushNotifications;

}

================================================
FILE: src/Api/Player/Data/Profile/Currencies.php
================================================
<?php


namespace NicklasW\PkmGoApi\Api\Player\Data\Profile;

use Exception;
use NicklasW\PkmGoApi\Api\Data\Data;
use POGOProtos\Data\Player\Currency as PlayerCurrency;

/**
 * @method integer setCurrencies(array $state)
 * @method integer getCurrencies()
 */
class Currencies extends Data {

    /**
     * @var string The pokecoin currency type
     */
    const CURRENCY_TYPE_POKECOIN = 'POKECOIN';

    /**
     * @var string The stardust currency type
     */
    const CURRENCY_TYPE_STARDUST = 'STARDUST';

    /**
     * @var Currency[]
     */
    protected $currencies;

    /**
     * Creates a TutorialState instance.
     *
     * @param PlayerCurrency[] $currencies
     * @return static
     */
    public static function create($currencies)
    {
        $instance = new static();

        foreach ($currencies as $playerCurrency) {
            $currency = new Currency();

            $currency->setName($playerCurrency->getName());
            $currency->setAmount($playerCurrency->getAmount());

            $instance->currencies[$playerCurrency->getName()] = $currency;
        }

        return $instance;
    }

    /**
     * Returns the currency by currency type.
     *
     * @param string $type
     * @return Currency
     * @throws Exception
     */
    public function getByType($type)
    {
        // Check if the provided type is a valid currency type
        if (!array_key_exists($type, $this->currencies)) {
            throw new Exception('Invalid currency type provided');
        }

        return $this->currencies[$type];
    }

    /**
     * Returns the pokecoins currency.
     *
     * @return Currency
     * @throws Exception
     */
    public function getPokecoins()
    {
        return $this->getByType(self::CURRENCY_TYPE_POKECOIN);
    }

    /**
     * Returns stardust currency.
     *
     * @return Currency
     * @throws Exception
     */
    public function getStardust()
    {
        return $this->getByType(self::CURRENCY_TYPE_STARDUST);
    }

    /**
     * Returns all currency types.
     *
     * @return array
     */
    public function toArray()
    {
        return $this->currencies;
    }

}

================================================
FILE: src/Api/Player/Data/Profile/Currency.php
================================================
<?php


namespace NicklasW\PkmGoApi\Api\Player\Data\Profile;

use NicklasW\PkmGoApi\Api\Data\Data;

/**
 * @method void setName(string $state)
 * @method void setAmount(integer $state)
 *
 * @method string getName()
 * @method integer getAmount()
 */
class Currency extends Data {

    /**
     * @var string
     */
    protected $name;

    /**
     * @var string
     */
    protected $amount;

}

================================================
FILE: src/Api/Player/Data/Profile/DailyBonus.php
================================================
<?php


namespace NicklasW\PkmGoApi\Api\Player\Data\Profile;

use NicklasW\PkmGoApi\Api\Data\Data;

/**
 * @method void setNextCollectedTimestampMs(int $nextCollectedTimestampMs)
 * @method void setNextDefenderBonusCollectTimestampMs(int $nextDefenderBonusCollectTimestampMs)
 *
 * @method integer getNextCollectedTimestampMs()
 * @method integer getNextDefenderBonusCollectTimestampMs()
 */
class DailyBonus extends Data {

    /**
     * @var int
     */
    protected $nextCollectedTimestampMs;

    /**
     * @var int
     */
    protected $nextDefenderBonusCollectTimestampMs;

}

================================================
FILE: src/Api/Player/Data/Profile/ProfileData.php
================================================
<?php


namespace NicklasW\PkmGoApi\Api\Player\Data\Profile;

use NicklasW\PkmGoApi\Api\Data\Data;
use POGOProtos\Data\PlayerData;

/**
 * @method void setCreationTime(string $creationTime)
 * @method void setUsername(string $username)
 * @method void setTeam(integer $team)
 * @method void setTutorialState(TutorialState $tutorialState)
 * @method void setAvatar(Avatar $avatar)
 * @method void setPokemonStorage(array $pokemonStorage)
 * @method void setItemStorage(array $itemStorage)
 * @method void setDailyBonus(DailyBonus $dailyBonus)
 * @method void setBadge(Badge $badge)
 * @method void setContactSettings(ContactSettings $state)
 * @method void setCurrencies(Currencies $currencies)

 * @method string getCreationTime()
 * @method string getUsername()
 * @method integer getTeam()
 * @method TutorialState getTutorialState()
 * @method Avatar getAvatar()
 * @method array getPokemonStorage()
 * @method array getItemStorage()
 * @method DailyBonus getDailyBonus()
 * @method ContactSettings getBadge()
 * @method ContactSettings getContactSettings()
 * @method Currencies getCurrencies()
 */
class ProfileData extends Data {

    /**
     * @var string The creation time
     */
    protected $creationTime;

    /**
     * @var string The username
     */
    protected $username;

    /**
     * @var integer
     */
    protected $team;

    /**
     * @var TutorialState
     */
    protected $tutorialState;

    /**
     * @var Avatar
     */
    protected $avatar;

    /**
     * @var int
     */
    protected $pokemonStorage;

    /**
     * @var int
     */
    protected $itemStorage;

    /**
     * @var DailyBonus
     */
    protected $dailyBonus;

    /**
     * @var Badge
     */
    protected $badge;

    /**
     * @var ContactSettings
     */
    protected $contactSettings;

    /**
     * @var Currencies
     */
    protected $currencies;

    /**
     * Creates a data instance from a Protobuf Message.
     *
     * @param PlayerData $data
     * @return static
     */
    public static function create($data)
    {
        // Creates a instance of ProfileData
        $instance = new static();

        // Set the username
        $instance->username = $data->getUsername();

        // Set the team
        $instance->team = $data->getTeam();

        // Set the creation time
        $instance->creationTime = $data->getCreationTimestampMs();

        // Crates the tutorial state
        $instance->tutorialState = TutorialState::create($data->getTutorialState());

        // Creates the player avatar
        $instance->avatar = Avatar::create($data->getAvatar());

        // Set the pokemon storage
        $instance->pokemonStorage = $data->getMaxPokemonStorage();

        // Set the item storage
        $instance->itemStorage = $data->getMaxItemStorage();

        // Set the daily bonus
        $instance->dailyBonus = DailyBonus::create($data->getDailyBonus());

        // Set the equipped badge
        $instance->badge = Badge::create($data->getEquippedBadge());

        // Set the contact settings
        $instance->contactSettings = ContactSettings::create($data->getContactSettings());

        // Sets the player currencies
        $instance->currencies = Currencies::create($data->getCurrencies());

        return $instance;
    }


}

================================================
FILE: src/Api/Player/Data/Profile/TutorialState.php
================================================
<?php


namespace NicklasW\PkmGoApi\Api\Player\Data\Profile;

use NicklasW\PkmGoApi\Api\Data\Data;

/**
 * @method integer setState(array $state)
 *
 * @method integer getState()
 */
class TutorialState extends Data {

    /**
     * @var array
     */
    protected $state;

    /**
     * Creates a TutorialState instance.
     *
     * @param array $tutorialState
     * @return static
     */
    public static function create($tutorialState)
    {
        $instance = new static();
        $instance->setState($tutorialState);

        return $instance;
    }


}

================================================
FILE: src/Api/Player/Inventory.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Player;

use Exception;
use NicklasW\PkmGoApi\Api\Player\Data\Inventory\AppliedItems;
use NicklasW\PkmGoApi\Api\Player\Data\Inventory\CandyBank;
use NicklasW\PkmGoApi\Api\Player\Data\Inventory\EggIncubators;
use NicklasW\PkmGoApi\Api\Player\Data\Inventory\EggPokemon;
use NicklasW\PkmGoApi\Api\Player\Data\Inventory\Item;
use NicklasW\PkmGoApi\Api\Player\Data\Inventory\Items;
use NicklasW\PkmGoApi\Api\Player\Data\Inventory\PokeBank;
use NicklasW\PkmGoApi\Api\Player\Data\Inventory\Pokedex;
use NicklasW\PkmGoApi\Api\Player\Data\Inventory\Stats;
use NicklasW\PkmGoApi\Api\Procedure;
use NicklasW\PkmGoApi\Api\Support\Enums\GenericEnum;
use NicklasW\PkmGoApi\Facades\Log;
use NicklasW\PkmGoApi\Services\Request\InventoryRequestService;
use POGOProtos\Networking\Responses\RecycleInventoryItemResponse;
use POGOProtos\Networking\Responses\RecycleInventoryItemResponse_Result;
use POGOProtos\Networking\Responses\UseIncenseResponse;
use POGOProtos\Networking\Responses\UseIncenseResponse_Result;
use POGOProtos\Networking\Responses\UseItemXpBoostResponse;
use POGOProtos\Networking\Responses\UseItemXpBoostResponse_Result;

/**
 * @method void setPokeBank(PokeBank $pokeBank)
 * @method void setItems(Item[] $items)
 * @method void setCandyBank(CandyBank $candyBank)
 * @method void setPokedex(Pokedex $pokedex)
 * @method void setAppliedItems(AppliedItems $appliedItems)
 * @method void setStats(Stats $stats)
 * @method void setEggPokemon(EggPokemon[] $eggPokemon)
 * @method PokeBank getPokeBank()
 * @method Item[] getItems()
 * @method CandyBank getCandyBank()
 * @method Pokedex getPokedex()
 * @method EggIncubators getEggIncubators()
 * @method AppliedItems getAppliedItems()
 * @method Stats getStats()
 * @method EggPokemon[] getEggPokemon()
 */
class Inventory extends Procedure
{

    /**
     * @var Items
     */
    protected $data;

    /**
     * Returns the items.
     *
     * @returns Items
     */
    public function getData()
    {
        return parent::getData();
    }

    /**
     * Updates the player profile with the latest data.
     */
    public function update()
    {
        Log::debug(sprintf('[#%s] Retrieving inventory', __CLASS__));

        // Retrieves the player inventory metadata
        $playerInventory = $this->getRequestService()->getInventory();

        // Retrieve the inventory items
        $inventoryItems = $playerInventory->getInventoryDelta();

        // Set the items
        $this->data = Items::create($inventoryItems);

        Log::debug(sprintf('[#%s] Retrieved inventory.', __CLASS__));
    }

    /**
     * Recycle inventory item
     *
     * @param int $itemId
     * @param int $count
     * @throws Exception
     * @return RecycleInventoryItemResponse
     */
    public function recycle($itemId, $count)
    {
        // Retrieve the item from the inventory
        $item = $this->data->getItemById($itemId);

        // Retrieve the item from the inventory, validate the capacity
        if ($item == null || $item->getCount() < $count) {
            return RecycleInventoryItemResponse_Result::ERROR_NOT_ENOUGH_COPIES;
        }

        // Execute the API request
        $response = $this->getRequestService()->recycle($itemId, $count);

        // Check if the request was successfully executed
        if ($response->getResult() !== RecycleInventoryItemResponse_Result::SUCCESS) {
            throw new Exception(sprintf('Invalid response during item recycle. Result: \'%s\' Code: \'%s\'',
                $response->getResult(),
                GenericEnum::name(RecycleInventoryItemResponse_Result::class, $response->getResult())));
        }

        // Update inventory to reflect on the changes
        $item->setCount($item->getCount() - $count);

        return $response;
    }

    /**
     * Use incense item
     *
     * @param int $itemId
     * @throws Exception
     * @return UseIncenseResponse
     */
    public function useIncense($itemId)
    {
        // Execute the API request
        $response = $this->getRequestService()->useIncense($itemId);

        // Check if the request was successfully executed
        if ($response->getResult() !== UseIncenseResponse_Result::SUCCESS) {
            throw new Exception(sprintf('Invalid response during item usage. Result: \'%s\' Code: \'%s\'',
                $response->getResult(), GenericEnum::name(UseIncenseResponse_Result::class, $response->getResult())));
        }

        // Update inventory
        $this->update();

        return $response;
    }

    /**
     * Use XP Boost item
     *
     * @param int $itemId
     * @throws Exception
     * @return UseItemXpBoostResponse
     */
    public function useItemXpBoost($itemId)
    {
        // Execute the API request
        $response = $this->getRequestService()->useItemXpBoost($itemId);

        // Check if the request was successfully executed
        if ($response->getResult() !== UseItemXpBoostResponse_Result::SUCCESS) {
            throw new Exception(sprintf('Invalid response during item usage. Result: \'%s\' Code: \'%s\'',
                $response->getResult(),
                GenericEnum::name(UseItemXpBoostResponse_Result::class, $response->getResult())));
        }

        // Update inventory
        $this->update();

        return $response;
    }

    /**
     * Returns the request service.
     *
     * @return InventoryRequestService
     */
    protected function getRequestService()
    {
        return new InventoryRequestService();
    }

}

================================================
FILE: src/Api/Player/Journal.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Player;

use NicklasW\PkmGoApi\Api\Player\Data\Journal\Log;
use NicklasW\PkmGoApi\Api\Procedure;
use NicklasW\PkmGoApi\Services\Request\JournalRequestService;

class Journal extends Procedure {

    /**
     * Returns the forts log entries.
     *
     * @return Data\Journal\Fort[]
     */
    public function getForts()
    {
        return $this->getData()->getForts();
    }

    /**
     * Returns the pokemon log entries.
     *
     * @return Data\Journal\Pokemon[]
     */
    public function getPokemons()
    {
        return $this->getData()->getPokemons();
    }

    /**
     * Returns the log entries.
     *
     * @return Log
     */
    public function getEntries()
    {
        return $this->getData();
    }

    /**
     *
     */
    public function update()
    {
        // Retrieves the player metadata
        $data = $this->getRequestService()->getJournal();

        // Set the log entries
        $this->data = Log::create($data->getLogEntries());
    }

    /**
     * Returns the request service.
     *
     * @return JournalRequestService
     */
    protected function getRequestService()
    {
        return new JournalRequestService();
    }

}

================================================
FILE: src/Api/Player/Profile.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Player;

use NicklasW\PkmGoApi\Api\Player\Data\Profile\Avatar;
use NicklasW\PkmGoApi\Api\Player\Data\Profile\Badge;
use NicklasW\PkmGoApi\Api\Player\Data\Profile\ContactSettings;
use NicklasW\PkmGoApi\Api\Player\Data\Profile\Currencies;
use NicklasW\PkmGoApi\Api\Player\Data\Profile\DailyBonus;
use NicklasW\PkmGoApi\Api\Player\Data\Profile\ProfileData;
use NicklasW\PkmGoApi\Api\Player\Data\Profile\TutorialState;
use NicklasW\PkmGoApi\Api\Procedure;
use NicklasW\PkmGoApi\Services\Request\PlayerRequestService;

/**
 * @method void setCreationTime(string $creationTime)
 * @method void setUsername(string $username)
 * @method void setTeam(integer $team)
 * @method void setTutorialState(TutorialState $tutorialState)
 * @method void setAvatar(Avatar $avatar)
 * @method void setPokemonStorage(array $pokemonStorage)
 * @method void setItemStorage(array $itemStorage)
 * @method void setDailyBonus(DailyBonus $dailyBonus)
 * @method void setBadge(Badge $badge)
 * @method void setContactSettings(ContactSettings $state)
 * @method void setCurrencies(Currencies $currencies)

 * @method string getCreationTime()
 * @method string getUsername()
 * @method integer getTeam()
 * @method TutorialState getTutorialState()
 * @method Avatar getAvatar()
 * @method array getPokemonStorage()
 * @method array getItemStorage()
 * @method DailyBonus getDailyBonus()
 * @method Badge getBadge()
 * @method ContactSettings getContactSettings()
 * @method Currencies getCurrencies()
 */
class Profile extends Procedure {

    /**
     * Returns the profile data.
     *
     * @returns ProfileData
     */
    public function getData()
    {
        return parent::getData();
    }

    /**
     * Updates the player profile with the latest data.
     */
    public function update()
    {
        // Retrieves the player metadata
        $data = $this->getRequestService()->getPlayer();

        // Set the profile data
        $this->data = ProfileData::create($data->getPlayerData());
    }

    /**
     * Returns the request service.
     *
     * @return PlayerRequestService
     */
    protected function getRequestService()
    {
        return new PlayerRequestService();
    }

}

================================================
FILE: src/Api/Pokemon/Collection/PokemonCollection.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Pokemon\Collection;

use Illuminate\Support\Collection;
use NicklasW\PkmGoApi\Api\Pokemon\Pokemon;

class PokemonCollection extends Collection {

    /**
     * Returns a sorted collection by name.
     *
     * @param bool $descending
     * @return static
     */
    public function sortByName($descending = false)
    {
        return $this->sortBy(function (Pokemon $pokemon1) {
            return $pokemon1->getName();
        }, SORT_REGULAR, $descending);
    }

    /**
     * Returns a sorted collection by level.
     *
     * @param bool $descending
     * @return static
     */
    public function sortByLevel($descending = false)
    {
        return $this->sortBy(function (Pokemon $pokemon1) {
            return $pokemon1->getLevel();
        }, SORT_REGULAR, $descending);

    }

    /**
     * Returns a sorted collection by combat points.
     *
     * @param bool $descending
     * @return static
     */
    public function sortByCp($descending = false)
    {
        return $this->sortBy(function (Pokemon $pokemon1) {
            return $pokemon1->getCp();
        }, SORT_REGULAR, $descending);

    }

    /**
     * Returns a sorted collection by Pokedex index.
     *
     * @param bool $descending
     * @return static
     */
    public function sortByPokedexIndex($descending = false)
    {
        return $this->sortBy(function (Pokemon $pokemon1) {
            return $pokemon1->getPokemonId();
        }, SORT_REGULAR, $descending);

    }

    /**
     * Returns a sorted collection by IV ratio.
     *
     * @param bool $descending
     * @return static
     */
    public function sortByIVRatio($descending = false)
    {
        return $this->sortBy(function (Pokemon $pokemon1) {
            return $pokemon1->getIVRatio();
        }, SORT_REGULAR, $descending);
    }

    /**
     * Returns a sorted collection by date captured.
     *
     * @param bool $descending
     * @return static
     */
    public function sortByDate($descending = false)
    {
        return $this->sortBy(function (Pokemon $pokemon1) {
            return $pokemon1->getCreationTimeMs();
        }, SORT_REGULAR, $descending);
    }

}

================================================
FILE: src/Api/Pokemon/Data/MovementType.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Pokemon\Data;

class MovementType {

    /**
     *
     */
    const PSYCHIC = 0;

    /**
     *
     */
    const FLYING = 1;

    /**
     *
     */
    
    const ELECTRIC = 2;

    /**
     *
     */
    const NORMAL = 3;

    /**
     *
     */
    const HOVERING = 4;

    /**
     *
     */
    const JUMP = 5;

}

================================================
FILE: src/Api/Pokemon/Data/PokemonClass.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Pokemon\Data;

class PokemonClass {

    /**
     *
     */
    const NONE = 0;

    /**
     *
     */
    const VERY_COMMON = 1;

    /**
     *
     */
    const COMMON = 2;

    /**
     *
     */
    const UNCOMMON = 3;

    /**
     *
     */
    const RARE = 4;

    /**
     *
     */
    const VERY_RARE = 5;

    /**
     *
     */
    const EPIC = 6;

    /**
     *
     */
    const LEGENDARY = 7;

    /**
     *
     */
    const MYTHIC = 8;


}

================================================
FILE: src/Api/Pokemon/Data/PokemonMeta.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Pokemon\Data;

class PokemonMeta {

    protected $heightStdDev;

    protected $baseStamina;

    protected $cylRadiusM;

    protected $baseFleeRate;

    protected $baseAttack;

    protected $diskRadiusM;

    protected $collisionRadiusM;

    protected $pokedexWeightKg;

    protected $movementType;

    protected $type1;

    protected $collisionHeadRadiusM;

    protected $movementTimerS;

    protected $jumpTimeS;

    protected $modelScale;

    protected $uniqueId;

    protected $baseDefense;

    protected $attackTimerS;

    protected $weightStdDev;

    protected $cylHeightM;

    protected $candyToEvolve;

    protected $collisionHeightM;

    protected $shoulderModeScale;

    protected $baseCaptureRate;

    protected $parentId;

    protected $cylGroundM;

    protected $quickMoves;

    protected $templateId;

    protected $family;

    protected $pokemonClass;

    protected $type2;

    protected $pokedexHeightM;

    protected $cinematicMoves;

    protected $number;

    /**
     * @return mixed
     */
    public function getTemplateId()
    {
        return $this->templateId;
    }

    /**
     * @param mixed $templateId
     */
    public function setTemplateId($templateId)
    {
        $this->templateId = $templateId;
    }

    /**
     * @return mixed
     */
    public function getFamily()
    {
        return $this->family;
    }

    /**
     * @param mixed $family
     */
    public function setFamily($family)
    {
        $this->family = $family;
    }

    /**
     * @return mixed
     */
    public function getPokemonClass()
    {
        return $this->pokemonClass;
    }

    /**
     * @param mixed $pokemonClass
     */
    public function setPokemonClass($pokemonClass)
    {
        $this->pokemonClass = $pokemonClass;
    }

    /**
     * @return mixed
     */
    public function getType2()
    {
        return $this->type2;
    }

    /**
     * @param mixed $type2
     */
    public function setType2($type2)
    {
        $this->type2 = $type2;
    }

    /**
     * @return mixed
     */
    public function getPokedexHeightM()
    {
        return $this->pokedexHeightM;
    }

    /**
     * @param mixed $pokedexHeightM
     */
    public function setPokedexHeightM($pokedexHeightM)
    {
        $this->pokedexHeightM = $pokedexHeightM;
    }

    /**
     * @return mixed
     */
    public function getHeightStdDev()
    {
        return $this->heightStdDev;
    }

    /**
     * @param mixed $heightStdDev
     */
    public function setHeightStdDev($heightStdDev)
    {
        $this->heightStdDev = $heightStdDev;
    }

    /**
     * @return mixed
     */
    public function getBaseStamina()
    {
        return $this->baseStamina;
    }

    /**
     * @param mixed $baseStamina
     */
    public function setBaseStamina($baseStamina)
    {
        $this->baseStamina = $baseStamina;
    }

    /**
     * @return mixed
     */
    public function getCylRadiusM()
    {
        return $this->cylRadiusM;
    }

    /**
     * @param mixed $cylRadiusM
     */
    public function setCylRadiusM($cylRadiusM)
    {
        $this->cylRadiusM = $cylRadiusM;
    }

    /**
     * @return mixed
     */
    public function getBaseFleeRate()
    {
        return $this->baseFleeRate;
    }

    /**
     * @param mixed $baseFleeRate
     */
    public function setBaseFleeRate($baseFleeRate)
    {
        $this->baseFleeRate = $baseFleeRate;
    }

    /**
     * @return mixed
     */
    public function getBaseAttack()
    {
        return $this->baseAttack;
    }

    /**
     * @param mixed $baseAttack
     */
    public function setBaseAttack($baseAttack)
    {
        $this->baseAttack = $baseAttack;
    }

    /**
     * @return mixed
     */
    public function getDiskRadiusM()
    {
        return $this->diskRadiusM;
    }

    /**
     * @param mixed $diskRadiusM
     */
    public function setDiskRadiusM($diskRadiusM)
    {
        $this->diskRadiusM = $diskRadiusM;
    }

    /**
     * @return mixed
     */
    public function getCollisionRadiusM()
    {
        return $this->collisionRadiusM;
    }

    /**
     * @param mixed $collisionRadiusM
     */
    public function setCollisionRadiusM($collisionRadiusM)
    {
        $this->collisionRadiusM = $collisionRadiusM;
    }

    /**
     * @return mixed
     */
    public function getPokedexWeightKg()
    {
        return $this->pokedexWeightKg;
    }

    /**
     * @param mixed $pokedexWeightKg
     */
    public function setPokedexWeightKg($pokedexWeightKg)
    {
        $this->pokedexWeightKg = $pokedexWeightKg;
    }

    /**
     * @return mixed
     */
    public function getMovementType()
    {
        return $this->movementType;
    }

    /**
     * @param mixed $movementType
     */
    public function setMovementType($movementType)
    {
        $this->movementType = $movementType;
    }

    /**
     * @return mixed
     */
    public function getType1()
    {
        return $this->type1;
    }

    /**
     * @param mixed $type1
     */
    public function setType1($type1)
    {
        $this->type1 = $type1;
    }

    /**
     * @return mixed
     */
    public function getCollisionHeadRadiusM()
    {
        return $this->collisionHeadRadiusM;
    }

    /**
     * @param mixed $collisionHeadRadiusM
     */
    public function setCollisionHeadRadiusM($collisionHeadRadiusM)
    {
        $this->collisionHeadRadiusM = $collisionHeadRadiusM;
    }

    /**
     * @return mixed
     */
    public function getMovementTimerS()
    {
        return $this->movementTimerS;
    }

    /**
     * @param mixed $movementTimerS
     */
    public function setMovementTimerS($movementTimerS)
    {
        $this->movementTimerS = $movementTimerS;
    }

    /**
     * @return mixed
     */
    public function getJumpTimeS()
    {
        return $this->jumpTimeS;
    }

    /**
     * @param mixed $jumpTimeS
     */
    public function setJumpTimeS($jumpTimeS)
    {
        $this->jumpTimeS = $jumpTimeS;
    }

    /**
     * @return mixed
     */
    public function getModelScale()
    {
        return $this->modelScale;
    }

    /**
     * @param mixed $modelScale
     */
    public function setModelScale($modelScale)
    {
        $this->modelScale = $modelScale;
    }

    /**
     * @return mixed
     */
    public function getUniqueId()
    {
        return $this->uniqueId;
    }

    /**
     * @param mixed $uniqueId
     */
    public function setUniqueId($uniqueId)
    {
        $this->uniqueId = $uniqueId;
    }

    /**
     * @return mixed
     */
    public function getBaseDefense()
    {
        return $this->baseDefense;
    }

    /**
     * @param mixed $baseDefense
     */
    public function setBaseDefense($baseDefense)
    {
        $this->baseDefense = $baseDefense;
    }

    /**
     * @return mixed
     */
    public function getAttackTimerS()
    {
        return $this->attackTimerS;
    }

    /**
     * @param mixed $attackTimerS
     */
    public function setAttackTimerS($attackTimerS)
    {
        $this->attackTimerS = $attackTimerS;
    }

    /**
     * @return mixed
     */
    public function getWeightStdDev()
    {
        return $this->weightStdDev;
    }

    /**
     * @param mixed $weightStdDev
     */
    public function setWeightStdDev($weightStdDev)
    {
        $this->weightStdDev = $weightStdDev;
    }

    /**
     * @return mixed
     */
    public function getCylHeightM()
    {
        return $this->cylHeightM;
    }

    /**
     * @param mixed $cylHeightM
     */
    public function setCylHeightM($cylHeightM)
    {
        $this->cylHeightM = $cylHeightM;
    }

    /**
     * @return mixed
     */
    public function getCandyToEvolve()
    {
        return $this->candyToEvolve;
    }

    /**
     * @param mixed $candyToEvolve
     */
    public function setCandyToEvolve($candyToEvolve)
    {
        $this->candyToEvolve = $candyToEvolve;
    }

    /**
     * @return mixed
     */
    public function getCollisionHeightM()
    {
        return $this->collisionHeightM;
    }

    /**
     * @param mixed $collisionHeightM
     */
    public function setCollisionHeightM($collisionHeightM)
    {
        $this->collisionHeightM = $collisionHeightM;
    }

    /**
     * @return mixed
     */
    public function getShoulderModeScale()
    {
        return $this->shoulderModeScale;
    }

    /**
     * @param mixed $shoulderModeScale
     */
    public function setShoulderModeScale($shoulderModeScale)
    {
        $this->shoulderModeScale = $shoulderModeScale;
    }

    /**
     * @return mixed
     */
    public function getBaseCaptureRate()
    {
        return $this->baseCaptureRate;
    }

    /**
     * @param mixed $baseCaptureRate
     */
    public function setBaseCaptureRate($baseCaptureRate)
    {
        $this->baseCaptureRate = $baseCaptureRate;
    }

    /**
     * @return mixed
     */
    public function getParentId()
    {
        return $this->parentId;
    }

    /**
     * @param mixed $parentId
     */
    public function setParentId($parentId)
    {
        $this->parentId = $parentId;
    }

    /**
     * @return mixed
     */
    public function getCylGroundM()
    {
        return $this->cylGroundM;
    }

    /**
     * @param mixed $cylGroundM
     */
    public function setCylGroundM($cylGroundM)
    {
        $this->cylGroundM = $cylGroundM;
    }

    /**
     * @return PokemonMove
     */
    public function getQuickMoves()
    {
        return $this->quickMoves;
    }

    /**
     * @param PokemonMove $quickMoves
     */
    public function setQuickMoves(PokemonMove $quickMoves)
    {
        $this->quickMoves = $quickMoves;
    }

    /**
     * @return PokemonMove
     */
    public function getCinematicMoves()
    {
        return $this->cinematicMoves;
    }

    /**
     * @param PokemonMove $cinematicMoves
     */
    public function setCinematicMoves(PokemonMove $cinematicMoves)
    {
        $this->cinematicMoves = $cinematicMoves;
    }

    /**
     * @return mixed
     */
    public function getNumber()
    {
        return $this->number;
    }

    /**
     * @param mixed $number
     */
    public function setNumber($number)
    {
        $this->number = $number;
    }


}

================================================
FILE: src/Api/Pokemon/Data/PokemonMetaRegistry.php
================================================
<?php

namespace NicklasW\PkmGoApi\Api\Pokemon\Data;

use NicklasW\PkmGoApi\Api\Pokemon\Data\PokemonMove as PokemonMoveData;
use POGOProtos\Enums\PokemonFamilyId;
use POGOProtos\Enums\PokemonId;
use POGOProtos\Enums\PokemonMove;
use POGOProtos\Enums\PokemonType;

class PokemonMetaRegistry {

    /**
     * @var PokemonMeta[] The list of pokemon meta data
     */
    public static $POKEMON_META = array();

    /**
     * Returns the pokemon meta data by pokemon id.
     *
     * @param integer $pokemonId
     * @return PokemonMeta
     */
    public static function getByPokemonId($pokemonId)
    {
        return self::$POKEMON_META[$pokemonId];
    }

    /**
     * Initialize the pokemon meta registry.
     */
    public static function initialize()
    {
        $pokemonMeta = new PokemonMeta();
        $pokemonMeta->setTemplateId("V0001_POKEMON_BULBASAUR");
        $pokemonMeta->setFamily(PokemonFamilyId::FAMILY_BULBASAUR);
        $pokemonMeta->setPokemonClass(PokemonClass::COMMON);
        $pokemonMeta->setType2(PokemonType::POKEMON_TYPE_POISON);
        $pokemonMeta->setPokedexHeightM(0.7);
        $pokemonMeta->setHeightStdDev(0.0875);
        $pokemonMeta->setBaseStamina(90);
        $pokemonMeta->setCylRadiusM(0.3815);
        $pokemonMeta->setBaseFleeRate(0.1);
        $pokemonMeta->setBaseAttack(118);
        $pokemonMeta->setDiskRadiusM(0.5723);
        $pokemonMeta->setCollisionRadiusM(0.3815);
        $pokemonMeta->setPokedexWeightKg(6.9);
        $pokemonMeta->setMovementType(MovementType::JUMP);
        $pokemonMeta->setType1(PokemonType::POKEMON_TYPE_GRASS);
        $pokemonMeta->setCollisionHeadRadiusM(0.2725);
        $pokemonMeta->setMovementTimerS(10);
        $pokemonMeta->setJumpTimeS(1.15);
        $pokemonMeta->setModelScale(1.09);
        $pokemonMeta->setUniqueId("V0001_POKEMON_BULBASAUR");
        $pokemonMeta->setBaseDefense(118);
        $pokemonMeta->setAttackTimerS(29);
        $pokemonMeta->setWeightStdDev(0.8625);
        $pokemonMeta->setCylHeightM(0.763);
        $pokemonMeta->setCandyToEvolve(25);
        $pokemonMeta->setCollisionHeightM(0.654);
        $pokemonMeta->setShoulderModeScale(0.5);
        $pokemonMeta->setBaseCaptureRate(0.16);
        $pokemonMeta->setParentId(PokemonId::MISSINGNO);
        $pokemonMeta->setCylGroundM(0);
        $pokemonMeta->setQuickMoves(new PokemonMoveData(array(
            PokemonMove::VINE_WHIP_FAST,
            PokemonMove::TACKLE_FAST,
        )));
        $pokemonMeta->setCinematicMoves(new PokemonMoveData(array(
            PokemonMove::SLUDGE_BOMB,
            PokemonMove::SEED_BOMB,
            PokemonMove::POWER_WHIP,
        )));
        $pokemonMeta->setNumber(1);
        self::$POKEMON_META[PokemonId::BULBASAUR] = $pokemonMeta;

        $pokemonMeta = new PokemonMeta();
        $pokemonMeta->setTemplateId("V0002_POKEMON_IVYSAUR");
        $pokemonMeta->setFamily(PokemonFamilyId::FAMILY_BULBASAUR);
        $pokemonMeta->setPokemonClass(PokemonClass::RARE);
        $pokemonMeta->setType2(PokemonType::POKEMON_TYPE_POISON);
        $pokemonMeta->setPokedexHeightM(1);
        $pokemonMeta->setHeightStdDev(0.125);
        $pokemonMeta->setBaseStamina(120);
        $pokemonMeta->setCylRadiusM(0.51);
        $pokemonMeta->setBaseFleeRate(0.07);
        $pokemonMeta->setBaseAttack(151);
        $pokemonMeta->setDiskRadiusM(0.765);
        $pokemonMeta->setCollisionRadiusM(0.31875);
        $pokemonMeta->setPokedexWeightKg(13);
        $pokemonMeta->setMovementType(MovementType::JUMP);
        $pokemonMeta->setType1(PokemonType::POKEMON_TYPE_GRASS);
        $pokemonMeta->setCollisionHeadRadiusM(0.255);
        $pokemonMeta->setMovementTimerS(23);
        $pokemonMeta->setJumpTimeS(1.5);
        $pokemonMeta->setModelScale(0.85);
        $pokemonMeta->setUniqueId("V0002_POKEMON_IVYSAUR");
        $pokemonMeta->setBaseDefense(151);
        $pokemonMeta->setAttackTimerS(8);
        $pokemonMeta->setWeightStdDev(1.625);
        $pokemonMeta->setCylHeightM(1.0625);
        $pokemonMeta->setCandyToEvolve(100);
        $pokemonMeta->setCollisionHeightM(0.6375);
        $pokemonMeta->setShoulderModeScale(0.5);
        $pokemonMeta->setBaseCaptureRate(0.08);
        $pokemonMeta->setParentId(PokemonId::BULBASAUR);
        $pokemonMeta->setCylGroundM(0);
        $pokemonMeta->setQuickMoves(new PokemonMoveData(array(
            PokemonMove::VINE_WHIP_FAST,
            PokemonMove::RAZOR_LEAF_FAST,
        )));
        $pokemonMeta->setCinematicMoves(new PokemonMoveData(array(
            PokemonMove::SLUDGE_BOMB,
            PokemonMove::POWER_WHIP,
            PokemonMove::SOLAR_BEAM,
        )));
        $pokemonMeta->setNumber(2);
        self::$POKEMON_META[PokemonId::IVYSAUR] = $pokemonMeta;

        $pokemonMeta = new PokemonMeta();
        $pokemonMeta->setTemplateId("V0003_POKEMON_VENUSAUR");
        $pokemonMeta->setFamily(PokemonFamilyId::FAMILY_BULBASAUR);
        $pokemonMeta->setPokemonClass(PokemonClass::EPIC);
        $pokemonMeta->setType2(PokemonType::POKEMON_TYPE_POISON);
        $pokemonMeta->setPokedexHeightM(2);
        $pokemonMeta->setHeightStdDev(0.25);
        $pokemonMeta->setBaseStamina(160);
        $pokemonMeta->setCylRadiusM(0.759);
        $pokemonMeta->setBaseFleeRate(0.05);
        $pokemonMeta->setBaseAttack(198);
        $pokemonMeta->setDiskRadiusM(1.1385);
        $pokemonMeta->setCollisionRadiusM(0.759);
        $pokemonMeta->setPokedexWeightKg(100);
        $pokemonMeta->setMovementType(MovementType::JUMP);
        $pokemonMeta->setType1(PokemonType::POKEMON_TYPE_GRASS);
        $pokemonMeta->setCollisionHeadRadiusM(0.3795);
        $pokemonMeta->setMovementTimerS(11);
        $pokemonMeta->setJumpTimeS(1.25);
        $pokemonMeta->setModelScale(0.69);
        $pokemonMeta->setUniqueId("V0003_POKEMON_VENUSAUR");
        $pokemonMeta->setBaseDefense(198);
        $pokemonMeta->setAttackTimerS(4);
        $pokemonMeta->setWeightStdDev(12.5);
        $pokemonMeta->setCylHeightM(1.2075);
        $pokemonMeta->setCandyToEvolve(0);
        $pokemonMeta->setCollisionHeightM(1.035);
        $pokemonMeta->setShoulderModeScale(0.5);
        $pokemonMeta->setBaseCaptureRate(0.04);
        $pokemonMeta->setParentId(PokemonId::IVYSAUR);
        $pokemonMeta->setCylGroundM(0);
        $pokemonMeta->setQuickMoves(new PokemonMoveData(array(
            PokemonMove::VINE_WHIP_FAST,
            PokemonMove::RAZOR_LEAF_FAST,
        )));
        $pokemonMeta->setCinematicMoves(new PokemonMoveData(array(
            PokemonMove::SLUDGE_BOMB,
            PokemonMove::PETAL_BLIZZARD,
            PokemonMove::SOLAR_BEAM,
        )));
        $pokemonMeta->setNumber(3);
        self::$POKEMON_META[PokemonId::VENUSAUR] = $pokemonMeta;

        $pokemonMeta = new PokemonMeta();
        $pokemonMeta->setTemplateId("V0004_POKEMON_CHARMANDER");
        $pokemonMeta->setFamily(PokemonFamilyId::FAMILY_CHARMANDER);
        $pokemonMeta->setPokemonClass(PokemonClass::COMMON);
        $pokemonMeta->setType2(PokemonType::POKEMON_TYPE_NONE);
        $pokemonMeta->setPokedexHeightM(0.6);
        $pokemonMeta->setHeightStdDev(0.075);
        $pokemonMeta->setBaseStamina(78);
        $pokemonMeta->setCylRadiusM(0.3125);
        $pokemonMeta->setBaseFleeRate(0.1);
        $pokemonMeta->setBaseAttack(116);
        $pokemonMeta->setDiskRadiusM(0.4688);
        $pokemonMeta->setCollisionRadiusM(0.15625);
        $pokemonMeta->setPokedexWeightKg(8.5);
        $pokemonMeta->setMovementType(MovementType::JUMP);
        $pokemonMeta->setType1(PokemonType::POKEMON_TYPE_FIRE);
        $pokemonMeta->setCollisionHeadRadiusM(0.15625);
        $pokemonMeta->setMovementTimerS(29);
        $pokemonMeta->setJumpTimeS(1.25);
        $pokemonMeta->setModelScale(1.25);
        $pokemonMeta->setUniqueId("V0004_POKEMON_CHARMANDER");
        $pokemonMeta->setBaseDefense(96);
        $pokemonMeta->setAttackTimerS(10);
        $pokemonMeta->setWeightStdDev(1.0625);
        $pokemonMeta->setCylHeightM(0.75);
        $pokemonMeta->setCandyToEvolve(25);
        $pokemonMeta->setCollisionHeightM(0.46875);
        $pokemonMeta->setShoulderModeScale(0.5);
        $pokemonMeta->setBaseCaptureRate(0.16);
        $pokemonMeta->setParentId(PokemonId::MISSINGNO);
        $pokemonMeta->setCylGroundM(0);
        $pokemonMeta->setQuickMoves(new PokemonMoveData(array(
            PokemonMove::SCRATCH_FAST,
            PokemonMove::EMBER_FAST,
        )));
        $pokemonMeta->setCinematicMoves(new PokemonMoveData(array(
            PokemonMove::FLAME_CHARGE,
            PokemonMove::FLAME_BURST,
            PokemonMove::FLAMETHROWER,
        )));
        $pokemonMeta->setNumber(4);
        self::$POKEMON_META[PokemonId::CHARMANDER] = $pokemonMeta;

        $pokemonMeta = new PokemonMeta();
        $pokemonMeta->setTemplateId("V0005_POKEMON_CHARMELEON");
        $pokemonMeta->setFamily(PokemonFamilyId::FAMILY_CHARMANDER);
        $pokemonMeta->setPokemonClass(PokemonClass::RARE);
        $pokemonMeta->setType2(PokemonType::POKEMON_TYPE_NONE);
        $pokemonMeta->setPokedexHeightM(1.1);
        $pokemonMeta->setHeightStdDev(0.1375);
        $pokemonMeta->setBaseStamina(116);
        $pokemonMeta->setCylRadiusM(0.4635);
        $pokemonMeta->setBaseFleeRate(0.07);
        $pokemonMeta->setBaseAttack(158);
        $pokemonMeta->setDiskRadiusM(0.6953);
        $pokemonMeta->setCollisionRadiusM(0.2575);
        $pokemonMeta->setPokedexWeightKg(19);
        $pokemonMeta->setMovementType(MovementType::JUMP);
        $pokemonMeta->setType1(PokemonType::POKEMON_TYPE_FIRE);
        $pokemonMeta->setCollisionHeadRadiusM(0.23175);
        $pokemonMeta->setMovementTimerS(23);
        $pokemonMeta->setJumpTimeS(1);
        $pokemonMeta->setModelScale(1.03);
        $pokemonMeta->setUniqueId("V0005_POKEMON_CHARMELEON");
        $pokemonMeta->setBaseDefense(129);
        $pokemonMeta->setAttackTimerS(8);
        $pokemonMeta->setWeightStdDev(2.375);
        $pokemonMeta->setCylHeightM(1.133);
        $pokemonMeta->setCandyToEvolve(100);
        $pokemonMeta->setCollisionHeightM(0.7725);
        $pokemonMeta->setShoulderModeScale(0.5);
        $pokemonMeta->setBaseCaptureRate(0.08);
        $pokemonMeta->setParentId(PokemonId::CHARMANDER);
        $pokemonMeta->setCylGroundM(0);
        $pokemonMeta->setQuickMoves(new PokemonMoveData(array(
            PokemonMove::SCRATCH_FAST,
            PokemonMove::EMBER_FAST,
        )));
        $pokemonMeta->setCinematicMoves(new PokemonMoveData(array(
            PokemonMove::FIRE_PUNCH,
            PokemonMove::FLAME_BURST,
            PokemonMove::FLAMETHROWER,
        )));
        $pokemonMeta->setNumber(5);
        self::$POKEMON_META[PokemonId::CHARMELEON] = $pokemonMeta;

        $pokemonMeta = new PokemonMeta();
        $pokemonMeta->setTemplateId("V0006_POKEMON_CHARIZARD");
        $pokemonMeta->setFamily(PokemonFamilyId::FAMILY_CHARMANDER);
        $pokemonMeta->setPokemonClass(PokemonClass::EPIC);
        $pokemonMeta->setType2(PokemonType::POKEMON_TYPE_FLYING);
        $pokemonMeta->setPokedexHeightM(1.7);
        $pokemonMeta->setHeightStdDev(0.2125);
        $pokemonMeta->setBaseStamina(156);
        $pokemonMeta->setCylRadiusM(0.81);
        $pokemonMeta->setBaseFleeRate(0.05);
        $pokemonMeta->setBaseAttack(223);
        $pokemonMeta->setDiskRadiusM(1.215);
        $pokemonMeta->setCollisionRadiusM(0.405);
        $pokemonMeta->setPokedexWeightKg(90.5);
        $pokemonMeta->setMovementType(MovementType::FLYING);
        $pokemonMeta->setType1(PokemonType::POKEMON_TYPE_FIRE);
        $pokemonMeta->setCollisionHeadRadiusM(0.2025);
        $pokemonMeta->setMovementTimerS(11);
        $pokemonMeta->setJumpTimeS(1);
        $pokemonMeta->setModelScale(0.81);
        $pokemonMeta->setUniqueId("V0006_POKEMON_CHARIZARD");
        $pokemonMeta->setBaseDefense(176);
        $pokemonMeta->setAttackTimerS(4);
        $pokemonMeta->setWeightStdDev(11.3125);
        $pokemonMeta->setCylHeightM(1.377);
        $pokemonMeta->setCandyToEvolve(0);
        $pokemonMeta->setCollisionHeightM(1.0125);
        $pokemonMeta->setShoulderModeScale(0.5);
        $pokemonMeta->setBaseCaptureRate(0.04);
        $pokemonMeta->setParentId(PokemonId::CHARMELEON);
        $pokemonMeta->setCylGroundM(0.405);
        $pokemonMeta->setQuickMoves(new PokemonMoveData(array(
            PokemonMove::WING_ATTACK_FAST,
            PokemonMove::EMBER_FAST,
        )));
        $pokemonMeta->setCinematicMoves(new PokemonMoveData(array(
            PokemonMove::DRAGON_CLAW,
            PokemonMove::FLAMETHROWER,
            PokemonMove::FIRE_BLAST,
        )));
        $pokemonMeta->setNumber(6);
        self::$POKEMON_META[PokemonId::CHARIZARD] = $pokemonMeta;

        $pokemonMeta = new PokemonMeta();
        $pokemonMeta->setTemplateId("V0007_POKEMON_SQUIRTLE");
        $pokemonMeta->setFamily(PokemonFamilyId::FAMILY_SQUIRTLE);
        $pokemonMeta->setPokemonClass(PokemonClass::COMMON);
        $pokemonMeta->setType2(PokemonType::POKEMON_TYPE_NONE);
        $pokemonMeta->setPokedexHeightM(0.5);
        $pokemonMeta->setHeightStdDev(0.0625);
        $pokemonMeta->setBaseStamina(88);
        $pokemonMeta->setCylRadiusM(0.3825);
        $pokemonMeta->setBaseFleeRate(0.1);
        $pokemonMeta->setBaseAttack(94);
        $pokemonMeta->setDiskRadiusM(0.5738);
        $pokemonMeta->setCollisionRadiusM(0.2295);
        $pokemonMeta->setPokedexWeightKg(9);
        $pokemonMeta->setMovementType(MovementType::JUMP);
        $pokemonMeta->setType1(PokemonType::POKEMON_TYPE_WATER);
        $pokemonMeta->setCollisionHeadRadiusM(0.19125);
        $pokemonMeta->setMovementTimerS(10);
        $pokemonMeta->setJumpTimeS(1);
        $pokemonMeta->setModelScale(1.53);
        $pokemonMeta->setUniqueId("V0007_POKEMON_SQUIRTLE");
        $pokemonMeta->setBaseDefense(122);
        $pokemonMeta->setAttackTimerS(29);
        $pokemonMeta->setWeightStdDev(1.125);
        $pokemonMeta->setCylHeightM(0.64259988);
        $pokemonMeta->setCandyToEvolve(25);
        $pokemonMeta->setCollisionHeightM(0.3825);
        $pokemonMeta->setShoulderModeScale(0.1);
        $pokemonMeta->setBaseCaptureRate(0.16);
        $pokemonMeta->setParentId(PokemonId::MISSINGNO);
        $pokemonMeta->setCylGroundM(0);
        $pokemonMeta->setQuickMoves(new PokemonMoveData(array(
            PokemonMove::TACKLE_FAST,
            PokemonMove::BUBBLE_FAST,
        )));
        $pokemonMeta->setCinematicMoves(new PokemonMoveData(array(
            PokemonMove::AQUA_TAIL,
            PokemonMove::WATER_PULSE,
            PokemonMove::AQUA_JET,
        )));
        $pokemonMeta->setNumber(7);
        self::$POKEMON_META[PokemonId::SQUIRTLE] = $pokemonMeta;

        $pokemonMeta = new PokemonMeta();
        $pokemonMeta->setTemplateId("V0008_POKEMON_WARTORTLE");
        $pokemonMeta->setFamily(PokemonFamilyId::FAMILY_SQUIRTLE);
        $pokemonMeta->setPokemonClass(PokemonClass::RARE);
        $pokemonMeta->setType2(PokemonType::POKEMON_TYPE_NONE);
        $pokemonMeta->setPokedexHeightM(1);
        $pokemonMeta->setHeightStdDev(0.125);
        $pokemonMeta->setBaseStamina(118);
        $pokemonMeta->setCylRadiusM(0.375);
        $pokemonMeta->setBaseFleeRate(0.07);
        $pokemonMeta->setBaseAttack(126);
        $pokemonMeta->setDiskRadiusM(0.5625);
        $pokemonMeta->setCollisionRadiusM(0.25);
        $pokemonMeta->setPokedexWeightKg(22.5);
        $pokemonMeta->setMovementType(MovementType::JUMP);
        $pokemonMeta->setType1(PokemonType::POKEMON_TYPE_WATER);
        $pokemonMeta->setCollisionHeadRadiusM(0.1875);
        $pokemonMeta->setMovementTimerS(23);
        $pokemonMeta->setJumpTimeS(1.25);
        $pokemonMeta->setModelScale(1);
        $pokemonMeta->setUniqueId("V0008_POKEMON_WARTORTLE");
        $pokemonMeta->setBaseDefense(155);
        $pokemonMeta->setAttackTimerS(8);
        $pokemonMeta->setWeightStdDev(2.8125);
        $pokemonMeta->setCylHeightM(1);
        $pokemonMeta->setCandyToEvolve(100);
        $pokemonMeta->setCollisionHeightM(0.625);
        $pokemonMeta->setShoulderModeScale(0.5);
        $pokemonMeta->setBaseCaptureRate(0.08);
        $pokemonMeta->setParentId(PokemonId::SQUIRTLE);
        $pokemonMeta->setCylGroundM(0);
        $pokemonMeta->setQuickMoves(new PokemonMoveData(array(
            PokemonMove::BITE_FAST,
            PokemonMove::WATER_GUN_FAST,
        )));
        $pokemonMeta->setCinematicMoves(new PokemonMoveData(array(
            PokemonMove::ICE_BEAM,
            PokemonMove::HYDRO_PUMP,
            PokemonMove::AQUA_JET,
        )));
        $pokemonMeta->setNumber(8);
        self::$POKEMON_META[PokemonId::WARTORTLE] = $pokemonMeta;

        $pokemonMeta = new PokemonMeta();
        $pokemonMeta->setTemplateId("V0009_POKEMON_BLASTOISE");
        $pokemonMeta->setFamily(PokemonFamilyId::FAMILY_SQUIRTLE);
        $pokemonMeta->setPokemonClass(PokemonClass::EPIC);
        $pokemonMeta->setType2(PokemonType::POKEMON_TYPE_NONE);
        $pokemonMeta->setPokedexHeightM(1.6);
        $pokemonMeta->setHeightStdDev(0.2);
        $pokemonMeta->setBaseStamina(158);
        $pokemonMeta->setCylRadiusM(0.564);
        $pokemonMeta->setBaseFleeRate(0.05);
        $pokemonMeta->setBaseAttack(171);
        $pokemonMeta->setDiskRadiusM(0.846);
        $pokemonMeta->setCollisionRadiusM(0.564);
        $pokemonMeta->setPokedexWeightKg(85.5);
        $pokemonMeta->setMovementType(MovementType::JUMP);
        $pokemonMeta->setType1(PokemonType::POKEMON_TYPE_WATER);
        $pokemonMeta->setCollisionHeadRadiusM(0.282);
        $pokemonMeta->setMovementTimerS(14);
        $pokemonMeta->setJumpTimeS(1.25);
        $pokemonMeta->setModelScale(0.94);
        $pokemonMeta->setUniqueId("V0009_POKEMON_BLASTOISE");
        $pokemonMeta->setBaseDefense(210);
        $pokemonMeta->setAttackTimerS(5);
        $pokemonMeta->setWeightStdDev(10.6875);
        $pokemonMeta->setCylHeightM(1.2925);
        $pokemonMeta->setCandyToEvolve(0);
        $pokemonMeta->setCollisionHeightM(1.175);
        $pokemonMeta->setShoulderModeScale(0.5);
        $pokemonMeta->setBaseCaptureRate(0.04);
        $pokemonMeta->setParentId(PokemonId::WARTORTLE);
        $pokemonMeta->setCylGroundM(0);
        $pokemonMeta->setQuickMoves(new PokemonMoveData(array(
            PokemonMove::BITE_FAST,
            PokemonMove::WATER_GUN_FAST,
        )));
        $pokemonMeta->setCinematicMoves(new PokemonMoveData(array(
            PokemonMove::ICE_BEAM,
            PokemonMove::FLASH_CANNON,
            PokemonMove::HYDRO_PUMP,
        )));
        $pokemonMeta->setNumber(9);
        self::$POKEMON_META[PokemonId::BLASTOISE] = $pokemonMeta;

        $pokemonMeta = new PokemonMeta();
        $pokemonMeta->setTemplateId("V0010_POKEMON_CATERPIE");
        $pokemonMeta->setFamily(PokemonFamilyId::FAMILY_CATERPIE);
        $pokemonMeta->setPokemonClass(PokemonClass::VERY_COMMON);
        $pokemonMeta->setType2(PokemonType::POKEMON_TYPE_NONE);
        $pokemonMeta->setPokedexHeightM(0.3);
        $pokemonMeta->setHeightStdDev(0.0375);
        $pokemonMeta->setBaseStamina(90);
        $pokemonMeta->setCylRadiusM(0.306);
        $pokemonMeta->setBaseFleeRate(0.2);
        $pokemonMeta->setBaseAttack(55);
        $pokemonMeta->setDiskRadiusM(0.459);
        $pokemonMeta->setCollisionRadiusM(0.102);
        $pokemonMeta->setPokedexWeightKg(2.9);
        $pokemonMeta->setMovementType(MovementType::JUMP);
        $pokemonMeta->setType1(PokemonType::POKEMON_TYPE_BUG);
        $pokemonMeta->setCollisionHeadRadiusM(0.153);
        $pokemonMeta->setMovementTimerS(10);
        $pokemonMeta->setJumpTimeS(0);
        $pokemonMeta->setModelScale(2.04);
        $pokemonMeta->setUniqueId("V0010_POKEMON_CATERPIE");
        $pokemonMeta->setBaseDefense(62);
        $pokemonMeta->setAttackTimerS(29);
        $pokemonMeta->setWeightStdDev(0.3625);
        $pokemonMeta->setCylHeightM(0.408);
        $pokemonMeta->setCandyToEvolve(12);
        $pokemonMeta->setCollisionHeightM(0.306);
        $pokemonMeta->setShoulderModeScale(0);
        $pokemonMeta->setBaseCaptureRate(0.4);
        $pokemonMeta->setParentId(PokemonId::MISSINGNO);
        $pokemonMeta->setCylGroundM(0);
        $pokemonMeta->setQuickMoves(new PokemonMoveData(array(
            PokemonMove::BUG_BITE_FAST,
            PokemonMove::TACKLE_FAST,
        )));
        $pokemonMeta->setCinematicMoves(new PokemonMoveData(array(
            PokemonMove::STRUGGLE,
        )));
        $pokemonMeta->setNumber(10);
        self::$POKEMON_META[PokemonId::CATERPIE] = $pokemonMeta;

        $pokemonMeta = new PokemonMeta();
        $pokemonMeta->setTemplateId("V0011_POKEMON_METAPOD");
        $pokemonMeta->setFamily(PokemonFamilyId::FAMILY_CATERPIE);
        $pokemonMeta->setPokemonClass(PokemonClass::COMMON);
        $pokemonMeta->setType2(PokemonType::POKEMON_TYPE_NONE);
        $pokemonMeta->setPokedexHeightM(0.7);
        $pokemonMeta->setHeightStdDev(0.0875);
        $pokemonMeta->setBaseStamina(100);
        $pokemonMeta->setCylRadiusM(0.351);
        $pokemonMeta->setBaseFleeRate(0.09);
        $pokemonMeta->setBaseAttack(45);
        $pokemonMeta->setDiskRadiusM(0.5265);
        $pokemonMeta->setCollisionRadiusM(0.117);
        $pokemonMeta->setPokedexWeightKg(9.9);
        $pokemonMeta->setMovementType(MovementType::JUMP);
        $pokemonMeta->setType1(PokemonType::POKEMON_TYPE_BUG);
        $pokemonMeta->setCollisionHeadRadiusM(0.1755);
        $pokemonMeta->setMovementTimerS(3600);
        $pokemonMeta->setJumpTimeS(1);
        $pokemonMeta->setModelScale(1.17);
        $pokemonMeta->setUniqueId("V0011_POKEMON_METAPOD");
        $pokemonMeta->setBaseDefense(64);
        $pokemonMeta->setAttackTimerS(3600);
        $pokemonMeta->setWeightStdDev(1.2375);
        $pokemonMeta->setCylHeightM(0.6435);
        $pokemonMeta->setCandyToEvolve(50);
        $pokemonMeta->setCollisionHeightM(0.6435);
        $pokemonMeta->setShoulderModeScale(0.5);
        $pokemonMeta->setBaseCaptureRate(0.2);
        $pokemonMeta->setParentId(PokemonId::CATERPIE);
        $pokemonMeta->setCylGroundM(0);
        $pokemonMeta->setQuickMoves(new PokemonMoveData(array(
            PokemonMove::BUG_BITE_FAST,
            PokemonMove::TACKLE_FAST,
        )));
        $pokemonMeta->setCinematicMoves(new PokemonMoveData(array(
            PokemonMove::STRUGGLE,
        )));
        $pokemonMeta->setNumber(11);
        self::$POKEMON_META[PokemonId::METAPOD] = $pokemonMeta;

        $pokemonMeta = new PokemonMeta();
        $pokemonMeta->setTemplateId("V0012_POKEMON_BUTTERFREE");
        $pokemonMeta->setFamily(PokemonFamilyId::FAMILY_CATERPIE);
        $pokemonMeta->setPokemonClass(PokemonClass::UNCOMMON);
        $pokemonMeta->setType2(PokemonType::POKEMON_TYPE_FLYING);
        $pokemonMeta->setPokedexHeightM(1.1);
        $pokemonMeta->setHeightStdDev(0.1375);
        $pokemonMeta->setBaseStamina(120);
        $pokemonMeta->setCylRadiusM(0.666);
        $pokemonMeta->setBaseFleeRate(0.06);
        $pokemonMeta->setBaseAttack(167);
        $pokemonMeta->setDiskRadiusM(0.999);
        $pokemonMeta->setCollisionRadiusM(0.1665);
        $pokemonMeta->setPokedexWeightKg(32);
        $pokemonMeta->setMovementType(MovementType::FLYING);
        $pokemonMeta->setType1(PokemonType::POKEMON_TYPE_BUG);
        $pokemonMeta->setCollisionHeadRadiusM(0.1776);
        $pokemonMeta->setMovementTimerS(6);
        $pokemonMeta->setJumpTimeS(1);
        $pokemonMeta->setModelScale(1.11);
        $pokemonMeta->setUniqueId("V0012_POKEMON_BUTTERFREE");
        $pokemonMeta->setBaseDefense(151);
        $pokemonMeta->setAttackTimerS(17);
        $pokemonMeta->setWeightStdDev(4);
        $pokemonMeta->setCylHeightM(1.11);
        $pokemonMeta->setCandyToEvolve(0);
        $pokemonMeta->setCollisionHeightM(0.555);
        $pokemonMeta->setShoulderModeScale(0.5);
        $pokemonMeta->setBaseCaptureRate(0.1);
        $pokemonMeta->setParentId(PokemonId::METAPOD);
        $pokemonMeta->setCylGroundM(0.555);
        $pokemonMeta->setQuickMoves(new PokemonMoveData(array(
            PokemonMove::CONFUSION_FAST,
            PokemonMove::BUG_BITE_FAST,
        )));
        $pokemonMeta->setCinematicMoves(new PokemonMoveData(array(
            PokemonMove::BUG_BUZZ,
            PokemonMove::PSYCHIC,
            PokemonMove::SIGNAL_BEAM,
        )));
        $pokemonMeta->setNumber(12);
        self::$POKEMON_META[PokemonId::BUTTERFREE] = $pokemonMeta;

        $pokemonMeta = new PokemonMeta();
        $pokemonMeta->setTemplateId("V0013_POKEMON_WEEDLE");
        $pokemonMeta->setFamily(PokemonFamilyId::FAMILY_WEEDLE);
        $pokemonMeta->setPokemonClass(PokemonClass::VERY_COMMON);
        $pokemonMeta->setType2(PokemonType::POKEMON_TYPE_POISON);
        $pokemonMeta->setPokedexHeightM(0.3);
        $pokemonMeta->setHeightStdDev(0.0375);
        $pokemonMeta->setBaseStamina(80);
        $pokemonMeta->setCylRadiusM(0.209);
        $pokemonMeta->setBaseFleeRate(0.2);
        $pokemonMeta->setBaseAttack(63);
        $pokemonMeta->setDiskRadiusM(0.3135);
        $pokemonMeta->setCollisionRadiusM(0.1045);
        $pokemonMeta->setPokedexWeightKg(3.2);
        $pokemonMeta->setMovementType(MovementType::JUMP);
        $pokemonMeta->setType1(PokemonType::POKEMON_TYPE_BUG);
        $pokemonMeta->setCollisionHeadRadiusM(0.15675);
        $pokemonMeta->setMovementTimerS(10);
        $pokemonMeta->setJumpTimeS(1.25);
        $pokemonMeta->setModelScale(2.09);
        $pokemonMeta->setUniqueId("V0013_POKEMON_WEEDLE");
        $pokemonMeta->setBaseDefense(55);
        $pokemonMeta->setAttackTimerS(29);
        $pokemonMeta->setWeightStdDev(0.4);
        $pokemonMeta->setCylHeightM(0.418);
        $pokemonMeta->setCandyToEvolve(12);
        $pokemonMeta->setCollisionHeightM(0.209);
        $pokemonMeta->setShoulderModeScale(0.5);
        $pokemonMeta->setBaseCaptureRate(0.4);
        $pokemonMeta->setParentId(PokemonId::MISSINGNO);
        $pokemonMeta->setCylGroundM(0);
        $pokemonMeta->setQuickMoves(new PokemonMoveData(array(
            PokemonMove::POISON_STING_FAST,
            PokemonMove::BUG_BITE_FAST,
        )));
        $pokemonMeta->setCinematicMoves(new PokemonMoveData(array(
            PokemonMove::STRUGGLE,
        )));
        $pokemonMeta->setNumber(13);
        self::$POKEMON_META[PokemonId::WEEDLE] = $pokemonMeta;

        $pokemonMeta = new PokemonMeta();
        $pokemonMeta->setTemplateId("V0014_POKEMON_KAKUNA");
        $pokemonMeta->setFamily(PokemonFamilyId::FAMILY_WEEDLE);
        $pokemonMeta->setPokemonClass(PokemonClass::COMMON);
        $pokemonMeta->setType2(PokemonType::POKEMON_TYPE_POISON);
        $pokemonMeta->setPokedexHeightM(0.6);
        $pokemonMeta->setHeightStdDev(0.075);
        $pokemonMeta->setBaseStamina(90);
        $pokemonMeta->setCylRadiusM(0.25);
        $pokemonMeta->setBaseFleeRate(0.09);
        $pokemonMeta->setBaseAttack(46);
        $pokemonMeta->setDiskRadiusM(0.375);
        $pokemonMeta->setCollisionRadiusM(0.25);
        $pokemonMeta->setPokedexWeightKg(10);
        $pokemonMeta->setMovementType(MovementType::JUMP);
        $pokemonMeta->setType1(PokemonType::POKEMON_TYPE_BUG);
        $pokemonMeta->setCollisionHeadRadiusM(0.125);
        $pokemonMeta->setMovementTimerS(3600);
        $pokemonMeta->setJumpTimeS(0);
        $pokemonMeta->setModelScale(1.25);
        $pokemonMeta->setUniqueId("V0014_POKEMON_KAKUNA");
  
Download .txt
gitextract_xjegl40a/

├── .gitattributes
├── .gitignore
├── LICENSE.txt
├── README.md
├── composer.json
├── examples/
│   ├── AuthenticationExample.php
│   ├── CheckChallengeExample.php
│   ├── GUI_BestCpPokemonDetails.php
│   ├── ProxyExample.php
│   ├── ReleaseOnePidgeExample.php
│   ├── RetrieveAppliedItemsExample.php
│   ├── RetrieveJournalExample.php
│   ├── RetrievePlayerPokedexExample.php
│   ├── RetrievePlayerProfileExample.php
│   ├── RetrievePlayerStatsExample.php
│   ├── RetrievePokemonCandyCountExample.php
│   ├── RetrievePokemonCountExample.php
│   ├── RetrievePokemonTraitExample.php
│   └── VerifyChallengeExample.php
├── includes/
│   ├── config.php
│   └── protocolbuffers.inc.php
├── phpunit.xml.dist
├── src/
│   ├── Api/
│   │   ├── Data/
│   │   │   ├── Data.php
│   │   │   ├── Device.php
│   │   │   └── Location.php
│   │   ├── Map/
│   │   │   ├── Data/
│   │   │   │   ├── Resource.php
│   │   │   │   ├── Resources/
│   │   │   │   │   ├── CatchablePokemon.php
│   │   │   │   │   ├── Fort.php
│   │   │   │   │   ├── NearbyPokemon.php
│   │   │   │   │   ├── SpawnPoint.php
│   │   │   │   │   └── WildPokemon.php
│   │   │   │   └── Results/
│   │   │   │       └── PokestopSpinResult.php
│   │   │   ├── Map.php
│   │   │   ├── Pokestop.php
│   │   │   └── Support/
│   │   │       └── S2.php
│   │   ├── Player/
│   │   │   ├── CheckChallenge.php
│   │   │   ├── Data/
│   │   │   │   ├── CheckChallenge/
│   │   │   │   │   └── CheckChallengeData.php
│   │   │   │   ├── Inventory/
│   │   │   │   │   ├── AppliedItem.php
│   │   │   │   │   ├── AppliedItems.php
│   │   │   │   │   ├── CandyBank.php
│   │   │   │   │   ├── CandyItem.php
│   │   │   │   │   ├── EggIncubator.php
│   │   │   │   │   ├── EggIncubators.php
│   │   │   │   │   ├── EggPokemon.php
│   │   │   │   │   ├── Item.php
│   │   │   │   │   ├── Items.php
│   │   │   │   │   ├── PokeBank.php
│   │   │   │   │   ├── Pokedex.php
│   │   │   │   │   ├── PokedexItem.php
│   │   │   │   │   ├── PokemonItem.php
│   │   │   │   │   └── Stats.php
│   │   │   │   ├── Journal/
│   │   │   │   │   ├── Fort.php
│   │   │   │   │   ├── Item.php
│   │   │   │   │   ├── Log.php
│   │   │   │   │   └── Pokemon.php
│   │   │   │   └── Profile/
│   │   │   │       ├── Avatar.php
│   │   │   │       ├── Badge.php
│   │   │   │       ├── ContactSettings.php
│   │   │   │       ├── Currencies.php
│   │   │   │       ├── Currency.php
│   │   │   │       ├── DailyBonus.php
│   │   │   │       ├── ProfileData.php
│   │   │   │       └── TutorialState.php
│   │   │   ├── Inventory.php
│   │   │   ├── Journal.php
│   │   │   └── Profile.php
│   │   ├── Pokemon/
│   │   │   ├── Collection/
│   │   │   │   └── PokemonCollection.php
│   │   │   ├── Data/
│   │   │   │   ├── MovementType.php
│   │   │   │   ├── PokemonClass.php
│   │   │   │   ├── PokemonMeta.php
│   │   │   │   ├── PokemonMetaRegistry.php
│   │   │   │   └── PokemonMove.php
│   │   │   ├── Pokemon.php
│   │   │   └── Support/
│   │   │       ├── BasePokemonRetriever.php
│   │   │       ├── CombatPointsCalculator.php
│   │   │       └── PokemonDetailsTrait.php
│   │   ├── PokemonGoApi.php
│   │   ├── Procedure.php
│   │   └── Support/
│   │       ├── Enums/
│   │       │   ├── AbstractEnum.php
│   │       │   ├── GenericEnum.php
│   │       │   ├── ItemId.php
│   │       │   ├── PokemonFamilyId.php
│   │       │   ├── PokemonId.php
│   │       │   ├── PokemonMove.php
│   │       │   └── PokemonType.php
│   │       └── Traits/
│   │           ├── MakeApiResourcesAvailable.php
│   │           └── MakeDataPropertiesCallable.php
│   ├── Authentication/
│   │   ├── AccessToken.php
│   │   ├── Config/
│   │   │   └── Config.php
│   │   ├── Contracts/
│   │   │   └── Authenticator.php
│   │   ├── Exceptions/
│   │   │   ├── AuthenticationException.php
│   │   │   ├── IllegalAuthenticationTypeException.php
│   │   │   └── ResponseException.php
│   │   ├── Factory/
│   │   │   └── Factory.php
│   │   ├── Manager.php
│   │   └── Managers/
│   │       ├── Google/
│   │       │   ├── AuthenticationCode/
│   │       │   │   ├── Authenticator.php
│   │       │   │   ├── Clients/
│   │       │   │   │   └── AuthenticationClient.php
│   │       │   │   └── Parsers/
│   │       │   │       ├── OauthTokenParser.php
│   │       │   │       ├── Parser.php
│   │       │   │       └── Results/
│   │       │   │           ├── AuthenticationTokenResult.php
│   │       │   │           └── Result.php
│   │       │   ├── AuthenticationCodeManager.php
│   │       │   ├── AuthenticationCredentials/
│   │       │   │   ├── Authenticator.php
│   │       │   │   ├── Clients/
│   │       │   │   │   └── AuthenticationClient.php
│   │       │   │   ├── Parsers/
│   │       │   │   │   ├── OauthTokenParser.php
│   │       │   │   │   ├── Parser.php
│   │       │   │   │   ├── Results/
│   │       │   │   │   │   ├── AuthenticationTokenResult.php
│   │       │   │   │   │   └── Result.php
│   │       │   │   │   └── TokenParser.php
│   │       │   │   └── Support/
│   │       │   │       └── Signature.php
│   │       │   ├── AuthenticationCredentialsManager.php
│   │       │   ├── AuthenticationOauthTokenManager.php
│   │       │   ├── AuthenticationRefreshToken/
│   │       │   │   ├── Authenticator.php
│   │       │   │   ├── Clients/
│   │       │   │   │   └── AuthenticationClient.php
│   │       │   │   └── Parsers/
│   │       │   │       ├── OauthTokenParser.php
│   │       │   │       ├── Parser.php
│   │       │   │       └── Results/
│   │       │   │           ├── AuthenticationTokenResult.php
│   │       │   │           └── Result.php
│   │       │   └── AuthenticationRefreshTokenManager.php
│   │       └── PTC/
│   │           ├── AuthenticationCredentials/
│   │           │   ├── Authenticator.php
│   │           │   ├── Clients/
│   │           │   │   └── AuthenticationClient.php
│   │           │   └── Parsers/
│   │           │       ├── AuthenticationInformationParser.php
│   │           │       ├── Parser.php
│   │           │       ├── Results/
│   │           │       │   ├── AuthenticationInformationResult.php
│   │           │       │   ├── Result.php
│   │           │       │   ├── TicketResult.php
│   │           │       │   └── TokenResult.php
│   │           │       ├── TicketParser.php
│   │           │       └── TokenParser.php
│   │           ├── AuthenticationCredentialsManager.php
│   │           └── AuthenticationOauthTokenManager.php
│   ├── Clients/
│   │   └── Proxies/
│   │       └── ClientProxy.php
│   ├── Facades/
│   │   ├── App.php
│   │   └── Log.php
│   ├── Handlers/
│   │   ├── RequestHandler/
│   │   │   └── Exceptions/
│   │   │       ├── AuthenticationException.php
│   │   │       └── ResponseException.php
│   │   ├── RequestHandler.php
│   │   └── Session.php
│   ├── Kernels/
│   │   ├── ApplicationKernel.php
│   │   └── Kernel.php
│   ├── Providers/
│   │   ├── PokemonGoApiServiceProvider.php
│   │   ├── RequestHandlerServiceProvider.php
│   │   └── ServiceProvider.php
│   ├── Requests/
│   │   ├── AuthenticateRequest.php
│   │   ├── CheckChallengeRequest.php
│   │   ├── Envelops/
│   │   │   ├── AuthInfoEnvelope.php
│   │   │   └── Factory.php
│   │   ├── EvolvePokemonRequest.php
│   │   ├── FortSearchRequest.php
│   │   ├── GetInventoryRequest.php
│   │   ├── GetJournalRequest.php
│   │   ├── GetMapResourcesRequest.php
│   │   ├── GetPlayerRequest.php
│   │   ├── RecycleInventoryItemRequest.php
│   │   ├── RenamePokemonRequest.php
│   │   ├── Request.php
│   │   ├── SetFavoritePokemonRequest.php
│   │   ├── TransferPokemonRequest.php
│   │   ├── UpgradePokemonRequest.php
│   │   ├── UseIncenseRequest.php
│   │   ├── UseItemXpBoostRequest.php
│   │   └── VerifyChallengeRequest.php
│   └── Services/
│       ├── Request/
│       │   ├── CheckChallengeRequestService.php
│       │   ├── InventoryRequestService.php
│       │   ├── JournalRequestService.php
│       │   ├── MapRequestService.php
│       │   ├── PlayerRequestService.php
│       │   ├── PokemonRequestService.php
│       │   └── PokestopRequestService.php
│       └── RequestService.php
└── tests/
    └── Api/
        └── Pokemon/
            └── PokemonTest.php
Download .txt
SYMBOL INDEX (843 symbols across 165 files)

FILE: examples/AuthenticationExample.php
  class AuthenticationExample (line 11) | class AuthenticationExample {
    method run (line 16) | public function run()

FILE: examples/CheckChallengeExample.php
  class CheckChallengeRequest (line 10) | class CheckChallengeRequest {
    method run (line 15) | public function run()

FILE: examples/GUI_BestCpPokemonDetails.php
  function normalize (line 92) | function normalize($text)
  function make_row (line 97) | function make_row($k, $v)
  function show_error (line 102) | function show_error($txt)
  function html_start (line 107) | function html_start()
  function html_stop (line 115) | function html_stop()
  function html_header (line 122) | function html_header()
  function html_footer (line 137) | function html_footer()

FILE: examples/ProxyExample.php
  class ProxyExample (line 11) | class ProxyExample {
    method run (line 16) | public function run()

FILE: examples/ReleaseOnePidgeExample.php
  class ReleaseOnePidgeExample (line 10) | class ReleaseOnePidgeExample {
    method run (line 15) | public function run()

FILE: examples/RetrieveAppliedItemsExample.php
  class RetrieveAppliedItemsExample (line 11) | class RetrieveAppliedItemsExample {
    method run (line 16) | public function run()

FILE: examples/RetrieveJournalExample.php
  class RetrieveJournalExample (line 11) | class RetrieveJournalExample {
    method run (line 16) | public function run()

FILE: examples/RetrievePlayerPokedexExample.php
  class RetrievePlayerPokedexExample (line 10) | class RetrievePlayerPokedexExample {
    method run (line 15) | public function run()

FILE: examples/RetrievePlayerProfileExample.php
  class RetrievePlayerProfileExample (line 9) | class RetrievePlayerProfileExample {
    method run (line 14) | public function run()

FILE: examples/RetrievePlayerStatsExample.php
  class RetrievePlayerStatsExample (line 9) | class RetrievePlayerStatsExample {
    method run (line 14) | public function run()

FILE: examples/RetrievePokemonCandyCountExample.php
  class RetrievePokemonCandyCountExample (line 10) | class RetrievePokemonCandyCountExample {
    method run (line 15) | public function run()

FILE: examples/RetrievePokemonCountExample.php
  class RetrievePokemonCountExample (line 10) | class RetrievePokemonCountExample {
    method run (line 15) | public function run()

FILE: examples/RetrievePokemonTraitExample.php
  class RetrievePokemonTraitExample (line 10) | class RetrievePokemonTraitExample {
    method run (line 15) | public function run()

FILE: examples/VerifyChallengeExample.php
  class VerifyChallengeRequest (line 10) | class VerifyChallengeRequest {
    method showForm (line 15) | public function showForm()
    method processRequest (line 78) | public function processRequest($token)

FILE: includes/config.php
  function env (line 13) | function env($key, $default = null)

FILE: includes/protocolbuffers.inc.php
  function checkArgument (line 34) | function checkArgument($exp, $message)
  class ProtobufIO (line 41) | abstract class ProtobufIO {
    method toStream (line 43) | public static function toStream($in, &$limit = PHP_INT_MAX)
  class ProtobufEnum (line 59) | abstract class ProtobufEnum {
    method toString (line 61) | public static function toString($value)
  class ProtobufMessage (line 72) | abstract class ProtobufMessage {
    method __construct (line 76) | function __construct($fp = null, &$limit = PHP_INT_MAX)
    method read (line 88) | public function read($in, &$limit = PHP_INT_MAX)
    method write (line 102) | abstract public function write($fp);
    method size (line 104) | abstract public function size();
    method toProtobuf (line 108) | public function toProtobuf()
  class Protobuf (line 124) | abstract class Protobuf {
    method get_wiretype (line 190) | public static function get_wiretype($wire_type)
    method size_varint (line 216) | public static function size_varint($value)
    method decode_varint (line 249) | public static function decode_varint($encoded)
    method decode_signed_varint (line 261) | public static function decode_signed_varint($encoded)
    method decode_varint_int (line 289) | public static function decode_varint_int($encoded, $len)
    method decode_varint_float (line 304) | public static function decode_varint_float($encoded, $len)
    method decode_varint_bc (line 316) | public static function decode_varint_bc($encoded, $len)
    method decode_varint_gmp (line 327) | public static function decode_varint_gmp($encoded, $len)
    method read_bytes (line 339) | public static function read_bytes($fp, $len, &$limit = PHP_INT_MAX)
    method read_varint_bytes (line 379) | public static function read_varint_bytes($fp, &$limit = PHP_INT_MAX)
    method read_varint (line 400) | public static function read_varint($fp, &$limit = PHP_INT_MAX)
    method read_signed_varint (line 409) | public static function read_signed_varint($fp, &$limit = PHP_INT_MAX)
    method read_unpack (line 422) | protected static function read_unpack($fp, $len, $pack, &$limit = PHP_...
    method read_float (line 434) | public static function read_float($fp, &$limit = PHP_INT_MAX)
    method read_double (line 439) | public static function read_double($fp, &$limit = PHP_INT_MAX)
    method read_int32 (line 444) | public static function read_int32($fp, &$limit = PHP_INT_MAX)
    method read_uint32 (line 449) | public static function read_uint32($fp, &$limit = PHP_INT_MAX)
    method read_int64 (line 455) | public static function read_int64($fp, &$limit = PHP_INT_MAX)
    method read_uint64 (line 460) | public static function read_uint64($fp, &$limit = PHP_INT_MAX)
    method read_zint32 (line 465) | public static function read_zint32($fp, &$limit = PHP_INT_MAX)
    method read_zint64 (line 475) | public static function read_zint64($fp, &$limit = PHP_INT_MAX)
    method read_field (line 488) | public static function read_field($fp, $wire_type, &$limit = PHP_INT_MAX)
    method encode_varint_slide (line 525) | public static function encode_varint_slide($value)
    method encode_varint_int (line 621) | public static function encode_varint_int($value)
    method encode_varint_float (line 640) | public static function encode_varint_float($value)
    method encode_varint_bc (line 653) | public static function encode_varint_bc($value)
    method encode_varint_gmp (line 667) | public static function encode_varint_gmp($value)
    method encode_varint (line 696) | public static function encode_varint($value)
    method write_varint (line 735) | public static function write_varint($fp, $value)
    method write_pack (line 757) | protected static function write_pack($fp, $value, $pack)
    method write_float (line 774) | public static function write_float($fp, $f)
    method write_double (line 779) | public static function write_double($fp, $d)
    method write_int32 (line 784) | public static function write_int32($fp, $i)
    method write_uint32 (line 789) | public static function write_uint32($fp, $i)
    method write_int64 (line 795) | public static function write_int64($fp, $i)
    method write_uint64 (line 800) | public static function write_uint64($fp, $i)
    method write_zint32 (line 805) | public static function write_zint32($fp, $i)
    method write_zint64 (line 810) | public static function write_zint64($fp, $i)
    method skip_varint (line 818) | public static function skip_varint($fp)
    method skip_field (line 832) | public static function skip_field($fp, $wire_type, &$limit = PHP_INT_MAX)
    method toString (line 879) | public static function toString($key, $value, $default = null)

FILE: src/Api/Data/Data.php
  class Data (line 8) | abstract class Data {
    method create (line 16) | public static function create($data)
    method __call (line 51) | public function __call($name, $arguments)
    method getClassProperties (line 71) | protected static function getClassProperties($instance)
    method getClassDefaultProperties (line 84) | protected static function getClassDefaultProperties($instance)
    method getAttribute (line 97) | protected function getAttribute($method)
    method isSetMethod (line 108) | protected function isSetMethod($method)
    method isGetMethod (line 119) | protected function isGetMethod($method)

FILE: src/Api/Data/Device.php
  class Device (line 5) | class Device extends Data

FILE: src/Api/Data/Location.php
  class Location (line 12) | class Location extends Data {
    method __construct (line 30) | public function __construct($latitude = 0.0, $longitude = 0.0)

FILE: src/Api/Map/Data/Resource.php
  class Resource (line 19) | class Resource extends Data {
    method create (line 57) | public static function create($data)
    method addForts (line 91) | public function addForts($forts)
    method addSpawnPoints (line 117) | public function addSpawnPoints($spawnPoints)
    method addCatchablePokemons (line 130) | public function addCatchablePokemons($catchablePokemons)
    method addWildPokemons (line 141) | public function addWildPokemons($wildPokemons)
    method addNearbyPokemons (line 153) | public function addNearbyPokemons($nearbyPokemons)

FILE: src/Api/Map/Data/Resources/CatchablePokemon.php
  class CatchablePokemon (line 9) | class CatchablePokemon extends Data {

FILE: src/Api/Map/Data/Resources/Fort.php
  class Fort (line 46) | class Fort extends Data {

FILE: src/Api/Map/Data/Resources/NearbyPokemon.php
  class NearbyPokemon (line 8) | class NearbyPokemon extends Data {

FILE: src/Api/Map/Data/Resources/SpawnPoint.php
  class SpawnPoint (line 7) | class SpawnPoint extends Data {

FILE: src/Api/Map/Data/Resources/WildPokemon.php
  class WildPokemon (line 8) | class WildPokemon extends Data {

FILE: src/Api/Map/Data/Results/PokestopSpinResult.php
  class PokestopSpinResult (line 8) | class PokestopSpinResult extends Data {
    method getResult (line 48) | public function getResult()
    method getItemsAwarded (line 56) | public function getItemsAwarded()
    method getGemsAwarded (line 64) | public function getGemsAwarded()
    method getPokemonDataEgg (line 72) | public function getPokemonDataEgg()
    method getExperienceAwarded (line 80) | public function getExperienceAwarded()
    method getCooldownCompleteTimestampMs (line 88) | public function getCooldownCompleteTimestampMs()
    method getChainHackSequenceNumber (line 96) | public function getChainHackSequenceNumber()

FILE: src/Api/Map/Map.php
  class Map (line 13) | class Map extends Procedure {
    method __construct (line 18) | public function __construct()
    method getPokestops (line 28) | public function getPokestops()
    method getGyms (line 38) | public function getGyms()
    method getCatchablePokemon (line 46) | public function getCatchablePokemon()
    method update (line 57) | public function update()
    method getMapResources (line 71) | protected function getMapResources()
    method getRequestService (line 91) | protected function getRequestService()

FILE: src/Api/Map/Pokestop.php
  class Pokestop (line 44) | class Pokestop extends Procedure {
    method __construct (line 61) | public function __construct($fortData)
    method isInRange (line 71) | public function isInRange()
    method canSpin (line 88) | public function canSpin()
    method spin (line 101) | public function spin()
    method hasLure (line 121) | public function hasLure()
    method addLure (line 126) | public function addLure()
    method getDetails (line 134) | public function getDetails()
    method getCurrentLatitude (line 144) | protected function getCurrentLatitude()
    method getCurrentLongitude (line 154) | protected function getCurrentLongitude()
    method getRequestService (line 164) | protected function getRequestService()

FILE: src/Api/Map/Support/S2.php
  class S2 (line 8) | class S2 {
    method getCellIds (line 18) | public static function getCellIds($latitude, $longitude, $width = 9)

FILE: src/Api/Player/CheckChallenge.php
  class CheckChallenge (line 12) | class CheckChallenge extends Procedure {
    method getData (line 19) | public function getData()
    method update (line 27) | public function update()
    method getRequestService (line 41) | protected function getRequestService()

FILE: src/Api/Player/Data/CheckChallenge/CheckChallengeData.php
  class CheckChallengeData (line 8) | class CheckChallengeData extends Data {
    method create (line 26) | public static function create($data)

FILE: src/Api/Player/Data/Inventory/AppliedItem.php
  class AppliedItem (line 20) | class AppliedItem extends Data {

FILE: src/Api/Player/Data/Inventory/AppliedItems.php
  class AppliedItems (line 14) | class AppliedItems extends Data {
    method add (line 26) | public function add($appliedItem)
    method create (line 38) | public static function create($data)

FILE: src/Api/Player/Data/Inventory/CandyBank.php
  class CandyBank (line 16) | class CandyBank extends Data {
    method add (line 26) | public function add($data)
    method get (line 50) | public function get($familyId)

FILE: src/Api/Player/Data/Inventory/CandyItem.php
  class CandyItem (line 14) | class CandyItem extends Data {
    method getCount (line 31) | public function getCount()

FILE: src/Api/Player/Data/Inventory/EggIncubator.php
  class EggIncubator (line 26) | class EggIncubator extends Data {

FILE: src/Api/Player/Data/Inventory/EggIncubators.php
  class EggIncubators (line 15) | class EggIncubators extends Data {
    method add (line 25) | public function add($eggIncubator)
    method create (line 37) | public static function create($data)

FILE: src/Api/Player/Data/Inventory/EggPokemon.php
  class EggPokemon (line 21) | class EggPokemon extends Data {

FILE: src/Api/Player/Data/Inventory/Item.php
  class Item (line 17) | class Item extends Data {

FILE: src/Api/Player/Data/Inventory/Items.php
  class Items (line 30) | class Items extends Data {
    method __construct (line 75) | public function __construct()
    method create (line 90) | public static function create($data)
    method createItemData (line 113) | protected function createItemData($itemData)
    method getItemById (line 161) | public function getItemById($id)
    method isItem (line 182) | protected static function isItem($itemData)
    method isPokemon (line 193) | protected static function isPokemon($itemData)
    method isCandy (line 204) | protected static function isCandy($itemData)
    method isPokedexItem (line 215) | protected static function isPokedexItem($itemData)
    method isEggIncubators (line 226) | protected static function isEggIncubators($itemData)
    method isAppliedItems (line 237) | protected static function isAppliedItems($itemData)
    method isPlayerStats (line 248) | protected static function isPlayerStats($itemData)
    method isEggPokemon (line 259) | protected static function isEggPokemon($itemData)

FILE: src/Api/Player/Data/Inventory/PokeBank.php
  class PokeBank (line 18) | class PokeBank extends Data {
    method __construct (line 28) | public function __construct()
    method add (line 38) | public function add($data)
    method addPokemon (line 52) | public function addPokemon($pokemon)
    method removeBydId (line 64) | public function removeBydId($id)
    method removePokemon (line 83) | public function removePokemon($pokemon)
    method getPokemonById (line 94) | public function getPokemonById($id)
    method getPokemonsByType (line 111) | public function getPokemonsByType($typeId)
    method getPokemonsByFamily (line 129) | public function getPokemonsByFamily($familyId)

FILE: src/Api/Player/Data/Inventory/Pokedex.php
  class Pokedex (line 14) | class Pokedex extends Data {
    method add (line 26) | public function add($pokedexEntry)
    method get (line 41) | public function get($pokemonId)
    method createEmptyItem (line 62) | protected function createEmptyItem($pokemonId)

FILE: src/Api/Player/Data/Inventory/PokedexItem.php
  class PokedexItem (line 22) | class PokedexItem extends Data {

FILE: src/Api/Player/Data/Inventory/PokemonItem.php
  class PokemonItem (line 72) | class PokemonItem extends Data {

FILE: src/Api/Player/Data/Inventory/Stats.php
  class Stats (line 61) | class Stats extends Data {
    method getLevelXp (line 192) | public function getLevelXp($level = 1) {
    method getCurrentLevelXp (line 201) | public function getCurrentLevelXp() {
    method getCurrentLevelProgressXp (line 210) | public function getCurrentLevelProgressXp() {

FILE: src/Api/Player/Data/Journal/Fort.php
  class Fort (line 8) | class Fort extends Data {
    method create (line 41) | public static function create($data)

FILE: src/Api/Player/Data/Journal/Item.php
  class Item (line 7) | class Item extends Data {
    method getItemId (line 29) | public function getItemId()
    method getCount (line 39) | public function getCount()
    method isUnseen (line 49) | public function isUnseen()

FILE: src/Api/Player/Data/Journal/Log.php
  class Log (line 8) | class Log extends Data
    method getForts (line 24) | public function getForts()
    method getPokemons (line 32) | public function getPokemons()
    method create (line 43) | public static function create($data)

FILE: src/Api/Player/Data/Journal/Pokemon.php
  class Pokemon (line 11) | class Pokemon extends Data {
    method getTimestampMs (line 45) | public function getTimestampMs() {
    method getResult (line 54) | public function getResult()
    method getPokemonId (line 64) | public function getPokemonId()
    method getCombatPoints (line 74) | public function getCombatPoints()
    method getPokemonDataId (line 84) | public function getPokemonDataId()
    method getPokemonMeta (line 94) | public function getPokemonMeta()
    method getPokedexEntry (line 104) | public function getPokedexEntry()

FILE: src/Api/Player/Data/Profile/Avatar.php
  class Avatar (line 29) | class Avatar extends Data {

FILE: src/Api/Player/Data/Profile/Badge.php
  class Badge (line 17) | class Badge extends Data {

FILE: src/Api/Player/Data/Profile/ContactSettings.php
  class ContactSettings (line 15) | class ContactSettings extends Data {

FILE: src/Api/Player/Data/Profile/Currencies.php
  class Currencies (line 14) | class Currencies extends Data {
    method create (line 37) | public static function create($currencies)
    method getByType (line 60) | public function getByType($type)
    method getPokecoins (line 76) | public function getPokecoins()
    method getStardust (line 87) | public function getStardust()
    method toArray (line 97) | public function toArray()

FILE: src/Api/Player/Data/Profile/Currency.php
  class Currency (line 15) | class Currency extends Data {

FILE: src/Api/Player/Data/Profile/DailyBonus.php
  class DailyBonus (line 15) | class DailyBonus extends Data {

FILE: src/Api/Player/Data/Profile/ProfileData.php
  class ProfileData (line 34) | class ProfileData extends Data {
    method create (line 97) | public static function create($data)

FILE: src/Api/Player/Data/Profile/TutorialState.php
  class TutorialState (line 13) | class TutorialState extends Data {
    method create (line 26) | public static function create($tutorialState)

FILE: src/Api/Player/Inventory.php
  class Inventory (line 43) | class Inventory extends Procedure
    method getData (line 56) | public function getData()
    method update (line 64) | public function update()
    method recycle (line 88) | public function recycle($itemId, $count)
    method useIncense (line 121) | public function useIncense($itemId)
    method useItemXpBoost (line 145) | public function useItemXpBoost($itemId)
    method getRequestService (line 168) | protected function getRequestService()

FILE: src/Api/Player/Journal.php
  class Journal (line 9) | class Journal extends Procedure {
    method getForts (line 16) | public function getForts()
    method getPokemons (line 26) | public function getPokemons()
    method getEntries (line 36) | public function getEntries()
    method update (line 44) | public function update()
    method getRequestService (line 58) | protected function getRequestService()

FILE: src/Api/Player/Profile.php
  class Profile (line 40) | class Profile extends Procedure {
    method getData (line 47) | public function getData()
    method update (line 55) | public function update()
    method getRequestService (line 69) | protected function getRequestService()

FILE: src/Api/Pokemon/Collection/PokemonCollection.php
  class PokemonCollection (line 8) | class PokemonCollection extends Collection {
    method sortByName (line 16) | public function sortByName($descending = false)
    method sortByLevel (line 29) | public function sortByLevel($descending = false)
    method sortByCp (line 43) | public function sortByCp($descending = false)
    method sortByPokedexIndex (line 57) | public function sortByPokedexIndex($descending = false)
    method sortByIVRatio (line 71) | public function sortByIVRatio($descending = false)
    method sortByDate (line 84) | public function sortByDate($descending = false)

FILE: src/Api/Pokemon/Data/MovementType.php
  class MovementType (line 5) | class MovementType {

FILE: src/Api/Pokemon/Data/PokemonClass.php
  class PokemonClass (line 5) | class PokemonClass {

FILE: src/Api/Pokemon/Data/PokemonMeta.php
  class PokemonMeta (line 5) | class PokemonMeta {
    method getTemplateId (line 76) | public function getTemplateId()
    method setTemplateId (line 84) | public function setTemplateId($templateId)
    method getFamily (line 92) | public function getFamily()
    method setFamily (line 100) | public function setFamily($family)
    method getPokemonClass (line 108) | public function getPokemonClass()
    method setPokemonClass (line 116) | public function setPokemonClass($pokemonClass)
    method getType2 (line 124) | public function getType2()
    method setType2 (line 132) | public function setType2($type2)
    method getPokedexHeightM (line 140) | public function getPokedexHeightM()
    method setPokedexHeightM (line 148) | public function setPokedexHeightM($pokedexHeightM)
    method getHeightStdDev (line 156) | public function getHeightStdDev()
    method setHeightStdDev (line 164) | public function setHeightStdDev($heightStdDev)
    method getBaseStamina (line 172) | public function getBaseStamina()
    method setBaseStamina (line 180) | public function setBaseStamina($baseStamina)
    method getCylRadiusM (line 188) | public function getCylRadiusM()
    method setCylRadiusM (line 196) | public function setCylRadiusM($cylRadiusM)
    method getBaseFleeRate (line 204) | public function getBaseFleeRate()
    method setBaseFleeRate (line 212) | public function setBaseFleeRate($baseFleeRate)
    method getBaseAttack (line 220) | public function getBaseAttack()
    method setBaseAttack (line 228) | public function setBaseAttack($baseAttack)
    method getDiskRadiusM (line 236) | public function getDiskRadiusM()
    method setDiskRadiusM (line 244) | public function setDiskRadiusM($diskRadiusM)
    method getCollisionRadiusM (line 252) | public function getCollisionRadiusM()
    method setCollisionRadiusM (line 260) | public function setCollisionRadiusM($collisionRadiusM)
    method getPokedexWeightKg (line 268) | public function getPokedexWeightKg()
    method setPokedexWeightKg (line 276) | public function setPokedexWeightKg($pokedexWeightKg)
    method getMovementType (line 284) | public function getMovementType()
    method setMovementType (line 292) | public function setMovementType($movementType)
    method getType1 (line 300) | public function getType1()
    method setType1 (line 308) | public function setType1($type1)
    method getCollisionHeadRadiusM (line 316) | public function getCollisionHeadRadiusM()
    method setCollisionHeadRadiusM (line 324) | public function setCollisionHeadRadiusM($collisionHeadRadiusM)
    method getMovementTimerS (line 332) | public function getMovementTimerS()
    method setMovementTimerS (line 340) | public function setMovementTimerS($movementTimerS)
    method getJumpTimeS (line 348) | public function getJumpTimeS()
    method setJumpTimeS (line 356) | public function setJumpTimeS($jumpTimeS)
    method getModelScale (line 364) | public function getModelScale()
    method setModelScale (line 372) | public function setModelScale($modelScale)
    method getUniqueId (line 380) | public function getUniqueId()
    method setUniqueId (line 388) | public function setUniqueId($uniqueId)
    method getBaseDefense (line 396) | public function getBaseDefense()
    method setBaseDefense (line 404) | public function setBaseDefense($baseDefense)
    method getAttackTimerS (line 412) | public function getAttackTimerS()
    method setAttackTimerS (line 420) | public function setAttackTimerS($attackTimerS)
    method getWeightStdDev (line 428) | public function getWeightStdDev()
    method setWeightStdDev (line 436) | public function setWeightStdDev($weightStdDev)
    method getCylHeightM (line 444) | public function getCylHeightM()
    method setCylHeightM (line 452) | public function setCylHeightM($cylHeightM)
    method getCandyToEvolve (line 460) | public function getCandyToEvolve()
    method setCandyToEvolve (line 468) | public function setCandyToEvolve($candyToEvolve)
    method getCollisionHeightM (line 476) | public function getCollisionHeightM()
    method setCollisionHeightM (line 484) | public function setCollisionHeightM($collisionHeightM)
    method getShoulderModeScale (line 492) | public function getShoulderModeScale()
    method setShoulderModeScale (line 500) | public function setShoulderModeScale($shoulderModeScale)
    method getBaseCaptureRate (line 508) | public function getBaseCaptureRate()
    method setBaseCaptureRate (line 516) | public function setBaseCaptureRate($baseCaptureRate)
    method getParentId (line 524) | public function getParentId()
    method setParentId (line 532) | public function setParentId($parentId)
    method getCylGroundM (line 540) | public function getCylGroundM()
    method setCylGroundM (line 548) | public function setCylGroundM($cylGroundM)
    method getQuickMoves (line 556) | public function getQuickMoves()
    method setQuickMoves (line 564) | public function setQuickMoves(PokemonMove $quickMoves)
    method getCinematicMoves (line 572) | public function getCinematicMoves()
    method setCinematicMoves (line 580) | public function setCinematicMoves(PokemonMove $cinematicMoves)
    method getNumber (line 588) | public function getNumber()
    method setNumber (line 596) | public function setNumber($number)

FILE: src/Api/Pokemon/Data/PokemonMetaRegistry.php
  class PokemonMetaRegistry (line 11) | class PokemonMetaRegistry {
    method getByPokemonId (line 24) | public static function getByPokemonId($pokemonId)
    method initialize (line 32) | public static function initialize()

FILE: src/Api/Pokemon/Data/PokemonMove.php
  class PokemonMove (line 11) | class PokemonMove
    method __construct (line 21) | public function __construct(array $moves)
    method getMoves (line 31) | public function getMoves()
    method getMovesStrings (line 41) | public function getMovesStrings()

FILE: src/Api/Pokemon/Pokemon.php
  class Pokemon (line 84) | class Pokemon extends Procedure
    method __construct (line 94) | public function __construct($pokemonData)
    method transfer (line 105) | public function transfer()
    method upgrade (line 136) | public function upgrade()
    method rename (line 168) | public function rename($name)
    method evolve (line 191) | public function evolve()
    method favorite (line 220) | public function favorite($favourite)
    method getData (line 244) | public function getData()
    method getRequestService (line 254) | protected function getRequestService()

FILE: src/Api/Pokemon/Support/BasePokemonRetriever.php
  class BasePokemonRetriever (line 7) | class BasePokemonRetriever
    method getPokemonFamilyId (line 16) | public static function getPokemonFamilyId($pokemonId)

FILE: src/Api/Pokemon/Support/CombatPointsCalculator.php
  class CombatPointsCalculator (line 5) | class CombatPointsCalculator
    method getLevel (line 14) | public static function getLevel($cpMuliplier)
    method getMaxCp (line 35) | public static function getMaxCp($baseAttack, $baseDefense, $baseStamina)
    method getCp (line 53) | public static function getCp($attack, $defense, $stamina, $cpMultiplier)
    method getMaxCpForPlayer (line 67) | public static function getMaxCpForPlayer($attack, $defense, $stamina, ...
    method getCpAfterPowerup (line 81) | public static function getCpAfterPowerup($cp, $cpMultiplier)
    method getCandyCostForPowerup (line 105) | public static function getCandyCostForPowerup($cpMultiplier, $powerups)
    method getStardustCostsForPowerup (line 131) | public static function getStardustCostsForPowerup($cpMultiplier, $powe...

FILE: src/Api/Pokemon/Support/PokemonDetailsTrait.php
  type PokemonDetailsTrait (line 14) | trait PokemonDetailsTrait
    method getFamilyId (line 22) | public function getFamilyId()
    method getType1String (line 35) | public function getType1String()
    method getType2String (line 48) | public function getType2String()
    method getMove1String (line 61) | public function getMove1String()
    method getMove2String (line 71) | public function getMove2String()
    method getCpAfterPowerup (line 81) | public function getCpAfterPowerup()
    method getCandyCostForPowerup (line 92) | public function getCandyCostForPowerup()
    method getStardustCostsForPowerup (line 103) | public function getStardustCostsForPowerup()
    method isInjured (line 114) | public function isInjured()
    method isFainted (line 124) | public function isFainted()
    method canEvolve (line 134) | public function canEvolve()
    method getEvolveStatus (line 144) | public function getEvolveStatus()
    method canUpgrade (line 171) | public function canUpgrade()
    method getUpgradeStatus (line 181) | public function getUpgradeStatus()
    method getBaseStamina (line 212) | public function getBaseStamina()
    method getBaseCaptureRate (line 225) | public function getBaseCaptureRate()
    method getCandiesToEvolve (line 238) | public function getCandiesToEvolve()
    method getBaseFleeRate (line 251) | public function getBaseFleeRate()
    method getName (line 264) | public function getName()
    method getLevel (line 274) | public function getLevel()
    method getIvRatio (line 282) | public function getIvRatio()
    method getCandies (line 293) | public function getCandies()
    method getPokedexEntry (line 303) | public function getPokedexEntry()
    method isDeployed (line 313) | public function isDeployed()
    method getMaxCpForPlayer (line 326) | public function getMaxCpForPlayer()
    method getNameOrNickname (line 346) | protected function getNameOrNickname()

FILE: src/Api/PokemonGoApi.php
  class PokemonGoApi (line 13) | class PokemonGoApi {
    method __construct (line 48) | public function __construct()
    method getInventory (line 62) | public function getInventory()
    method getProfile (line 72) | public function getProfile()
    method getJournal (line 80) | public function getJournal()
    method getMap (line 90) | public function getMap()
    method checkChallenge (line 100) | public function checkChallenge()
    method verifyChallenge (line 112) | public function verifyChallenge($token)
    method getRequestService (line 127) | public function getRequestService()
    method initialize (line 135) | protected function initialize()

FILE: src/Api/Procedure.php
  class Procedure (line 10) | abstract class Procedure
    method update (line 23) | public function update()
    method getData (line 33) | public function getData()
    method __call (line 48) | public function __call($name, $arguments)
    method getRequestService (line 63) | protected function getRequestService()

FILE: src/Api/Support/Enums/AbstractEnum.php
  class AbstractEnum (line 7) | abstract class AbstractEnum
    method name (line 26) | public static function name($id)
    method isValid (line 45) | public static function isValid($id)
    method getCachedEnumEntries (line 58) | protected static function getCachedEnumEntries()

FILE: src/Api/Support/Enums/GenericEnum.php
  class GenericEnum (line 7) | class GenericEnum
    method name (line 22) | public static function name($class, $id)
    method isValid (line 45) | public static function isValid($class, $id)
    method getCachedEnumEntries (line 59) | protected static function getCachedEnumEntries($class)

FILE: src/Api/Support/Enums/ItemId.php
  class ItemId (line 5) | class ItemId extends AbstractEnum

FILE: src/Api/Support/Enums/PokemonFamilyId.php
  class PokemonFamilyId (line 5) | class PokemonFamilyId extends AbstractEnum

FILE: src/Api/Support/Enums/PokemonId.php
  class PokemonId (line 5) | class PokemonId extends AbstractEnum

FILE: src/Api/Support/Enums/PokemonMove.php
  class PokemonMove (line 5) | class PokemonMove extends AbstractEnum

FILE: src/Api/Support/Enums/PokemonType.php
  class PokemonType (line 5) | class PokemonType extends AbstractEnum

FILE: src/Api/Support/Traits/MakeApiResourcesAvailable.php
  type MakeApiResourcesAvailable (line 14) | trait MakeApiResourcesAvailable {
    method pokeBank (line 21) | protected function pokeBank()
    method pokedex (line 31) | protected function pokedex()
    method candyBank (line 41) | protected function candyBank()
    method profile (line 51) | protected function profile()
    method inventory (line 61) | protected function inventory()
    method getPokemonGoApi (line 71) | protected function getPokemonGoApi()
    method getApplication (line 81) | protected function getApplication()

FILE: src/Api/Support/Traits/MakeDataPropertiesCallable.php
  type MakeDataPropertiesCallable (line 5) | trait MakeDataPropertiesCallable {
    method __call (line 11) | public function __call($name, $arguments)

FILE: src/Authentication/AccessToken.php
  class AccessToken (line 5) | class AccessToken {
    method __construct (line 45) | public function __construct($token, $provider, $timestamp = null, $ref...
    method getToken (line 56) | public function getToken()
    method setToken (line 64) | public function setToken($token)
    method getTimestamp (line 72) | public function getTimestamp()
    method setTimestamp (line 80) | public function setTimestamp($timestamp)
    method hasTimestamp (line 90) | public function hasTimestamp()
    method isTimestampValid (line 100) | public function isTimestampValid()
    method isValid (line 110) | public function isValid()
    method getRefreshToken (line 134) | public function getRefreshToken()
    method setRefreshToken (line 142) | public function setRefreshToken($refreshToken)
    method hasFreshToken (line 150) | public function hasFreshToken()
    method getProvider (line 158) | public function getProvider()

FILE: src/Authentication/Config/Config.php
  class Config (line 8) | class Config {
    method getUser (line 43) | public function getUser()
    method setUser (line 51) | public function setUser($user)
    method getPassword (line 59) | public function getPassword()
    method setPassword (line 67) | public function setPassword($password)
    method getAuthToken (line 75) | public function getAuthToken()
    method setAuthToken (line 83) | public function setAuthToken($authToken)
    method getRefreshToken (line 91) | public function getRefreshToken()
    method setRefreshToken (line 99) | public function setRefreshToken($refreshToken)
    method getOauthToken (line 107) | public function getOauthToken()
    method setOauthToken (line 115) | public function setOauthToken($oauthToken)
    method getProvider (line 123) | public function getProvider()
    method setProvider (line 131) | public function setProvider($provider)
    method isGoogle (line 139) | public function isGoogle()
    method isPTC (line 147) | public function isPTC()

FILE: src/Authentication/Contracts/Authenticator.php
  type Authenticator (line 5) | interface Authenticator {
    method authenticate (line 7) | public function authenticate();

FILE: src/Authentication/Exceptions/AuthenticationException.php
  class AuthenticationException (line 8) | class AuthenticationException extends Exception {
    method __construct (line 20) | public function __construct($message = '', $code = 0, Exception $previ...
    method shouldRetry (line 31) | public function shouldRetry()

FILE: src/Authentication/Exceptions/IllegalAuthenticationTypeException.php
  class IllegalAuthenticationTypeException (line 8) | class IllegalAuthenticationTypeException extends Exception {
    method __construct (line 17) | public function __construct($message = '', $code = 0, Exception $previ...

FILE: src/Authentication/Exceptions/ResponseException.php
  class ResponseException (line 8) | class ResponseException extends Exception {
    method __construct (line 17) | public function __construct($message = '', $code = 0, Exception $previ...

FILE: src/Authentication/Factory/Factory.php
  class Factory (line 17) | class Factory {
    method create (line 35) | public static function create($config)
    method createAuthenticationManager (line 49) | protected static function createAuthenticationManager($config)
    method createAuthenticationManagerByAccessToken (line 70) | protected static function createAuthenticationManagerByAccessToken($ac...
    method createGoogleManager (line 106) | protected static function createGoogleManager($config)
    method createPTCManager (line 135) | protected static function createPTCManager($config)
    method isAccessConfig (line 150) | protected static function isAccessConfig($config)
    method isAdaptedForGoogleAuthenticationCodeManager (line 161) | protected static function isAdaptedForGoogleAuthenticationCodeManager(...
    method isAdaptedForUserCredentialsManager (line 172) | protected static function isAdaptedForUserCredentialsManager($config)
    method isAdaptedForGoogleOauthToken (line 183) | protected static function isAdaptedForGoogleOauthToken($config)
    method isAdaptedForGoogleRefreshTokenManager (line 194) | protected static function isAdaptedForGoogleRefreshTokenManager($config)
    method createGoogleRefreshTokenManager (line 205) | protected static function createGoogleRefreshTokenManager($config)
    method createGoogleOauthManager (line 216) | protected static function createGoogleOauthManager($config)
    method createGoogleAuthenticationCodeManager (line 227) | protected static function createGoogleAuthenticationCodeManager($config)
    method createGoogleUserCredentialsManager (line 238) | protected static function createGoogleUserCredentialsManager($config)

FILE: src/Authentication/Manager.php
  class Manager (line 8) | abstract class Manager {
    method getAccessToken (line 30) | abstract public function getAccessToken();
    method getIdentifier (line 37) | abstract public function getIdentifier();
    method addListener (line 44) | public function addListener(Closure $listener)
    method dispatchEvent (line 55) | public function dispatchEvent($event, $data)
    method setAccessToken (line 67) | public function setAccessToken($accessToken)
    method refreshTokenIfPossible (line 78) | protected function refreshTokenIfPossible()
    method isAuthenticated (line 103) | protected function isAuthenticated()
    method isTokenValid (line 113) | protected function isTokenValid()
    method hasFreshToken (line 128) | protected function hasFreshToken()

FILE: src/Authentication/Managers/Google/AuthenticationCode/Authenticator.php
  class Authenticator (line 9) | class Authenticator {
    method loginByToken (line 22) | public function loginByToken($token)
    method identifier (line 35) | public function identifier()
    method getOauthTokenByAuthenticationCode (line 46) | protected function getOauthTokenByAuthenticationCode($authenticationCode)
    method client (line 56) | protected function client()

FILE: src/Authentication/Managers/Google/AuthenticationCode/Clients/AuthenticationClient.php
  class AuthenticationClient (line 11) | class AuthenticationClient {
    method getOauthTokenByAuthenticationCode (line 54) | public function getOauthTokenByAuthenticationCode($authenticationCode)
    method post (line 81) | protected function post($url, $parameters = array())
    method client (line 95) | protected function client()

FILE: src/Authentication/Managers/Google/AuthenticationCode/Parsers/OauthTokenParser.php
  class OauthTokenParser (line 13) | class OauthTokenParser extends Parser {
    method __construct (line 18) | public function __construct()
    method parse (line 29) | public function parse($response)
    method validateResponse (line 58) | protected function validateResponse($response)
    method isTokenAlreadyRedeemed (line 92) | protected function isTokenAlreadyRedeemed($content)
    method isTokenInvalid (line 103) | protected function isTokenInvalid($content)

FILE: src/Authentication/Managers/Google/AuthenticationCode/Parsers/Parser.php
  class Parser (line 11) | abstract class Parser {
    method __construct (line 38) | public function __construct($dom = null)
    method parse (line 49) | abstract public function parse($content);
    method validateResponse (line 57) | protected function validateResponse($response)
    method isServerError (line 78) | protected function isServerError($response)

FILE: src/Authentication/Managers/Google/AuthenticationCode/Parsers/Results/AuthenticationTokenResult.php
  class AuthenticationTokenResult (line 5) | class AuthenticationTokenResult extends Result {
    method getToken (line 12) | public function getToken()
    method getRefreshToken (line 22) | public function getRefreshToken()
    method getExpiryTimestamp (line 32) | public function getExpiryTimestamp()

FILE: src/Authentication/Managers/Google/AuthenticationCode/Parsers/Results/Result.php
  class Result (line 5) | class Result {
    method __construct (line 17) | public function __construct($data)
    method getData (line 25) | public function getData()
    method setData (line 33) | public function setData($data)

FILE: src/Authentication/Managers/Google/AuthenticationCodeManager.php
  class AuthenticationCodeManager (line 9) | class AuthenticationCodeManager extends Manager {
    method __construct (line 21) | public function __construct($authenticationCode)
    method getAccessToken (line 31) | public function getAccessToken()
    method getIdentifier (line 59) | public function getIdentifier()
    method authenticator (line 69) | protected function authenticator()

FILE: src/Authentication/Managers/Google/AuthenticationCredentials/Authenticator.php
  class Authenticator (line 10) | class Authenticator {
    method login (line 24) | public function login($email, $password)
    method identifier (line 45) | public function identifier()
    method getAuthenticationToken (line 57) | protected function getAuthenticationToken($email, $password)
    method getOauthTokenByUserCredentials (line 69) | protected function getOauthTokenByUserCredentials($email, $token)
    method client (line 79) | protected function client()

FILE: src/Authentication/Managers/Google/AuthenticationCredentials/Clients/AuthenticationClient.php
  class AuthenticationClient (line 14) | class AuthenticationClient
    method getAuthenticationToken (line 54) | public function getAuthenticationToken($email, $password)
    method getOauthTokenByUserCredentials (line 90) | public function getOauthTokenByUserCredentials($email, $token)
    method post (line 124) | protected function post($url, $parameters = array())
    method options (line 139) | protected function options($options = array())
    method client (line 149) | protected function client()

FILE: src/Authentication/Managers/Google/AuthenticationCredentials/Parsers/OauthTokenParser.php
  class OauthTokenParser (line 10) | class OauthTokenParser extends Parser {
    method __construct (line 15) | public function __construct()
    method parse (line 26) | public function parse($response)
    method parseAuthId (line 46) | protected function parseAuthId($content)
    method parseExpiryTimestamp (line 61) | protected function parseExpiryTimestamp($content)

FILE: src/Authentication/Managers/Google/AuthenticationCredentials/Parsers/Parser.php
  class Parser (line 11) | abstract class Parser {
    method __construct (line 38) | public function __construct($dom = null)
    method parse (line 49) | abstract public function parse($content);
    method validateResponse (line 57) | protected function validateResponse($response)
    method isServerError (line 78) | protected function isServerError($response)

FILE: src/Authentication/Managers/Google/AuthenticationCredentials/Parsers/Results/AuthenticationTokenResult.php
  class AuthenticationTokenResult (line 6) | class AuthenticationTokenResult extends Result {
    method getToken (line 13) | public function getToken()
    method getAuthId (line 23) | public function getAuthId()
    method getExpiryTimestamp (line 33) | public function getExpiryTimestamp()

FILE: src/Authentication/Managers/Google/AuthenticationCredentials/Parsers/Results/Result.php
  class Result (line 6) | class Result {
    method __construct (line 18) | public function __construct($data)
    method getData (line 26) | public function getData()
    method setData (line 34) | public function setData($data)

FILE: src/Authentication/Managers/Google/AuthenticationCredentials/Parsers/TokenParser.php
  class TokenParser (line 12) | class TokenParser extends Parser {
    method __construct (line 17) | public function __construct()
    method parse (line 30) | public function parse($response)
    method parseToken (line 58) | protected function parseToken($content)

FILE: src/Authentication/Managers/Google/AuthenticationCredentials/Support/Signature.php
  class Signature (line 8) | class Signature {
    method create (line 22) | public static function create($email, $password)
    method modulus (line 52) | protected static function modulus($binaryKey)
    method exponent (line 65) | protected static function exponent($binaryKey)
    method signature (line 75) | protected static function signature()
    method encrypt (line 91) | protected static function encrypt($email, $password, $modulus, $exponent)

FILE: src/Authentication/Managers/Google/AuthenticationCredentialsManager.php
  class AuthenticationCredentialsManager (line 10) | class AuthenticationCredentialsManager extends Manager {
    method __construct (line 28) | public function __construct($email, $password)
    method getAccessToken (line 39) | public function getAccessToken()
    method getIdentifier (line 66) | public function getIdentifier()
    method refreshTokenIfPossible (line 77) | protected function refreshTokenIfPossible()
    method authenticator (line 102) | protected function authenticator()

FILE: src/Authentication/Managers/Google/AuthenticationOauthTokenManager.php
  class AuthenticationOauthTokenManager (line 8) | class AuthenticationOauthTokenManager extends Manager {
    method __construct (line 20) | public function __construct($token)
    method getAccessToken (line 34) | public function getAccessToken()
    method getIdentifier (line 51) | public function getIdentifier()

FILE: src/Authentication/Managers/Google/AuthenticationRefreshToken/Authenticator.php
  class Authenticator (line 9) | class Authenticator {
    method loginByRefreshToken (line 22) | public function loginByRefreshToken($token)
    method identifier (line 35) | public function identifier()
    method getOauthTokenByAuthenticationRefreshToken (line 46) | protected function getOauthTokenByAuthenticationRefreshToken($Authenti...
    method client (line 56) | protected function client()

FILE: src/Authentication/Managers/Google/AuthenticationRefreshToken/Clients/AuthenticationClient.php
  class AuthenticationClient (line 13) | class AuthenticationClient
    method __construct (line 59) | public function __construct()
    method getOauthTokenByAuthenticationRefreshToken (line 70) | public function getOauthTokenByAuthenticationRefreshToken($token)
    method post (line 98) | protected function post($url, $parameters = array())
    method options (line 113) | protected function options($options = array())
    method client (line 123) | protected function client()

FILE: src/Authentication/Managers/Google/AuthenticationRefreshToken/Parsers/OauthTokenParser.php
  class OauthTokenParser (line 11) | class OauthTokenParser extends Parser {
    method __construct (line 16) | public function __construct()
    method parse (line 27) | public function parse($response)
    method validateResponse (line 55) | protected function validateResponse($response)
    method isTokenAlreadyRedeemed (line 89) | protected function isTokenAlreadyRedeemed($content)
    method isTokenInvalid (line 100) | protected function isTokenInvalid($content)

FILE: src/Authentication/Managers/Google/AuthenticationRefreshToken/Parsers/Parser.php
  class Parser (line 11) | abstract class Parser {
    method __construct (line 38) | public function __construct($dom = null)
    method parse (line 49) | abstract public function parse($content);
    method validateResponse (line 57) | protected function validateResponse($response)
    method isServerError (line 78) | protected function isServerError($response)

FILE: src/Authentication/Managers/Google/AuthenticationRefreshToken/Parsers/Results/AuthenticationTokenResult.php
  class AuthenticationTokenResult (line 5) | class AuthenticationTokenResult extends Result {
    method getToken (line 12) | public function getToken()
    method getExpiryTimestamp (line 22) | public function getExpiryTimestamp()

FILE: src/Authentication/Managers/Google/AuthenticationRefreshToken/Parsers/Results/Result.php
  class Result (line 5) | class Result
    method __construct (line 18) | public function __construct($data)
    method getData (line 26) | public function getData()
    method setData (line 34) | public function setData($data)

FILE: src/Authentication/Managers/Google/AuthenticationRefreshTokenManager.php
  class AuthenticationRefreshTokenManager (line 9) | class AuthenticationRefreshTokenManager extends Manager {
    method __construct (line 21) | public function __construct($token)
    method getAccessToken (line 31) | public function getAccessToken()
    method getIdentifier (line 62) | public function getIdentifier()
    method authenticator (line 72) | protected function authenticator()

FILE: src/Authentication/Managers/PTC/AuthenticationCredentials/Authenticator.php
  class Authenticator (line 10) | class Authenticator {
    method login (line 24) | public function login($username, $password)
    method identifier (line 47) | public function identifier()
    method client (line 57) | protected function client()

FILE: src/Authentication/Managers/PTC/AuthenticationCredentials/Clients/AuthenticationClient.php
  class AuthenticationClient (line 18) | class AuthenticationClient {
    method __construct (line 43) | public function __construct()
    method authenticationInformation (line 53) | public function authenticationInformation()
    method ticket (line 73) | public function ticket($username, $password, $authenticationInformation)
    method token (line 100) | public function token($ticket)
    method get (line 129) | protected function get($url, $parameters = array())
    method post (line 145) | protected function post($url, $parameters = array())
    method options (line 160) | protected function options($options = array())
    method client (line 170) | protected function client()

FILE: src/Authentication/Managers/PTC/AuthenticationCredentials/Parsers/AuthenticationInformationParser.php
  class AuthenticationInformationParser (line 11) | class AuthenticationInformationParser extends Parser {
    method __construct (line 16) | public function __construct()
    method parse (line 28) | public function parse($response)
    method content (line 50) | protected function content($response)

FILE: src/Authentication/Managers/PTC/AuthenticationCredentials/Parsers/Parser.php
  class Parser (line 11) | abstract class Parser
    method __construct (line 34) | public function __construct($dom = null)
    method parse (line 45) | abstract public function parse($content);
    method validateResponse (line 51) | protected function validateResponse($response)
    method isSuccessfulResponse (line 71) | protected function isSuccessfulResponse($response)
    method isRedirect (line 82) | protected function isRedirect($response)

FILE: src/Authentication/Managers/PTC/AuthenticationCredentials/Parsers/Results/AuthenticationInformationResult.php
  class AuthenticationInformationResult (line 5) | class AuthenticationInformationResult extends Result {
    method getLtCode (line 12) | public function getLtCode()
    method getExecutionCode (line 20) | public function getExecutionCode()

FILE: src/Authentication/Managers/PTC/AuthenticationCredentials/Parsers/Results/Result.php
  class Result (line 5) | class Result {
    method __construct (line 17) | public function __construct($data)
    method getData (line 25) | public function getData()
    method setData (line 33) | public function setData($data)

FILE: src/Authentication/Managers/PTC/AuthenticationCredentials/Parsers/Results/TicketResult.php
  class TicketResult (line 5) | class TicketResult extends Result {
    method getTicket (line 12) | public function getTicket()

FILE: src/Authentication/Managers/PTC/AuthenticationCredentials/Parsers/Results/TokenResult.php
  class TokenResult (line 5) | class TokenResult extends Result {
    method getToken (line 12) | public function getToken()
    method getTimestamp (line 22) | public function getTimestamp()

FILE: src/Authentication/Managers/PTC/AuthenticationCredentials/Parsers/TicketParser.php
  class TicketParser (line 13) | class TicketParser extends Parser {
    method __construct (line 18) | public function __construct()
    method parse (line 31) | public function parse($response)
    method parseContent (line 70) | protected function parseContent($response)
    method parseTicket (line 92) | protected function parseTicket($location)

FILE: src/Authentication/Managers/PTC/AuthenticationCredentials/Parsers/TokenParser.php
  class TokenParser (line 11) | class TokenParser extends Parser {
    method __construct (line 16) | public function __construct()
    method parse (line 28) | public function parse($response)
    method parseToken (line 58) | protected function parseToken($content)
    method parseExpiresTimestamp (line 73) | protected function parseExpiresTimestamp($content)

FILE: src/Authentication/Managers/PTC/AuthenticationCredentialsManager.php
  class AuthenticationCredentialsManager (line 9) | class AuthenticationCredentialsManager extends Manager {
    method __construct (line 27) | public function __construct($username, $password)
    method getAccessToken (line 38) | public function getAccessToken()
    method getIdentifier (line 65) | public function getIdentifier()
    method refreshTokenIfPossible (line 76) | protected function refreshTokenIfPossible()
    method authenticator (line 101) | protected function authenticator()

FILE: src/Authentication/Managers/PTC/AuthenticationOauthTokenManager.php
  class AuthenticationOauthTokenManager (line 13) | class AuthenticationOauthTokenManager extends Manager
    method __construct (line 20) | public function __construct(AccessToken $token)
    method getAccessToken (line 25) | public function getAccessToken()
    method getIdentifier (line 32) | public function getIdentifier()

FILE: src/Clients/Proxies/ClientProxy.php
  class ClientProxy (line 16) | class ClientProxy implements ClientInterface
    method __construct (line 34) | public function __construct($client)
    method send (line 48) | public function send(RequestInterface $request, array $options = [])
    method sendAsync (line 61) | public function sendAsync(RequestInterface $request, array $options = [])
    method request (line 78) | public function request($method, $uri, array $options = [])
    method requestAsync (line 95) | public function requestAsync($method, $uri, array $options = [])
    method getConfig (line 109) | public function getConfig($option = null)
    method __call (line 119) | public function __call($method, $args)
    method options (line 139) | protected function options($options)

FILE: src/Facades/App.php
  class App (line 7) | class App extends StaticProxy {
    method getInstanceIdentifier (line 15) | public static function getInstanceIdentifier()

FILE: src/Facades/Log.php
  class Log (line 7) | class Log extends StaticProxy {
    method getInstanceIdentifier (line 15) | public static function getInstanceIdentifier()

FILE: src/Handlers/RequestHandler.php
  class RequestHandler (line 24) | class RequestHandler
    method __construct (line 97) | public function __construct($application)
    method handle (line 117) | public function handle($request, $retry = 0)
    method validateResponseEnvelope (line 176) | protected function validateResponseEnvelope($response)
    method reinitializeSession (line 201) | protected function reinitializeSession($authenticationInformation)
    method build (line 214) | protected function build($request)
    method call (line 249) | protected function call($requestEnvelope)
    method unmarshall (line 283) | protected function unmarshall($response)
    method session (line 300) | protected function session($response)
    method validateSession (line 322) | protected function validateSession()
    method hasAuthenticationError (line 346) | protected function hasAuthenticationError($responseEnvelop)
    method isAccountBannedError (line 357) | protected function isAccountBannedError($responseEnvelop)
    method isHandshake (line 368) | protected function isHandshake($responseEnvelop)
    method isThrottledResponse (line 379) | protected function isThrottledResponse($responseEnvelop)
    method isUnknownResponse (line 390) | protected function isUnknownResponse($responseEnvelop)
    method isServerError (line 401) | protected function isServerError($response)
    method requestId (line 414) | protected function requestId()
    method validateResponse (line 425) | protected function validateResponse($response)
    method prepareAuthentication (line 441) | protected function prepareAuthentication($requestEnvelope)
    method manager (line 458) | protected function manager()
    method client (line 468) | protected function client()

FILE: src/Handlers/RequestHandler/Exceptions/AuthenticationException.php
  class AuthenticationException (line 7) | class AuthenticationException extends \Exception {
    method __construct (line 16) | public function __construct($message = '', $code = 0, Exception $previ...

FILE: src/Handlers/RequestHandler/Exceptions/ResponseException.php
  class ResponseException (line 7) | class ResponseException extends \Exception {
    method __construct (line 16) | public function __construct($message = '', $code = 0, Exception $previ...

FILE: src/Handlers/Session.php
  class Session (line 8) | class Session {
    method isValid (line 30) | public function isValid()
    method getAuthenticationTicket (line 51) | public function getAuthenticationTicket()
    method setAuthenticationTicket (line 59) | public function setAuthenticationTicket($authenticationTicket)
    method getAuthenticationInformation (line 67) | public function getAuthenticationInformation()
    method setAuthenticationInformation (line 75) | public function setAuthenticationInformation($authenticationInformation)
    method getApiUrl (line 83) | public function getApiUrl()
    method setApiUrl (line 91) | public function setApiUrl($apiUrl)

FILE: src/Kernels/ApplicationKernel.php
  class ApplicationKernel (line 14) | class ApplicationKernel extends Kernel
    method __construct (line 32) | public function __construct($manager)
    method initialize (line 46) | public function initialize()
    method setClient (line 62) | public function setClient($client)
    method getPokemonGoApi (line 73) | public function getPokemonGoApi()
    method setLocation (line 83) | public function setLocation($location)
    method getLocation (line 91) | public function getLocation()
    method getManager (line 99) | public function getManager()
    method initializeClient (line 107) | public function initializeClient()
    method addFacades (line 115) | protected function addFacades()
    method addServiceProviders (line 125) | protected function addServiceProviders()

FILE: src/Kernels/Kernel.php
  class Kernel (line 19) | class Kernel implements ContainerInterface
    method __construct (line 40) | public function __construct()
    method get (line 57) | public function get($id)
    method has (line 69) | public function has($id)
    method register (line 79) | public function register($provider)
    method setLogger (line 89) | public function setLogger(LoggerInterface $logger)
    method initialize (line 97) | protected function initialize()
    method addFacades (line 112) | protected function addFacades()
    method initializeContainer (line 121) | protected function initializeContainer()
    method initializeProxyManager (line 133) | protected function initializeProxyManager()
    method container (line 149) | public function container()
    method initializeServiceProviders (line 157) | protected function initializeServiceProviders()
    method initializeLogger (line 170) | protected function initializeLogger()

FILE: src/Providers/PokemonGoApiServiceProvider.php
  class PokemonGoApiServiceProvider (line 8) | class PokemonGoApiServiceProvider extends ServiceProvider {
    method register (line 15) | public function register()

FILE: src/Providers/RequestHandlerServiceProvider.php
  class RequestHandlerServiceProvider (line 11) | class RequestHandlerServiceProvider extends ServiceProvider {
    method __construct (line 18) | public function __construct($app)
    method register (line 28) | public function register()

FILE: src/Providers/ServiceProvider.php
  class ServiceProvider (line 7) | abstract class ServiceProvider {
    method __construct (line 19) | public function __construct($app)
    method register (line 29) | abstract public function register();

FILE: src/Requests/AuthenticateRequest.php
  class AuthenticateRequest (line 8) | class AuthenticateRequest extends Request
    method getType (line 14) | public function getType()
    method getMessage (line 22) | public function getMessage()
    method handleResponse (line 31) | public function handleResponse($data)

FILE: src/Requests/CheckChallengeRequest.php
  class CheckChallengeRequest (line 10) | class CheckChallengeRequest extends Request
    method getType (line 26) | public function getType()
    method getMessage (line 34) | public function getMessage()
    method handleResponse (line 45) | public function handleResponse($data)

FILE: src/Requests/Envelops/AuthInfoEnvelope.php
  class AuthInfoEnvelope (line 6) | class AuthInfoEnvelope {

FILE: src/Requests/Envelops/Factory.php
  class Factory (line 10) | class Factory {
    method create (line 24) | public function create($type, ...$parameters)
    method authInfoEnvelope (line 47) | protected function authInfoEnvelope($type, $token)

FILE: src/Requests/EvolvePokemonRequest.php
  class EvolvePokemonRequest (line 11) | class EvolvePokemonRequest extends Request {
    method __construct (line 33) | public function __construct($pokemonId)
    method getType (line 41) | public function getType()
    method getMessage (line 49) | public function getMessage()
    method handleResponse (line 63) | public function handleResponse($data)

FILE: src/Requests/FortSearchRequest.php
  class FortSearchRequest (line 14) | class FortSearchRequest extends Request {
    method __construct (line 48) | public function __construct($id, $latitude, $longitude)
    method getType (line 58) | public function getType()
    method getMessage (line 66) | public function getMessage()
    method handleResponse (line 86) | public function handleResponse($data)
    method getCurrentLatitude (line 105) | protected function getCurrentLatitude()
    method getCurrentLongitude (line 115) | protected function getCurrentLongitude()
    method getApplication (line 125) | protected function getApplication()

FILE: src/Requests/GetInventoryRequest.php
  class GetInventoryRequest (line 11) | class GetInventoryRequest extends Request {
    method getType (line 26) | public function getType()
    method getMessage (line 34) | public function getMessage()
    method handleResponse (line 45) | public function handleResponse($data)

FILE: src/Requests/GetJournalRequest.php
  class GetJournalRequest (line 10) | class GetJournalRequest extends Request {
    method getType (line 25) | public function getType()
    method getMessage (line 33) | public function getMessage()
    method handleResponse (line 44) | public function handleResponse($data)

FILE: src/Requests/GetMapResourcesRequest.php
  class GetMapResourcesRequest (line 11) | class GetMapResourcesRequest extends Request {
    method __construct (line 45) | public function __construct($latitude, $longitude, $cellIds)
    method getType (line 55) | public function getType()
    method getMessage (line 63) | public function getMessage()
    method handleResponse (line 84) | public function handleResponse($data)

FILE: src/Requests/GetPlayerRequest.php
  class GetPlayerRequest (line 11) | class GetPlayerRequest extends Request {
    method getType (line 26) | public function getType()
    method getMessage (line 34) | public function getMessage()
    method handleResponse (line 45) | public function handleResponse($data)

FILE: src/Requests/RecycleInventoryItemRequest.php
  class RecycleInventoryItemRequest (line 11) | class RecycleInventoryItemRequest extends Request
    method __construct (line 40) | public function __construct($itemId, $count)
    method getType (line 49) | public function getType()
    method getMessage (line 57) | public function getMessage()
    method handleResponse (line 72) | public function handleResponse($data)

FILE: src/Requests/RenamePokemonRequest.php
  class RenamePokemonRequest (line 11) | class RenamePokemonRequest extends Request {
    method __construct (line 39) | public function __construct($pokemonId, $name)
    method getType (line 48) | public function getType()
    method getMessage (line 56) | public function getMessage()
    method handleResponse (line 71) | public function handleResponse($data)

FILE: src/Requests/Request.php
  class Request (line 8) | abstract class Request {
    method getType (line 18) | abstract public function getType();
    method getMessage (line 23) | abstract public function getMessage();
    method handleResponse (line 29) | abstract public function handleResponse($data);
    method getData (line 34) | public function getData()
    method setData (line 42) | public function setData($data)

FILE: src/Requests/SetFavoritePokemonRequest.php
  class SetFavoritePokemonRequest (line 11) | class SetFavoritePokemonRequest extends Request
    method __construct (line 40) | public function __construct($pokemonId, $favorite)
    method getType (line 49) | public function getType()
    method getMessage (line 57) | public function getMessage()
    method handleResponse (line 72) | public function handleResponse($data)

FILE: src/Requests/TransferPokemonRequest.php
  class TransferPokemonRequest (line 11) | class TransferPokemonRequest extends Request {
    method __construct (line 33) | public function __construct($pokemonId)
    method getType (line 41) | public function getType()
    method getMessage (line 49) | public function getMessage()
    method handleResponse (line 63) | public function handleResponse($data)

FILE: src/Requests/UpgradePokemonRequest.php
  class UpgradePokemonRequest (line 11) | class UpgradePokemonRequest extends Request {
    method __construct (line 33) | public function __construct($pokemonId)
    method getType (line 41) | public function getType()
    method getMessage (line 49) | public function getMessage()
    method handleResponse (line 63) | public function handleResponse($data)

FILE: src/Requests/UseIncenseRequest.php
  class UseIncenseRequest (line 11) | class UseIncenseRequest extends Request {
    method __construct (line 33) | public function __construct($itemId)
    method getType (line 41) | public function getType()
    method getMessage (line 49) | public function getMessage()
    method handleResponse (line 63) | public function handleResponse($data)

FILE: src/Requests/UseItemXpBoostRequest.php
  class UseItemXpBoostRequest (line 11) | class UseItemXpBoostRequest extends Request {
    method __construct (line 33) | public function __construct($itemId)
    method getType (line 41) | public function getType()
    method getMessage (line 49) | public function getMessage()
    method handleResponse (line 63) | public function handleResponse($data)

FILE: src/Requests/VerifyChallengeRequest.php
  class VerifyChallengeRequest (line 10) | class VerifyChallengeRequest extends Request {
    method __construct (line 32) | public function __construct($token)
    method getType (line 40) | public function getType()
    method getMessage (line 48) | public function getMessage()
    method handleResponse (line 62) | public function handleResponse($data)

FILE: src/Services/Request/CheckChallengeRequestService.php
  class CheckChallengeRequestService (line 10) | class CheckChallengeRequestService extends RequestService {
    method checkChallenge (line 18) | public function checkChallenge()

FILE: src/Services/Request/InventoryRequestService.php
  class InventoryRequestService (line 16) | class InventoryRequestService extends RequestService {
    method getInventory (line 23) | public function getInventory()
    method recycle (line 39) | public function recycle($itemId, $count)
    method useIncense (line 54) | public function useIncense($itemId)
    method useItemXpBoost (line 69) | public function useItemXpBoost($itemId)

FILE: src/Services/Request/JournalRequestService.php
  class JournalRequestService (line 10) | class JournalRequestService extends RequestService {
    method getJournal (line 18) | public function getJournal()

FILE: src/Services/Request/MapRequestService.php
  class MapRequestService (line 10) | class MapRequestService extends RequestService {
    method getResources (line 22) | public function getResources($latitude, $longitude, $mapCellIds)

FILE: src/Services/Request/PlayerRequestService.php
  class PlayerRequestService (line 10) | class PlayerRequestService extends RequestService {
    method getPlayer (line 18) | public function getPlayer()

FILE: src/Services/Request/PokemonRequestService.php
  class PokemonRequestService (line 20) | class PokemonRequestService extends RequestService {
    method transfer (line 30) | public function transfer($pokemonId)
    method rename (line 46) | public function rename($pokemonId, $name)
    method envolve (line 63) | public function envolve($pokemonId)
    method upgrade (line 80) | public function upgrade($pokemonId)
    method favorite (line 98) | public function favorite($pokemonId, $fav)

FILE: src/Services/Request/PokestopRequestService.php
  class PokestopRequestService (line 18) | class PokestopRequestService extends RequestService {
    method spin (line 30) | public function spin($id, $latitude, $longitude)

FILE: src/Services/RequestService.php
  class RequestService (line 9) | class RequestService {
    method requestHandler (line 17) | public function requestHandler()
    method getContainer (line 27) | protected function getContainer()

FILE: tests/Api/Pokemon/PokemonTest.php
  class PokemonTest (line 19) | class PokemonTest extends \PHPUnit_Framework_TestCase
    method buildCandyMockedPokemon (line 31) | protected function buildCandyMockedPokemon(PokemonItem $pokemonItem, C...
    method buildLevelStardustCandyMockedPokemon (line 53) | protected function buildLevelStardustCandyMockedPokemon(PokemonItem $p...
    method testIsDeployed (line 101) | public function testIsDeployed(PokemonItem $pokemonItem, $deploymentSt...
    method providerDeployedPokemon (line 112) | public function providerDeployedPokemon()
    method testCanEvolve (line 130) | public function testCanEvolve(Pokemon $pokemon, $evolvability)
    method providerEvolvePokemon (line 140) | public function providerEvolvePokemon()
    method testCanUpgrade (line 171) | public function testCanUpgrade(Pokemon $pokemon, $upgradeability)
    method providerUpgradePokemon (line 181) | public function providerUpgradePokemon()
Condensed preview — 171 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (896K chars).
[
  {
    "path": ".gitattributes",
    "chars": 293,
    "preview": "# Path-based git attributes\n# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html\n\n# Ignore all test and"
  },
  {
    "path": ".gitignore",
    "chars": 51,
    "preview": ".env\nvendor\ncomposer.lock\nstorage/logs\n.idea\nbuild\n"
  },
  {
    "path": "LICENSE.txt",
    "chars": 1305,
    "preview": "Copyright (c) 2016, Nicklas Wallgren\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or wi"
  },
  {
    "path": "README.md",
    "chars": 2075,
    "preview": "# PokemonGoAPI-PHP\n\n[![Total Downloads][ico-downloads]][link-packagist]\n[![PHP7 Ready](https://img.shields.io/badge/PHP7"
  },
  {
    "path": "composer.json",
    "chars": 958,
    "preview": "{\n    \"name\": \"nicklasw/pkm-go-api\",\n    \"description\": \"The Pokemon Go API library.\",\n    \"keywords\": [\"Pokemon Go API\""
  },
  {
    "path": "examples/AuthenticationExample.php",
    "chars": 2179,
    "preview": "<?php\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\nuse NicklasW\\PkmGoApi\\Authentication\\AccessToken;\nuse NicklasW\\PkmG"
  },
  {
    "path": "examples/CheckChallengeExample.php",
    "chars": 5877,
    "preview": "<?php\nrequire __DIR__ . '/../vendor/autoload.php';\n\nuse NicklasW\\PkmGoApi\\Authentication\\AccessToken;\nuse NicklasW\\PkmGo"
  },
  {
    "path": "examples/GUI_BestCpPokemonDetails.php",
    "chars": 4228,
    "preview": "<?php\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\nuse NicklasW\\PkmGoApi\\Authentication\\Config\\Config;\nuse NicklasW\\Pk"
  },
  {
    "path": "examples/ProxyExample.php",
    "chars": 1332,
    "preview": "<?php\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\nuse NicklasW\\PkmGoApi\\Authentication\\Config\\"
  },
  {
    "path": "examples/ReleaseOnePidgeExample.php",
    "chars": 1475,
    "preview": "<?php\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\nuse NicklasW\\PkmGoApi\\Authentication\\Config\\Config;\nuse NicklasW\\Pk"
  },
  {
    "path": "examples/RetrieveAppliedItemsExample.php",
    "chars": 1551,
    "preview": "<?php\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\nuse NicklasW\\PkmGoApi\\Api\\Player\\Data\\Inventory\\ItemMetaRegistry;\nu"
  },
  {
    "path": "examples/RetrieveJournalExample.php",
    "chars": 2115,
    "preview": "<?php\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\nuse NicklasW\\PkmGoApi\\Api\\Support\\Enums\\ItemId;\nuse NicklasW\\PkmGoA"
  },
  {
    "path": "examples/RetrievePlayerPokedexExample.php",
    "chars": 1770,
    "preview": "<?php\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\nuse NicklasW\\PkmGoApi\\Api\\Pokemon\\Data\\PokemonMetaRegistry;\nuse Nic"
  },
  {
    "path": "examples/RetrievePlayerProfileExample.php",
    "chars": 1153,
    "preview": "<?php\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\nuse NicklasW\\PkmGoApi\\Authentication\\Config\\Config;\nuse NicklasW\\Pk"
  },
  {
    "path": "examples/RetrievePlayerStatsExample.php",
    "chars": 1155,
    "preview": "<?php\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\nuse NicklasW\\PkmGoApi\\Authentication\\Config\\Config;\nuse NicklasW\\Pk"
  },
  {
    "path": "examples/RetrievePokemonCandyCountExample.php",
    "chars": 1327,
    "preview": "<?php\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\nuse NicklasW\\PkmGoApi\\Authentication\\Config\\Config;\nuse NicklasW\\Pk"
  },
  {
    "path": "examples/RetrievePokemonCountExample.php",
    "chars": 1315,
    "preview": "<?php\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\nuse NicklasW\\PkmGoApi\\Authentication\\Config\\Config;\nuse NicklasW\\Pk"
  },
  {
    "path": "examples/RetrievePokemonTraitExample.php",
    "chars": 1600,
    "preview": "<?php\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\nuse NicklasW\\PkmGoApi\\Authentication\\Config\\Config;\nuse NicklasW\\Pk"
  },
  {
    "path": "examples/VerifyChallengeExample.php",
    "chars": 5040,
    "preview": "<?php\nrequire __DIR__ . '/../vendor/autoload.php';\n\nuse NicklasW\\PkmGoApi\\Authentication\\AccessToken;\nuse NicklasW\\PkmGo"
  },
  {
    "path": "includes/config.php",
    "chars": 963,
    "preview": "<?php\n\nuse Illuminate\\Support\\Str;\n\nif (!function_exists('env')) {\n    /**\n     * Gets the value of an environment varia"
  },
  {
    "path": "includes/protocolbuffers.inc.php",
    "chars": 29597,
    "preview": "<?php\n/****\n * PHP Protocol Buffer Parser\n * https://github.com/bramp/protoc-gen-php\n * Licence (Simplified BSD License)"
  },
  {
    "path": "phpunit.xml.dist",
    "chars": 819,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit bootstrap=\"vendor/autoload.php\"\n         backupGlobals=\"false\"\n         "
  },
  {
    "path": "src/Api/Data/Data.php",
    "chars": 2962,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Data;\n\nuse Google\\Protobuf\\Internal\\Message;\nuse ReflectionClass;\n\nabstract class"
  },
  {
    "path": "src/Api/Data/Device.php",
    "chars": 1017,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Data;\n\nclass Device extends Data\n{\n    /**\n     * @var string\n     */\n    protect"
  },
  {
    "path": "src/Api/Data/Location.php",
    "chars": 642,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Data;\n\n/**\n * @method void setLatitude(double $latitude)\n * @method void setLongi"
  },
  {
    "path": "src/Api/Map/Data/Resource.php",
    "chars": 4443,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Map\\Data;\n\nuse GetMapObjectsResponse;\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\nuse Ni"
  },
  {
    "path": "src/Api/Map/Data/Resources/CatchablePokemon.php",
    "chars": 590,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Api\\Map\\Data\\Resources;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\nuse POGOProtos\\Enums\\P"
  },
  {
    "path": "src/Api/Map/Data/Resources/Fort.php",
    "chars": 2708,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Map\\Data\\Resources;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\nuse POGOProtos\\Enums\\Po"
  },
  {
    "path": "src/Api/Map/Data/Resources/NearbyPokemon.php",
    "chars": 380,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Map\\Data\\Resources;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\nuse POGOProtos\\Enums\\Po"
  },
  {
    "path": "src/Api/Map/Data/Resources/SpawnPoint.php",
    "chars": 151,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Map\\Data\\Resources;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\n\nclass SpawnPoint exten"
  },
  {
    "path": "src/Api/Map/Data/Resources/WildPokemon.php",
    "chars": 900,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Api\\Map\\Data\\Resources;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\n\nclass WildPokemon ext"
  },
  {
    "path": "src/Api/Map/Data/Results/PokestopSpinResult.php",
    "chars": 1905,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Map\\Data\\Results;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\nuse POGOProtos\\Networking"
  },
  {
    "path": "src/Api/Map/Map.php",
    "chars": 2049,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Map;\n\nuse Exception;\nuse NicklasW\\PkmGoApi\\Api\\Map\\Data\\Resource;\nuse NicklasW\\Pk"
  },
  {
    "path": "src/Api/Map/Pokestop.php",
    "chars": 4368,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Map;\n\nuse NicklasW\\PkmGoApi\\Api\\Map\\Data\\Resources\\Fort;\nuse NicklasW\\PkmGoApi\\Ap"
  },
  {
    "path": "src/Api/Map/Support/S2.php",
    "chars": 1228,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Map\\Support;\n\nuse S2\\S2CellId;\nuse S2\\S2LatLng;\n\nclass S2 {\n\n    /**\n     * Retur"
  },
  {
    "path": "src/Api/Player/CheckChallenge.php",
    "chars": 1022,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player;\n\nuse NicklasW\\PkmGoApi\\Api\\Player\\Data\\CheckChallenge\\CheckChallengeData;"
  },
  {
    "path": "src/Api/Player/Data/CheckChallenge/CheckChallengeData.php",
    "chars": 979,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\CheckChallenge;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\nuse POGOProtos\\"
  },
  {
    "path": "src/Api/Player/Data/Inventory/AppliedItem.php",
    "chars": 797,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Inventory;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\nuse POGOProtos\\Inven"
  },
  {
    "path": "src/Api/Player/Data/Inventory/AppliedItems.php",
    "chars": 1280,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Inventory;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\nuse POGOProtos\\Inve"
  },
  {
    "path": "src/Api/Player/Data/Inventory/CandyBank.php",
    "chars": 1882,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Inventory;\n\nuse Exception;\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\nuse "
  },
  {
    "path": "src/Api/Player/Data/Inventory/CandyItem.php",
    "chars": 641,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Inventory;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\nuse POGOProtos\\Enums"
  },
  {
    "path": "src/Api/Player/Data/Inventory/EggIncubator.php",
    "chars": 1282,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Inventory;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\nuse POGOProtos\\Inven"
  },
  {
    "path": "src/Api/Player/Data/Inventory/EggIncubators.php",
    "chars": 1226,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Inventory;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\n\nuse POGOProtos\\Inv"
  },
  {
    "path": "src/Api/Player/Data/Inventory/EggPokemon.php",
    "chars": 906,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Inventory;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\n\n/**\n * @method voi"
  },
  {
    "path": "src/Api/Player/Data/Inventory/Item.php",
    "chars": 580,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Inventory;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\n\n/**\n * @method void"
  },
  {
    "path": "src/Api/Player/Data/Inventory/Items.php",
    "chars": 7004,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Inventory;\n\nuse Exception;\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\nuse N"
  },
  {
    "path": "src/Api/Player/Data/Inventory/PokeBank.php",
    "chars": 3601,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Inventory;\n\nuse Exception;\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\nuse "
  },
  {
    "path": "src/Api/Player/Data/Inventory/Pokedex.php",
    "chars": 1615,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Inventory;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\nuse NicklasW\\PkmGoA"
  },
  {
    "path": "src/Api/Player/Data/Inventory/PokedexItem.php",
    "chars": 972,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Inventory;\n\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\n\n/**\n * @method vo"
  },
  {
    "path": "src/Api/Player/Data/Inventory/PokemonItem.php",
    "chars": 4667,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Inventory;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\nuse POGOProtos\\Enums"
  },
  {
    "path": "src/Api/Player/Data/Inventory/Stats.php",
    "chars": 5148,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Inventory;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\nuse POGOProtos\\Inve"
  },
  {
    "path": "src/Api/Player/Data/Journal/Fort.php",
    "chars": 1224,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Journal;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\nuse POGOProtos\\Data\\Lo"
  },
  {
    "path": "src/Api/Player/Data/Journal/Item.php",
    "chars": 764,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Journal;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\n\nclass Item extends Da"
  },
  {
    "path": "src/Api/Player/Data/Journal/Log.php",
    "chars": 1584,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Journal;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\nuse POGOProtos\\Data\\Lo"
  },
  {
    "path": "src/Api/Player/Data/Journal/Pokemon.php",
    "chars": 1963,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Journal;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\nuse NicklasW\\PkmGoApi\\"
  },
  {
    "path": "src/Api/Player/Data/Profile/Avatar.php",
    "chars": 1271,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Profile;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\n\n/**\n * @method void "
  },
  {
    "path": "src/Api/Player/Data/Profile/Badge.php",
    "chars": 643,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Profile;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\n\n/**\n * @method void "
  },
  {
    "path": "src/Api/Player/Data/Profile/ContactSettings.php",
    "chars": 522,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Profile;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\n\n/**\n * @method void "
  },
  {
    "path": "src/Api/Player/Data/Profile/Currencies.php",
    "chars": 2164,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Profile;\n\nuse Exception;\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\nuse PO"
  },
  {
    "path": "src/Api/Player/Data/Profile/Currency.php",
    "chars": 399,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Profile;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\n\n/**\n * @method void "
  },
  {
    "path": "src/Api/Player/Data/Profile/DailyBonus.php",
    "chars": 585,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Profile;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\n\n/**\n * @method void "
  },
  {
    "path": "src/Api/Player/Data/Profile/ProfileData.php",
    "chars": 3299,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Profile;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\nuse POGOProtos\\Data\\P"
  },
  {
    "path": "src/Api/Player/Data/Profile/TutorialState.php",
    "chars": 568,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player\\Data\\Profile;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\n\n/**\n * @method integ"
  },
  {
    "path": "src/Api/Player/Inventory.php",
    "chars": 5527,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player;\n\nuse Exception;\nuse NicklasW\\PkmGoApi\\Api\\Player\\Data\\Inventory\\AppliedIt"
  },
  {
    "path": "src/Api/Player/Journal.php",
    "chars": 1220,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player;\n\nuse NicklasW\\PkmGoApi\\Api\\Player\\Data\\Journal\\Log;\nuse NicklasW\\PkmGoApi"
  },
  {
    "path": "src/Api/Player/Profile.php",
    "chars": 2217,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Player;\n\nuse NicklasW\\PkmGoApi\\Api\\Player\\Data\\Profile\\Avatar;\nuse NicklasW\\PkmGo"
  },
  {
    "path": "src/Api/Pokemon/Collection/PokemonCollection.php",
    "chars": 2198,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Pokemon\\Collection;\n\nuse Illuminate\\Support\\Collection;\nuse NicklasW\\PkmGoApi\\Api"
  },
  {
    "path": "src/Api/Pokemon/Data/MovementType.php",
    "chars": 361,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Pokemon\\Data;\n\nclass MovementType {\n\n    /**\n     *\n     */\n    const PSYCHIC = 0"
  },
  {
    "path": "src/Api/Pokemon/Data/PokemonClass.php",
    "chars": 499,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Pokemon\\Data;\n\nclass PokemonClass {\n\n    /**\n     *\n     */\n    const NONE = 0;\n\n"
  },
  {
    "path": "src/Api/Pokemon/Data/PokemonMeta.php",
    "chars": 10294,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Pokemon\\Data;\n\nclass PokemonMeta {\n\n    protected $heightStdDev;\n\n    protected $"
  },
  {
    "path": "src/Api/Pokemon/Data/PokemonMetaRegistry.php",
    "chars": 488306,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Pokemon\\Data;\n\nuse NicklasW\\PkmGoApi\\Api\\Pokemon\\Data\\PokemonMove as PokemonMoveD"
  },
  {
    "path": "src/Api/Pokemon/Data/PokemonMove.php",
    "chars": 950,
    "preview": "<?php\n/**\n * @author DrDelay <info@vi0lation.de>\n */\n\nnamespace NicklasW\\PkmGoApi\\Api\\Pokemon\\Data;\n\nuse NicklasW\\PkmGoA"
  },
  {
    "path": "src/Api/Pokemon/Pokemon.php",
    "chars": 8649,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Pokemon;\n\nuse Exception;\nuse NicklasW\\PkmGoApi\\Api\\Player\\Data\\Inventory\\PokemonI"
  },
  {
    "path": "src/Api/Pokemon/Support/BasePokemonRetriever.php",
    "chars": 548,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Pokemon\\Support;\n\nuse NicklasW\\PkmGoApi\\Api\\Support\\Enums\\PokemonFamilyId;\n\nclass"
  },
  {
    "path": "src/Api/Pokemon/Support/CombatPointsCalculator.php",
    "chars": 7646,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Pokemon\\Support;\n\nclass CombatPointsCalculator\n{\n\n    /**\n     * Calculates the l"
  },
  {
    "path": "src/Api/Pokemon/Support/PokemonDetailsTrait.php",
    "chars": 9147,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Pokemon\\Support;\n\nuse NicklasW\\PkmGoApi\\Api\\Player\\Data\\Inventory\\CandyItem;\nuse "
  },
  {
    "path": "src/Api/PokemonGoApi.php",
    "chars": 3040,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api;\n\nuse NicklasW\\PkmGoApi\\Api\\Map\\Map;\nuse NicklasW\\PkmGoApi\\Api\\Player\\Inventory;\n"
  },
  {
    "path": "src/Api/Procedure.php",
    "chars": 1196,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Api;\n\nuse NicklasW\\PkmGoApi\\Api\\Data\\Data;\nuse NicklasW\\PkmGoApi\\Api\\Support\\Traits\\"
  },
  {
    "path": "src/Api/Support/Enums/AbstractEnum.php",
    "chars": 1489,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Support\\Enums;\n\nuse ReflectionClass;\n\nabstract class AbstractEnum\n{\n\n    /**\n    "
  },
  {
    "path": "src/Api/Support/Enums/GenericEnum.php",
    "chars": 1620,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Support\\Enums;\n\nuse ReflectionClass;\n\nclass GenericEnum\n{\n\n    /**\n     * @var ar"
  },
  {
    "path": "src/Api/Support/Enums/ItemId.php",
    "chars": 336,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Support\\Enums;\n\nclass ItemId extends AbstractEnum\n{\n\n    /**\n     * @var string T"
  },
  {
    "path": "src/Api/Support/Enums/PokemonFamilyId.php",
    "chars": 345,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Support\\Enums;\n\nclass PokemonFamilyId extends AbstractEnum\n{\n\n    /**\n     * @var"
  },
  {
    "path": "src/Api/Support/Enums/PokemonId.php",
    "chars": 333,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Support\\Enums;\n\nclass PokemonId extends AbstractEnum\n{\n\n    /**\n     * @var strin"
  },
  {
    "path": "src/Api/Support/Enums/PokemonMove.php",
    "chars": 337,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Support\\Enums;\n\nclass PokemonMove extends AbstractEnum\n{\n\n    /**\n     * @var str"
  },
  {
    "path": "src/Api/Support/Enums/PokemonType.php",
    "chars": 337,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Support\\Enums;\n\nclass PokemonType extends AbstractEnum\n{\n\n    /**\n     * @var str"
  },
  {
    "path": "src/Api/Support/Traits/MakeApiResourcesAvailable.php",
    "chars": 1740,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Support\\Traits;\n\nuse NicklasW\\PkmGoApi\\Api\\Player\\Data\\Inventory\\CandyBank;\nuse N"
  },
  {
    "path": "src/Api/Support/Traits/MakeDataPropertiesCallable.php",
    "chars": 263,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Api\\Support\\Traits;\n\ntrait MakeDataPropertiesCallable {\n\n    /**\n     * @param $name\n"
  },
  {
    "path": "src/Authentication/AccessToken.php",
    "chars": 3554,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication;\n\nclass AccessToken {\n\n    /**\n     * @var string\n     */\n    const PR"
  },
  {
    "path": "src/Authentication/Config/Config.php",
    "chars": 2395,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Config;\n\nuse NicklasW\\PkmGoApi\\Authentication\\AccessToken;\nuse Nicklas"
  },
  {
    "path": "src/Authentication/Contracts/Authenticator.php",
    "chars": 127,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Contracts;\n\ninterface Authenticator {\n\n    public function authenticat"
  },
  {
    "path": "src/Authentication/Exceptions/AuthenticationException.php",
    "chars": 912,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Exceptions;\n\nuse \\Exception;\n\nclass AuthenticationException extends E"
  },
  {
    "path": "src/Authentication/Exceptions/IllegalAuthenticationTypeException.php",
    "chars": 475,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Exceptions;\n\nuse \\Exception;\n\nclass IllegalAuthenticationTypeExceptio"
  },
  {
    "path": "src/Authentication/Exceptions/ResponseException.php",
    "chars": 447,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Exceptions;\n\nuse \\Exception;\n\nclass ResponseException extends Excepti"
  },
  {
    "path": "src/Authentication/Factory/Factory.php",
    "chars": 7906,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Factory;\n\nuse Exception;\nuse NicklasW\\PkmGoApi\\Authentication\\AccessTo"
  },
  {
    "path": "src/Authentication/Manager.php",
    "chars": 3037,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication;\n\nuse Closure;\nuse NicklasW\\PkmGoApi\\Authentication\\Exceptions\\Authent"
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationCode/Authenticator.php",
    "chars": 1781,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google\\AuthenticationCode;\n\nuse NicklasW\\PkmGoApi\\Authenticat"
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationCode/Clients/AuthenticationClient.php",
    "chars": 2829,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google\\AuthenticationCode\\Clients;\n\nuse GuzzleHttp\\Client;\nus"
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationCode/Parsers/OauthTokenParser.php",
    "chars": 3204,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google\\AuthenticationCode\\Parsers;\n\nuse Exception;\nuse Nickla"
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationCode/Parsers/Parser.php",
    "chars": 2282,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google\\AuthenticationCode\\Parsers;\n\nuse NicklasW\\PkmGoApi\\Aut"
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationCode/Parsers/Results/AuthenticationTokenResult.php",
    "chars": 658,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google\\AuthenticationCode\\Parsers\\Results;\n\nclass Authenticat"
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationCode/Parsers/Results/Result.php",
    "chars": 596,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google\\AuthenticationCode\\Parsers\\Results;\n\nclass Result {\n\n "
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationCodeManager.php",
    "chars": 1802,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google;\n\nuse NicklasW\\PkmGoApi\\Authentication\\AccessToken;\nus"
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationCredentials/Authenticator.php",
    "chars": 2476,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google\\AuthenticationCredentials;\n\nuse NicklasW\\PkmGoApi\\Auth"
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationCredentials/Clients/AuthenticationClient.php",
    "chars": 4700,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google\\AuthenticationCredentials\\Clients;\n\nuse GuzzleHttp\\Cli"
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationCredentials/Parsers/OauthTokenParser.php",
    "chars": 1725,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google\\AuthenticationCredentials\\Parsers;\n\nuse NicklasW\\PkmGo"
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationCredentials/Parsers/Parser.php",
    "chars": 2276,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google\\AuthenticationCredentials\\Parsers;\n\nuse NicklasW\\PkmGo"
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationCredentials/Parsers/Results/AuthenticationTokenResult.php",
    "chars": 645,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google\\AuthenticationCredentials\\Parsers\\Results;\n\nclass Aut"
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationCredentials/Parsers/Results/Result.php",
    "chars": 604,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google\\AuthenticationCredentials\\Parsers\\Results;\n\nclass Res"
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationCredentials/Parsers/TokenParser.php",
    "chars": 1990,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google\\AuthenticationCredentials\\Parsers;\n\nuse NicklasW\\PkmGo"
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationCredentials/Support/Signature.php",
    "chars": 2771,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google\\AuthenticationCredentials\\Support;\n\nuse phpseclib\\Cryp"
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationCredentialsManager.php",
    "chars": 2558,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google;\n\nuse NicklasW\\PkmGoApi\\Authentication\\AccessToken;\nus"
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationOauthTokenManager.php",
    "chars": 1167,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google;\n\nuse NicklasW\\PkmGoApi\\Authentication\\AccessToken;\nus"
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationRefreshToken/Authenticator.php",
    "chars": 1816,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google\\AuthenticationRefreshToken;\n\nuse NicklasW\\PkmGoApi\\Aut"
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationRefreshToken/Clients/AuthenticationClient.php",
    "chars": 3360,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google\\AuthenticationRefreshToken\\Clients;\n\nuse GuzzleHttp\\Cl"
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationRefreshToken/Parsers/OauthTokenParser.php",
    "chars": 3091,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google\\AuthenticationRefreshToken\\Parsers;\n\nuse NicklasW\\PkmG"
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationRefreshToken/Parsers/Parser.php",
    "chars": 2298,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google\\AuthenticationRefreshToken\\Parsers;\n\nuse NicklasW\\PkmG"
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationRefreshToken/Parsers/Results/AuthenticationTokenResult.php",
    "chars": 491,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google\\AuthenticationRefreshToken\\Parsers\\Results;\n\nclass Aut"
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationRefreshToken/Parsers/Results/Result.php",
    "chars": 616,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google\\AuthenticationRefreshToken\\Parsers\\Results;\n\nclass Res"
  },
  {
    "path": "src/Authentication/Managers/Google/AuthenticationRefreshTokenManager.php",
    "chars": 1816,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\Google;\n\nuse NicklasW\\PkmGoApi\\Authentication\\AccessToken;\nus"
  },
  {
    "path": "src/Authentication/Managers/PTC/AuthenticationCredentials/Authenticator.php",
    "chars": 1988,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\PTC\\AuthenticationCredentials;\n\nuse NicklasW\\PkmGoApi\\Authent"
  },
  {
    "path": "src/Authentication/Managers/PTC/AuthenticationCredentials/Clients/AuthenticationClient.php",
    "chars": 5308,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\PTC\\AuthenticationCredentials\\Clients;\n\nuse GuzzleHttp\\Client"
  },
  {
    "path": "src/Authentication/Managers/PTC/AuthenticationCredentials/Parsers/AuthenticationInformationParser.php",
    "chars": 1489,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\PTC\\AuthenticationCredentials\\Parsers;\n\nuse NicklasW\\PkmGoApi"
  },
  {
    "path": "src/Authentication/Managers/PTC/AuthenticationCredentials/Parsers/Parser.php",
    "chars": 2304,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\PTC\\AuthenticationCredentials\\Parsers;\n\nuse NicklasW\\PkmGoApi"
  },
  {
    "path": "src/Authentication/Managers/PTC/AuthenticationCredentials/Parsers/Results/AuthenticationInformationResult.php",
    "chars": 456,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\PTC\\AuthenticationCredentials\\Parsers\\Results;\n\nclass Authent"
  },
  {
    "path": "src/Authentication/Managers/PTC/AuthenticationCredentials/Parsers/Results/Result.php",
    "chars": 606,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\PTC\\AuthenticationCredentials\\Parsers\\Results;\n\nclass Result "
  },
  {
    "path": "src/Authentication/Managers/PTC/AuthenticationCredentials/Parsers/Results/TicketResult.php",
    "chars": 299,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\PTC\\AuthenticationCredentials\\Parsers\\Results;\n\nclass TicketR"
  },
  {
    "path": "src/Authentication/Managers/PTC/AuthenticationCredentials/Parsers/Results/TokenResult.php",
    "chars": 459,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\PTC\\AuthenticationCredentials\\Parsers\\Results;\n\nclass TokenRe"
  },
  {
    "path": "src/Authentication/Managers/PTC/AuthenticationCredentials/Parsers/TicketParser.php",
    "chars": 3074,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\PTC\\AuthenticationCredentials\\Parsers;\n\nuse NicklasW\\PkmGoApi"
  },
  {
    "path": "src/Authentication/Managers/PTC/AuthenticationCredentials/Parsers/TokenParser.php",
    "chars": 2390,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\PTC\\AuthenticationCredentials\\Parsers;\n\nuse NicklasW\\PkmGoApi"
  },
  {
    "path": "src/Authentication/Managers/PTC/AuthenticationCredentialsManager.php",
    "chars": 2487,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\PTC;\n\nuse NicklasW\\PkmGoApi\\Authentication\\AccessToken;\nuse N"
  },
  {
    "path": "src/Authentication/Managers/PTC/AuthenticationOauthTokenManager.php",
    "chars": 784,
    "preview": "<?php\n\n/**\n * @author DrDelay <info@vi0lation.de>\n */\n\nnamespace NicklasW\\PkmGoApi\\Authentication\\Managers\\PTC;\n\nuse Nic"
  },
  {
    "path": "src/Clients/Proxies/ClientProxy.php",
    "chars": 4796,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Clients\\Proxies;\n\nuse GuzzleHttp\\ClientInterface;\nuse GuzzleHttp\\Exception\\GuzzleExce"
  },
  {
    "path": "src/Facades/App.php",
    "chars": 431,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Facades;\n\nuse XStatic\\StaticProxy;\n\nclass App extends StaticProxy {\n\n    /**\n     * R"
  },
  {
    "path": "src/Facades/Log.php",
    "chars": 431,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Facades;\n\nuse XStatic\\StaticProxy;\n\nclass Log extends StaticProxy {\n\n    /**\n     * R"
  },
  {
    "path": "src/Handlers/RequestHandler/Exceptions/AuthenticationException.php",
    "chars": 461,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Handlers\\RequestHandler\\Exceptions;\n\nuse Exception;\n\nclass AuthenticationException ex"
  },
  {
    "path": "src/Handlers/RequestHandler/Exceptions/ResponseException.php",
    "chars": 455,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Handlers\\RequestHandler\\Exceptions;\n\nuse Exception;\n\nclass ResponseException extends "
  },
  {
    "path": "src/Handlers/RequestHandler.php",
    "chars": 13729,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Handlers;\n\nuse Exception;\nuse Google\\Protobuf\\Internal\\GPBType;\nuse Google\\Protobuf\\I"
  },
  {
    "path": "src/Handlers/Session.php",
    "chars": 2094,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Handlers;\n\nuse POGOProtos\\Networking\\Envelopes\\AuthTicket;\nuse POGOProtos\\Networking\\"
  },
  {
    "path": "src/Kernels/ApplicationKernel.php",
    "chars": 2749,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Kernels;\n\nuse DI\\NotFoundException;\nuse GuzzleHttp\\Client;\nuse NicklasW\\PkmGoApi\\Api\\"
  },
  {
    "path": "src/Kernels/Kernel.php",
    "chars": 3920,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Kernels;\n\nuse DI\\Container;\nuse DI\\ContainerBuilder;\nuse Dotenv\\Dotenv;\nuse Interop\\C"
  },
  {
    "path": "src/Providers/PokemonGoApiServiceProvider.php",
    "chars": 395,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Providers;\n\nuse NicklasW\\PkmGoApi\\Api\\PokemonGoApi;\n\nclass PokemonGoApiServiceProvid"
  },
  {
    "path": "src/Providers/RequestHandlerServiceProvider.php",
    "chars": 813,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Providers;\n\nuse NicklasW\\PkmGoApi\\Authentication\\Manager;\nuse NicklasW\\PkmGoApi\\Facad"
  },
  {
    "path": "src/Providers/ServiceProvider.php",
    "chars": 497,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Providers;\n\nuse NicklasW\\PkmGoApi\\Kernels\\ApplicationKernel;\n\nabstract class ServiceP"
  },
  {
    "path": "src/Requests/AuthenticateRequest.php",
    "chars": 621,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Requests;\n\nuse Google\\Protobuf\\Internal\\Message;\nuse POGOProtos\\Networking\\Envelopes\\"
  },
  {
    "path": "src/Requests/CheckChallengeRequest.php",
    "chars": 1245,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Requests;\n\nuse Google\\Protobuf\\Internal\\Message;\nuse POGOProtos\\Networking\\Envelopes\\"
  },
  {
    "path": "src/Requests/Envelops/AuthInfoEnvelope.php",
    "chars": 94,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Requests\\Envelops;\n\nclass AuthInfoEnvelope {\n\n\n    \n\n\n\n\n\n}"
  },
  {
    "path": "src/Requests/Envelops/Factory.php",
    "chars": 1428,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Requests\\Envelops;\n\nuse Google\\Protobuf\\Internal\\Message;\nuse NicklasW\\PkmGoApi\\Authe"
  },
  {
    "path": "src/Requests/EvolvePokemonRequest.php",
    "chars": 1697,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Requests;\n\nuse Google\\Protobuf\\Internal\\Message;\nuse POGOProtos\\Networking\\Envelopes\\"
  },
  {
    "path": "src/Requests/FortSearchRequest.php",
    "chars": 2844,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Requests;\n\nuse Google\\Protobuf\\Internal\\Message;\nuse NicklasW\\PkmGoApi\\Facades\\App;\nu"
  },
  {
    "path": "src/Requests/GetInventoryRequest.php",
    "chars": 1284,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Requests;\n\nuse Google\\Protobuf\\Internal\\Message;\nuse POGOProtos\\Networking\\Envelopes\\"
  },
  {
    "path": "src/Requests/GetJournalRequest.php",
    "chars": 1244,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Requests;\n\nuse Google\\Protobuf\\Internal\\Message;\nuse POGOProtos\\Networking\\Envelopes\\"
  },
  {
    "path": "src/Requests/GetMapResourcesRequest.php",
    "chars": 2119,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Requests;\n\nuse Google\\Protobuf\\Internal\\Message;\nuse POGOProtos\\Networking\\Envelopes\\"
  },
  {
    "path": "src/Requests/GetPlayerRequest.php",
    "chars": 1252,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Requests;\n\nuse Google\\Protobuf\\Internal\\Message;\nuse POGOProtos\\Networking\\Envelopes\\"
  },
  {
    "path": "src/Requests/RecycleInventoryItemRequest.php",
    "chars": 1978,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Requests;\n\nuse Google\\Protobuf\\Internal\\Message;\nuse POGOProtos\\Networking\\Envelopes\\"
  },
  {
    "path": "src/Requests/RenamePokemonRequest.php",
    "chars": 1902,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Requests;\n\nuse Google\\Protobuf\\Internal\\Message;\nuse POGOProtos\\Networking\\Envelopes\\"
  },
  {
    "path": "src/Requests/Request.php",
    "chars": 748,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Requests;\n\nuse Google\\Protobuf\\Internal\\Message;\nuse POGOProtos\\Networking\\Envelopes\\"
  },
  {
    "path": "src/Requests/SetFavoritePokemonRequest.php",
    "chars": 1979,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Requests;\n\nuse Google\\Protobuf\\Internal\\Message;\nuse POGOProtos\\Networking\\Envelopes\\"
  },
  {
    "path": "src/Requests/TransferPokemonRequest.php",
    "chars": 1697,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Requests;\n\nuse Google\\Protobuf\\Internal\\Message;\nuse POGOProtos\\Networking\\Envelopes\\"
  },
  {
    "path": "src/Requests/UpgradePokemonRequest.php",
    "chars": 1695,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Requests;\n\nuse Google\\Protobuf\\Internal\\Message;\nuse POGOProtos\\Networking\\Envelopes\\"
  },
  {
    "path": "src/Requests/UseIncenseRequest.php",
    "chars": 1634,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Requests;\n\nuse Google\\Protobuf\\Internal\\Message;\nuse POGOProtos\\Networking\\Envelopes\\"
  },
  {
    "path": "src/Requests/UseItemXpBoostRequest.php",
    "chars": 1693,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Requests;\n\nuse Google\\Protobuf\\Internal\\Message;\nuse POGOProtos\\Networking\\Envelopes\\"
  },
  {
    "path": "src/Requests/VerifyChallengeRequest.php",
    "chars": 2209,
    "preview": "<?php\nnamespace NicklasW\\PkmGoApi\\Requests;\n\nuse Google\\Protobuf\\Internal\\Message;\nuse POGOProtos\\Networking\\Envelopes\\R"
  },
  {
    "path": "src/Services/Request/CheckChallengeRequestService.php",
    "chars": 688,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Services\\Request;\n\nuse NicklasW\\PkmGoApi\\Handlers\\Exception;\nuse NicklasW\\PkmGoApi\\Re"
  },
  {
    "path": "src/Services/Request/InventoryRequestService.php",
    "chars": 2029,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Services\\Request;\n\nuse NicklasW\\PkmGoApi\\Requests\\GetInventoryRequest;\nuse NicklasW\\P"
  },
  {
    "path": "src/Services/Request/JournalRequestService.php",
    "chars": 632,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Services\\Request;\n\nuse NicklasW\\PkmGoApi\\Handlers\\Exception;\nuse NicklasW\\PkmGoApi\\Re"
  },
  {
    "path": "src/Services/Request/MapRequestService.php",
    "chars": 894,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Services\\Request;\n\nuse NicklasW\\PkmGoApi\\Handlers\\RequestHandler\\Exceptions\\Authentic"
  },
  {
    "path": "src/Services/Request/PlayerRequestService.php",
    "chars": 615,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Services\\Request;\n\nuse NicklasW\\PkmGoApi\\Handlers\\Exception;\nuse NicklasW\\PkmGoApi\\Re"
  },
  {
    "path": "src/Services/Request/PokemonRequestService.php",
    "chars": 3003,
    "preview": "<?php\n\n\nnamespace NicklasW\\PkmGoApi\\Services\\Request;\n\nuse Exception;\nuse NicklasW\\PkmGoApi\\Handlers\\RequestHandler\\Exce"
  },
  {
    "path": "src/Services/Request/PokestopRequestService.php",
    "chars": 1032,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Services\\Request;\n\nuse Exception;\nuse NicklasW\\PkmGoApi\\Handlers\\RequestHandler\\Excep"
  },
  {
    "path": "src/Services/RequestService.php",
    "chars": 571,
    "preview": "<?php\n\nnamespace NicklasW\\PkmGoApi\\Services;\n\nuse DI\\Container;\nuse NicklasW\\PkmGoApi\\Facades\\App;\nuse NicklasW\\PkmGoApi"
  },
  {
    "path": "tests/Api/Pokemon/PokemonTest.php",
    "chars": 7140,
    "preview": "<?php\n/**\n * @author DrDelay <info@vi0lation.de>\n */\n\nnamespace NicklasW\\PkmGoApi\\Test\\Api\\Pokemon;\n\nuse NicklasW\\PkmGoA"
  }
]

About this extraction

This page contains the full source code of the NicklasWallgren/PokemonGoAPI-PHP GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 171 files (833.5 KB), approximately 232.8k tokens, and a symbol index with 843 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!