From 71679041ddb2c02cb483d94ffb8a04092bdcda08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Sun, 16 Jul 2023 16:36:39 +0200 Subject: [PATCH] Add PHPStan in CI (#1193) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 * Update src/Provider/Cache/Tests/ProviderCacheTest.php Co-authored-by: Tomas Norkūnas * Update src/Provider/Cache/Tests/ProviderCacheTest.php Co-authored-by: Tomas Norkūnas * Update src/Provider/GeoIP2/Tests/GeoIP2Test.php Co-authored-by: Tomas Norkūnas * 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 * Update src/Plugin/PluginProvider.php Co-authored-by: Tomas Norkūnas * Use PHPStan baseline instead of ignore See https://phpstan.org/user-guide/baseline --------- Co-authored-by: Tomas Norkūnas --- Tests/IntegrationTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Tests/IntegrationTest.php b/Tests/IntegrationTest.php index 155e757..f3be195 100644 --- a/Tests/IntegrationTest.php +++ b/Tests/IntegrationTest.php @@ -21,25 +21,25 @@ */ class IntegrationTest extends ProviderIntegrationTest { - protected $skippedTests = [ + protected array $skippedTests = [ 'testReverseQueryWithNoResults' => 'Null island exists. ', ]; - protected $testIpv4 = false; + protected bool $testIpv4 = false; - protected $testIpv6 = false; + protected bool $testIpv6 = false; protected function createProvider(ClientInterface $httpClient) { return new TomTom($httpClient, $this->getApiKey()); } - protected function getCacheDir() + protected function getCacheDir(): string { return __DIR__.'/.cached_responses'; } - protected function getApiKey() + protected function getApiKey(): string { return $_SERVER['TOMTOM_MAP_KEY']; }