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 Symfony 6 support #778

Merged
merged 3 commits into from
Nov 26, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ jobs:
allowed-to-fail: false
symfony-require: 5.4.*
variant: symfony/symfony:"5.4.*"
- php-version: '8.0'
dependencies: highest
allowed-to-fail: false
symfony-require: 6.0.*
variant: symfony/symfony:"6.0.*"

steps:
- name: Checkout
Expand Down
30 changes: 15 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
"doctrine/persistence": "^2.0",
"sonata-project/doctrine-extensions": "^1.10.1",
"sonata-project/form-extensions": "^1.4",
"symfony/config": "^4.4 || ^5.3",
"symfony/console": "^4.4 || ^5.3",
"symfony/dependency-injection": "^4.4 || ^5.3",
"symfony/form": "^4.4 || ^5.3",
"symfony/http-foundation": "^4.4 || ^5.3",
"symfony/http-kernel": "^4.4 || ^5.3",
"symfony/options-resolver": "^4.4 || ^5.3",
"symfony/config": "^4.4 || ^5.3 || ^6.0",
"symfony/console": "^4.4 || ^5.3 || ^6.0",
"symfony/dependency-injection": "^4.4 || ^5.3 || ^6.0",
"symfony/form": "^4.4 || ^5.3 || ^6.0",
"symfony/http-foundation": "^4.4 || ^5.3 || ^6.0",
"symfony/http-kernel": "^4.4 || ^5.3 || ^6.0",
"symfony/options-resolver": "^4.4 || ^5.3 || ^6.0",
"twig/twig": "^2.12.1 || ^3.0"
},
"conflict": {
Expand Down Expand Up @@ -64,14 +64,14 @@
"sonata-project/block-bundle": "^4.0",
"sonata-project/doctrine-mongodb-admin-bundle": "^4.0",
"sonata-project/doctrine-orm-admin-bundle": "^4.0",
"symfony/browser-kit": "^4.4 || ^5.3",
"symfony/phpunit-bridge": "^5.3",
"symfony/routing": "^4.4 || ^5.3",
"symfony/security-bundle": "^4.4 || ^5.3",
"symfony/security-csrf": "^4.4 || ^5.3",
"symfony/translation": "^4.4 || ^5.3",
"symfony/twig-bundle": "^4.4 || ^5.3",
"symfony/yaml": "^4.4 || ^5.3",
"symfony/browser-kit": "^4.4 || ^5.3 || ^6.0",
"symfony/phpunit-bridge": "^5.3 || ^6.0",
"symfony/routing": "^4.4 || ^5.3 || ^6.0",
"symfony/security-bundle": "^4.4 || ^5.3 || ^6.0",
"symfony/security-csrf": "^4.4 || ^5.3 || ^6.0",
"symfony/translation": "^4.4 || ^5.3 || ^6.0",
"symfony/twig-bundle": "^4.4 || ^5.3 || ^6.0",
"symfony/yaml": "^4.4 || ^5.3 || ^6.0",
"vimeo/psalm": "^4.7.2"
},
"suggest": {
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/CategoryAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ public function listAction(Request $request): Response

public function treeAction(Request $request): Response
{
$categoryManager = $this->get('sonata.classification.manager.category');
$categoryManager = $this->container->get('sonata.classification.manager.category');
Copy link
Member

Choose a reason for hiding this comment

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

Do we have a test that covers this action?

Copy link
Member Author

Choose a reason for hiding this comment

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

I dont know, but the get method was deprecated on 5.4, and removed on 6.0

Edit: I would say probably because test were failing without this change

Copy link
Member

Choose a reason for hiding this comment

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

This is not related to this PR, but we had some problem with some admin actions.

I'll try to add some basic tests to cover this this before releasing the stable release.

\assert($categoryManager instanceof CategoryManagerInterface);

$currentContext = null;

$contextId = $request->get('context');
if (null !== $contextId) {
$contextManager = $this->get('sonata.classification.manager.context');
$contextManager = $this->container->get('sonata.classification.manager.context');
\assert($contextManager instanceof ContextManagerInterface);

$currentContext = $contextManager->find($contextId);
Expand Down