From dfdaba41276c55ef0bd24932045c799bf58b1e62 Mon Sep 17 00:00:00 2001 From: MateuszKolankowski Date: Thu, 27 Mar 2025 16:26:30 +0100 Subject: [PATCH 1/2] Changes to align to 5.0 --- .github/workflows/backend-ci.yaml | 42 ++++++++++++++++--- composer.json | 27 ++++++------ rector.php | 25 +++++++++++ .../Templating/Twig/ComponentExtension.php | 4 +- 4 files changed, 79 insertions(+), 19 deletions(-) create mode 100644 rector.php diff --git a/.github/workflows/backend-ci.yaml b/.github/workflows/backend-ci.yaml index 0f05780..2044585 100644 --- a/.github/workflows/backend-ci.yaml +++ b/.github/workflows/backend-ci.yaml @@ -14,7 +14,7 @@ jobs: strategy: matrix: php: - - '8.1' + - '8.3' steps: - uses: actions/checkout@v3 @@ -32,7 +32,41 @@ jobs: - name: Run code style check run: composer run-script check-cs -- --format=checkstyle | cs2pr - + + rector: + name: Run rector + runs-on: "ubuntu-22.04" + strategy: + matrix: + php: + - '8.3' + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP Action + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + extensions: 'pdo_sqlite, gd' + tools: cs2pr + + - name: Add composer keys for private packagist + run: | + composer config http-basic.updates.ibexa.co $SATIS_NETWORK_KEY $SATIS_NETWORK_TOKEN + composer config github-oauth.github.com $TRAVIS_GITHUB_TOKEN + env: + SATIS_NETWORK_KEY: ${{ secrets.SATIS_NETWORK_KEY }} + SATIS_NETWORK_TOKEN: ${{ secrets.SATIS_NETWORK_TOKEN }} + TRAVIS_GITHUB_TOKEN: ${{ secrets.TRAVIS_GITHUB_TOKEN }} + + - uses: ramsey/composer-install@v3 + with: + dependency-versions: highest + + - name: Run rector + run: vendor/bin/rector process --dry-run --ansi + deptrac: name: Deptrac runs-on: ubuntu-latest @@ -50,9 +84,7 @@ jobs: fail-fast: false matrix: php: - - '7.4' - - '8.1' - - '8.2' + - '8.3' steps: - uses: actions/checkout@v2 diff --git a/composer.json b/composer.json index 2d8405a..05a1f93 100644 --- a/composer.json +++ b/composer.json @@ -2,25 +2,28 @@ "name": "ibexa/twig-components", "license": "(GPL-2.0-only or proprietary)", "type": "ibexa-bundle", + "minimum-stability": "dev", + "prefer-stable": true, "keywords": [ "ibexa-dxp" ], "require": { - "php": "^7.4 || ^8.0", - "ibexa/core": "~4.6.x-dev", - "symfony/config": "^5.4", - "symfony/dependency-injection": "^5.4", - "symfony/event-dispatcher": "^5.4", + "php": ">=8.3", + "ibexa/core": "~5.0.x-dev", + "symfony/config": "^6.4", + "symfony/dependency-injection": "^6.4", + "symfony/event-dispatcher": "^6.4", "symfony/event-dispatcher-contracts": "^2.2", - "symfony/http-foundation": "^5.4", - "symfony/http-kernel": "^5.4", - "symfony/yaml": "^5.4" + "symfony/http-foundation": "^6.4", + "symfony/http-kernel": "^6.4", + "symfony/yaml": "^6.4" }, "require-dev": { - "ibexa/behat": "~4.6.x-dev", + "ibexa/behat": "~5.0.x-dev", "ibexa/code-style": "~2.0.0", - "ibexa/doctrine-schema": "~4.6.x-dev", - "ibexa/phpstan": "~4.6.x-dev", + "ibexa/doctrine-schema": "~5.0.x-dev", + "ibexa/phpstan": "~5.0.x-dev", + "ibexa/rector": "~5.0.x-dev", "matthiasnoback/symfony-config-test": "^4.3.0 || ^5.1", "matthiasnoback/symfony-dependency-injection-test": "^4.3.1 || ^5.0", "phpstan/phpstan": "^2.0", @@ -59,7 +62,7 @@ }, "extra": { "branch-alias": { - "dev-main": "4.6.x-dev" + "dev-main": "5.0.x-dev" } }, "config": { diff --git a/rector.php b/rector.php new file mode 100644 index 0000000..da984b1 --- /dev/null +++ b/rector.php @@ -0,0 +1,25 @@ +withPaths([ + __DIR__ . '/src', + __DIR__ . '/tests', + ]) + ->withSets([ + IbexaSetList::IBEXA_50->value, + SymfonySetList::SYMFONY_60, + SymfonySetList::SYMFONY_61, + SymfonySetList::SYMFONY_62, + SymfonySetList::SYMFONY_63, + SymfonySetList::SYMFONY_64, + ]); diff --git a/src/bundle/Templating/Twig/ComponentExtension.php b/src/bundle/Templating/Twig/ComponentExtension.php index 60cb0b3..9cb5b2f 100644 --- a/src/bundle/Templating/Twig/ComponentExtension.php +++ b/src/bundle/Templating/Twig/ComponentExtension.php @@ -35,12 +35,12 @@ public function getFunctions(): array return [ new TwigFunction( 'ibexa_twig_component_group', - [$this, 'renderComponentGroup'], + $this->renderComponentGroup(...), ['is_safe' => ['html']] ), new TwigFunction( 'ibexa_twig_component', - [$this, 'renderComponent'], + $this->renderComponent(...), ['is_safe' => ['html']] ), ]; From 8d43bef4523aef11233276f0e45ecff338bcb979 Mon Sep 17 00:00:00 2001 From: Mateusz Kolankowski Date: Fri, 28 Mar 2025 15:36:50 +0100 Subject: [PATCH 2/2] Update .github/workflows/backend-ci.yaml Co-authored-by: Konrad Oboza --- .github/workflows/backend-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backend-ci.yaml b/.github/workflows/backend-ci.yaml index 2044585..c224446 100644 --- a/.github/workflows/backend-ci.yaml +++ b/.github/workflows/backend-ci.yaml @@ -16,7 +16,7 @@ jobs: php: - '8.3' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup PHP Action uses: shivammathur/setup-php@v2