Skip to content

Commit

Permalink
Add PHPStan in CI (#1193)
Browse files Browse the repository at this point in the history
* 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 <norkunas.tom@gmail.com>

* Update src/Provider/Cache/Tests/ProviderCacheTest.php

Co-authored-by: Tomas Norkūnas <norkunas.tom@gmail.com>

* Update src/Provider/Cache/Tests/ProviderCacheTest.php

Co-authored-by: Tomas Norkūnas <norkunas.tom@gmail.com>

* Update src/Provider/GeoIP2/Tests/GeoIP2Test.php

Co-authored-by: Tomas Norkūnas <norkunas.tom@gmail.com>

* 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 <norkunas.tom@gmail.com>

* Update src/Plugin/PluginProvider.php

Co-authored-by: Tomas Norkūnas <norkunas.tom@gmail.com>

* Use PHPStan baseline instead of ignore

See https://phpstan.org/user-guide/baseline

---------

Co-authored-by: Tomas Norkūnas <norkunas.tom@gmail.com>
  • Loading branch information
jbelien and norkunas committed Jul 16, 2023
1 parent bcfb50f commit ced6d18
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions Tests/ProviderCacheTest.php
Expand Up @@ -18,6 +18,7 @@
use Geocoder\Provider\Provider;
use Geocoder\Query\GeocodeQuery;
use Geocoder\Query\ReverseQuery;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Psr\SimpleCache\CacheInterface;

Expand All @@ -27,12 +28,12 @@
class ProviderCacheTest extends TestCase
{
/**
* @var \PHPUnit_Framework_MockObject_MockObject|Provider
* @var Provider&MockObject
*/
private $providerMock;

/**
* @var \PHPUnit_Framework_MockObject_MockObject|CacheInterface
* @var CacheInterface&MockObject
*/
private $cacheMock;

Expand Down Expand Up @@ -60,16 +61,6 @@ public function testName()
$this->assertEquals('foo (cache)', $providerCache->getName());
}

public function testMagicFunction()
{
$this->providerMock->expects($this->once())
->method('getFoo')
->willReturn('foo');

$providerCache = new ProviderCache($this->providerMock, $this->cacheMock);
$this->assertEquals('foo', $providerCache->getFoo());
}

public function testGeocodeMiss()
{
$query = GeocodeQuery::create('foo');
Expand Down

0 comments on commit ced6d18

Please sign in to comment.