diff --git a/doc/index.rst b/doc/index.rst index b8bf034..1fdfd49 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -56,7 +56,7 @@ Renderer .. tip:: Read the `Symfony UX Map Leaflet bridge docs`_ and the - `Symfony UX Map Google Maps brige docs`_ to learn about the configuration + `Symfony UX Map Google Maps bridge docs`_ to learn about the configuration options available for each renderer. Create a map @@ -564,7 +564,7 @@ Then, you can use this controller in your template: .. tip:: Read the `Symfony UX Map Leaflet bridge docs`_ and the - `Symfony UX Map Google Maps brige docs`_ to learn about the exact code + `Symfony UX Map Google Maps bridge docs`_ to learn about the exact code needed to customize the markers. Advanced: Low-level options @@ -852,7 +852,7 @@ https://symfony.com/doc/current/contributing/code/bc.html .. _`the Symfony UX initiative`: https://ux.symfony.com/ .. _`Google Maps`: https://github.com/symfony/ux-google-map .. _`Leaflet`: https://github.com/symfony/ux-leaflet-map -.. _`Symfony UX Map Google Maps brige docs`: https://github.com/symfony/ux/blob/2.x/src/Map/src/Bridge/Google/README.md +.. _`Symfony UX Map Google Maps bridge docs`: https://github.com/symfony/ux/blob/2.x/src/Map/src/Bridge/Google/README.md .. _`Symfony UX Map Leaflet bridge docs`: https://github.com/symfony/ux/blob/2.x/src/Map/src/Bridge/Leaflet/README.md .. _`Twig Component`: https://symfony.com/bundles/ux-twig-component/current/index.html .. _`Live Actions`: https://symfony.com/bundles/ux-live-component/current/index.html#actions diff --git a/tests/Distance/DistanceCalculatorTest.php b/tests/Distance/DistanceCalculatorTest.php index 3f6c982..5c7b974 100644 --- a/tests/Distance/DistanceCalculatorTest.php +++ b/tests/Distance/DistanceCalculatorTest.php @@ -21,7 +21,7 @@ use Symfony\UX\Map\Point; class DistanceCalculatorTest extends TestCase { - public function testCalculateDistanceUseCalculator(): void + public function testCalculateDistanceUseCalculator() { $calculator = new class implements DistanceCalculatorInterface { public function calculateDistance(Point $point1, Point $point2): float @@ -41,7 +41,7 @@ class DistanceCalculatorTest extends TestCase * * @dataProvider distanceAccuracyProvider */ - public function testAccuracyAgainstVincenty(Point $point1, Point $point2, float $tolerance): void + public function testAccuracyAgainstVincenty(Point $point1, Point $point2, float $tolerance) { $vincenty = new VincentyDistanceCalculator(); $referenceDistance = $vincenty->calculateDistance($point1, $point2); diff --git a/tests/Distance/DistanceUnitTest.php b/tests/Distance/DistanceUnitTest.php index f33b985..c6d8b1a 100644 --- a/tests/Distance/DistanceUnitTest.php +++ b/tests/Distance/DistanceUnitTest.php @@ -33,7 +33,7 @@ class DistanceUnitTest extends TestCase /** * @dataProvider provideConvertedUnits */ - public function testConversionFactorFrom(DistanceUnit $unit, DistanceUnit $otherUnit, float $expected): void + public function testConversionFactorFrom(DistanceUnit $unit, DistanceUnit $otherUnit, float $expected) { $this->assertEqualsWithDelta($expected, $unit->getConversionFactorFrom($otherUnit), 0.001); } diff --git a/tests/IconTest.php b/tests/IconTest.php index 35ddeb9..68c42cf 100644 --- a/tests/IconTest.php +++ b/tests/IconTest.php @@ -43,7 +43,7 @@ class IconTest extends TestCase * * @param class-string $expectedInstance */ - public function testIconConstruction(Icon $icon, string $expectedInstance, array $expectedToArray): void + public function testIconConstruction(Icon $icon, string $expectedInstance, array $expectedToArray) { self::assertInstanceOf($expectedInstance, $icon); } @@ -51,7 +51,7 @@ class IconTest extends TestCase /** * @dataProvider provideIcons */ - public function testToArray(Icon $icon, string $expectedInstance, array $expectedToArray): void + public function testToArray(Icon $icon, string $expectedInstance, array $expectedToArray) { self::assertSame($expectedToArray, $icon->toArray()); } @@ -59,7 +59,7 @@ class IconTest extends TestCase /** * @dataProvider provideIcons */ - public function testFromArray(Icon $icon, string $expectedInstance, array $expectedToArray): void + public function testFromArray(Icon $icon, string $expectedInstance, array $expectedToArray) { self::assertEquals($icon, Icon::fromArray($expectedToArray)); } @@ -87,7 +87,7 @@ class IconTest extends TestCase /** * @dataProvider dataProviderForTestSvgIconCustomizationMethodsCanNotBeCalled */ - public function testSvgIconCustomizationMethodsCanNotBeCalled(string $method, mixed ...$args): void + public function testSvgIconCustomizationMethodsCanNotBeCalled(string $method, mixed ...$args) { $this->expectException(\LogicException::class); if (\in_array($method, ['width', 'height'], true)) { diff --git a/tests/InfoWindowTest.php b/tests/InfoWindowTest.php index 12c11f9..0ef677e 100644 --- a/tests/InfoWindowTest.php +++ b/tests/InfoWindowTest.php @@ -17,7 +17,7 @@ use Symfony\UX\Map\Point; class InfoWindowTest extends TestCase { - public function testToArray(): void + public function testToArray() { $infoWindow = new InfoWindow( headerContent: 'Paris', diff --git a/tests/MapFactoryTest.php b/tests/MapFactoryTest.php index 2519437..834c4f5 100644 --- a/tests/MapFactoryTest.php +++ b/tests/MapFactoryTest.php @@ -30,7 +30,7 @@ class MapFactoryTest extends TestCase DummyOptions::unregisterFromNormalizer(); } - public function testFromArray(): void + public function testFromArray() { $array = self::createMapArray(); $map = Map::fromArray($array); @@ -62,7 +62,7 @@ class MapFactoryTest extends TestCase $this->assertSame($array['polylines'][0]['infoWindow']['content'], $polylines[0]['infoWindow']['content']); } - public function testToArrayFromArray(): void + public function testToArrayFromArray() { $map = (new Map()) ->center(new Point(48.8566, 2.3522)) @@ -95,7 +95,7 @@ class MapFactoryTest extends TestCase $this->assertEquals($map->toArray(), $newMap->toArray()); } - public function testFromArrayWithInvalidCenter(): void + public function testFromArrayWithInvalidCenter() { $array = self::createMapArray(); $array['center'] = 'invalid'; @@ -104,7 +104,7 @@ class MapFactoryTest extends TestCase Map::fromArray($array); } - public function testFromArrayWithInvalidZoom(): void + public function testFromArrayWithInvalidZoom() { $array = self::createMapArray(); $array['zoom'] = 'invalid'; @@ -113,7 +113,7 @@ class MapFactoryTest extends TestCase Map::fromArray($array); } - public function testFromArrayWithInvalidMarkers(): void + public function testFromArrayWithInvalidMarkers() { $array = self::createMapArray(); $array['markers'] = 'invalid'; @@ -123,7 +123,7 @@ class MapFactoryTest extends TestCase Map::fromArray($array); } - public function testFromArrayWithInvalidMarker(): void + public function testFromArrayWithInvalidMarker() { $array = self::createMapArray(); $array['markers'] = [ @@ -137,7 +137,7 @@ class MapFactoryTest extends TestCase Map::fromArray($array); } - public function testFromArrayWithInvalidPolygons(): void + public function testFromArrayWithInvalidPolygons() { $array = self::createMapArray(); $array['polygons'] = 'invalid'; @@ -147,7 +147,7 @@ class MapFactoryTest extends TestCase Map::fromArray($array); } - public function testFromArrayWithInvalidPolygon(): void + public function testFromArrayWithInvalidPolygon() { $array = self::createMapArray(); $array['polygons'] = [ @@ -161,7 +161,7 @@ class MapFactoryTest extends TestCase Map::fromArray($array); } - public function testFromArrayWithInvalidPolylines(): void + public function testFromArrayWithInvalidPolylines() { $array = self::createMapArray(); $array['polylines'] = 'invalid'; @@ -171,7 +171,7 @@ class MapFactoryTest extends TestCase Map::fromArray($array); } - public function testFromArrayWithInvalidPolyline(): void + public function testFromArrayWithInvalidPolyline() { $array = self::createMapArray(); $array['polylines'] = [ diff --git a/tests/MapOptionsNormalizerTest.php b/tests/MapOptionsNormalizerTest.php index 1348a4a..aa0bbd6 100644 --- a/tests/MapOptionsNormalizerTest.php +++ b/tests/MapOptionsNormalizerTest.php @@ -24,7 +24,7 @@ final class MapOptionsNormalizerTest extends TestCase DummyOptions::unregisterFromNormalizer(); } - public function testDenormalizingWhenProviderKeyIsMissing(): void + public function testDenormalizingWhenProviderKeyIsMissing() { $this->expectException(UnableToDenormalizeOptionsException::class); $this->expectExceptionMessage(' the provider key "@provider" is missing in the normalized options.'); @@ -32,7 +32,7 @@ final class MapOptionsNormalizerTest extends TestCase MapOptionsNormalizer::denormalize([]); } - public function testDenormalizingWhenProviderIsNotSupported(): void + public function testDenormalizingWhenProviderIsNotSupported() { $this->expectException(UnableToDenormalizeOptionsException::class); $this->expectExceptionMessage(' the provider "foo" is not supported. Supported providers are "google", "leaflet".'); @@ -40,7 +40,7 @@ final class MapOptionsNormalizerTest extends TestCase MapOptionsNormalizer::denormalize(['@provider' => 'foo']); } - public function testDenormalizingAndNormalizing(): void + public function testDenormalizingAndNormalizing() { DummyOptions::registerToNormalizer(); diff --git a/tests/MapTest.php b/tests/MapTest.php index c5018d4..f88cec8 100644 --- a/tests/MapTest.php +++ b/tests/MapTest.php @@ -34,7 +34,7 @@ class MapTest extends TestCase DummyOptions::unregisterFromNormalizer(); } - public function testCenterValidation(): void + public function testCenterValidation() { self::expectException(InvalidArgumentException::class); self::expectExceptionMessage('The map "center" must be explicitly set when not enabling "fitBoundsToMarkers" feature.'); @@ -43,7 +43,7 @@ class MapTest extends TestCase $map->toArray(); } - public function testZoomValidation(): void + public function testZoomValidation() { self::expectException(InvalidArgumentException::class); self::expectExceptionMessage('The map "zoom" must be explicitly set when not enabling "fitBoundsToMarkers" feature.'); @@ -54,7 +54,7 @@ class MapTest extends TestCase $map->toArray(); } - public function testZoomAndCenterCanBeOmittedIfFitBoundsToMarkers(): void + public function testZoomAndCenterCanBeOmittedIfFitBoundsToMarkers() { $map = new Map( fitBoundsToMarkers: true @@ -78,7 +78,7 @@ class MapTest extends TestCase ], $array); } - public function testWithMinimumConfiguration(): void + public function testWithMinimumConfiguration() { $map = new Map(); $map @@ -103,7 +103,7 @@ class MapTest extends TestCase ], $array); } - public function testWithMaximumConfiguration(): void + public function testWithMaximumConfiguration() { $map = new Map(); $map @@ -432,7 +432,7 @@ class MapTest extends TestCase * [null, 5, 2, "The \"zoom\" must be less than or equal to \"maxZoom\"."] * [2.1, null, 2.0, "The \"minZoom\" must be less than or equal to \"maxZoom\"."] */ - public function testZoomsValidation(?float $minZoom, ?float $zoom, ?float $maxZoom, string $expectedExceptionMessage): void + public function testZoomsValidation(?float $minZoom, ?float $zoom, ?float $maxZoom, string $expectedExceptionMessage) { self::expectException(InvalidArgumentException::class); self::expectExceptionMessage($expectedExceptionMessage); diff --git a/tests/MarkerTest.php b/tests/MarkerTest.php index db1ae73..c9c886b 100644 --- a/tests/MarkerTest.php +++ b/tests/MarkerTest.php @@ -19,7 +19,7 @@ use Symfony\UX\Map\Point; class MarkerTest extends TestCase { - public function testToArray(): void + public function testToArray() { $marker = new Marker( position: new Point(48.8566, 2.3522), diff --git a/tests/PointTest.php b/tests/PointTest.php index 2032680..2d33e1d 100644 --- a/tests/PointTest.php +++ b/tests/PointTest.php @@ -28,7 +28,7 @@ class PointTest extends TestCase /** * @dataProvider provideInvalidPoint */ - public function testInvalidPoint(float $latitude, float $longitude, string $expectedExceptionMessage): void + public function testInvalidPoint(float $latitude, float $longitude, string $expectedExceptionMessage) { self::expectException(InvalidArgumentException::class); self::expectExceptionMessage($expectedExceptionMessage); @@ -36,21 +36,21 @@ class PointTest extends TestCase new Point($latitude, $longitude); } - public function testGetLatitude(): void + public function testGetLatitude() { $point = new Point(48.8566, 2.3533); self::assertSame(48.8566, $point->getLatitude()); } - public function testGetLongitude(): void + public function testGetLongitude() { $point = new Point(48.8566, 2.3533); self::assertSame(2.3533, $point->getLongitude()); } - public function testToArray(): void + public function testToArray() { $point = new Point(48.8566, 2.3533); diff --git a/tests/Renderer/NullRendererTest.php b/tests/Renderer/NullRendererTest.php index f026c3f..f46d36e 100644 --- a/tests/Renderer/NullRendererTest.php +++ b/tests/Renderer/NullRendererTest.php @@ -44,7 +44,7 @@ final class NullRendererTest extends TestCase /** * @dataProvider provideTestRenderMap */ - public function testRenderMap(string $expectedExceptionMessage, RendererInterface $renderer): void + public function testRenderMap(string $expectedExceptionMessage, RendererInterface $renderer) { self::expectException(LogicException::class); self::expectExceptionMessage($expectedExceptionMessage); diff --git a/tests/Renderer/RendererTest.php b/tests/Renderer/RendererTest.php index 4c4a859..9990dc1 100644 --- a/tests/Renderer/RendererTest.php +++ b/tests/Renderer/RendererTest.php @@ -19,7 +19,7 @@ use Symfony\UX\Map\Renderer\RendererInterface; final class RendererTest extends TestCase { - public function testUnsupportedSchemeException(): void + public function testUnsupportedSchemeException() { self::expectException(UnsupportedSchemeException::class); self::expectExceptionMessage('The renderer "scheme" is not supported.'); @@ -28,7 +28,7 @@ final class RendererTest extends TestCase $renderer->fromString('scheme://default'); } - public function testSupportedFactory(): void + public function testSupportedFactory() { $renderer = new Renderer([ 'one' => $oneFactory = self::createMock(RendererFactoryInterface::class), diff --git a/tests/Renderer/RenderersTest.php b/tests/Renderer/RenderersTest.php index 8458287..a8e6fae 100644 --- a/tests/Renderer/RenderersTest.php +++ b/tests/Renderer/RenderersTest.php @@ -21,7 +21,7 @@ use Symfony\UX\Map\Renderer\Renderers; class RenderersTest extends TestCase { - public function testConstructWithoutRenderers(): void + public function testConstructWithoutRenderers() { self::expectException(LogicException::class); self::expectExceptionMessage('"Symfony\UX\Map\Renderer\Renderers" must have at least one renderer configured.'); @@ -29,7 +29,7 @@ class RenderersTest extends TestCase new Renderers([]); } - public function testRenderMapWithDefaultRenderer(): void + public function testRenderMapWithDefaultRenderer() { $defaultRenderer = $this->createMock(RendererInterface::class); $defaultRenderer->expects(self::once())->method('renderMap')->willReturn('
'); @@ -39,7 +39,7 @@ class RenderersTest extends TestCase self::assertSame('
', $renderers->renderMap(new Map())); } - public function testRenderMapWithCustomRenderer(): void + public function testRenderMapWithCustomRenderer() { $defaultRenderer = $this->createMock(RendererInterface::class); $defaultRenderer->expects(self::never())->method('renderMap'); @@ -54,7 +54,7 @@ class RenderersTest extends TestCase self::assertSame('
', $renderers->renderMap($map)); } - public function testRenderMapWithUnknownRenderer(): void + public function testRenderMapWithUnknownRenderer() { self::expectException(LogicException::class); self::expectExceptionMessage('The "unknown" renderer does not exist (available renderers: "default").'); diff --git a/tests/Twig/MapComponentTest.php b/tests/Twig/MapComponentTest.php index 031fd92..fa57a47 100644 --- a/tests/Twig/MapComponentTest.php +++ b/tests/Twig/MapComponentTest.php @@ -24,7 +24,7 @@ class MapComponentTest extends KernelTestCase return TwigComponentKernel::class; } - public function testRenderMapComponent(): void + public function testRenderMapComponent() { $map = (new Map()) ->center(new Point(latitude: 5, longitude: 10)) diff --git a/tests/Twig/MapExtensionTest.php b/tests/Twig/MapExtensionTest.php index 9e7c2b4..e3a1bf6 100644 --- a/tests/Twig/MapExtensionTest.php +++ b/tests/Twig/MapExtensionTest.php @@ -30,7 +30,7 @@ class MapExtensionTest extends KernelTestCase return TwigAppKernel::class; } - public function testExtensionIsRegistered(): void + public function testExtensionIsRegistered() { /** @var Environment $twig */ $twig = self::getContainer()->get('twig'); @@ -39,7 +39,7 @@ class MapExtensionTest extends KernelTestCase $this->assertInstanceOf(MapExtension::class, $twig->getExtension(MapExtension::class)); } - public function testRuntimeIsRegistered(): void + public function testRuntimeIsRegistered() { /** @var Environment $twig */ $twig = self::getContainer()->get('twig'); @@ -47,7 +47,7 @@ class MapExtensionTest extends KernelTestCase $this->assertInstanceOf(MapRuntime::class, $twig->getRuntime(MapRuntime::class)); } - public function testMapFunctionWithArray(): void + public function testMapFunctionWithArray() { $map = (new Map()) ->center(new Point(latitude: 5, longitude: 10)) diff --git a/tests/TwigTest.php b/tests/TwigTest.php index b69da03..c3e4a7f 100644 --- a/tests/TwigTest.php +++ b/tests/TwigTest.php @@ -25,7 +25,7 @@ final class TwigTest extends KernelTestCase return TwigAppKernel::class; } - public function testRenderMap(): void + public function testRenderMap() { $map = new Map(); $attributes = ['data-foo' => 'bar']; diff --git a/tests/UXMapBundleTest.php b/tests/UXMapBundleTest.php index 169b890..dd385a2 100644 --- a/tests/UXMapBundleTest.php +++ b/tests/UXMapBundleTest.php @@ -35,7 +35,7 @@ class UXMapBundleTest extends TestCase * * @param class-string $kernelClass */ - public function testBootKernel(string $kernelClass): void + public function testBootKernel(string $kernelClass) { $kernel = new $kernelClass('test', true); $kernel->boot(); @@ -48,7 +48,7 @@ class UXMapBundleTest extends TestCase * * @param class-string $kernelClass */ - public function testNullRendererAsDefault(string $kernelClass): void + public function testNullRendererAsDefault(string $kernelClass) { $expectedRenderer = new NullRenderer(['symfony/ux-google-map', 'symfony/ux-leaflet-map']); diff --git a/tests/Utils/CoordinateUtilsTest.php b/tests/Utils/CoordinateUtilsTest.php index e7ac82d..bb1e66e 100644 --- a/tests/Utils/CoordinateUtilsTest.php +++ b/tests/Utils/CoordinateUtilsTest.php @@ -15,31 +15,31 @@ use PHPUnit\Framework\TestCase; class CoordinateUtilsTest extends TestCase { - public function testDecimalToDMSConvertsCorrectly(): void + public function testDecimalToDMSConvertsCorrectly() { $result = CoordinateUtils::decimalToDMS(48.8588443); $this->assertSame([48, 51, 31.83948], $result); } - public function testDecimalToDMSHandlesNegativeValues(): void + public function testDecimalToDMSHandlesNegativeValues() { $result = CoordinateUtils::decimalToDMS(-48.8588443); $this->assertSame([-48, 51, 31.83948], $result); } - public function testDMSToDecimalConvertsCorrectly(): void + public function testDMSToDecimalConvertsCorrectly() { $result = CoordinateUtils::DMSToDecimal(48, 51, 31.8388); $this->assertSame(48.858844, $result); } - public function testDMSToDecimalHandlesNegativeValues(): void + public function testDMSToDecimalHandlesNegativeValues() { $result = CoordinateUtils::DMSToDecimal(-48, 51, 31.8388); $this->assertSame(-48.858844, $result); } - public function testDMSToDecimalHandlesZeroValues(): void + public function testDMSToDecimalHandlesZeroValues() { $result = CoordinateUtils::DMSToDecimal(0, 0, 0.0); $this->assertSame(0.0, $result);