Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Igor Pinchuk
committed
Sep 18, 2019
1 parent
7655f98
commit 8fa1628
Showing
6 changed files
with
172 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace SomeWork\Minjust; | ||
|
||
use GuzzleHttp\RequestOptions; | ||
|
||
class Client | ||
{ | ||
private const SERVICE_URL = 'http://lawyers.minjust.ru'; | ||
|
||
/** | ||
* @var \GuzzleHttp\Client | ||
*/ | ||
private $client; | ||
|
||
public function __construct(\GuzzleHttp\Client $client) | ||
{ | ||
$this->client = $client; | ||
} | ||
|
||
public function list(array $formData = []): string | ||
{ | ||
return $this | ||
->client | ||
->request('GET', static::SERVICE_URL . '/Lawyers', [ | ||
RequestOptions::QUERY => $formData, | ||
]) | ||
->getBody() | ||
->getContents(); | ||
} | ||
|
||
public function detail(string $url) | ||
{ | ||
return $this | ||
->client | ||
->request('GET', static::SERVICE_URL . $url) | ||
->getBody() | ||
->getContents(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters