Skip to content

Commit 8c366d6

Browse files
committed
[CI] Fix installation of PropertyInfo and TypeInfo for LiveComponent
1 parent df8d2e5 commit 8c366d6

File tree

3 files changed

+30
-25
lines changed

3 files changed

+30
-25
lines changed

.github/workflows/.utils.sh

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

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
32+
before_composer_install() {
33+
local component=$1
34+
local php_version=$2
3635

37-
case "$php_version" in
38-
8.1)
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.2)
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.3)
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
36+
# Install specific versions of PropertyInfo and TypeInfo based on PHP version
37+
# To remove in Symfony UX 4.0
38+
if [[ "$component" == "LiveComponent" ]]; then
39+
case "$php_version" in
40+
8.1)
41+
# no-op, let Composer install the best PropertyInfo version (defined in composer.json), but do not require TypeInfo
42+
return 0
43+
;;
44+
8.2)
45+
# PropertyInfo 7.1 (experimental PropertyTypeExtractorInterface::getType) and TypeInfo 7.2 (lowest non-experimental)
46+
composer require symfony/property-info:7.1.* symfony/type-info:7.2.* --no-update
47+
return $?
48+
;;
49+
8.3)
50+
# Install PropertyInfo 7.3 (deprecate PropertyTypeExtractorInterface::getTypes) and TypeInfo 7.3 (new features and deprecations)
51+
composer require symfony/property-info:7.3.* symfony/type-info:7.3.* --no-update
52+
return $?
53+
;;
54+
esac
55+
56+
# Install the best TypeInfo version available
57+
composer require symfony/type-info --no-update
58+
fi
5359

54-
# Install the best TypeInfo version available
55-
composer require symfony/type-info
5660
}
57-
export -f live_component_post_install
61+
export -f before_composer_install

.github/workflows/unit-tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ jobs:
122122
echo "$PACKAGES" | xargs -n1 | parallel -j +3 "_run_task {} \
123123
'(cd src/{} \
124124
&& $COMPOSER_MIN_STAB \
125+
&& before_composer_install \"{}" \"${{ matrix.php-version }}\" \
125126
&& $COMPOSER_UP \
126-
&& if [ {} = LiveComponent ]; then live_component_post_install \"${{ matrix.php-version }}\"; fi \
127127
&& $PHPUNIT)'"
128128
129129
- name: Run packages tests (Windows)
@@ -137,8 +137,8 @@ jobs:
137137
if ! PACKAGE="$PACKAGE" _run_task_sequential $PACKAGE \
138138
'(cd src/$PACKAGE \
139139
&& $COMPOSER_MIN_STAB \
140+
&& before_composer_install $PACKAGE ${{ matrix.php-version }} \
140141
&& $COMPOSER_UP \
141-
&& if [ "$PACKAGE" = "LiveComponent" ]; then live_component_post_install ${{ matrix.php-version }}; fi \
142142
&& $PHPUNIT)'; then
143143
FAILED_PACKAGES="$FAILED_PACKAGES $PACKAGE"
144144
fi

src/LiveComponent/src/ComponentToolsTrait.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
*/
2121
trait ComponentToolsTrait
2222
{
23+
2324
private LiveResponder $liveResponder;
2425

2526
/**

0 commit comments

Comments
 (0)