Skip to content

[Map] Downgrade PHP requirement from 8.3 to 8.1 #2695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ jobs:
minimum-stability: 'dev'
- php-version: '8.3'
minimum-stability: 'dev'
- component: Map # does not support PHP 8.1
php-version: '8.1'
- component: Map/src/Bridge/Google # does not support PHP 8.1
php-version: '8.1'
- component: Map/src/Bridge/Leaflet # does not support PHP 8.1
php-version: '8.1'
- component: Swup # has no tests
- component: Turbo # has its own workflow (test-turbo.yml)
- component: Typed # has no tests
Expand Down
10 changes: 7 additions & 3 deletions src/Map/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 2.25

- Downgrade PHP requirement from 8.3 to 8.1

## 2.24

- Installing the package in a Symfony app using Flex won't add the `@symfony/ux-map` dependency to the `package.json` file anymore.
Expand All @@ -26,13 +30,13 @@

## 2.20

- Deprecate `render_map` Twig function (will be removed in 2.21). Use
- Deprecate `render_map` Twig function (will be removed in 2.21). Use
`ux_map` or the `<twig:ux:map />` Twig component instead.
- Add `ux_map` Twig function (replaces `render_map` with a more flexible
- Add `ux_map` Twig function (replaces `render_map` with a more flexible
interface)
- Add `<twig:ux:map />` Twig component
- The importmap entry `@symfony/ux-map/abstract-map-controller` can be removed
from your importmap, it is no longer needed.
from your importmap, it is no longer needed.
- Add `Polygon` support

## 2.19
Expand Down
4 changes: 2 additions & 2 deletions src/Map/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
}
},
"require": {
"php": ">=8.3",
"php": ">=8.1",
"symfony/stimulus-bundle": "^2.18.1"
},
"require-dev": {
"symfony/asset-mapper": "^6.4|^7.0",
"symfony/framework-bundle": "^6.4|^7.0",
"symfony/phpunit-bridge": "^6.4|^7.0",
"symfony/phpunit-bridge": "^7.2",
"symfony/twig-bundle": "^6.4|^7.0",
"symfony/ux-twig-component": "^2.18",
"symfony/ux-icons": "^2.18"
Expand Down
6 changes: 5 additions & 1 deletion src/Map/src/Bridge/Google/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 2.25

- Downgrade PHP requirement from 8.3 to 8.1

## 2.22

- Add support for configuring a default Map ID
Expand All @@ -10,7 +14,7 @@

### BC Breaks

- Renamed importmap entry `@symfony/ux-google-map/map-controller` to `@symfony/ux-google-map`,
- Renamed importmap entry `@symfony/ux-google-map/map-controller` to `@symfony/ux-google-map`,
you will need to update your importmap.

## 2.19
Expand Down
7 changes: 4 additions & 3 deletions src/Map/src/Bridge/Google/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
}
],
"require": {
"php": ">=8.3",
"php": ">=8.1",
"symfony/stimulus-bundle": "^2.18.1",
"symfony/ux-map": "^2.19"
},
"require-dev": {
"symfony/phpunit-bridge": "^6.4|^7.0",
"symfony/phpunit-bridge": "^7.2",
"symfony/ux-icons": "^2.18",
"spatie/phpunit-snapshot-assertions": "^5.1.8"
"spatie/phpunit-snapshot-assertions": "^4.2.17",
"phpunit/phpunit": "^9.6.22"
},
"autoload": {
"psr-4": { "Symfony\\UX\\Map\\Bridge\\Google\\": "src/" },
Expand Down
3 changes: 1 addition & 2 deletions src/Map/src/Bridge/Google/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
<directory suffix=".php">./src</directory>
</include>
</coverage>

<php>
<ini name="error_reporting" value="-1"/>
<server name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0"/>
<server name="SYMFONY_PHPUNIT_VERSION" value="11.5.0"/>
</php>

<testsuites>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
*
* @author Hugo Alliaume <hugo@alliau.me>
*/
final readonly class FullscreenControlOptions
final class FullscreenControlOptions
{
public function __construct(
private ControlPosition $position = ControlPosition::INLINE_END_BLOCK_START,
private readonly ControlPosition $position = ControlPosition::INLINE_END_BLOCK_START,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
*
* @author Hugo Alliaume <hugo@alliau.me>
*/
final readonly class MapTypeControlOptions
final class MapTypeControlOptions
{
/**
* @param array<'hybrid'|'roadmap'|'satellite'|'terrain'|string> $mapTypeIds
*/
public function __construct(
private array $mapTypeIds = [],
private ControlPosition $position = ControlPosition::BLOCK_START_INLINE_START,
private MapTypeControlStyle $style = MapTypeControlStyle::DEFAULT,
private readonly array $mapTypeIds = [],
private readonly ControlPosition $position = ControlPosition::BLOCK_START_INLINE_START,
private readonly MapTypeControlStyle $style = MapTypeControlStyle::DEFAULT,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
*
* @author Hugo Alliaume <hugo@alliau.me>
*/
final readonly class StreetViewControlOptions
final class StreetViewControlOptions
{
public function __construct(
private ControlPosition $position = ControlPosition::INLINE_END_BLOCK_END,
private readonly ControlPosition $position = ControlPosition::INLINE_END_BLOCK_END,
) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/Map/src/Bridge/Google/src/Option/ZoomControlOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
*
* @author Hugo Alliaume <hugo@alliau.me>
*/
final readonly class ZoomControlOptions
final class ZoomControlOptions
{
public function __construct(
private ControlPosition $position = ControlPosition::INLINE_END_BLOCK_END,
private readonly ControlPosition $position = ControlPosition::INLINE_END_BLOCK_END,
) {
}

Expand Down
23 changes: 11 additions & 12 deletions src/Map/src/Bridge/Google/src/Renderer/GoogleRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,27 @@
*
* @internal
*/
final readonly class GoogleRenderer extends AbstractRenderer
final class GoogleRenderer extends AbstractRenderer
{
/**
* Parameters are based from https://googlemaps.github.io/js-api-loader/interfaces/LoaderOptions.html documentation.
*/
public function __construct(
StimulusHelper $stimulusHelper,
UxIconRenderer $uxIconRenderer,
#[\SensitiveParameter]
private string $apiKey,
private ?string $id = null,
private ?string $language = null,
private ?string $region = null,
private ?string $nonce = null,
private ?int $retries = null,
private ?string $url = null,
private ?string $version = null,
#[\SensitiveParameter] private readonly string $apiKey,
private readonly ?string $id = null,
private readonly ?string $language = null,
private readonly ?string $region = null,
private readonly ?string $nonce = null,
private readonly ?int $retries = null,
private readonly ?string $url = null,
private readonly ?string $version = null,
/**
* @var array<'core'|'maps'|'places'|'geocoding'|'routes'|'marker'|'geometry'|'elevation'|'streetView'|'journeySharing'|'drawing'|'visualization'>
*/
private array $libraries = [],
private ?string $defaultMapId = null,
private readonly array $libraries = [],
private readonly ?string $defaultMapId = null,
) {
parent::__construct($stimulusHelper, $uxIconRenderer);
}
Expand Down
8 changes: 6 additions & 2 deletions src/Map/src/Bridge/Leaflet/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# CHANGELOG

## 2.25

- Downgrade PHP requirement from 8.3 to 8.1

## 2.20

### BC Breaks

- Renamed importmap entry `@symfony/ux-leaflet-map/map-controller` to `@symfony/ux-leaflet-map`,
you will need to update your importmap.
- Renamed importmap entry `@symfony/ux-leaflet-map/map-controller` to `@symfony/ux-leaflet-map`,
you will need to update your importmap.

## 2.19

Expand Down
7 changes: 4 additions & 3 deletions src/Map/src/Bridge/Leaflet/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
}
],
"require": {
"php": ">=8.3",
"php": ">=8.1",
"symfony/stimulus-bundle": "^2.18.1",
"symfony/ux-map": "^2.19"
},
"require-dev": {
"symfony/phpunit-bridge": "^6.4|^7.0",
"symfony/phpunit-bridge": "^7.2",
"symfony/ux-icons": "^2.18",
"spatie/phpunit-snapshot-assertions": "^5.1.8"
"spatie/phpunit-snapshot-assertions": "^4.2.17",
"phpunit/phpunit": "^9.6.22"
},
"autoload": {
"psr-4": { "Symfony\\UX\\Map\\Bridge\\Leaflet\\": "src/" },
Expand Down
3 changes: 1 addition & 2 deletions src/Map/src/Bridge/Leaflet/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
<directory suffix=".php">./src</directory>
</include>
</coverage>

<php>
<ini name="error_reporting" value="-1"/>
<server name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0"/>
<server name="SYMFONY_PHPUNIT_VERSION" value="11.5.0"/>
</php>

<testsuites>
Expand Down
8 changes: 4 additions & 4 deletions src/Map/src/Bridge/Leaflet/src/Option/TileLayer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
*
* @author Hugo Alliaume <hugo@alliau.me>
*/
final readonly class TileLayer
final class TileLayer
{
/**
* @param array<mixed> $options
*/
public function __construct(
private string $url,
private string $attribution,
private array $options = [],
private readonly string $url,
private readonly string $attribution,
private readonly array $options = [],
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* @internal
*/
final readonly class LeafletRenderer extends AbstractRenderer
final class LeafletRenderer extends AbstractRenderer
{
protected function getName(): string
{
Expand Down
6 changes: 3 additions & 3 deletions src/Map/src/Distance/DistanceCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
/**
* @author Simon André <smn.andre@gmail.com>
*/
final readonly class DistanceCalculator implements DistanceCalculatorInterface
final class DistanceCalculator implements DistanceCalculatorInterface
{
public function __construct(
private DistanceCalculatorInterface $calculator = new VincentyDistanceCalculator(),
private DistanceUnit $unit = DistanceUnit::Meter,
private readonly DistanceCalculatorInterface $calculator = new VincentyDistanceCalculator(),
private readonly DistanceUnit $unit = DistanceUnit::Meter,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Map/src/Distance/HaversineDistanceCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* @author Simon André <smn.andre@gmail.com>
*/
final readonly class HaversineDistanceCalculator implements DistanceCalculatorInterface
final class HaversineDistanceCalculator implements DistanceCalculatorInterface
{
/**
* @const float The Earth's radius in meters.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* @author Simon André <smn.andre@gmail.com>
*/
final readonly class SphericalCosineDistanceCalculator implements DistanceCalculatorInterface
final class SphericalCosineDistanceCalculator implements DistanceCalculatorInterface
{
/**
* @const float The Earth's radius in meters.
Expand Down
2 changes: 1 addition & 1 deletion src/Map/src/Distance/VincentyDistanceCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* @author Simon André <smn.andre@gmail.com>
*/
final readonly class VincentyDistanceCalculator implements DistanceCalculatorInterface
final class VincentyDistanceCalculator implements DistanceCalculatorInterface
{
/**
* WS-84 ellipsoid parameters.
Expand Down
4 changes: 2 additions & 2 deletions src/Map/src/Icon/UxIconRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
*
* @internal
*/
readonly class UxIconRenderer
class UxIconRenderer
{
public function __construct(
private ?IconRendererInterface $renderer,
private readonly ?IconRendererInterface $renderer,
) {
}

Expand Down
14 changes: 7 additions & 7 deletions src/Map/src/InfoWindow.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
*
* @author Hugo Alliaume <hugo@alliau.me>
*/
final readonly class InfoWindow
final class InfoWindow
{
/**
* @param array<string, mixed> $extra Extra data, can be used by the developer to store additional information and
* use them later JavaScript side
*/
public function __construct(
private ?string $headerContent = null,
private ?string $content = null,
private ?Point $position = null,
private bool $opened = false,
private bool $autoClose = true,
private array $extra = [],
private readonly ?string $headerContent = null,
private readonly ?string $content = null,
private readonly ?Point $position = null,
private readonly bool $opened = false,
private readonly bool $autoClose = true,
private readonly array $extra = [],
) {
}

Expand Down
5 changes: 4 additions & 1 deletion src/Map/src/MapOptionsNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
*/
final class MapOptionsNormalizer
{
private const string KEY_PROVIDER = '@provider';
/**
* @var string
*/
private const KEY_PROVIDER = '@provider';

/**
* @var array<string, class-string<MapOptionsInterface>>
Expand Down
Loading
Loading