Skip to content
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
37 changes: 24 additions & 13 deletions .github/workflows/.utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,29 @@ _run_task() {
}
export -f _run_task

install_property_info_for_version() {
local php_version="$1"
local min_stability="$2"
# Install specific versions of PropertyInfo and TypeInfo based on PHP and Symfony versions
# To remove in Symfony UX 4.0
live_component_post_install() {
local php_version=$1

if [ "$php_version" = "8.2" ]; then
composer require symfony/property-info:7.1.* symfony/type-info:7.2.*
elif [ "$php_version" = "8.3" ]; then
composer require symfony/property-info:7.2.* symfony/type-info:7.2.*
elif [ "$php_version" = "8.4" ] && [ "$min_stability" = "stable" ]; then
composer require symfony/property-info:7.3.* symfony/type-info:7.3.*
elif [ "$php_version" = "8.4" ] && [ "$min_stability" = "dev" ]; then
composer require symfony/property-info:>=7.3 symfony/type-info:>=7.3
fi
case "$php_version" in
8.1)
# no-op, let Composer install the best PropertyInfo version (defined in composer.json), but do not require TypeInfo
return 0
;;
8.2)
# PropertyInfo 7.1 (experimental PropertyTypeExtractorInterface::getType) and TypeInfo 7.2 (lowest non-experimental)
composer require symfony/property-info:7.1.* symfony/type-info:7.2.*
return $?
;;
8.3)
# Install PropertyInfo 7.3 (deprecate PropertyTypeExtractorInterface::getTypes) and TypeInfo 7.3 (new features and deprecations)
composer require symfony/property-info:7.3.* symfony/type-info:7.3.*
return $?
;;
esac

# Install the best TypeInfo version available
composer require symfony/type-info
}
export -f install_property_info_for_version
export -f live_component_post_install
24 changes: 14 additions & 10 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,29 @@ jobs:
include:
- minimum-stability: 'dev'
php-version: '8.5'

# lowest deps
- php-version: '8.1'
dependency-version: 'lowest'

# LTS version of Symfony
- php-version: '8.1'
symfony-version: '6.4.*'
- php-version: '8.1'
symfony-version: '6.4.*'
os: 'windows-latest'
# Explicit Symfony versions

- php-version: '8.2'
symfony-version: '^7.4.0-RC1' # TODO: change to '7.4.*' when Symfony 7.4 is released
minimum-stability: 'RC'
symfony-version: '7.4.*'
- php-version: '8.2'
symfony-version: '7.4.*'
os: 'windows-latest'

# Explicit Symfony versions
- php-version: '8.4'
symfony-version: '^8.0.0-RC1' # TODO: change to '8.0.*' when Symfony 8.0 is released
minimum-stability: 'RC'
symfony-version: '8.0.*'
- php-version: '8.5'
symfony-version: '^8.0.0-RC1' # TODO: change to '8.0.*' when Symfony 8.0 is released
minimum-stability: 'RC'
symfony-version: '8.0.*'

env:
SYMFONY_REQUIRE: ${{ matrix.symfony-version || '>=5.4' }} # TODO: To change to '>=6.4' in 3.x
Expand Down Expand Up @@ -87,7 +91,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ matrix.os == 'windows-latest' && 'pdo_sqlite,sqlite3,fileinfo,gd' || '' }}
extensions: ${{ matrix.os == 'windows-latest' && 'pdo_sqlite,sqlite3,fileinfo,gd,zip' || '' }}
tools: flex

- name: Get composer cache directory
Expand Down Expand Up @@ -119,7 +123,7 @@ jobs:
'(cd src/{} \
&& $COMPOSER_MIN_STAB \
&& $COMPOSER_UP \
&& if [ {} = LiveComponent ]; then install_property_info_for_version \"${{ matrix.php-version }}\" \"${{ matrix.minimum-stability }}\"; fi \
&& if [ {} = LiveComponent ]; then live_component_post_install \"${{ matrix.php-version }}\"; fi \
&& $PHPUNIT)'"

- name: Run packages tests (Windows)
Expand All @@ -134,7 +138,7 @@ jobs:
'(cd src/$PACKAGE \
&& $COMPOSER_MIN_STAB \
&& $COMPOSER_UP \
&& if [ "$PACKAGE" = "LiveComponent" ]; then install_property_info_for_version \"${{ matrix.php-version }}\" \"${{ matrix.minimum-stability }}\"; fi \
&& if [ "$PACKAGE" = "LiveComponent" ]; then live_component_post_install ${{ matrix.php-version }}; fi \
&& $PHPUNIT)'; then
FAILED_PACKAGES="$FAILED_PACKAGES $PACKAGE"
fi
Expand Down
2 changes: 1 addition & 1 deletion src/Autocomplete/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"require-dev": {
"doctrine/collections": "^1.6.8|^2.0",
"doctrine/doctrine-bundle": "^2.4.3|^3.0.0",
"doctrine/doctrine-bundle": "^2.4.3|^3.0|^4.0",
"doctrine/orm": "^2.9.4|^3.0",
"fakerphp/faker": "^1.22",
"mtdowling/jmespath.php": "^2.6",
Expand Down
3 changes: 2 additions & 1 deletion src/Autocomplete/tests/Fixtures/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ protected function configureContainer(ContainerConfigurator $c): void
$doctrineConfig['orm']['controller_resolver']['auto_mapping'] = true;
}
}
if (\PHP_VERSION_ID >= 80400 && version_compare($doctrineBundleVersion, '2.15.0', '>=')) {

if (\PHP_VERSION_ID >= 80400 && version_compare($doctrineBundleVersion, '2.15.0', '>=') && version_compare($doctrineBundleVersion, '4.0.0', '<')) {
$doctrineConfig['orm']['enable_native_lazy_objects'] = true;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/LiveComponent/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
"require-dev": {
"doctrine/annotations": "^1.0|^2.0",
"doctrine/collections": "^1.6.8|^2.0",
"doctrine/doctrine-bundle": "^2.4.3|^3.0.0",
"doctrine/doctrine-bundle": "^2.4.3|^3.0|^4.0",
"doctrine/orm": "^2.9.4|^3.0",
"doctrine/persistence": "^2.5.2|^3.0",
"doctrine/persistence": "^2.5.2|^3.0|^4.0",
"phpdocumentor/reflection-docblock": "5.x-dev",
"symfony/dependency-injection": "^5.4|^6.0|^7.0|^8.0",
"symfony/expression-language": "^5.4|^6.0|^7.0|^8.0",
Expand Down
18 changes: 14 additions & 4 deletions src/LiveComponent/tests/Fixtures/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use Composer\InstalledVersions;
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
use Doctrine\ORM\Mapping\AssociationMapping;
use Psr\Log\NullLogger;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
Expand Down Expand Up @@ -81,7 +80,7 @@ public function registerBundles(): iterable
protected function build(ContainerBuilder $container): void
{
// workaround https://github.com/symfony/symfony/issues/50322
$container->addCompilerPass(new class() implements CompilerPassInterface {
$container->addCompilerPass(new class implements CompilerPassInterface {
public function process(ContainerBuilder $container): void
{
$container->removeDefinition('doctrine.orm.listeners.pdo_session_handler_schema_listener');
Expand Down Expand Up @@ -190,18 +189,29 @@ protected function configureContainer(ContainerConfigurator $c): void
if (version_compare($doctrineBundleVersion, '2.8.0', '>=')) {
$doctrineConfig['orm']['enable_lazy_ghost_objects'] = true;
}

// https://github.com/doctrine/DoctrineBundle/pull/1661
if (version_compare($doctrineBundleVersion, '2.9.0', '>=')) {
$doctrineConfig['orm']['report_fields_where_declared'] = true;
}

if (version_compare($doctrineBundleVersion, '2.12.0', '>=')) {
$doctrineConfig['orm']['controller_resolver']['auto_mapping'] = false;
}
}

// https://github.com/doctrine/DoctrineBundle/pull/1661
if (version_compare($doctrineBundleVersion, '2.9.0', '>=')) {
$doctrineConfig['orm']['report_fields_where_declared'] = true;
$doctrineConfig['orm']['validate_xml_mapping'] = true;
$doctrineConfig['dbal']['schema_manager_factory'] = 'doctrine.dbal.default_schema_manager_factory';

// https://github.com/doctrine/DoctrineBundle/pull/1962
if (version_compare($doctrineBundleVersion, '3.0.0', '<')) {
$doctrineConfig['orm']['report_fields_where_declared'] = true;
}
}
if (\PHP_VERSION_ID >= 80400 && version_compare($doctrineBundleVersion, '2.15.0', '>=')) {

if (\PHP_VERSION_ID >= 80400 && version_compare($doctrineBundleVersion, '2.15.0', '>=') && version_compare($doctrineBundleVersion, '4.0.0', '<')) {
$doctrineConfig['orm']['enable_native_lazy_objects'] = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Turbo/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"symfony/stimulus-bundle": "^2.9.1"
},
"require-dev": {
"doctrine/doctrine-bundle": "^2.4.3|^3.0.0",
"doctrine/doctrine-bundle": "^2.4.3|^3.0|^4.0",
"doctrine/orm": "^2.8|^3.0",
"phpstan/phpstan": "^2.1.17",
"symfony/asset-mapper": "^6.4|^7.0|^8.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Turbo/tests/app/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ protected function configureContainer(ContainerConfigurator $container): void
}
}

if (\PHP_VERSION_ID >= 80400 && version_compare($doctrineBundleVersion, '2.15.0', '>=')) {
if (\PHP_VERSION_ID >= 80400 && version_compare($doctrineBundleVersion, '2.15.0', '>=') && version_compare($doctrineBundleVersion, '4.0.0', '<')) {
$doctrineConfig['orm']['enable_native_lazy_objects'] = true;
}
}
Expand Down
Loading