Skip to content

Commit 396662f

Browse files
committed
feature #1616 Update to Symfony 7.4 (javiereguiluz)
This PR was squashed before being merged into the main branch. Discussion ---------- Update to Symfony 7.4 Commits ------- d5693df Update to Symfony 7.4
2 parents d3ebca2 + d5693df commit 396662f

18 files changed

+3417
-1261
lines changed

.env

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
###> symfony/framework-bundle ###
1818
APP_ENV=dev
1919
APP_SECRET=
20+
APP_SHARE_DIR=var/share
2021
###< symfony/framework-bundle ###
2122

2223
###> doctrine/doctrine-bundle ###
@@ -32,3 +33,9 @@ DATABASE_URL="sqlite:///%kernel.project_dir%/data/database.sqlite"
3233
###> symfony/mailer ###
3334
MAILER_DSN=null://null
3435
###< symfony/mailer ###
36+
37+
###> symfony/routing ###
38+
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
39+
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
40+
DEFAULT_URI=http://localhost
41+
###< symfony/routing ###

assets/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// start the Stimulus application
2-
import './bootstrap.js';
2+
import './stimulus_bootstrap.js';
33
import './styles/app.scss';
44
import 'highlight.js/styles/github-dark-dimmed.css';
55
import 'lato-font/css/lato-font.css';

assets/controllers/csrf_protection_controller.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ const nameCheck = /^[-_a-zA-Z0-9]{4,22}$/;
22
const tokenCheck = /^[-_/+a-zA-Z0-9]{24,}$/;
33

44
// Generate and double-submit a CSRF token in a form field and a cookie, as defined by Symfony's SameOriginCsrfTokenManager
5+
// Use `form.requestSubmit()` to ensure that the submit event is triggered. Using `form.submit()` will not trigger the event
6+
// and thus this event-listener will not be executed.
57
document.addEventListener('submit', function (event) {
68
generateCsrfToken(event.target);
79
}, true);
@@ -33,8 +35,8 @@ export function generateCsrfToken (formElement) {
3335
if (!csrfCookie && nameCheck.test(csrfToken)) {
3436
csrfField.setAttribute('data-csrf-protection-cookie-value', csrfCookie = csrfToken);
3537
csrfField.defaultValue = csrfToken = btoa(String.fromCharCode.apply(null, (window.crypto || window.msCrypto).getRandomValues(new Uint8Array(18))));
36-
csrfField.dispatchEvent(new Event('change', { bubbles: true }));
3738
}
39+
csrfField.dispatchEvent(new Event('change', { bubbles: true }));
3840

3941
if (csrfCookie && tokenCheck.test(csrfToken)) {
4042
const cookie = csrfCookie + '_' + csrfToken + '=' + csrfCookie + '; path=/; samesite=strict';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { startStimulusApp } from '@symfony/stimulus-bundle';
22

33
const app = startStimulusApp();
4+
45
// register any custom, 3rd party controllers here
56
// app.register('some_controller_name', SomeImportedController);

bin/phpunit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit';

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"license": "MIT",
44
"type": "project",
55
"description": "Symfony Demo Application",
6-
"minimum-stability": "stable",
7-
"prefer-stable": true,
6+
"minimum-stability": "dev",
7+
"prefer-stable": false,
88
"require": {
99
"php": ">=8.2",
1010
"ext-ctype": "*",
@@ -111,7 +111,7 @@
111111
"extra": {
112112
"symfony": {
113113
"allow-contrib": true,
114-
"require": "7.3.*"
114+
"require": "7.4.*"
115115
}
116116
}
117117
}

0 commit comments

Comments
 (0)