Skip to content

Commit

Permalink
Bump to symfony ^6.4 || ^7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Feb 4, 2024
1 parent 747e4bb commit ec5fcf6
Show file tree
Hide file tree
Showing 12 changed files with 360 additions and 364 deletions.
1 change: 1 addition & 0 deletions .github/workflows/continuous-integration.yml
Expand Up @@ -14,5 +14,6 @@ jobs:
with:
PHP_EXTENSIONS: "mbstring, json, mongodb"
SYMFONY_KERNEL: "Nucleos\\ProfileBundle\\Tests\\App\\AppKernel"
SYMFONY_VERSIONS: "6.4,7.0"
secrets:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
42 changes: 21 additions & 21 deletions composer.json
Expand Up @@ -38,40 +38,40 @@
"php": "^8.1",
"doctrine/persistence": "^2.2.2 || ^3.0.0",
"nucleos/user-bundle": "^2.3 || ^3.0",
"symfony/config": "^5.4 || ^6.2",
"symfony/dependency-injection": "^5.4 || ^6.2",
"symfony/event-dispatcher": "^5.4 || ^6.2",
"symfony/config": "^6.4 || ^7.0",
"symfony/dependency-injection": "^6.4 || ^7.0",
"symfony/event-dispatcher": "^6.4 || ^7.0",
"symfony/event-dispatcher-contracts": "^1.0 || ^2.0 || ^3.0",
"symfony/form": "^5.4 || ^6.2",
"symfony/framework-bundle": "^5.4.19 || ^6.2.5",
"symfony/http-foundation": "^5.4 || ^6.2",
"symfony/http-kernel": "^5.4 || ^6.2",
"symfony/intl": "^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/security-core": "^5.4 || ^6.2",
"symfony/translation": "^5.4 || ^6.2",
"symfony/form": "^6.4 || ^7.0",
"symfony/framework-bundle": "^6.4 || ^7.0",
"symfony/http-foundation": "^6.4 || ^7.0",
"symfony/http-kernel": "^6.4 || ^7.0",
"symfony/intl": "^6.4 || ^7.0",
"symfony/mailer": "^6.4 || ^7.0",
"symfony/mime": "^6.4 || ^7.0",
"symfony/options-resolver": "^6.4 || ^7.0",
"symfony/routing": "^6.4 || ^7.0",
"symfony/security-core": "^6.4 || ^7.0",
"symfony/translation": "^6.4 || ^7.0",
"symfony/translation-contracts": "^1.0 || ^2.0 || ^3.0",
"symfony/twig-bridge": "^5.4 || ^6.2",
"symfony/twig-bundle": "^5.4 || ^6.2",
"symfony/validator": "^5.4 || ^6.2",
"symfony/twig-bridge": "^6.4 || ^7.0",
"symfony/twig-bundle": "^6.4 || ^7.0",
"symfony/validator": "^6.4 || ^7.0",
"twig/twig": "^2.14 || ^3.1"
},
"require-dev": {
"alcaeus/mongo-php-adapter": "^1.1",
"doctrine/doctrine-bundle": "^2.5",
"doctrine/orm": "^2.7",
"ergebnis/composer-normalize": "^2.0.1",
"symfony/browser-kit": "^5.4 || ^6.2",
"symfony/doctrine-bridge": "^5.4 || ^6.2",
"symfony/yaml": "^5.4 || ^6.2"
"symfony/browser-kit": "^6.4 || ^7.0",
"symfony/doctrine-bridge": "^6.4 || ^7.0",
"symfony/yaml": "^6.4 || ^7.0"
},
"conflict": {
"doctrine/doctrine-bundle": "<2.5",
"doctrine/orm": "<2.7",
"symfony/doctrine-bridge": "<5.4"
"symfony/doctrine-bridge": "<6.4"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/Action/EditProfileAction.php
Expand Up @@ -18,6 +18,7 @@
use Nucleos\UserBundle\Event\GetResponseUserEvent;
use Nucleos\UserBundle\Model\UserInterface;
use Nucleos\UserBundle\Model\UserManager;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\Form\FormInterface;
Expand All @@ -26,7 +27,6 @@
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\Security;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Twig\Environment;

Expand Down
2 changes: 1 addition & 1 deletion src/Action/RegistrationConfirmedAction.php
Expand Up @@ -12,12 +12,12 @@
namespace Nucleos\ProfileBundle\Action;

use Nucleos\UserBundle\Model\UserInterface;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\Security;
use Twig\Environment;

final class RegistrationConfirmedAction
Expand Down
2 changes: 1 addition & 1 deletion src/Action/ShowProfileAction.php
Expand Up @@ -12,9 +12,9 @@
namespace Nucleos\ProfileBundle\Action;

use Nucleos\UserBundle\Model\UserInterface;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\Security;
use Twig\Environment;

final class ShowProfileAction
Expand Down
2 changes: 1 addition & 1 deletion src/EventListener/AlreadyLoggedinListener.php
Expand Up @@ -17,11 +17,11 @@
use Nucleos\UserBundle\Event\GetResponseUserEvent;
use Nucleos\UserBundle\Model\UserInterface;
use Nucleos\UserBundle\NucleosUserEvents;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Security\Core\Security;

final class AlreadyLoggedinListener implements EventSubscriberInterface
{
Expand Down
3 changes: 1 addition & 2 deletions tests/App/AppKernel.php
Expand Up @@ -88,8 +88,7 @@ protected function configureRoutes(RoutingConfigurator $routes): void

protected function configureContainer(ContainerConfigurator $container): void
{
$container->import(__DIR__.'/config/config.yaml');
$container->import(__DIR__.'/config/security.yaml');
$container->import(__DIR__.'/config/config.php');
}

private function getBaseDir(): string
Expand Down
81 changes: 81 additions & 0 deletions tests/App/config/config.php
@@ -0,0 +1,81 @@
<?php

declare(strict_types=1);

/*
* This file is part of the NucleosProfileBundle package.
*
* (c) Christian Gripp <mail@core23.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Nucleos\ProfileBundle\Tests\App\Entity\TestGroup;
use Nucleos\ProfileBundle\Tests\App\Entity\TestUser;
use Nucleos\UserBundle\Model\UserInterface;
use Symfony\Component\Security\Http\Attribute\IsGranted;

return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->extension('framework', ['secret' => 'secret']);

$containerConfigurator->extension('framework', ['test' => true]);

$containerConfigurator->extension('framework', ['session' => ['storage_factory_id' => 'session.storage.factory.mock_file', 'handler_id' => null]]);

$containerConfigurator->extension('twig', ['strict_variables' => true]);

$containerConfigurator->extension('twig', ['exception_controller' => null]);

$containerConfigurator->extension('doctrine', ['dbal' => ['url' => 'sqlite:///%kernel.cache_dir%/data.db', 'logging' => false, 'use_savepoints' => true]]);

$containerConfigurator->extension('doctrine', ['orm' => [
'auto_mapping' => true,
'mappings' => [
'App' => [
'is_bundle' => false,
'type' => 'attribute',
'dir' => '%kernel.project_dir%/Entity',
'prefix' => 'Nucleos\ProfileBundle\Tests\App\Entity',
'alias' => 'App',
],
],
]]);

$securityConfig = [
'firewalls' => ['main' => ['security' => true]],
];

// TODO: Remove if when dropping support of Symfony 5.4
if (!class_exists(IsGranted::class)) {
$securityConfig['enable_authenticator_manager'] = true;
}

$containerConfigurator->extension('security', $securityConfig);

$containerConfigurator->extension('security', [
'providers' => ['nucleos_userbundle' => ['id' => 'nucleos_user.user_provider.username']],
]);

$containerConfigurator->extension('security', ['access_control' => [
['path' => '^/.*', 'role' => 'PUBLIC_ACCESS'],
]]);

$containerConfigurator->extension('security', ['password_hashers' => [UserInterface::class => [
'algorithm' => 'plaintext',
]]]);

$containerConfigurator->extension('nucleos_user', ['db_driver' => 'orm']);

$containerConfigurator->extension('nucleos_user', ['firewall_name' => 'main']);

$containerConfigurator->extension('nucleos_user', ['from_email' => 'no-reply@localhost']);

$containerConfigurator->extension('nucleos_user', ['user_class' => TestUser::class]);

$containerConfigurator->extension('nucleos_user', ['group' => ['group_class' => TestGroup::class]]);

$containerConfigurator->extension('nucleos_user', ['loggedin' => ['route' => 'home']]);
};
46 changes: 0 additions & 46 deletions tests/App/config/config.yaml

This file was deleted.

35 changes: 0 additions & 35 deletions tests/App/config/security.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion vendor-bin/tools/composer.json
Expand Up @@ -15,7 +15,7 @@
"phpunit/phpunit": "^10.1.2",
"psalm/plugin-phpunit": "^0.18.4",
"psalm/plugin-symfony": "^5.0.3",
"symfony/phpunit-bridge": "^6.2.7",
"symfony/phpunit-bridge": "^7.0",
"vimeo/psalm": "^5.9"
},
"config": {
Expand Down

0 comments on commit ec5fcf6

Please sign in to comment.