blancohugo/correios
Composer 安装命令:
composer require blancohugo/correios
包简介
Consulta de cep no SIGEP dos Correios com PHP
README 文档
README
A service for fetching data from an address from a provided zip code.
Installation
$ composer require blancohugo/correios
How-to
See the example below of how to implement a search for address data:
<?php require 'vendor/autoload.php'; use BlancoHugo\Correios\Zipcode; use BlancoHugo\Correios\Client; use BlancoHugo\Correios\Exception; $client = new Client(); $address = $client->query(new Zipcode('01311-929'));
The client class uses exceptions for data treatments. Make sure your code will have a treatment for the following situations:
<?php try { $address = $client->query(new Zipcode('01311-929')); } catch (Exception\InvalidZipcodeException $e) { // Invalid zipcode } catch (Exception\ZipcodeNotFoundException $e) { // Address data not found } catch (Exception\UnexpectedResponseException $e) { // Unexpected response from SIGEP }
Contributing
See how to CONTRIBUTE to this project.
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-09-11