Skip to content

Commit

Permalink
Merge 4.x into 5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
SonataCI authored Dec 8, 2024
2 parents 20d6de6 + 143f552 commit be3dd69
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 47 deletions.
20 changes: 7 additions & 13 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
strategy:
matrix:
php-version:
- '8.0'
- '8.1'
- '8.2'
- '8.3'
Expand All @@ -39,30 +38,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
50 changes: 25 additions & 25 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,36 @@
],
"homepage": "https://docs.sonata-project.org/projects/SonataPageBundle",
"require": {
"php": "^8.0",
"php": "^8.1",
"cocur/slugify": "^4.0",
"doctrine/doctrine-bundle": "^2.7",
"doctrine/persistence": "^3.0.2",
"sonata-project/admin-bundle": "^4.28",
"sonata-project/admin-bundle": "^4.34",
"sonata-project/block-bundle": "^4.18 || ^5.0",
"sonata-project/doctrine-extensions": "^1.18 || ^2.1",
"sonata-project/doctrine-orm-admin-bundle": "^4.0",
"sonata-project/form-extensions": "^1.20 || ^2.0",
"sonata-project/seo-bundle": "^3.4",
"sonata-project/twig-extensions": "^1.3 || ^2.0",
"symfony-cmf/routing-bundle": "^2.1 || ^3.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/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/intl": "^5.4 || ^6.2 || ^7.0",
"symfony/options-resolver": "^5.4 || ^6.2 || ^7.0",
"symfony/process": "^5.4 || ^6.2 || ^7.0",
"symfony/property-access": "^5.4 || ^6.2 || ^7.0",
"symfony/property-info": "^5.4 || ^6.2 || ^7.0",
"symfony/routing": "^5.4 || ^6.2 || ^7.0",
"symfony/runtime": "^5.4 || ^6.2 || ^7.0",
"symfony/security-core": "^5.4 || ^6.2 || ^7.0",
"symfony/security-http": "^5.4 || ^6.2 || ^7.0",
"symfony/serializer": "^5.4.24 || ^6.2.11 || ^7.0",
"symfony/validator": "^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/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/intl": "^6.4 || ^7.1",
"symfony/options-resolver": "^6.4 || ^7.1",
"symfony/process": "^6.4 || ^7.1",
"symfony/property-access": "^6.4 || ^7.1",
"symfony/property-info": "^6.4 || ^7.1",
"symfony/routing": "^6.4 || ^7.1",
"symfony/runtime": "^6.4 || ^7.1",
"symfony/security-core": "^6.4 || ^7.1",
"symfony/security-http": "^6.4 || ^7.1",
"symfony/serializer": "^6.4 || ^7.1",
"symfony/validator": "^6.4 || ^7.1",
"twig/string-extra": "^3.0",
"twig/twig": "^3.0"
},
Expand All @@ -69,12 +69,12 @@
"psalm/plugin-phpunit": "^0.19",
"psalm/plugin-symfony": "^5.0",
"rector/rector": "^1.1",
"symfony/browser-kit": "^5.4 || ^6.2 || ^7.0",
"symfony/css-selector": "^5.4 || ^6.2 || ^7.0",
"symfony/filesystem": "^5.4 || ^6.2 || ^7.0",
"symfony/browser-kit": "^6.4 || ^7.1",
"symfony/css-selector": "^6.4 || ^7.1",
"symfony/filesystem": "^6.4 || ^7.1",
"symfony/panther": "^2.0.1",
"symfony/phpunit-bridge": "^7.0",
"symfony/yaml": "^5.4 || ^6.2 || ^7.0",
"symfony/phpunit-bridge": "^7.1",
"symfony/yaml": "^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
5 changes: 1 addition & 4 deletions src/Listener/ExceptionListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
*/
final class ExceptionListener
{
private LoggerInterface $logger;

/**
* @param array<int, string> $httpErrorCodes An array of http error code routes
*/
Expand All @@ -45,10 +43,9 @@ public function __construct(
private PageServiceManagerInterface $pageServiceManager,
private DecoratorStrategyInterface $decoratorStrategy,
private array $httpErrorCodes,
?LoggerInterface $logger = null,
private LoggerInterface $logger = new NullLogger(),
private bool $status = false,
) {
$this->logger = $logger ?? new NullLogger();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/Functional/Frontend/ExceptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
use Doctrine\ORM\EntityManagerInterface;
use Sonata\PageBundle\Tests\App\Entity\SonataPagePage;
use Sonata\PageBundle\Tests\App\Entity\SonataPageSite;
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\BrowserKit\AbstractBrowser;
use Symfony\Component\BrowserKit\Cookie;
use Symfony\Component\HttpFoundation\Session\SessionFactoryInterface;
use Symfony\Component\Security\Core\User\OidcUser;
Expand Down Expand Up @@ -97,7 +97,7 @@ private function prepareData(): void
* Normally this would happen via an interactive login.
* Part of this logic is also copied from AbstractBrowser::loginUser().
*/
private function becomeEditor(AbstractBrowser $client): void
private function becomeEditor(KernelBrowser $client): void
{
$sessionFactory = self::getContainer()->get('session.factory');
\assert($sessionFactory instanceof SessionFactoryInterface);
Expand Down
4 changes: 2 additions & 2 deletions tests/Functional/Frontend/PageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
use Sonata\PageBundle\Tests\App\Entity\SonataPageBlock;
use Sonata\PageBundle\Tests\App\Entity\SonataPagePage;
use Sonata\PageBundle\Tests\App\Entity\SonataPageSite;
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\BrowserKit\AbstractBrowser;
use Symfony\Component\BrowserKit\Cookie;
use Symfony\Component\HttpFoundation\Session\SessionFactoryInterface;

Expand Down Expand Up @@ -366,7 +366,7 @@ private function prepareGlobalPageData(): void
* Normally this would happen via an interactive login.
* Part of this logic is also copied from AbstractBrowser::loginUser().
*/
private function becomeEditor(AbstractBrowser $client): void
private function becomeEditor(KernelBrowser $client): void
{
$sessionFactory = self::getContainer()->get('session.factory');
\assert($sessionFactory instanceof SessionFactoryInterface);
Expand Down

0 comments on commit be3dd69

Please sign in to comment.