tcgdex / sdk
PHP SDK to communicate with the TCGdex API
2.1.0
2021-12-15 10:35 UTC
Requires
- php: >=7.4
- psr/http-client: ^1.0
- psr/simple-cache: ^1.0
Requires (Dev)
- kriswallsmith/buzz: ^1.2
- nyholm/psr7: ^1.4
- phpmd/phpmd: ^2.10
- phpstan/phpstan: ^0.12.90
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.6
- symfony/cache: ^5.3
- webclient/fake-http-client: ^1.0
Suggests
- kriswallsmith/buzz: Good PSR 18 implementation
- nyholm/psr7: Good PSR17 implementation
- symfony/cache: Good PSR16 implementation
This package is auto-updated.
Last update: 2024-03-28 01:40:08 UTC
README
TCGdex PHP SDK
This is the SDK used to communicate with the Open source TCGdex API trough PHP
Full API/SDK documentation in progress at https://www.tcgdex.net/docs
Getting Started
install the SDK using:
composer require tcgdex/sdk # if you have no PSR 16/17/18 implementations add the following packages composer require symfony/cache nyholm/psr7 kriswallsmith/buzz # they will be automaticly setup for the project # symfony/cache === PSR16 # nyholm/psr7 === PSR17 # kriswallsmith/buzz === PSR18
Usage
Note: a complete documentation is in progress
use TCGdex\TCGdex; // Is you are using your own PSRs implementations add theses before loading the class 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('1', 'Sword & Shield');