Skip to content

Commit 6127799

Browse files
committed
feature #2695 [Map] Downgrade PHP requirement from 8.3 to 8.1 (Kocal)
This PR was merged into the 2.x branch. Discussion ---------- [Map] Downgrade PHP requirement from 8.3 to 8.1 | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes <!-- please update src/**/CHANGELOG.md files --> | Docs? | yes/no <!-- required for new features --> | Issues | Fix #2681 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - For new features, provide some code snippets to help understand usage. - Features and deprecations must be submitted against branch main. - Update/add documentation as required (we can help!) - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> See #2681 Downgrade done with Rector Commits ------- 43625af [Map] Downgrade PHP requirement from 8.3 to 8.1
2 parents 26ed9f1 + 43625af commit 6127799

34 files changed

+118
-109
lines changed

.github/workflows/test.yaml

-6
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,6 @@ jobs:
8484
minimum-stability: 'dev'
8585
- php-version: '8.3'
8686
minimum-stability: 'dev'
87-
- component: Map # does not support PHP 8.1
88-
php-version: '8.1'
89-
- component: Map/src/Bridge/Google # does not support PHP 8.1
90-
php-version: '8.1'
91-
- component: Map/src/Bridge/Leaflet # does not support PHP 8.1
92-
php-version: '8.1'
9387
- component: Swup # has no tests
9488
- component: Turbo # has its own workflow (test-turbo.yml)
9589
- component: Typed # has no tests

src/Map/CHANGELOG.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## 2.25
4+
5+
- Downgrade PHP requirement from 8.3 to 8.1
6+
37
## 2.24
48

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

2731
## 2.20
2832

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

3842
## 2.19

src/Map/composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232
}
3333
},
3434
"require": {
35-
"php": ">=8.3",
35+
"php": ">=8.1",
3636
"symfony/stimulus-bundle": "^2.18.1"
3737
},
3838
"require-dev": {
3939
"symfony/asset-mapper": "^6.4|^7.0",
4040
"symfony/framework-bundle": "^6.4|^7.0",
41-
"symfony/phpunit-bridge": "^6.4|^7.0",
41+
"symfony/phpunit-bridge": "^7.2",
4242
"symfony/twig-bundle": "^6.4|^7.0",
4343
"symfony/ux-twig-component": "^2.18",
4444
"symfony/ux-icons": "^2.18"

src/Map/src/Bridge/Google/CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## 2.25
4+
5+
- Downgrade PHP requirement from 8.3 to 8.1
6+
37
## 2.22
48

59
- Add support for configuring a default Map ID
@@ -10,7 +14,7 @@
1014

1115
### BC Breaks
1216

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

1620
## 2.19

src/Map/src/Bridge/Google/composer.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616
}
1717
],
1818
"require": {
19-
"php": ">=8.3",
19+
"php": ">=8.1",
2020
"symfony/stimulus-bundle": "^2.18.1",
2121
"symfony/ux-map": "^2.19"
2222
},
2323
"require-dev": {
24-
"symfony/phpunit-bridge": "^6.4|^7.0",
24+
"symfony/phpunit-bridge": "^7.2",
2525
"symfony/ux-icons": "^2.18",
26-
"spatie/phpunit-snapshot-assertions": "^5.1.8"
26+
"spatie/phpunit-snapshot-assertions": "^4.2.17",
27+
"phpunit/phpunit": "^9.6.22"
2728
},
2829
"autoload": {
2930
"psr-4": { "Symfony\\UX\\Map\\Bridge\\Google\\": "src/" },

src/Map/src/Bridge/Google/phpunit.xml.dist

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
<directory suffix=".php">./src</directory>
1313
</include>
1414
</coverage>
15-
15+
1616
<php>
1717
<ini name="error_reporting" value="-1"/>
1818
<server name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0"/>
19-
<server name="SYMFONY_PHPUNIT_VERSION" value="11.5.0"/>
2019
</php>
2120

2221
<testsuites>

src/Map/src/Bridge/Google/src/Option/FullscreenControlOptions.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
*
1919
* @author Hugo Alliaume <[email protected]>
2020
*/
21-
final readonly class FullscreenControlOptions
21+
final class FullscreenControlOptions
2222
{
2323
public function __construct(
24-
private ControlPosition $position = ControlPosition::INLINE_END_BLOCK_START,
24+
private readonly ControlPosition $position = ControlPosition::INLINE_END_BLOCK_START,
2525
) {
2626
}
2727

src/Map/src/Bridge/Google/src/Option/MapTypeControlOptions.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
*
1919
* @author Hugo Alliaume <[email protected]>
2020
*/
21-
final readonly class MapTypeControlOptions
21+
final class MapTypeControlOptions
2222
{
2323
/**
2424
* @param array<'hybrid'|'roadmap'|'satellite'|'terrain'|string> $mapTypeIds
2525
*/
2626
public function __construct(
27-
private array $mapTypeIds = [],
28-
private ControlPosition $position = ControlPosition::BLOCK_START_INLINE_START,
29-
private MapTypeControlStyle $style = MapTypeControlStyle::DEFAULT,
27+
private readonly array $mapTypeIds = [],
28+
private readonly ControlPosition $position = ControlPosition::BLOCK_START_INLINE_START,
29+
private readonly MapTypeControlStyle $style = MapTypeControlStyle::DEFAULT,
3030
) {
3131
}
3232

src/Map/src/Bridge/Google/src/Option/StreetViewControlOptions.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
*
1919
* @author Hugo Alliaume <[email protected]>
2020
*/
21-
final readonly class StreetViewControlOptions
21+
final class StreetViewControlOptions
2222
{
2323
public function __construct(
24-
private ControlPosition $position = ControlPosition::INLINE_END_BLOCK_END,
24+
private readonly ControlPosition $position = ControlPosition::INLINE_END_BLOCK_END,
2525
) {
2626
}
2727

src/Map/src/Bridge/Google/src/Option/ZoomControlOptions.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
*
1919
* @author Hugo Alliaume <[email protected]>
2020
*/
21-
final readonly class ZoomControlOptions
21+
final class ZoomControlOptions
2222
{
2323
public function __construct(
24-
private ControlPosition $position = ControlPosition::INLINE_END_BLOCK_END,
24+
private readonly ControlPosition $position = ControlPosition::INLINE_END_BLOCK_END,
2525
) {
2626
}
2727

src/Map/src/Bridge/Google/src/Renderer/GoogleRenderer.php

+11-12
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,27 @@
2222
*
2323
* @internal
2424
*/
25-
final readonly class GoogleRenderer extends AbstractRenderer
25+
final class GoogleRenderer extends AbstractRenderer
2626
{
2727
/**
2828
* Parameters are based from https://googlemaps.github.io/js-api-loader/interfaces/LoaderOptions.html documentation.
2929
*/
3030
public function __construct(
3131
StimulusHelper $stimulusHelper,
3232
UxIconRenderer $uxIconRenderer,
33-
#[\SensitiveParameter]
34-
private string $apiKey,
35-
private ?string $id = null,
36-
private ?string $language = null,
37-
private ?string $region = null,
38-
private ?string $nonce = null,
39-
private ?int $retries = null,
40-
private ?string $url = null,
41-
private ?string $version = null,
33+
#[\SensitiveParameter] private readonly string $apiKey,
34+
private readonly ?string $id = null,
35+
private readonly ?string $language = null,
36+
private readonly ?string $region = null,
37+
private readonly ?string $nonce = null,
38+
private readonly ?int $retries = null,
39+
private readonly ?string $url = null,
40+
private readonly ?string $version = null,
4241
/**
4342
* @var array<'core'|'maps'|'places'|'geocoding'|'routes'|'marker'|'geometry'|'elevation'|'streetView'|'journeySharing'|'drawing'|'visualization'>
4443
*/
45-
private array $libraries = [],
46-
private ?string $defaultMapId = null,
44+
private readonly array $libraries = [],
45+
private readonly ?string $defaultMapId = null,
4746
) {
4847
parent::__construct($stimulusHelper, $uxIconRenderer);
4948
}

src/Map/src/Bridge/Leaflet/CHANGELOG.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
# CHANGELOG
22

3+
## 2.25
4+
5+
- Downgrade PHP requirement from 8.3 to 8.1
6+
37
## 2.20
48

59
### BC Breaks
610

7-
- Renamed importmap entry `@symfony/ux-leaflet-map/map-controller` to `@symfony/ux-leaflet-map`,
8-
you will need to update your importmap.
11+
- Renamed importmap entry `@symfony/ux-leaflet-map/map-controller` to `@symfony/ux-leaflet-map`,
12+
you will need to update your importmap.
913

1014
## 2.19
1115

src/Map/src/Bridge/Leaflet/composer.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616
}
1717
],
1818
"require": {
19-
"php": ">=8.3",
19+
"php": ">=8.1",
2020
"symfony/stimulus-bundle": "^2.18.1",
2121
"symfony/ux-map": "^2.19"
2222
},
2323
"require-dev": {
24-
"symfony/phpunit-bridge": "^6.4|^7.0",
24+
"symfony/phpunit-bridge": "^7.2",
2525
"symfony/ux-icons": "^2.18",
26-
"spatie/phpunit-snapshot-assertions": "^5.1.8"
26+
"spatie/phpunit-snapshot-assertions": "^4.2.17",
27+
"phpunit/phpunit": "^9.6.22"
2728
},
2829
"autoload": {
2930
"psr-4": { "Symfony\\UX\\Map\\Bridge\\Leaflet\\": "src/" },

src/Map/src/Bridge/Leaflet/phpunit.xml.dist

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
<directory suffix=".php">./src</directory>
1313
</include>
1414
</coverage>
15-
15+
1616
<php>
1717
<ini name="error_reporting" value="-1"/>
1818
<server name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0"/>
19-
<server name="SYMFONY_PHPUNIT_VERSION" value="11.5.0"/>
2019
</php>
2120

2221
<testsuites>

src/Map/src/Bridge/Leaflet/src/Option/TileLayer.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
*
1919
* @author Hugo Alliaume <[email protected]>
2020
*/
21-
final readonly class TileLayer
21+
final class TileLayer
2222
{
2323
/**
2424
* @param array<mixed> $options
2525
*/
2626
public function __construct(
27-
private string $url,
28-
private string $attribution,
29-
private array $options = [],
27+
private readonly string $url,
28+
private readonly string $attribution,
29+
private readonly array $options = [],
3030
) {
3131
}
3232

src/Map/src/Bridge/Leaflet/src/Renderer/LeafletRenderer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
* @internal
2222
*/
23-
final readonly class LeafletRenderer extends AbstractRenderer
23+
final class LeafletRenderer extends AbstractRenderer
2424
{
2525
protected function getName(): string
2626
{

src/Map/src/Distance/DistanceCalculator.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
/**
1717
* @author Simon André <[email protected]>
1818
*/
19-
final readonly class DistanceCalculator implements DistanceCalculatorInterface
19+
final class DistanceCalculator implements DistanceCalculatorInterface
2020
{
2121
public function __construct(
22-
private DistanceCalculatorInterface $calculator = new VincentyDistanceCalculator(),
23-
private DistanceUnit $unit = DistanceUnit::Meter,
22+
private readonly DistanceCalculatorInterface $calculator = new VincentyDistanceCalculator(),
23+
private readonly DistanceUnit $unit = DistanceUnit::Meter,
2424
) {
2525
}
2626

src/Map/src/Distance/HaversineDistanceCalculator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
* @author Simon André <[email protected]>
2222
*/
23-
final readonly class HaversineDistanceCalculator implements DistanceCalculatorInterface
23+
final class HaversineDistanceCalculator implements DistanceCalculatorInterface
2424
{
2525
/**
2626
* @const float The Earth's radius in meters.

src/Map/src/Distance/SphericalCosineDistanceCalculator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
* @author Simon André <[email protected]>
2222
*/
23-
final readonly class SphericalCosineDistanceCalculator implements DistanceCalculatorInterface
23+
final class SphericalCosineDistanceCalculator implements DistanceCalculatorInterface
2424
{
2525
/**
2626
* @const float The Earth's radius in meters.

src/Map/src/Distance/VincentyDistanceCalculator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
* @author Simon André <[email protected]>
2222
*/
23-
final readonly class VincentyDistanceCalculator implements DistanceCalculatorInterface
23+
final class VincentyDistanceCalculator implements DistanceCalculatorInterface
2424
{
2525
/**
2626
* WS-84 ellipsoid parameters.

src/Map/src/Icon/UxIconRenderer.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
*
1919
* @internal
2020
*/
21-
readonly class UxIconRenderer
21+
class UxIconRenderer
2222
{
2323
public function __construct(
24-
private ?IconRendererInterface $renderer,
24+
private readonly ?IconRendererInterface $renderer,
2525
) {
2626
}
2727

src/Map/src/InfoWindow.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@
1616
*
1717
* @author Hugo Alliaume <[email protected]>
1818
*/
19-
final readonly class InfoWindow
19+
final class InfoWindow
2020
{
2121
/**
2222
* @param array<string, mixed> $extra Extra data, can be used by the developer to store additional information and
2323
* use them later JavaScript side
2424
*/
2525
public function __construct(
26-
private ?string $headerContent = null,
27-
private ?string $content = null,
28-
private ?Point $position = null,
29-
private bool $opened = false,
30-
private bool $autoClose = true,
31-
private array $extra = [],
26+
private readonly ?string $headerContent = null,
27+
private readonly ?string $content = null,
28+
private readonly ?Point $position = null,
29+
private readonly bool $opened = false,
30+
private readonly bool $autoClose = true,
31+
private readonly array $extra = [],
3232
) {
3333
}
3434

src/Map/src/MapOptionsNormalizer.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626
*/
2727
final class MapOptionsNormalizer
2828
{
29-
private const string KEY_PROVIDER = '@provider';
29+
/**
30+
* @var string
31+
*/
32+
private const KEY_PROVIDER = '@provider';
3033

3134
/**
3235
* @var array<string, class-string<MapOptionsInterface>>

0 commit comments

Comments
 (0)