Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Symfony 7 #28

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 24 additions & 11 deletions .github/workflows/ci.yml
Expand Up @@ -54,11 +54,12 @@ jobs:
php-version: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
composer-options: ['--prefer-stable']
dependency-versions: ['highest']
include:
# testing lowest PHP version with lowest dependencies
- php-version: '7.2.5'
dependency-versions: 'lowest'
composer-options: '--prefer-lowest'
# Disable lowest for now
# include:
# # testing lowest PHP version with lowest dependencies
# - php-version: '7.2.5'
# dependency-versions: 'lowest'
# composer-options: '--prefer-lowest'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could not get this to work, and perhaps we should also not support this any longer?

I don't mind supporting php 7.2 as long as it uses the latest versions it can (since sf 5.4 support it) but supporting it with the lowest versions possible of the supporting libraries is rather annoying.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried adding it back again after dropping support for symfony 4? Otherwise you might remove dead code

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I re-added it in 0a1f3c9.

I had to bump the minimum-requirement of doctrine/doctrine-bundle from 2.0.0 to 2.0.8 for the root-project and for the sf5.4-demo-project I updated the minimum-requirement of symfony/flex to 1.21.

To have phpunit run succesfully, I had to signal phpunit-bridge to use phpunit 7 for that specific job.

Good of you to catch it, since this way we can guarantee our minimum requirements actually work. 👍


steps:
- name: "Checkout code"
Expand All @@ -81,7 +82,7 @@ jobs:
composer-options: "--prefer-dist --no-progress"

- name: Unit Tests
run: vendor/bin/phpunit
run: vendor/bin/simple-phpunit

- name: Install symlinks for demo's
uses: "ramsey/composer-install@v2"
Expand All @@ -90,15 +91,15 @@ jobs:
composer-options: "--prefer-dist --no-progress"
working-directory: "demo"

- name: Demo symfony4.4 - Install dependencies
- name: Demo symfony5.4 - Install dependencies
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependency-versions }}"
composer-options: "--prefer-dist --no-progress"
working-directory: "demo/symfony4.4"
working-directory: "demo/symfony5.4"

- name: Demo symfony4.4 - Unit Tests
run: demo/symfony4.4/vendor/bin/simple-phpunit -c demo/symfony4.4/phpunit.xml.dist
- name: Demo symfony5.4 - Unit Tests
run: demo/symfony5.4/bin/phpunit -c demo/symfony5.4/phpunit.xml.dist

- name: Demo symfony6.x - Install dependencies
uses: "ramsey/composer-install@v2"
Expand All @@ -110,4 +111,16 @@ jobs:

- name: Demo symfony6.x - Unit Tests
run: demo/symfony6.x/vendor/bin/simple-phpunit -c demo/symfony6.x/phpunit.xml.dist
if: ${{ startsWith(matrix.php-version , '8.') }}
if: ${{ startsWith(matrix.php-version , '8.') }}

- name: Demo symfony7.x - Install dependencies
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependency-versions }}"
composer-options: "--prefer-dist --no-progress"
working-directory: "demo/symfony7.x"
if: ${{ startsWith(matrix.php-version , '8.2') }}

- name: Demo symfony7.x - Unit Tests
run: demo/symfony7.x/vendor/bin/simple-phpunit -c demo/symfony7.x/phpunit.xml.dist
if: ${{ startsWith(matrix.php-version , '8.2') }}
15 changes: 7 additions & 8 deletions composer.json
Expand Up @@ -9,22 +9,21 @@
"paragonie/halite": "^4.6|^5.0",
"doctrine/orm": "^2.5",
"doctrine/doctrine-bundle": "^2.0",
"symfony/property-access": "^4.1|^5.0|^6.0",
"symfony/dependency-injection": "^4.1|^5.0|^6.0",
"symfony/yaml": "^4.1|^5.0|^6.0",
"symfony/http-kernel": "^4.1|^5.0|^6.0",
"symfony/config": "^4.1|^5.0|^6.0",
"symfony/property-access": "^5.4|^6.0|^7.0",
"symfony/dependency-injection": "^5.4|^6.0|^7.0",
"symfony/yaml": "^5.4|^6.0|^7.0",
"symfony/http-kernel": "^5.4|^6.0|^7.0",
"symfony/config": "^5.4|^6.0|^7.0",
"doctrine/annotations": "^1.13|^2.0",
"symfony/expression-language": "^4.1|^5.0|^6.0"
"symfony/expression-language": "^5.4|^6.0|^7.0"
},
"require-dev": {
"phpunit/phpunit": "^8.0|^9.0",
"defuse/php-encryption": "^2.1",
"doctrine/cache": "^1.11",
"phpstan/phpstan": "^1.4",
"jetbrains/phpstorm-attributes": "^1.0",
"phpcompatibility/php-compatibility": "^9.3",
"symfony/phpunit-bridge": "^6.0"
"symfony/phpunit-bridge": "^6.4|^7.0"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can drop symfony/phpunit-bridge 6 completly. It is mostly backward compatible

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the docs and you're right, we can drop the support for 6.4, especially since they are in the dev-requirements, which do not affect users of our library.

From the docs:

The PHPUnit bridge is designed to work with all maintained versions of Symfony components,
even across different major versions of them.
You should always use its very latest stable major version to get the most accurate deprecation report.

},
"suggest": {
"defuse/php-encryption": "Alternative for halite for use with older php-versions",
Expand Down
17 changes: 11 additions & 6 deletions demo/composer.json
Expand Up @@ -14,17 +14,22 @@
],
"installScripts" : [
"Kporras07\\ComposerSymlinks\\ScriptHandler::createSymlinks",
"printf 'HALITE_SECRET=\"%s\"' \"$(cat shared/.Halite.key)\" > symfony5.4/.env.local",
"printf 'HALITE_SECRET=\"%s\"' \"$(cat shared/.Halite.key)\" > symfony5.4/.env.test.local",
"printf 'HALITE_SECRET=\"%s\"' \"$(cat shared/.Halite.key)\" > symfony6.x/.env.local",
"printf 'HALITE_SECRET=\"%s\"' \"$(cat shared/.Halite.key)\" > symfony6.x/.env.test.local"
"printf 'HALITE_SECRET=\"%s\"' \"$(cat shared/.Halite.key)\" > symfony6.x/.env.test.local",
"printf 'HALITE_SECRET=\"%s\"' \"$(cat shared/.Halite.key)\" > symfony7.x/.env.local",
"printf 'HALITE_SECRET=\"%s\"' \"$(cat shared/.Halite.key)\" > symfony7.x/.env.test.local"
]
},
"extra": {
"symlinks": {
"shared/templates": "symfony4.4/templates",
"./shared/templates": "symfony6.x/templates",
"shared/var/data.db": "symfony4.4/var/data.db",
"./shared/var/data.db": "symfony6.x/var/data.db",
"shared/.Halite.key": "symfony4.4/.Halite.key"
"shared/templates": "symfony5.4/templates",
"./shared/templates": "symfony6.x/templates",
"././shared/templates": "symfony7.x/templates",
"shared/var/data.db": "symfony5.4/var/data.db",
"./shared/var/data.db": "symfony6.x/var/data.db",
"././shared/var/data.db": "symfony7.x/var/data.db"
}
}
}
1 change: 0 additions & 1 deletion demo/symfony4.4/.phpversion

This file was deleted.

42 changes: 0 additions & 42 deletions demo/symfony4.4/bin/console

This file was deleted.

23 changes: 0 additions & 23 deletions demo/symfony4.4/config/bootstrap.php

This file was deleted.

2 changes: 0 additions & 2 deletions demo/symfony4.4/config/packages/ambta_doctrine_encrypt.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions demo/symfony4.4/config/packages/doctrine.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions demo/symfony4.4/config/packages/prod/doctrine.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions demo/symfony4.4/config/packages/prod/routing.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions demo/symfony4.4/config/packages/routing.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions demo/symfony4.4/config/packages/test/doctrine.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions demo/symfony4.4/config/packages/test/framework.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions demo/symfony4.4/config/packages/test/twig.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions demo/symfony4.4/config/packages/twig.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions demo/symfony4.4/config/routes/dev/framework.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions demo/symfony4.4/docker-compose.override.yml

This file was deleted.

21 changes: 0 additions & 21 deletions demo/symfony4.4/docker-compose.yml

This file was deleted.

29 changes: 0 additions & 29 deletions demo/symfony4.4/phpunit.xml.dist

This file was deleted.

27 changes: 0 additions & 27 deletions demo/symfony4.4/public/index.php

This file was deleted.