isolta / opendata
There is no license information available for the latest version (1.0.2) of this package.
open deta package
1.0.2
2020-10-11 09:43 UTC
Requires
- ext-json: *
- guzzlehttp/guzzle: ^7.0
- larapack/dd: ^1.1
Requires (Dev)
- roave/security-advisories: dev-master
This package is auto-updated.
Last update: 2025-03-11 19:42:57 UTC
README
How to install package?
composer require isolta/opendata
How to use Business Service in your application ?
<?php use Isolta\OpenData\Exception\BadRequestException; use Isolta\OpenData\Exception\EmptyResponseException; use Isolta\OpenData\Exception\JsonParseException; use Isolta\OpenData\Exception\ValidationException; use Isolta\OpenData\Formatter\BusinessResponseFormatter; use Isolta\OpenData\Service\BusinessService; include "vendor/autoload.php"; $businessService = new BusinessService(new BusinessResponseFormatter()); try { $data = $businessService->fetch('3163643-1'); echo sprintf('Name: %s', $data->getName()) ; echo sprintf('Website: %s', $data->getWebsite()); echo sprintf('Address Info : %s', $data->getAddress()); } catch (BadRequestException $e) { echo $e->getMessage(); } catch (EmptyResponseException $e) { echo $e->getMessage(); } catch (JsonParseException $e) { echo $e->getMessage(); } catch (ValidationException $e) { echo $e->getMessage(); }