korkoshko/bestchange-api

This package is abandoned and no longer maintained. No replacement package was suggested.

A simple package for working with the pseudo API of the bestchage.ru

1.0.5 2020-08-29 14:04 UTC

This package is auto-updated.

Last update: 2024-03-30 21:05:39 UTC


README

A simple package for working with the pseudo API of the bestchage.ru

Features

  • Save memory by using generators

Requirements

Installation

composer require korkoshko/bestchange-api

Usage

Initial

$bestChange = new BestChange();
$bestChange->setArchivePath(__DIR__); // If param is not set, a tmp directory is used 

$bestChange->download(); // Downloading archive with data

Get base info of API

foreach($bestChange->getInfo() as $info) { // The generator returns (https://www.php.net/manual/ru/language.generators.php)
    var_dump($info);
}

// Or using sugar method

var_dump(
    $bestChange->getArray(InfoMethod::class);
);

Get exchangers

foreach ($bestChange->getExchangers() as $exchanger) {
    var_dump($exchanger);
}

License

MIT