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

Allow Symfony 7 #1669

Merged
merged 12 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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 @@ -63,6 +63,11 @@ jobs:
allowed-to-fail: false
symfony-require: 6.4.*
variant: symfony/symfony:"6.4.*"
- php-version: '8.2'
dependencies: highest
allowed-to-fail: false
symfony-require: 7.0.*
variant: symfony/symfony:"7.0.*"

steps:
- name: Checkout
Expand Down
42 changes: 21 additions & 21 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,35 @@
"sonata-project/doctrine-extensions": "^1.13 || ^2.0",
"sonata-project/form-extensions": "^1.4 || ^2.0",
"sonata-project/twig-extensions": "^1.3 || ^2.0",
"symfony/config": "^5.4 || ^6.2",
"symfony/console": "^5.4 || ^6.2",
"symfony/config": "^5.4 || ^6.2 || ^7.0",
"symfony/console": "^5.4 || ^6.2 || ^7.0",
"symfony/dependency-injection": "^5.4 || ^6.2",
"symfony/event-dispatcher": "^5.4 || ^6.2",
"symfony/form": "^5.4 || ^6.2",
"symfony/framework-bundle": "^5.4 || ^6.2",
"symfony/http-foundation": "^5.4 || ^6.2",
"symfony/http-kernel": "^5.4 || ^6.2",
"symfony/mailer": "^5.4 || ^6.2",
"symfony/mime": "^5.4 || ^6.2",
"symfony/options-resolver": "^5.4 || ^6.2",
"symfony/routing": "^5.4 || ^6.2",
"symfony/framework-bundle": "^5.4 || ^6.2 || ^7.0",
"symfony/http-foundation": "^5.4 || ^6.2 || ^7.0",
"symfony/http-kernel": "^5.4 || ^6.2 || ^7.0",
"symfony/mailer": "^5.4 || ^6.2 || ^7.0",
"symfony/mime": "^5.4 || ^6.2 || ^7.0",
"symfony/options-resolver": "^5.4 || ^6.2 || ^7.0",
"symfony/routing": "^5.4 || ^6.2 || ^7.0",
"symfony/security-acl": "^3.0",
"symfony/security-core": "^5.4 || ^6.2",
"symfony/security-csrf": "^5.4 || ^6.2",
"symfony/translation": "^5.4 || ^6.2",
"symfony/security-core": "^5.4 || ^6.2 || ^7.0",
"symfony/security-csrf": "^5.4 || ^6.2 || ^7.0",
"symfony/translation": "^5.4 || ^6.2 || ^7.0",
"symfony/translation-contracts": "^2.5 || ^3.0",
"symfony/validator": "^5.4 || ^6.2",
"symfony/validator": "^5.4 || ^6.2 || ^7.0",
"twig/twig": "^3.0"
},
"require-dev": {
"dama/doctrine-test-bundle": "^7.0",
"dama/doctrine-test-bundle": "^8.0",
"doctrine/doctrine-bundle": "^2.7",
"doctrine/mongodb-odm": "^2.3",
"doctrine/orm": "^2.14",
"egulias/email-validator": "^3.1 || ^4.0",
"friendsofphp/php-cs-fixer": "^3.4",
"matthiasnoback/symfony-config-test": "^4.2",
"matthiasnoback/symfony-dependency-injection-test": "^4.0",
"matthiasnoback/symfony-config-test": "^4.2 || ^5.0",
"matthiasnoback/symfony-dependency-injection-test": "^4.0 || ^5.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
Expand All @@ -68,11 +68,11 @@
"sonata-project/admin-bundle": "^4.20",
"sonata-project/block-bundle": "^4.11 || ^5.0",
"sonata-project/doctrine-orm-admin-bundle": "^4.0",
"symfony/browser-kit": "^5.4 || ^6.2",
"symfony/console": "^5.4 || ^6.2",
"symfony/filesystem": "^5.4 || ^6.2",
"symfony/intl": "^5.4 || ^6.2",
"symfony/phpunit-bridge": "^6.2",
"symfony/browser-kit": "^5.4 || ^6.2 || ^7.0",
"symfony/console": "^5.4 || ^6.2 || ^7.0",
"symfony/filesystem": "^5.4 || ^6.2 || ^7.0",
"symfony/intl": "^5.4 || ^6.2 || ^7.0",
"symfony/phpunit-bridge": "^6.2 || ^7.0",
"vimeo/psalm": "^5.0"
},
"conflict": {
Expand Down
4 changes: 2 additions & 2 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
final class Configuration implements ConfigurationInterface
{
/**
* @psalm-suppress PossiblyNullReference, UndefinedInterfaceMethod
* @psalm-suppress UndefinedInterfaceMethod
*
* @see https://github.com/psalm/psalm-plugin-symfony/issues/174
*/
Expand Down Expand Up @@ -94,7 +94,7 @@ public function getConfigTreeBuilder(): TreeBuilder
}

/**
* @psalm-suppress PossiblyNullReference, UndefinedInterfaceMethod
* @psalm-suppress UndefinedInterfaceMethod
*
* @see https://github.com/psalm/psalm-plugin-symfony/issues/174
*/
Expand Down
7 changes: 3 additions & 4 deletions src/Security/Authorization/Voter/UserAclVoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
namespace Sonata\UserBundle\Security\Authorization\Voter;

use Sonata\UserBundle\Model\UserInterface;
use Symfony\Component\Security\Acl\Voter\AclVoter;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;

final class UserAclVoter extends AclVoter
final class UserAclVoter implements VoterInterface
jordisala1991 marked this conversation as resolved.
Show resolved Hide resolved
{
public function supportsClass($class): bool

Check failure on line 22 in src/Security/Authorization/Voter/UserAclVoter.php

View workflow job for this annotation

GitHub Actions / Psalm

MissingParamType

src/Security/Authorization/Voter/UserAclVoter.php:22:35: MissingParamType: Parameter $class has no provided type (see https://psalm.dev/154)

Check failure on line 22 in src/Security/Authorization/Voter/UserAclVoter.php

View workflow job for this annotation

GitHub Actions / PHPStan

Method Sonata\UserBundle\Security\Authorization\Voter\UserAclVoter::supportsClass() has parameter $class with no type specified.
{
// support the Object-Scope ACL
return is_subclass_of($class, UserInterface::class);
Expand All @@ -34,12 +34,11 @@
}

/**
* @param mixed $subject
* @param mixed[] $attributes
*
* @return self::ACCESS_ABSTAIN|self::ACCESS_DENIED
*/
public function vote(TokenInterface $token, $subject, array $attributes): int
public function vote(TokenInterface $token, mixed $subject, array $attributes): int
{
if (!\is_object($subject) || !$this->supportsClass($subject::class)) {
return self::ACCESS_ABSTAIN;
Expand Down
1 change: 1 addition & 0 deletions tests/App/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ doctrine:
dbal:
driver: pdo_sqlite
path: '%app.base_dir%/sonata_user_test.db3'
use_savepoints: true
orm:
entity_managers:
default:
Expand Down
Loading