Skip to content

Commit c7cc088

Browse files
authored
Add PHP Coding Standards Fixer in CI (#1196)
* Update composer.json * Update .gitignore * Update php.yml * Apply PHPCSFixer fixes * Switch to php-cs-fixer/shim * Create .php-cs-fixer.dist.php
1 parent 80acaed commit c7cc088

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

Provider/AbstractHttpProvider.php

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
use Geocoder\Exception\InvalidServerResponse;
1717
use Geocoder\Exception\QuotaExceeded;
1818
use Geocoder\Provider\AbstractProvider;
19-
use Http\Message\MessageFactory;
2019
use Http\Discovery\MessageFactoryDiscovery;
20+
use Http\Message\MessageFactory;
2121
use Psr\Http\Client\ClientInterface;
2222
use Psr\Http\Message\RequestInterface;
2323

@@ -37,10 +37,6 @@ abstract class AbstractHttpProvider extends AbstractProvider
3737
*/
3838
private $messageFactory;
3939

40-
/**
41-
* @param ClientInterface $client
42-
* @param MessageFactory|null $factory
43-
*/
4440
public function __construct(ClientInterface $client, MessageFactory $factory = null)
4541
{
4642
$this->client = $client;
@@ -50,10 +46,6 @@ public function __construct(ClientInterface $client, MessageFactory $factory = n
5046
/**
5147
* Get URL and return contents. If content is empty, an exception will be thrown.
5248
*
53-
* @param string $url
54-
*
55-
* @return string
56-
*
5749
* @throws InvalidServerResponse
5850
*/
5951
protected function getUrlContents(string $url): string
@@ -63,11 +55,6 @@ protected function getUrlContents(string $url): string
6355
return $this->getParsedResponse($request);
6456
}
6557

66-
/**
67-
* @param string $url
68-
*
69-
* @return RequestInterface
70-
*/
7158
protected function getRequest(string $url): RequestInterface
7259
{
7360
return $this->getMessageFactory()->createRequest('GET', $url);
@@ -76,10 +63,6 @@ protected function getRequest(string $url): RequestInterface
7663
/**
7764
* Send request and return contents. If content is empty, an exception will be thrown.
7865
*
79-
* @param RequestInterface $request
80-
*
81-
* @return string
82-
*
8366
* @throws InvalidServerResponse
8467
*/
8568
protected function getParsedResponse(RequestInterface $request): string
@@ -105,17 +88,12 @@ protected function getParsedResponse(RequestInterface $request): string
10588

10689
/**
10790
* Returns the HTTP adapter.
108-
*
109-
* @return ClientInterface
11091
*/
11192
protected function getHttpClient(): ClientInterface
11293
{
11394
return $this->client;
11495
}
11596

116-
/**
117-
* @return MessageFactory
118-
*/
11997
protected function getMessageFactory(): MessageFactory
12098
{
12199
return $this->messageFactory;

Tests/Provider/AbstractHttpProviderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
use Geocoder\Model\AddressCollection;
1818
use Geocoder\Query\GeocodeQuery;
1919
use Geocoder\Query\ReverseQuery;
20-
use Psr\Http\Client\ClientInterface;
2120
use Http\Mock\Client;
2221
use PHPUnit\Framework\TestCase;
22+
use Psr\Http\Client\ClientInterface;
2323

2424
class AbstractHttpProviderTest extends TestCase
2525
{

0 commit comments

Comments
 (0)