Skip to content

Commit d81980e

Browse files
committed
Merge branch '2.x' into 3.x
* 2.x: Tests on Symfony 8 stable # Conflicts: # .github/workflows/.utils.sh # .github/workflows/unit-tests.yaml # src/Autocomplete/composer.json # src/LiveComponent/composer.json # src/LiveComponent/tests/Fixtures/Kernel.php # src/Turbo/composer.json
2 parents d019f4a + 7217125 commit d81980e

File tree

8 files changed

+53
-43
lines changed

8 files changed

+53
-43
lines changed

.github/workflows/.utils.sh

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,29 @@ _run_task() {
2929
}
3030
export -f _run_task
3131

32-
install_property_info_for_version() {
33-
local php_version="$1"
34-
local symfony_version="$2"
35-
local min_stability="$3"
32+
# Install specific versions of PropertyInfo and TypeInfo based on PHP and Symfony versions
33+
# To remove in Symfony UX 4.0
34+
live_component_post_install() {
35+
local php_version=$1
3636

37-
if [ "$php_version" = "8.2" ] || [ "$symfony_version" = "6.4.*" ]; then
38-
# Prevent usage of TypeInfo, required to test support of LegacyLivePropMetadata
39-
composer require symfony/property-info:6.4.*
40-
elif [ "$php_version" = "8.3" ] ; then
41-
composer require symfony/property-info:7.1.* symfony/type-info:7.2.*
42-
elif [ "$php_version" = "8.4" ]; then
43-
composer require symfony/property-info:7.2.* symfony/type-info:7.2.*
44-
elif [ "$php_version" = "8.5" ] && [ "$min_stability" = "stable" ]; then
45-
composer require symfony/property-info:7.3.* symfony/type-info:7.3.*
46-
elif [ "$php_version" = "8.5" ] && [ "$min_stability" = "dev" ]; then
47-
composer require symfony/property-info:8.0.x-dev symfony/type-info:8.0.x-dev
48-
fi
37+
case "$php_version" in
38+
8.2)
39+
# no-op, let Composer install the best PropertyInfo version (defined in composer.json), but do not require TypeInfo
40+
return 0
41+
;;
42+
8.3)
43+
# PropertyInfo 7.1 (experimental PropertyTypeExtractorInterface::getType) and TypeInfo 7.2 (lowest non-experimental)
44+
composer require symfony/property-info:7.1.* symfony/type-info:7.2.*
45+
return $?
46+
;;
47+
8.4)
48+
# Install PropertyInfo 7.3 (deprecate PropertyTypeExtractorInterface::getTypes) and TypeInfo 7.3 (new features and deprecations)
49+
composer require symfony/property-info:7.3.* symfony/type-info:7.3.*
50+
return $?
51+
;;
52+
esac
53+
54+
# Install the best TypeInfo version available
55+
composer require symfony/type-info
4956
}
50-
export -f install_property_info_for_version
57+
export -f live_component_post_install

.github/workflows/unit-tests.yaml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,31 +36,28 @@ jobs:
3636
include:
3737
- minimum-stability: 'dev'
3838
php-version: '8.5'
39+
3940
# lowest deps
4041
- php-version: '8.2'
4142
dependency-version: 'lowest'
4243

43-
# oldest LTS
44+
# 6.4 LTS
4445
- php-version: '8.2'
4546
symfony-version: '6.4.*'
4647

47-
# oldest LTS + Windows
48+
# 7.4 LTS
4849
- php-version: '8.2'
49-
symfony-version: '6.4.*'
50+
symfony-version: '7.4.*'
51+
- php-version: '8.2'
52+
symfony-version: '7.4.*'
5053
os: 'windows-latest'
5154

5255
# Explicit Symfony versions
53-
- php-version: '8.2'
54-
symfony-version: '^7.4.0-RC1' # TODO: change to '7.4.*' when Symfony 7.4 is released
55-
minimum-stability: 'RC'
56-
5756
- php-version: '8.4'
58-
symfony-version: '^8.0.0-RC1' # TODO: change to '8.0.*' when Symfony 8.0 is released
59-
minimum-stability: 'RC'
60-
57+
symfony-version: '8.0.*'
6158
- php-version: '8.5'
62-
symfony-version: '^8.0.0-RC1' # TODO: change to '8.0.*' when Symfony 8.0 is released
63-
minimum-stability: 'RC'
59+
symfony-version: '8.0.*'
60+
6461

6562
env:
6663
SYMFONY_REQUIRE: ${{ matrix.symfony-version || '>=6.4' }}
@@ -120,7 +117,7 @@ jobs:
120117
'(cd src/{} \
121118
&& $COMPOSER_MIN_STAB \
122119
&& $COMPOSER_UP \
123-
&& if [ {} = LiveComponent ]; then install_property_info_for_version \"${{ matrix.php-version }}\" \"${{ matrix.symfony-version }}\" \"${{ matrix.minimum-stability }}\"; fi \
120+
&& if [ {} = LiveComponent ]; then live_component_post_install \"${{ matrix.php-version }}\"; fi \
124121
&& $PHPUNIT)'"
125122
126123
- name: Run packages tests (Windows)
@@ -135,7 +132,7 @@ jobs:
135132
'(cd src/$PACKAGE \
136133
&& $COMPOSER_MIN_STAB \
137134
&& $COMPOSER_UP \
138-
&& if [ "$PACKAGE" = "LiveComponent" ]; then install_property_info_for_version \"${{ matrix.php-version }}\" \"${{ matrix.symfony-version }}\" \"${{ matrix.minimum-stability }}\"; fi \
135+
&& if [ "$PACKAGE" = "LiveComponent" ]; then live_component_post_install ${{ matrix.php-version }}; fi \
139136
&& $PHPUNIT)'; then
140137
FAILED_PACKAGES="$FAILED_PACKAGES $PACKAGE"
141138
fi

src/Autocomplete/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
},
3434
"require-dev": {
3535
"doctrine/collections": "^1.6.8|^2.0",
36-
"doctrine/doctrine-bundle": "^2.14|^3.0.0",
36+
"doctrine/doctrine-bundle": "^2.14|^3.0|^4.0",
3737
"doctrine/orm": "^2.9.4|^3.0",
3838
"fakerphp/faker": "^1.22",
3939
"mtdowling/jmespath.php": "^2.6",

src/Autocomplete/tests/Fixtures/Kernel.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ protected function configureContainer(ContainerConfigurator $c): void
138138
$doctrineConfig['orm']['controller_resolver']['auto_mapping'] = true;
139139
}
140140
}
141-
if (\PHP_VERSION_ID >= 80400 && version_compare($doctrineBundleVersion, '2.15.0', '>=')) {
141+
142+
if (\PHP_VERSION_ID >= 80400 && version_compare($doctrineBundleVersion, '2.15.0', '>=') && version_compare($doctrineBundleVersion, '4.0.0', '<')) {
142143
$doctrineConfig['orm']['enable_native_lazy_objects'] = true;
143144
}
144145
}

src/LiveComponent/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
"require-dev": {
3838
"doctrine/annotations": "^1.0|^2.0",
3939
"doctrine/collections": "^1.6.8|^2.0",
40-
"doctrine/doctrine-bundle": "^2.14|^3.0.0",
40+
"doctrine/doctrine-bundle": "^2.14|^3.0|^4.0",
4141
"doctrine/orm": "^2.9.4|^3.0",
42-
"doctrine/persistence": "^2.5.2|^3.0",
42+
"doctrine/persistence": "^2.5.2|^3.0|^4.0",
4343
"phpdocumentor/reflection-docblock": "5.x-dev",
4444
"phpunit/phpunit": "^11.1|^12.0",
4545
"symfony/dependency-injection": "^6.4|^7.0|^8.0",

src/LiveComponent/tests/Fixtures/Kernel.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Composer\InstalledVersions;
1515
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
16-
use Doctrine\ORM\Mapping\AssociationMapping;
1716
use Psr\Log\NullLogger;
1817
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
1918
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
@@ -81,7 +80,7 @@ public function registerBundles(): iterable
8180
protected function build(ContainerBuilder $container): void
8281
{
8382
// workaround https://github.com/symfony/symfony/issues/50322
84-
$container->addCompilerPass(new class() implements CompilerPassInterface {
83+
$container->addCompilerPass(new class implements CompilerPassInterface {
8584
public function process(ContainerBuilder $container): void
8685
{
8786
$container->removeDefinition('doctrine.orm.listeners.pdo_session_handler_schema_listener');
@@ -191,18 +190,24 @@ protected function configureContainer(ContainerConfigurator $c): void
191190
if (version_compare($doctrineBundleVersion, '3.0.0', '<')) {
192191
$doctrineConfig['orm']['auto_generate_proxy_classes'] = true;
193192

194-
if (version_compare($doctrineBundleVersion, '2.12.0', '>=')) {
195-
$doctrineConfig['orm']['controller_resolver']['auto_mapping'] = false;
193+
if (version_compare($doctrineBundleVersion, '2.8.0', '>=')) {
194+
$doctrineConfig['orm']['enable_lazy_ghost_objects'] = true;
195+
}
196+
197+
// https://github.com/doctrine/DoctrineBundle/pull/1661
198+
// https://github.com/doctrine/DoctrineBundle/pull/1962
199+
if (version_compare($doctrineBundleVersion, '2.9.0', '>=')) {
200+
$doctrineConfig['orm']['report_fields_where_declared'] = true;
196201
}
197202
}
198203

199204
// https://github.com/doctrine/DoctrineBundle/pull/1661
200205
if (version_compare($doctrineBundleVersion, '2.9.0', '>=')) {
201-
$doctrineConfig['orm']['report_fields_where_declared'] = true;
202206
$doctrineConfig['orm']['validate_xml_mapping'] = true;
203207
$doctrineConfig['dbal']['schema_manager_factory'] = 'doctrine.dbal.default_schema_manager_factory';
204208
}
205-
if (\PHP_VERSION_ID >= 80400 && version_compare($doctrineBundleVersion, '2.15.0', '>=')) {
209+
210+
if (\PHP_VERSION_ID >= 80400 && version_compare($doctrineBundleVersion, '2.15.0', '>=') && version_compare($doctrineBundleVersion, '4.0.0', '<')) {
206211
$doctrineConfig['orm']['enable_native_lazy_objects'] = true;
207212
}
208213
}

src/Turbo/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"symfony/stimulus-bundle": "^2.9.1"
3939
},
4040
"require-dev": {
41-
"doctrine/doctrine-bundle": "^2.14|^3.0.0",
41+
"doctrine/doctrine-bundle": "^2.14|^3.0|^4.0",
4242
"doctrine/orm": "^2.8|^3.0",
4343
"phpstan/phpstan": "^2.1.17",
4444
"symfony/asset-mapper": "^6.4|^7.0|^8.0",

src/Turbo/tests/app/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ protected function configureContainer(ContainerConfigurator $container): void
111111
}
112112
}
113113

114-
if (\PHP_VERSION_ID >= 80400 && version_compare($doctrineBundleVersion, '2.15.0', '>=')) {
114+
if (\PHP_VERSION_ID >= 80400 && version_compare($doctrineBundleVersion, '2.15.0', '>=') && version_compare($doctrineBundleVersion, '4.0.0', '<')) {
115115
$doctrineConfig['orm']['enable_native_lazy_objects'] = true;
116116
}
117117
}

0 commit comments

Comments
 (0)