php-mtg/mtg-api-com-mtgjson-object

实现了php-mtg/mtg-api-com-mtgjson-interface库的库


README

实现了php-mtg/mtg-api-com-mtgjson-interface库的库。

coverage build status

安装

此库的安装通过composer完成,所有类的自动加载都通过它们的自动加载器完成。

  • 他们的网站下载 composer.phar
  • 然后运行以下命令将此库作为依赖项安装
  • php composer.phar require php-mtg/mtg-api-com-mtgjson-object ^7

基本用法

此库可以使用以下方式使用


use PhpMtg\Mtgjson\MtgjsonComApiEndpoint;

/* @var $client \Psr\Http\Client\ClientInterface */

$endpoint = new MtgjsonComApiEndpoint($client);

$collection = $this->_endpoint->getSetList();

foreach($collection->getSets() as $setResume)
{
	/** @var \PhpMtg\Mtgjson\MtgjsonComApiSetMetaInterface $meta */
	$meta = $this->_endpoint->getSet($setResume->getCode());
	
	$set = $meta->getSet();
	// do something to set
}

许可证

MIT(见许可证文件)。