Skip to content

Commit

Permalink
Merge 5.x into 6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
SonataCI authored Dec 8, 2024
2 parents b29878f + fda673f commit ccf7320
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 44 deletions.
20 changes: 7 additions & 13 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
strategy:
matrix:
php-version:
- '8.0'
- '8.1'
- '8.2'
- '8.3'
Expand All @@ -45,30 +44,25 @@ jobs:
symfony-require: ['']
variant: [normal]
include:
- php-version: '8.0'
- php-version: '8.1'
dependencies: lowest
allowed-to-fail: false
variant: normal
- php-version: '8.3'
dependencies: highest
allowed-to-fail: false
symfony-require: 5.4.*
variant: symfony/symfony:"5.4.*"
- php-version: '8.3'
dependencies: highest
allowed-to-fail: false
symfony-require: 6.3.*
variant: symfony/symfony:"6.3.*"
symfony-require: 6.4.*
variant: symfony/symfony:"6.4.*"
- php-version: '8.3'
dependencies: highest
allowed-to-fail: false
symfony-require: 6.4.*
variant: symfony/symfony:"6.4.*"
symfony-require: 7.1.*
variant: symfony/symfony:"7.1.*"
- php-version: '8.3'
dependencies: highest
allowed-to-fail: false
symfony-require: 7.0.*
variant: symfony/symfony:"7.0.*"
symfony-require: 7.2.*
variant: symfony/symfony:"7.2.*"

steps:
- name: Checkout
Expand Down
46 changes: 23 additions & 23 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,29 @@
],
"homepage": "https://docs.sonata-project.org/projects/SonataUserBundle",
"require": {
"php": "^8.0",
"php": "^8.1",
"doctrine/collections": "^1.6 || ^2.0",
"doctrine/common": "^3.1",
"doctrine/persistence": "^3.0.2",
"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 || ^7.0",
"symfony/console": "^5.4 || ^6.2 || ^7.0",
"symfony/dependency-injection": "^5.4 || ^6.2 || ^7.0",
"symfony/event-dispatcher": "^5.4 || ^6.2 || ^7.0",
"symfony/form": "^5.4 || ^6.2 || ^7.0",
"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/options-resolver": "^5.4 || ^6.2 || ^7.0",
"symfony/routing": "^5.4 || ^6.2 || ^7.0",
"symfony/config": "^6.4 || ^7.1",
"symfony/console": "^6.4 || ^7.1",
"symfony/dependency-injection": "^6.4 || ^7.1",
"symfony/event-dispatcher": "^6.4 || ^7.1",
"symfony/form": "^6.4 || ^7.1",
"symfony/framework-bundle": "^6.4 || ^7.1",
"symfony/http-foundation": "^6.4 || ^7.1",
"symfony/http-kernel": "^6.4 || ^7.1",
"symfony/options-resolver": "^6.4 || ^7.1",
"symfony/routing": "^6.4 || ^7.1",
"symfony/security-acl": "^3.0",
"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/security-core": "^6.4 || ^7.1",
"symfony/security-csrf": "^6.4 || ^7.1",
"symfony/translation": "^6.4 || ^7.1",
"symfony/translation-contracts": "^2.5 || ^3.0",
"symfony/validator": "^5.4 || ^6.2 || ^7.0",
"symfony/validator": "^6.4 || ^7.1",
"twig/twig": "^3.0"
},
"require-dev": {
Expand All @@ -64,16 +64,16 @@
"psalm/plugin-phpunit": "^0.18",
"psalm/plugin-symfony": "^5.0",
"rector/rector": "^1.1",
"sonata-project/admin-bundle": "^4.20",
"sonata-project/admin-bundle": "^4.34",
"sonata-project/block-bundle": "^4.11 || ^5.0",
"sonata-project/doctrine-orm-admin-bundle": "^4.0",
"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/mailer": "^5.4 || ^6.2 || ^7.0",
"symfony/mime": "^5.4 || ^6.2 || ^7.0",
"symfony/phpunit-bridge": "^6.2 || ^7.0",
"symfony/browser-kit": "^6.4 || ^7.1",
"symfony/console": "^6.4 || ^7.1",
"symfony/filesystem": "^6.4 || ^7.1",
"symfony/intl": "^6.4 || ^7.1",
"symfony/mailer": "^6.4 || ^7.1",
"symfony/mime": "^6.4 || ^7.1",
"symfony/phpunit-bridge": "^6.4 || ^7.1",
"vimeo/psalm": "^5.0"
},
"conflict": {
Expand Down
6 changes: 5 additions & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

use Rector\Config\RectorConfig;
use Rector\Php70\Rector\FunctionLike\ExceptionHandlerTypehintRector;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\NarrowUnusedSetUpDefinedPropertyRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
Expand All @@ -31,7 +33,7 @@
]);

$rectorConfig->sets([
LevelSetList::UP_TO_PHP_80,
LevelSetList::UP_TO_PHP_81,
PHPUnitSetList::PHPUNIT_90,
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
]);
Expand All @@ -40,6 +42,8 @@
$rectorConfig->importShortClasses(false);
$rectorConfig->skip([
ExceptionHandlerTypehintRector::class,
ReadOnlyPropertyRector::class,
NullToStrictStringFuncCallArgRector::class,
PreferPHPUnitThisCallRector::class,
NarrowUnusedSetUpDefinedPropertyRector::class,
]);
Expand Down
2 changes: 1 addition & 1 deletion src/Action/CheckLoginAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

final class CheckLoginAction
{
public function __invoke(): void
public function __invoke(): never
{
throw new \RuntimeException('You must configure the check path to be handled by the firewall using form_login in your security firewall configuration.');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Action/LogoutAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

final class LogoutAction
{
public function __invoke(): void
public function __invoke(): never
{
throw new \RuntimeException('You must activate the logout in your security firewall configuration.');
}
Expand Down
7 changes: 6 additions & 1 deletion src/Model/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ public function getUsername(): ?string

public function getUserIdentifier(): string
{
return $this->getUsername() ?? '-';
$username = $this->getUsername();
if (null === $username || '' === $username) {
return '-';
}

return $username;
}

public function getUsernameCanonical(): ?string
Expand Down
4 changes: 2 additions & 2 deletions src/Twig/RolesMatrixExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ public function __construct(private MatrixRolesBuilderInterface $rolesBuilder)
public function getFunctions(): array
{
return [
new TwigFunction('renderMatrix', [$this, 'renderMatrix'], ['needs_environment' => true]),
new TwigFunction('renderMatrix', $this->renderMatrix(...), ['needs_environment' => true]),
new TwigFunction(
'renderRolesList',
[$this, 'renderRolesList'],
$this->renderRolesList(...),
['needs_environment' => true]
),
];
Expand Down
2 changes: 1 addition & 1 deletion tests/Action/CheckLoginActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

final class CheckLoginActionTest extends TestCase
{
public function testAction(): void
public function testAction(): never
{
$this->expectException(\RuntimeException::class);
$this->expectExceptionMessage('You must configure the check path to be handled by the firewall using form_login in your security firewall configuration.');
Expand Down
2 changes: 1 addition & 1 deletion tests/Action/LogoutActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

final class LogoutActionTest extends TestCase
{
public function testAction(): void
public function testAction(): never
{
$this->expectException(\RuntimeException::class);
$this->expectExceptionMessage('You must activate the logout in your security firewall configuration.');
Expand Down

0 comments on commit ccf7320

Please sign in to comment.