Merge branch 'symfony74'

This commit is contained in:
Jan Böhmer 2025-11-30 15:10:21 +01:00
commit 5d843ec8eb
18 changed files with 3842 additions and 833 deletions

3
.env
View file

@ -31,7 +31,7 @@ DATABASE_EMULATE_NATURAL_SORT=0
# General settings # General settings
################################################################################### ###################################################################################
# The public reachable URL of this Part-DB installation. This is used for generating links in SAML and email templates # The public reachable URL of this Part-DB installation. This is used for generating links in SAML and email templates or when no request context is available.
# This must end with a slash! # This must end with a slash!
DEFAULT_URI="https://partdb.changeme.invalid/" DEFAULT_URI="https://partdb.changeme.invalid/"
@ -134,4 +134,5 @@ CORS_ALLOW_ORIGIN='^https?://(localhost|127\.0\.0\.1)(:[0-9]+)?$'
###> symfony/framework-bundle ### ###> symfony/framework-bundle ###
APP_ENV=prod APP_ENV=prod
APP_SECRET=a03498528f5a5fc089273ec9ae5b2849 APP_SECRET=a03498528f5a5fc089273ec9ae5b2849
APP_SHARE_DIR=var/share
###< symfony/framework-bundle ### ###< symfony/framework-bundle ###

View file

@ -2,6 +2,8 @@ const nameCheck = /^[-_a-zA-Z0-9]{4,22}$/;
const tokenCheck = /^[-_/+a-zA-Z0-9]{24,}$/; const tokenCheck = /^[-_/+a-zA-Z0-9]{24,}$/;
// Generate and double-submit a CSRF token in a form field and a cookie, as defined by Symfony's SameOriginCsrfTokenManager // Generate and double-submit a CSRF token in a form field and a cookie, as defined by Symfony's SameOriginCsrfTokenManager
// Use `form.requestSubmit()` to ensure that the submit event is triggered. Using `form.submit()` will not trigger the event
// and thus this event-listener will not be executed.
document.addEventListener('submit', function (event) { document.addEventListener('submit', function (event) {
generateCsrfToken(event.target); generateCsrfToken(event.target);
}, true); }, true);
@ -33,8 +35,8 @@ export function generateCsrfToken (formElement) {
if (!csrfCookie && nameCheck.test(csrfToken)) { if (!csrfCookie && nameCheck.test(csrfToken)) {
csrfField.setAttribute('data-csrf-protection-cookie-value', csrfCookie = csrfToken); csrfField.setAttribute('data-csrf-protection-cookie-value', csrfCookie = csrfToken);
csrfField.defaultValue = csrfToken = btoa(String.fromCharCode.apply(null, (window.crypto || window.msCrypto).getRandomValues(new Uint8Array(18)))); csrfField.defaultValue = csrfToken = btoa(String.fromCharCode.apply(null, (window.crypto || window.msCrypto).getRandomValues(new Uint8Array(18))));
csrfField.dispatchEvent(new Event('change', { bubbles: true }));
} }
csrfField.dispatchEvent(new Event('change', { bubbles: true }));
if (csrfCookie && tokenCheck.test(csrfToken)) { if (csrfCookie && tokenCheck.test(csrfToken)) {
const cookie = csrfCookie + '_' + csrfToken + '=' + csrfCookie + '; path=/; samesite=strict'; const cookie = csrfCookie + '_' + csrfToken + '=' + csrfCookie + '; path=/; samesite=strict';

View file

@ -28,7 +28,7 @@ import '../css/app/treeview.css';
import '../css/app/images.css'; import '../css/app/images.css';
// start the Stimulus application // start the Stimulus application
import '../bootstrap'; import '../stimulus_bootstrap';
// Need jQuery? Install it with "yarn add jquery", then uncomment to require it. // Need jQuery? Install it with "yarn add jquery", then uncomment to require it.
const $ = require('jquery'); const $ = require('jquery');

View file

@ -1,23 +1,4 @@
#!/usr/bin/env php #!/usr/bin/env php
<?php <?php
if (!ini_get('date.timezone')) {
ini_set('date.timezone', 'UTC');
}
if (is_file(dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit')) {
if (PHP_VERSION_ID >= 80000) {
require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit'; require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit';
} else {
define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php');
require PHPUNIT_COMPOSER_INSTALL;
PHPUnit\TextUI\Command::main();
}
} else {
if (!is_file(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
exit(1);
}
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
}

View file

@ -57,36 +57,35 @@
"shivas/versioning-bundle": "^4.0", "shivas/versioning-bundle": "^4.0",
"spatie/db-dumper": "^3.3.1", "spatie/db-dumper": "^3.3.1",
"symfony/apache-pack": "^1.0", "symfony/apache-pack": "^1.0",
"symfony/asset": "7.3.*", "symfony/asset": "7.4.*",
"symfony/console": "7.3.*", "symfony/console": "7.4.*",
"symfony/css-selector": "7.3.*", "symfony/css-selector": "7.4.*",
"symfony/dom-crawler": "7.3.*", "symfony/dom-crawler": "7.4.*",
"symfony/dotenv": "7.3.*", "symfony/dotenv": "7.4.*",
"symfony/expression-language": "7.3.*", "symfony/expression-language": "7.4.*",
"symfony/flex": "^v2.3.1", "symfony/flex": "^v2.3.1",
"symfony/form": "7.3.*", "symfony/form": "7.4.*",
"symfony/framework-bundle": "7.3.*", "symfony/framework-bundle": "7.4.*",
"symfony/http-client": "7.3.*", "symfony/http-client": "7.4.*",
"symfony/http-kernel": "7.3.*", "symfony/http-kernel": "7.4.*",
"symfony/mailer": "7.3.*", "symfony/mailer": "7.4.*",
"symfony/monolog-bundle": "^3.1", "symfony/monolog-bundle": "^3.1",
"symfony/polyfill-php82": "^1.28", "symfony/process": "7.4.*",
"symfony/process": "7.3.*", "symfony/property-access": "7.4.*",
"symfony/property-access": "7.3.*", "symfony/property-info": "7.4.*",
"symfony/property-info": "7.3.*", "symfony/rate-limiter": "7.4.*",
"symfony/rate-limiter": "7.3.*", "symfony/runtime": "7.4.*",
"symfony/runtime": "7.3.*", "symfony/security-bundle": "7.4.*",
"symfony/security-bundle": "7.3.*", "symfony/serializer": "7.4.*",
"symfony/serializer": "7.3.*", "symfony/string": "7.4.*",
"symfony/string": "7.3.*", "symfony/translation": "7.4.*",
"symfony/translation": "7.3.*", "symfony/twig-bundle": "7.4.*",
"symfony/twig-bundle": "7.3.*",
"symfony/ux-translator": "^2.10", "symfony/ux-translator": "^2.10",
"symfony/ux-turbo": "^2.0", "symfony/ux-turbo": "^2.0",
"symfony/validator": "7.3.*", "symfony/validator": "7.4.*",
"symfony/web-link": "7.3.*", "symfony/web-link": "7.4.*",
"symfony/webpack-encore-bundle": "^v2.0.1", "symfony/webpack-encore-bundle": "^v2.0.1",
"symfony/yaml": "7.3.*", "symfony/yaml": "7.4.*",
"symplify/easy-coding-standard": "^12.5.20", "symplify/easy-coding-standard": "^12.5.20",
"tecnickcom/tc-lib-barcode": "^2.1.4", "tecnickcom/tc-lib-barcode": "^2.1.4",
"twig/cssinliner-extra": "^3.0", "twig/cssinliner-extra": "^3.0",
@ -111,12 +110,12 @@
"phpunit/phpunit": "^11.5.0", "phpunit/phpunit": "^11.5.0",
"rector/rector": "^2.0.4", "rector/rector": "^2.0.4",
"roave/security-advisories": "dev-latest", "roave/security-advisories": "dev-latest",
"symfony/browser-kit": "7.3.*", "symfony/browser-kit": "7.4.*",
"symfony/debug-bundle": "7.3.*", "symfony/debug-bundle": "7.4.*",
"symfony/maker-bundle": "^1.13", "symfony/maker-bundle": "^1.13",
"symfony/phpunit-bridge": "7.3.*", "symfony/phpunit-bridge": "7.4.*",
"symfony/stopwatch": "7.3.*", "symfony/stopwatch": "7.4.*",
"symfony/web-profiler-bundle": "7.3.*" "symfony/web-profiler-bundle": "7.4.*"
}, },
"replace": { "replace": {
"symfony/polyfill-mbstring": "*", "symfony/polyfill-mbstring": "*",
@ -174,7 +173,7 @@
"extra": { "extra": {
"symfony": { "symfony": {
"allow-contrib": false, "allow-contrib": false,
"require": "7.3.*", "require": "7.4.*",
"docker": true "docker": true
} }
} }

1588
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -10,14 +10,6 @@ when@dev:
path: "%kernel.logs_dir%/%kernel.environment%.log" path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug level: debug
channels: ["!event"] channels: ["!event"]
# uncomment to get logging in your browser
# you may have to allow bigger header sizes in your Web server configuration
#firephp:
# type: firephp
# level: info
#chromephp:
# type: chromephp
# level: info
console: console:
type: console type: console
process_psr_3_messages: false process_psr_3_messages: false
@ -45,6 +37,7 @@ when@prod:
action_level: error action_level: error
handler: nested handler: nested
excluded_http_codes: [404, 405] excluded_http_codes: [404, 405]
channels: ["!deprecation"]
buffer_size: 50 # How many messages should be saved? Prevent memory leaks buffer_size: 50 # How many messages should be saved? Prevent memory leaks
nested: nested:
type: stream type: stream

2896
config/reference.php Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,12 @@
# yaml-language-server: $schema=../vendor/symfony/routing/Loader/schema/routing.schema.json
# This file is the entry point to configure the routes of your app.
# Methods with the #[Route] attribute are automatically imported.
# See also https://symfony.com/doc/current/routing.html
# To list all registered routes, run the following command:
# bin/console debug:router
# Redirect every url without an locale to the locale of the user/the global base locale # Redirect every url without an locale to the locale of the user/the global base locale
scan_qr: scan_qr:

View file

@ -1,5 +1,8 @@
# yaml-language-server: $schema=../vendor/symfony/dependency-injection/Loader/schema/services.schema.json
# This file is the entry point to configure your own services. # This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies. # Files in the packages/ subdirectory configure your dependencies.
# See also https://symfony.com/doc/current/service_container/import.html
# Put parameters here that don't need to change on each machine where the app is deployed # Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration # https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration

View file

@ -9,9 +9,9 @@
"@symfony/stimulus-bridge": "^4.0.0", "@symfony/stimulus-bridge": "^4.0.0",
"@symfony/ux-translator": "file:vendor/symfony/ux-translator/assets", "@symfony/ux-translator": "file:vendor/symfony/ux-translator/assets",
"@symfony/ux-turbo": "file:vendor/symfony/ux-turbo/assets", "@symfony/ux-turbo": "file:vendor/symfony/ux-turbo/assets",
"@symfony/webpack-encore": "^5.0.0", "@symfony/webpack-encore": "^5.1.0",
"bootstrap": "^5.1.3", "bootstrap": "^5.1.3",
"core-js": "^3.23.0", "core-js": "^3.38.0",
"intl-messageformat": "^10.2.5", "intl-messageformat": "^10.2.5",
"jquery": "^3.5.1", "jquery": "^3.5.1",
"popper.js": "^1.14.7", "popper.js": "^1.14.7",

View file

@ -134,7 +134,7 @@ class BOMImporter
private function parseKiCADPCB(string $data): array private function parseKiCADPCB(string $data): array
{ {
$csv = Reader::createFromString($data); $csv = Reader::fromString($data);
$csv->setDelimiter(';'); $csv->setDelimiter(';');
$csv->setHeaderOffset(0); $csv->setHeaderOffset(0);
@ -175,7 +175,7 @@ class BOMImporter
*/ */
private function validateKiCADPCB(string $data): array private function validateKiCADPCB(string $data): array
{ {
$csv = Reader::createFromString($data); $csv = Reader::fromString($data);
$csv->setDelimiter(';'); $csv->setDelimiter(';');
$csv->setHeaderOffset(0); $csv->setHeaderOffset(0);
@ -202,7 +202,7 @@ class BOMImporter
// Handle potential BOM (Byte Order Mark) at the beginning // Handle potential BOM (Byte Order Mark) at the beginning
$data = preg_replace('/^\xEF\xBB\xBF/', '', $data); $data = preg_replace('/^\xEF\xBB\xBF/', '', $data);
$csv = Reader::createFromString($data); $csv = Reader::fromString($data);
$csv->setDelimiter($delimiter); $csv->setDelimiter($delimiter);
$csv->setHeaderOffset(0); $csv->setHeaderOffset(0);
@ -262,7 +262,7 @@ class BOMImporter
// Handle potential BOM (Byte Order Mark) at the beginning // Handle potential BOM (Byte Order Mark) at the beginning
$data = preg_replace('/^\xEF\xBB\xBF/', '', $data); $data = preg_replace('/^\xEF\xBB\xBF/', '', $data);
$csv = Reader::createFromString($data); $csv = Reader::fromString($data);
$csv->setDelimiter($delimiter); $csv->setDelimiter($delimiter);
$csv->setHeaderOffset(0); $csv->setHeaderOffset(0);

View file

@ -305,7 +305,7 @@
"repo": "github.com/symfony/recipes", "repo": "github.com/symfony/recipes",
"branch": "main", "branch": "main",
"version": "11.1", "version": "11.1",
"ref": "c6658a60fc9d594805370eacdf542c3d6b5c0869" "ref": "1117deb12541f35793eec9fff7494d7aa12283fc"
}, },
"files": [ "files": [
".env.test", ".env.test",
@ -488,12 +488,12 @@
] ]
}, },
"symfony/framework-bundle": { "symfony/framework-bundle": {
"version": "7.3", "version": "7.4",
"recipe": { "recipe": {
"repo": "github.com/symfony/recipes", "repo": "github.com/symfony/recipes",
"branch": "main", "branch": "main",
"version": "7.3", "version": "7.4",
"ref": "5a1497d539f691b96afd45ae397ce5fe30beb4b9" "ref": "09f6e081c763a206802674ce0cb34a022f0ffc6d"
}, },
"files": [ "files": [
".editorconfig", ".editorconfig",
@ -550,15 +550,15 @@
"version": "v4.4.2" "version": "v4.4.2"
}, },
"symfony/monolog-bundle": { "symfony/monolog-bundle": {
"version": "3.10", "version": "3.11",
"recipe": { "recipe": {
"repo": "github.com/symfony/recipes", "repo": "github.com/symfony/recipes",
"branch": "main", "branch": "main",
"version": "3.7", "version": "3.7",
"ref": "aff23899c4440dd995907613c1dd709b6f59503f" "ref": "1b9efb10c54cb51c713a9391c9300ff8bceda459"
}, },
"files": [ "files": [
"./config/packages/monolog.yaml" "config/packages/monolog.yaml"
] ]
}, },
"symfony/options-resolver": { "symfony/options-resolver": {
@ -611,12 +611,12 @@
] ]
}, },
"symfony/routing": { "symfony/routing": {
"version": "7.3", "version": "7.4",
"recipe": { "recipe": {
"repo": "github.com/symfony/recipes", "repo": "github.com/symfony/recipes",
"branch": "main", "branch": "main",
"version": "7.0", "version": "7.4",
"ref": "21b72649d5622d8f7da329ffb5afb232a023619d" "ref": "bc94c4fd86f393f3ab3947c18b830ea343e51ded"
}, },
"files": [ "files": [
"config/packages/routing.yaml", "config/packages/routing.yaml",
@ -627,12 +627,12 @@
"version": "v5.3.4" "version": "v5.3.4"
}, },
"symfony/security-bundle": { "symfony/security-bundle": {
"version": "6.4", "version": "7.4",
"recipe": { "recipe": {
"repo": "github.com/symfony/recipes", "repo": "github.com/symfony/recipes",
"branch": "main", "branch": "main",
"version": "6.4", "version": "7.4",
"ref": "2ae08430db28c8eb4476605894296c82a642028f" "ref": "c42fee7802181cdd50f61b8622715829f5d2335c"
}, },
"files": [ "files": [
"config/packages/security.yaml", "config/packages/security.yaml",
@ -655,18 +655,18 @@
"version": "v1.1.5" "version": "v1.1.5"
}, },
"symfony/stimulus-bundle": { "symfony/stimulus-bundle": {
"version": "2.27", "version": "2.31",
"recipe": { "recipe": {
"repo": "github.com/symfony/recipes", "repo": "github.com/symfony/recipes",
"branch": "main", "branch": "main",
"version": "2.20", "version": "2.24",
"ref": "e058471c5502e549c1404ebdd510099107bb5549" "ref": "3357f2fa6627b93658d8e13baa416b2a94a50c5f"
}, },
"files": [ "files": [
"assets/bootstrap.js",
"assets/controllers.json", "assets/controllers.json",
"assets/controllers/csrf_protection_controller.js", "assets/controllers/csrf_protection_controller.js",
"assets/controllers/hello_controller.js" "assets/controllers/hello_controller.js",
"assets/stimulus_bootstrap.js"
] ]
}, },
"symfony/stopwatch": { "symfony/stopwatch": {
@ -779,12 +779,12 @@
] ]
}, },
"symfony/webpack-encore-bundle": { "symfony/webpack-encore-bundle": {
"version": "2.2", "version": "2.3",
"recipe": { "recipe": {
"repo": "github.com/symfony/recipes", "repo": "github.com/symfony/recipes",
"branch": "main", "branch": "main",
"version": "2.0", "version": "2.0",
"ref": "9ef5412a4a2a8415aca3a3f2b4edd3866aab9a19" "ref": "719f6110345acb6495e496601fc1b4977d7102b3"
}, },
"files": [ "files": [
"assets/app.js", "assets/app.js",

View file

@ -30,13 +30,12 @@ use App\Services\InfoProviderSystem\DTOs\BulkSearchPartResultDTO;
use App\Services\InfoProviderSystem\DTOs\BulkSearchPartResultsDTO; use App\Services\InfoProviderSystem\DTOs\BulkSearchPartResultsDTO;
use App\Services\InfoProviderSystem\DTOs\BulkSearchResponseDTO; use App\Services\InfoProviderSystem\DTOs\BulkSearchResponseDTO;
use App\Services\InfoProviderSystem\DTOs\SearchResultDTO; use App\Services\InfoProviderSystem\DTOs\SearchResultDTO;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
/** #[Group("slow")]
* @group slow #[Group("DB")]
* @group DB
*/
class BulkInfoProviderImportControllerTest extends WebTestCase class BulkInfoProviderImportControllerTest extends WebTestCase
{ {
public function testStep1WithoutIds(): void public function testStep1WithoutIds(): void

View file

@ -32,13 +32,12 @@ use App\Entity\Parts\StorageLocation;
use App\Entity\Parts\Supplier; use App\Entity\Parts\Supplier;
use App\Entity\UserSystem\User; use App\Entity\UserSystem\User;
use App\Services\InfoProviderSystem\DTOs\BulkSearchResponseDTO; use App\Services\InfoProviderSystem\DTOs\BulkSearchResponseDTO;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
/** #[Group("slow")]
* @group slow #[Group("DB")]
* @group DB
*/
class PartControllerTest extends WebTestCase class PartControllerTest extends WebTestCase
{ {
public function testShowPart(): void public function testShowPart(): void

View file

@ -23,13 +23,12 @@ declare(strict_types=1);
namespace App\Tests\Form\InfoProviderSystem; namespace App\Tests\Form\InfoProviderSystem;
use App\Form\InfoProviderSystem\GlobalFieldMappingType; use App\Form\InfoProviderSystem\GlobalFieldMappingType;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Form\FormFactoryInterface; use Symfony\Component\Form\FormFactoryInterface;
/** #[Group("slow")]
* @group slow #[Group("DB")]
* @group DB
*/
class GlobalFieldMappingTypeTest extends KernelTestCase class GlobalFieldMappingTypeTest extends KernelTestCase
{ {
private FormFactoryInterface $formFactory; private FormFactoryInterface $formFactory;

View file

@ -71,7 +71,7 @@ Encore
// When enabled, Webpack "splits" your files into smaller pieces for greater optimization. // When enabled, Webpack "splits" your files into smaller pieces for greater optimization.
.splitEntryChunks() .splitEntryChunks()
// enables the Symfony UX Stimulus bridge (used in assets/bootstrap.js) // enables the Symfony UX Stimulus bridge (used in assets/stimulus_bootstrap.js)
.enableStimulusBridge('./assets/controllers.json') .enableStimulusBridge('./assets/controllers.json')
// will require an extra script tag for runtime.js // will require an extra script tag for runtime.js