Skip to content

Commit 29318e0

Browse files
jbeliennorkunas
andauthored
Add PHPStan in CI (#1193)
* Add PHPStan * Update php.yml * Update composer.json * Fix PHPStan level 0 * Fix PHPStan level 1 * Update phpstan.neon * Fix PHPStan level 2 * Update composer.json * Fix PHPStan level 3 * Fix tests * Fix PHPStan level 4 * Update src/Common/Tests/TimedGeocoderTest.php Co-authored-by: Tomas Norkūnas <[email protected]> * Update src/Provider/Cache/Tests/ProviderCacheTest.php Co-authored-by: Tomas Norkūnas <[email protected]> * Update src/Provider/Cache/Tests/ProviderCacheTest.php Co-authored-by: Tomas Norkūnas <[email protected]> * Update src/Provider/GeoIP2/Tests/GeoIP2Test.php Co-authored-by: Tomas Norkūnas <[email protected]> * Fix PHPStan level 5 * Normalize composer.json * Rename analyse script * Update composer.json * Update IntegrationTest * Update AlgoliaPlacesTest * Update composer.json * Update RequestInterface vs. getParsedResponse() * Update src/Plugin/PluginProvider.php Co-authored-by: Tomas Norkūnas <[email protected]> * Update src/Plugin/PluginProvider.php Co-authored-by: Tomas Norkūnas <[email protected]> * Use PHPStan baseline instead of ignore See https://phpstan.org/user-guide/baseline --------- Co-authored-by: Tomas Norkūnas <[email protected]>
1 parent ef1c0fb commit 29318e0

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

MapQuest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,8 @@ private function executePostQuery(string $endpoint, array $params)
253253
}
254254

255255
/**
256-
* @param string $url
256+
* @param string $endpoint
257+
* @param array $params
257258
*
258259
* @return AddressCollection
259260
*/

Tests/IntegrationTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@
2121
*/
2222
class IntegrationTest extends ProviderIntegrationTest
2323
{
24-
protected $testIpv4 = false;
24+
protected bool $testIpv4 = false;
2525

26-
protected $testIpv6 = false;
26+
protected bool $testIpv6 = false;
2727

2828
protected function createProvider(ClientInterface $httpClient)
2929
{
3030
return new MapQuest($httpClient, $this->getApiKey());
3131
}
3232

33-
protected function getCacheDir()
33+
protected function getCacheDir(): string
3434
{
3535
return __DIR__.'/.cached_responses';
3636
}
3737

38-
protected function getApiKey()
38+
protected function getApiKey(): string
3939
{
4040
return $_SERVER['MAPQUEST_API_KEY'];
4141
}

Tests/MapQuestTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ public function testGeocodeWithSpecificCityAndBounds()
358358

359359
$query = GeocodeQuery::create('foobar');
360360
$query = $query->withData(MapQuest::DATA_KEY_ADDRESS, $address);
361-
$query = $query->withBounds(new Bounds('39', '-77', '41', '-75'));
361+
$query = $query->withBounds(new Bounds(39, -77, 41, -75));
362362
$results = $provider->geocodeQuery($query);
363363

364364
$this->assertInstanceOf('Geocoder\Model\AddressCollection', $results);

0 commit comments

Comments
 (0)