Skip to content

Commit

Permalink
feat: Upgraded to Symfony 6.4 LTS
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Controller::get and Controller::has methods have been removed
  • Loading branch information
ambroisemaupate committed Dec 2, 2023
1 parent e534f11 commit 0e37266
Show file tree
Hide file tree
Showing 36 changed files with 247 additions and 280 deletions.
13 changes: 6 additions & 7 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,6 @@ HOSTNAME_SOLR=`solr.roadiz-core-app.test`,`solr.roadiz-core-app.local`
HOSTNAME_MAILER=`mail.roadiz-core-app.test`,`mail.roadiz-core-app.local`

DEFAULT_GATEWAY=172.58.0.1

###> symfony/lock ###
# Choose one of the stores below
# postgresql+advisory://db_user:db_password@localhost/db_name
LOCK_DSN=flock
###< symfony/lock ###

###> rezozero/intervention-request-bundle ###
IR_DEFAULT_QUALITY=90
IR_MAX_PIXEL_SIZE=2500
Expand Down Expand Up @@ -120,3 +113,9 @@ SCALEWAY_STORAGE_ID=
SCALEWAY_STORAGE_SECRET=
SCALEWAY_STORAGE_BUCKET=
SCALEWAY_STORAGE_REGION=

###> symfony/lock ###
# Choose one of the stores below
# postgresql+advisory://db_user:db_password@localhost/db_name
LOCK_DSN=flock
###< symfony/lock ###
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test:
vendor/bin/monorepo-builder validate
vendor/bin/atoum -d ./lib/Documents/tests
vendor/bin/atoum -f ./lib/EntityGenerator/tests/units/*
vendor/bin/phpunit -v lib/Models/tests
vendor/bin/phpunit -v
php -d "memory_limit=-1" vendor/bin/phpcs -p
make phpstan
php -d "memory_limit=-1" bin/console lint:twig ./lib/Rozier/src/Resources/views
Expand Down
99 changes: 50 additions & 49 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"doctrine/doctrine-bundle": "^2.8.1",
"doctrine/doctrine-migrations-bundle": "^3.1",
"doctrine/migrations": "^3.1.1",
"endroid/qr-code": "^4.0",
"doctrine/orm": "~2.17.0",
"endroid/qr-code": "^4.0",
"enshrined/svg-sanitize": "^0.15",
"gedmo/doctrine-extensions": "^3.10.0",
"guzzlehttp/guzzle": "^7.2.0",
Expand Down Expand Up @@ -82,52 +82,53 @@
"sensio/framework-extra-bundle": "^6.1",
"sentry/sentry-symfony": "^4.2",
"solarium/solarium": "^6.0.4",
"symfony-cmf/routing": "^2.3.3",
"symfony-cmf/routing-bundle": "^2.5",
"symfony/asset": "5.4.*",
"symfony/cache": "5.4.*",
"symfony/console": "5.4.*",
"symfony/dotenv": "5.4.*",
"symfony/event-dispatcher": "5.4.*",
"symfony-cmf/routing-bundle": "^3.0.2",
"symfony/asset": "6.4.*",
"symfony/cache": "6.4.*",
"symfony/console": "6.4.*",
"symfony/doctrine-messenger": "6.4.*",
"symfony/dotenv": "6.4.*",
"symfony/event-dispatcher": "6.4.*",
"symfony/event-dispatcher-contracts": "^2.4.0",
"symfony/expression-language": "5.4.*",
"symfony/filesystem": "5.4.*",
"symfony/finder": "5.4.*",
"symfony/expression-language": "6.4.*",
"symfony/filesystem": "6.4.*",
"symfony/finder": "6.4.*",
"symfony/flex": "^2.2.3",
"symfony/form": "5.4.*",
"symfony/framework-bundle": "5.4.*",
"symfony/http-client": "5.4.*",
"symfony/http-foundation": "5.4.*",
"symfony/http-kernel": "5.4.*",
"symfony/intl": "5.4.*",
"symfony/mailer": "5.4.*",
"symfony/messenger": "5.4.*",
"symfony/mime": "5.4.*",
"symfony/form": "6.4.*",
"symfony/framework-bundle": "6.4.*",
"symfony/http-client": "6.4.*",
"symfony/http-foundation": "6.4.*",
"symfony/http-kernel": "6.4.*",
"symfony/intl": "6.4.*",
"symfony/lock": "6.4.*",
"symfony/mailer": "6.4.*",
"symfony/messenger": "6.4.*",
"symfony/mime": "6.4.*",
"symfony/monolog-bundle": "^3.1",
"symfony/notifier": "5.4.*",
"symfony/options-resolver": "5.4.*",
"symfony/process": "5.4.*",
"symfony/property-access": "5.4.*",
"symfony/property-info": "5.4.*",
"symfony/proxy-manager-bridge": "5.4.*",
"symfony/rate-limiter": "5.4.*",
"symfony/notifier": "6.4.*",
"symfony/options-resolver": "6.4.*",
"symfony/process": "6.4.*",
"symfony/property-access": "6.4.*",
"symfony/property-info": "6.4.*",
"symfony/proxy-manager-bridge": "6.4.*",
"symfony/rate-limiter": "6.4.*",
"symfony/requirements-checker": "^2.0",
"symfony/routing": "5.4.*",
"symfony/runtime": "5.4.*",
"symfony/security-bundle": "5.4.*",
"symfony/security-core": "5.4.*",
"symfony/security-csrf": "5.4.*",
"symfony/security-http": "5.4.*",
"symfony/serializer": "5.4.*",
"symfony/stopwatch": "5.4.*",
"symfony/string": "5.4.*",
"symfony/translation": "5.4.*",
"symfony/routing": "6.4.*",
"symfony/runtime": "6.4.*",
"symfony/security-bundle": "6.4.*",
"symfony/security-core": "6.4.*",
"symfony/security-csrf": "6.4.*",
"symfony/security-http": "6.4.*",
"symfony/serializer": "6.4.*",
"symfony/stopwatch": "6.4.*",
"symfony/string": "6.4.*",
"symfony/translation": "6.4.*",
"symfony/translation-contracts": "^2.3",
"symfony/twig-bundle": "5.4.*",
"symfony/validator": "5.4.*",
"symfony/web-link": "5.4.*",
"symfony/workflow": "5.4.*",
"symfony/yaml": "5.4.*",
"symfony/twig-bundle": "6.4.*",
"symfony/validator": "6.4.*",
"symfony/web-link": "6.4.*",
"symfony/workflow": "6.4.*",
"symfony/yaml": "6.4.*",
"twig/extra-bundle": "^3.0",
"twig/html-extra": "^3.3",
"twig/intl-extra": "*",
Expand All @@ -147,12 +148,12 @@
"phpunit/phpunit": "^9.5",
"rector/rector": "^0.14.5",
"squizlabs/php_codesniffer": "^3.5",
"symfony/browser-kit": "5.4.*",
"symfony/css-selector": "5.4.*",
"symfony/debug-bundle": "5.4.*",
"symfony/maker-bundle": "^1.48",
"symfony/phpunit-bridge": "5.4.*",
"symfony/web-profiler-bundle": "5.4.*",
"symfony/browser-kit": "6.4.*",
"symfony/css-selector": "6.4.*",
"symfony/debug-bundle": "6.4.*",
"symfony/maker-bundle": "^1.52",
"symfony/phpunit-bridge": "^7.0",
"symfony/web-profiler-bundle": "6.4.*",
"symplify/monorepo-builder": "11.2.2.72"
},
"config": {
Expand Down Expand Up @@ -242,7 +243,7 @@
"extra": {
"symfony": {
"allow-contrib": false,
"require": "5.4.*"
"require": "6.4.*"
},
"branch-alias": {
"dev-main": "2.1.x-dev",
Expand Down
1 change: 0 additions & 1 deletion config/packages/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ security:
# https://symfony.com/bundles/LexikJWTAuthenticationBundle/current/index.html#configure-application-routing
api_login:
pattern: ^/api/token
stateless: true
provider: all_users
login_throttling:
max_attempts: 3
Expand Down
4 changes: 2 additions & 2 deletions lib/DocGenerator/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"require": {
"php": ">=8.1",
"roadiz/nodetype-contracts": "~1.1.2",
"symfony/translation": "5.4.*",
"symfony/http-foundation": "5.4.*"
"symfony/translation": "6.4.*",
"symfony/http-foundation": "6.4.*"
},
"license": "MIT",
"authors": [
Expand Down
16 changes: 8 additions & 8 deletions lib/Documents/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
"intervention/image": "^2.5",
"league/flysystem": "^3.0",
"monolog/monolog": "^1.24.0 || ^2.1.1",
"symfony/asset": "5.4.*",
"symfony/console": "5.4.*",
"symfony/event-dispatcher": "5.4.*",
"symfony/filesystem": "5.4.*",
"symfony/finder": "5.4.*",
"symfony/http-foundation": "5.4.*",
"symfony/options-resolver": "5.4.*",
"symfony/serializer": "5.4.*",
"symfony/asset": "6.4.*",
"symfony/console": "6.4.*",
"symfony/event-dispatcher": "6.4.*",
"symfony/filesystem": "6.4.*",
"symfony/finder": "6.4.*",
"symfony/http-foundation": "6.4.*",
"symfony/options-resolver": "6.4.*",
"symfony/serializer": "6.4.*",
"twig/twig": "^3.1"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion lib/DtsGenerator/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "library",
"require": {
"roadiz/nodetype-contracts": "~1.1.2",
"symfony/http-foundation": "5.4.*"
"symfony/http-foundation": "6.4.*"
},
"require-dev": {
"phpstan/phpstan": "^1.5.3",
Expand Down
8 changes: 4 additions & 4 deletions lib/EntityGenerator/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"php": ">=8.1",
"ext-json": "*",
"roadiz/nodetype-contracts": "~1.1.2",
"symfony/string": "5.4.*",
"symfony/yaml": "5.4.*",
"symfony/serializer": "5.4.*",
"symfony/options-resolver": "5.4.*"
"symfony/string": "6.4.*",
"symfony/yaml": "6.4.*",
"symfony/serializer": "6.4.*",
"symfony/options-resolver": "6.4.*"
},
"suggest": {
"api-platform/core": "If you need to create ApiFilter annotation right into your entities"
Expand Down
2 changes: 1 addition & 1 deletion lib/Markdown/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"league/commonmark": "^2.2.0",
"twig/twig": "^3.1",
"doctrine/collections": ">=1.6",
"symfony/stopwatch": "5.4.*"
"symfony/stopwatch": "6.4.*"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.5",
Expand Down
8 changes: 4 additions & 4 deletions lib/Models/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
"php": ">=8.1",
"doctrine/orm": "~2.17.0",
"jms/serializer": "^3.9.0",
"symfony/string": "5.4.*",
"symfony/string": "6.4.*",
"symfony/translation-contracts": "^2.3",
"symfony/http-foundation": "5.4.*",
"symfony/serializer": "5.4.*",
"symfony/validator": "5.4.*"
"symfony/http-foundation": "6.4.*",
"symfony/serializer": "6.4.*",
"symfony/validator": "6.4.*"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
Expand Down
12 changes: 6 additions & 6 deletions lib/Models/src/Bag/LazyParameterBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __construct()
* @param mixed|null $default
* @return mixed|null
*/
public function get(string $key, $default = null)
public function get(string $key, $default = null): mixed
{
if (!$this->ready) {
$this->populateParameters();
Expand All @@ -50,7 +50,7 @@ public function all(string $key = null): array
*
* @return bool
*/
public function has(string $key)
public function has(string $key): bool
{
if (!$this->ready) {
$this->populateParameters();
Expand All @@ -62,7 +62,7 @@ public function has(string $key)
/**
* @return array
*/
public function keys()
public function keys(): array
{
if (!$this->ready) {
$this->populateParameters();
Expand All @@ -75,7 +75,7 @@ public function keys()
* @return \ArrayIterator
*/
#[\ReturnTypeWillChange]
public function getIterator()
public function getIterator(): \ArrayIterator
{
if (!$this->ready) {
$this->populateParameters();
Expand All @@ -88,7 +88,7 @@ public function getIterator()
* @return int
*/
#[\ReturnTypeWillChange]
public function count()
public function count(): int
{
if (!$this->ready) {
$this->populateParameters();
Expand All @@ -105,7 +105,7 @@ public function count()
*
* @return mixed
*/
public function filter(string $key, $default = null, int $filter = \FILTER_DEFAULT, $options = [])
public function filter(string $key, $default = null, int $filter = \FILTER_DEFAULT, $options = []): mixed
{
if (!$this->ready) {
$this->populateParameters();
Expand Down
10 changes: 5 additions & 5 deletions lib/OpenId/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
"roadiz/random": "2.2.x-dev",
"roadiz/models": "2.2.x-dev",
"guzzlehttp/guzzle": "^7.2.0",
"symfony/http-foundation": "5.4.*",
"symfony/security-core": "5.4.*",
"symfony/security-http": "5.4.*",
"symfony/security-csrf": "5.4.*",
"symfony/http-foundation": "6.4.*",
"symfony/security-core": "6.4.*",
"symfony/security-http": "6.4.*",
"symfony/security-csrf": "6.4.*",
"psr/cache": ">=1.0.1",
"symfony/event-dispatcher-contracts": "^2.4.0",
"codercat/jwk-to-pem": "^1.0",
"symfony/routing": "5.4.*"
"symfony/routing": "6.4.*"
},
"require-dev": {
"phpstan/phpstan": "^1.5.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class OpenIdAccountProvider implements UserProviderInterface
* @param string $username
* @deprecated since Symfony 5.3, use loadUserByIdentifier() instead
*/
public function loadUserByUsername($username)
public function loadUserByUsername(string $username): UserInterface
{
throw new UserNotFoundException('Cannot load an OpenId account with its email.');
}
Expand Down
2 changes: 1 addition & 1 deletion lib/RoadizCompatBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"pimple/pimple": "^3.3.1",
"roadiz/core-bundle": "2.2.x-dev",
"roadiz/openid": "2.2.x-dev",
"symfony/framework-bundle": "5.4.*"
"symfony/framework-bundle": "6.4.*"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.4",
Expand Down
12 changes: 6 additions & 6 deletions lib/RoadizCompatBundle/src/Controller/AppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ public function getAssignation(): array
public function prepareBaseAssignation()
{
/** @var KernelInterface $kernel */
$kernel = $this->get('kernel');
$kernel = $this->container->get('kernel');
$this->assignation = [
'head' => [
'ajax' => $this->getRequest()->isXmlHttpRequest(),
Expand Down Expand Up @@ -368,7 +368,7 @@ public function getTheme(): ?Theme
{
$this->getStopwatch()->start('getTheme');
/** @var ThemeResolverInterface $themeResolver */
$themeResolver = $this->get(ThemeResolverInterface::class);
$themeResolver = $this->container->get(ThemeResolverInterface::class);
if (null === $this->theme) {
$className = new UnicodeString(static::getCalledClass());
while (!$className->endsWith('App')) {
Expand Down Expand Up @@ -475,7 +475,7 @@ public function validateNodeAccessForRole(mixed $attributes, mixed $nodeId = nul
/** @var User $user */
$user = $this->getUser();
/** @var NodeChrootResolver $chrootResolver */
$chrootResolver = $this->get(NodeChrootResolver::class);
$chrootResolver = $this->container->get(NodeChrootResolver::class);
$chroot = $chrootResolver->getChroot($user);

if ($this->isGranted($attributes) && $chroot === null) {
Expand Down Expand Up @@ -560,9 +560,9 @@ public function makeResponseCachable(
bool $allowClientCache = false
): Response {
/** @var Kernel $kernel */
$kernel = $this->get('kernel');
$kernel = $this->container->get('kernel');
/** @var RequestStack $requestStack */
$requestStack = $this->get(RequestStack::class);
$requestStack = $this->container->get(RequestStack::class);
$settings = $this->getSettingsBag();

if (
Expand Down Expand Up @@ -647,7 +647,7 @@ protected function getHome(?TranslationInterface $translation = null): ?Node
protected function getErrorsAsArray(FormInterface $form): array
{
/** @var FormErrorSerializer $formErrorSerializer */
$formErrorSerializer = $this->get(FormErrorSerializer::class);
$formErrorSerializer = $this->container->get(FormErrorSerializer::class);
return $formErrorSerializer->getErrorsAsArray($form);
}
}
Loading

0 comments on commit 0e37266

Please sign in to comment.