Skip to content

Commit

Permalink
Merge branch 'release/1.0.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
claudsonm committed Jan 23, 2020
2 parents fe97bc9 + da0f4f6 commit 859ee8c
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 15 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# CEP Promise PHP
[![Build Status](https://travis-ci.org/claudsonm/cep-promise-php.svg?branch=master)](https://travis-ci.org/claudsonm/cep-promise-php)
[![StyleCI](https://github.styleci.io/repos/177436507/shield?branch=master)](https://github.styleci.io/repos/177436507)
![Packagist](https://img.shields.io/packagist/dt/claudsonm/cep-promise-php?style=flat-square)
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors)

Um pacote agnóstico para PHP 7.0+ que efetua a busca de CEPs em diversos serviços utilizando [Promises/A+](https://promisesaplus.com/).
Expand Down
10 changes: 10 additions & 0 deletions src/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,14 @@ public function toArray()
{
return (array) $this;
}

/**
* Converte a instância da classe em JSON.
*
* @return string
*/
public function __toString()
{
return json_encode($this->toArray());
}
}
8 changes: 4 additions & 4 deletions src/CepPromise.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace Claudsonm\CepPromise;

use Claudsonm\CepPromise\Exceptions\CepPromiseException;
use Claudsonm\CepPromise\Providers\CepAbertoProvider;
use Claudsonm\CepPromise\Providers\CorreiosProvider;
use Claudsonm\CepPromise\Providers\ViaCepProvider;
use Exception;
use GuzzleHttp\Promise;
use GuzzleHttp\Promise\FulfilledPromise;
use Claudsonm\CepPromise\Providers\ViaCepProvider;
use Claudsonm\CepPromise\Providers\CorreiosProvider;
use Claudsonm\CepPromise\Providers\CepAbertoProvider;
use Claudsonm\CepPromise\Exceptions\CepPromiseException;

/**
* Efetua a consulta pelas informações de um CEP em diferentes serviços de
Expand Down
6 changes: 3 additions & 3 deletions src/Providers/CepAbertoProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Claudsonm\CepPromise\Providers;

use Exception;
use Psr\Http\Message\ResponseInterface;
use GuzzleHttp\Exception\RequestException;
use Claudsonm\CepPromise\Contracts\BaseProvider;
use Claudsonm\CepPromise\Exceptions\CepPromiseProviderException;
use Exception;
use GuzzleHttp\Exception\RequestException;
use Psr\Http\Message\ResponseInterface;

class CepAbertoProvider extends BaseProvider
{
Expand Down
6 changes: 3 additions & 3 deletions src/Providers/CorreiosProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Claudsonm\CepPromise\Providers;

use Exception;
use Psr\Http\Message\ResponseInterface;
use GuzzleHttp\Exception\RequestException;
use Claudsonm\CepPromise\Contracts\BaseProvider;
use Claudsonm\CepPromise\Exceptions\CepPromiseProviderException;
use Exception;
use GuzzleHttp\Exception\RequestException;
use Psr\Http\Message\ResponseInterface;

class CorreiosProvider extends BaseProvider
{
Expand Down
6 changes: 3 additions & 3 deletions src/Providers/ViaCepProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Claudsonm\CepPromise\Providers;

use Exception;
use Psr\Http\Message\ResponseInterface;
use GuzzleHttp\Exception\RequestException;
use Claudsonm\CepPromise\Contracts\BaseProvider;
use Claudsonm\CepPromise\Exceptions\CepPromiseProviderException;
use Exception;
use GuzzleHttp\Exception\RequestException;
use Psr\Http\Message\ResponseInterface;

class ViaCepProvider extends BaseProvider
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/CepPromiseUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Claudsonm\CepPromise\Tests\Unit;

use ReflectionMethod;
use PHPUnit\Framework\TestCase;
use Claudsonm\CepPromise\Address;
use Claudsonm\CepPromise\CepPromise;
use Claudsonm\CepPromise\Exceptions\CepPromiseException;
use PHPUnit\Framework\TestCase;
use ReflectionMethod;

class CepPromiseUnitTest extends TestCase
{
Expand Down

0 comments on commit 859ee8c

Please sign in to comment.