tcgdex / sdk
PHP SDK to communicate with the TCGdex API
Fund package maintenance!
tcgdex
2.2.0-beta.3
2024-06-26 20:51 UTC
Requires
- php: >=8.1
- psr/http-client: ^1.0
- psr/simple-cache: ^1 || ^2 || ^3
Requires (Dev)
Suggests
- kriswallsmith/buzz: Good PSR 18 implementation
- nyholm/psr7: Good PSR17 implementation
- symfony/cache: Good PSR16 implementation
- dev-master
- 2.2.0-beta.3
- 2.2.0-beta.2
- 2.2.0-beta.1
- 2.1.1
- 2.1.0
- 2.0.1
- 2.0.0
- 2.0.0-BETA2
- 2.0.0-BETA
- dev-dependabot/composer/squizlabs/php_codesniffer-3.11.1
- dev-dependabot/github_actions/codecov/codecov-action-5
- dev-dependabot/composer/squizlabs/php_codesniffer-3.11.0
- dev-dependabot/composer/phpstan/phpstan-1.12.9
- dev-53-try-to-remove-the-curl-deps
This package is auto-updated.
Last update: 2024-11-18 06:48:00 UTC
README
TCGdex PHP SDK
This is the SDK used to communicate with the Open source TCGdex API using PHP
Full API/SDK documentation in progress here
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
Quick usage
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');