@@ -29,20 +29,43 @@ _run_task() {
2929}
3030export -f _run_task
3131
32- install_property_info_for_version () {
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 () {
3335 local php_version=" $1 "
3436 local symfony_version=" $2 "
3537
36- if [ " $symfony_version " = " 7.4.*" ]; then
37- composer require symfony/property-info:7.4.* symfony/type-info:7.4.*
38- elif [ " $symfony_version " = " 8.0.*" ]; then
39- composer require symfony/property-info:8.0.* symfony/type-info:8.0.*
40- elif [ " $php_version " = " 8.2" ]; then
38+ # Lowest PHP version
39+ if [ " $php_version " = " 8.1" ]; then
40+ # no-op, let Composer install the best PropertyInfo version (defined in composer.json), but do not require TypeInfo
41+ return 0
42+ fi
43+
44+ if [ " $php_version " = " 8.2" ]; then
45+ # PropertyInfo 7.1 (experimental PropertyTypeExtractorInterface::getType) and TypeInfo 7.2 (lowest non-experimental)
4146 composer require symfony/property-info:7.1.* symfony/type-info:7.2.*
42- elif [ " $php_version " = " 8.3" ]; then
47+ return $?
48+ fi
49+
50+ if [ " $php_version " = " 8.3" ]; then
51+ # Install PropertyInfo 7.2 and TypeInfo 7.2, ensuring they are compatible together in LiveComponent
4352 composer require symfony/property-info:7.2.* symfony/type-info:7.2.*
44- elif [ " $php_version " = " 8.4" ]; then
53+ return $?
54+ fi
55+
56+ if [ " $php_version " = " 8.4" ]; then
57+ # Install PropertyInfo 7.3 (deprecate PropertyTypeExtractorInterface::getTypes) and TypeInfo 7.3 (new features and deprecations)
4558 composer require symfony/property-info:7.3.* symfony/type-info:7.3.*
59+ return $?
4660 fi
61+
62+ if [ " $php_version " = " 8.5" ]; then
63+ # Install PropertyInfo 7.3 (deprecate PropertyTypeExtractorInterface::getTypes) and TypeInfo 7.3 (new features and deprecations)
64+ composer require symfony/property-info:7.3.* symfony/type-info:7.3.*
65+ return $?
66+ fi
67+
68+ echo " No specific PropertyInfo/TypeInfo installation for PHP \" $php_version \" and Symfony \" $symfony_version \" "
69+ return 1
4770}
48- export -f install_property_info_for_version
71+ export -f live_component_post_install
0 commit comments