PHP code example of heroespatchnotes / sdk

1. Go to this page and download the library: Download heroespatchnotes/sdk library. Choose the download type require.

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

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

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

    

heroespatchnotes / sdk example snippets


// Hero data, latest patch
$heroes = DataProvider::get('hero');
echo $heroes->Abathur->life->amount; // "685.0"

// Skin data from a previous patch
$skins = DataProvider::get('heroskin', '2.48.4.77406');
var_dump($skins->DemonHunterWinter);
array(
    "hyperlinkId": "WintersHelperValla",
    "attributeId": "Dhu5",
    "rarity": "Legendary",
    "releaseDate": "2017-12-12",
    "features": [
      "ThemedAbilities",
      "ThemedAnimations"
    ],
)

// English game strings, latest patch
$strings = StringProvider::get('enus');
echo $strings->gamestrings->unit->descriptino->Abathur; // "A unique Hero that can manipulate the battle from anywhere on the map."

// French game strings, previous patch
$older = StringProvider::get(StringProvider::FRANCE, '2.49.2.77981');
echo $older->gamestrings->abiltalent->$tassadarTalentId->name; // "Phase dimensionnelle"
// 

// Tassadar, pre-rework, in French
$heroes   = new HeroFactory(StringProvider::LOCALE['France'], '2.49.2.77981');
$tassadar = $heroes->get('Tassadar');
foreach ($tassadar->abilities() as $ability)
{
	echo $ability->name; // e.g. "Phase dimensionnelle"
}