Salta ai contenuti

The PHP SDK

Questi contenuti non sono ancora disponibili nella tua lingua.

Packagist VersionGithub starsPackagist DownloadsCoveragethe TCGdex PHP SDK's automated builds.

Installation

  1. Install the SDK using Composer

    Terminal window
    composer require tcgdex/sdk
  2. if you don’t have the PSRs 16,17 & 18 implementations, you can quickly add them using this command

    Terminal window
    composer require symfony/cache nyholm/psr7 kriswallsmith/buzz

Usage

// import the package
use TCGdex\TCGdex;
// if you use another anything else than the recommended you need to add them here
TCGdex::$cache = /* PSR16 CacheInterface */;
TCGdex::$requestFactory = /* PSR17 RequestFactoryInterface */;
TCGdex::$responseFactory = /* PSR17 ResponseFactoryInterface */;
TCGdex::$client = /* PSR18 ClientInterface */;
// initialize the SDK with the language
$tcgdex = new TCGdex("en");
// Fetch the cards !
$card = $tcgdex->fetchCard('136', 'swsh3');

You can check in the JSON REST API docs and select the correct tab to see the command specific for your SDK

Source Code

The source code for the SDK is available on Github !