fixed error messages related to datafixtures in prod

This commit is contained in:
Jan Böhmer 2025-11-30 21:30:17 +01:00
parent d89a76bdc3
commit d8ec65461e
3 changed files with 196 additions and 275 deletions

View file

@ -128,7 +128,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
* http_method_override?: bool, // Set true to enable support for the '_method' request parameter to determine the intended HTTP method on POST requests. // Default: false
* allowed_http_method_override?: list<string>|null,
* trust_x_sendfile_type_header?: scalar|null, // Set true to enable support for xsendfile in binary file responses. // Default: "%env(bool:default::SYMFONY_TRUST_X_SENDFILE_TYPE_HEADER)%"
* ide?: scalar|null, // Default: "%env(default::SYMFONY_IDE)%"
* ide?: scalar|null, // Default: null
* test?: bool,
* default_locale?: scalar|null, // Default: "en"
* set_locale_from_accept_language?: bool, // Whether to use the Accept-Language HTTP header to set the Request locale (only when the "_locale" request attribute is not passed). // Default: false
@ -285,7 +285,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
* paths?: array<string, scalar|null>,
* excluded_patterns?: list<scalar|null>,
* exclude_dotfiles?: bool, // If true, any files starting with "." will be excluded from the asset mapper. // Default: true
* server?: bool, // If true, a "dev server" will return the assets from the public directory (true in "debug" mode only by default). // Default: true
* server?: bool, // If true, a "dev server" will return the assets from the public directory (true in "debug" mode only by default). // Default: false
* public_prefix?: scalar|null, // The public path where the assets will be written to (and served from when "server" is true). // Default: "/assets/"
* missing_import_mode?: "strict"|"warn"|"ignore", // Behavior if an asset cannot be found when imported from JavaScript or CSS files - e.g. "import './non-existent.js'". "strict" means an exception is thrown, "warn" means a warning is logged, "ignore" means the import is left as-is. // Default: "warn"
* extensions?: array<string, scalar|null>,
@ -405,7 +405,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
* },
* php_errors?: array{ // PHP errors handling configuration
* log?: mixed, // Use the application logger instead of the PHP logger for logging PHP errors. // Default: true
* throw?: bool, // Throw PHP errors as \ErrorException instances. // Default: true
* throw?: bool, // Throw PHP errors as \ErrorException instances. // Default: false
* },
* exceptions?: array<string, array{ // Default: []
* log_level?: scalar|null, // The level of log message. Null to let Symfony decide. // Default: null
@ -468,7 +468,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
* scheduler?: bool|array{ // Scheduler configuration
* enabled?: bool, // Default: false
* },
* disallow_search_engine_index?: bool, // Enabled by default when debug is enabled. // Default: true
* disallow_search_engine_index?: bool, // Enabled by default when debug is enabled. // Default: false
* http_client?: bool|array{ // HTTP Client configuration
* enabled?: bool, // Default: true
* max_host_connections?: int, // The maximum number of connections to a single host.
@ -731,8 +731,8 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
* platform_service?: scalar|null, // Deprecated: The "platform_service" configuration key is deprecated since doctrine-bundle 2.9. DBAL 4 will not support setting a custom platform via connection params anymore.
* auto_commit?: bool,
* schema_filter?: scalar|null,
* logging?: bool, // Default: true
* profiling?: bool, // Default: true
* logging?: bool, // Default: false
* profiling?: bool, // Default: false
* profiling_collect_backtrace?: bool, // Enables collecting backtraces when profiling is enabled // Default: false
* profiling_collect_schema_errors?: bool, // Enables collecting schema errors when profiling is enabled // Default: true
* disable_type_comments?: bool,
@ -871,7 +871,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
* pool?: scalar|null,
* },
* region_lock_lifetime?: scalar|null, // Default: 60
* log_enabled?: bool, // Default: true
* log_enabled?: bool, // Default: false
* region_lifetime?: scalar|null, // Default: 3600
* enabled?: bool, // Default: true
* factory?: scalar|null,
@ -1365,14 +1365,6 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
* html_to_text_converter?: scalar|null, // A service implementing the "Symfony\Component\Mime\HtmlToTextConverter\HtmlToTextConverterInterface". // Default: null
* },
* }
* @psalm-type WebProfilerConfig = array{
* toolbar?: bool|array{ // Profiler toolbar configuration
* enabled?: bool, // Default: false
* ajax_replace?: bool, // Replace toolbar on AJAX requests // Default: false
* },
* intercept_redirects?: bool, // Default: false
* excluded_ajax_paths?: scalar|null, // Default: "^/((index|app(_[\\w]+)?)\\.php/)?_wdt"
* }
* @psalm-type MonologConfig = array{
* use_microseconds?: scalar|null, // Default: true
* channels?: list<scalar|null>,
@ -1541,18 +1533,6 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
* },
* }>,
* }
* @psalm-type DebugConfig = array{
* max_items?: int, // Max number of displayed items past the first level, -1 means no limit. // Default: 2500
* min_depth?: int, // Minimum tree depth to clone all the items, 1 is default. // Default: 1
* max_string_length?: int, // Max length of displayed strings, -1 means no limit. // Default: -1
* dump_destination?: scalar|null, // A stream URL where dumps should be written to. // Default: null
* theme?: "dark"|"light", // Changes the color of the dump() output when rendered directly on the templating. "dark" (default) or "light". // Default: "dark"
* }
* @psalm-type MakerConfig = array{
* root_namespace?: scalar|null, // Default: "App"
* generate_final_classes?: bool, // Default: true
* generate_final_entities?: bool, // Default: false
* }
* @psalm-type WebpackEncoreConfig = array{
* output_path: scalar|null, // The path where Encore is building the assets - i.e. Encore.setOutputPath()
* crossorigin?: false|"anonymous"|"use-credentials", // crossorigin value when Encore.enableIntegrityHashes() is used, can be false (default), anonymous or use-credentials // Default: false
@ -2372,13 +2352,6 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
* invalidate_on_env_change?: bool, // Default: true
* },
* }
* @psalm-type JbtronicsTranslationEditorConfig = array{
* translations_path?: scalar|null, // Default: "%translator.default_path%"
* format?: scalar|null, // Default: "xlf"
* xliff_version?: scalar|null, // Default: "2.0"
* use_intl_icu_format?: bool, // Default: false
* writer_options?: list<scalar|null>,
* }
* @psalm-type ApiPlatformConfig = array{
* title?: scalar|null, // The title of the API. // Default: ""
* description?: scalar|null, // The description of the API. // Default: ""
@ -2529,7 +2502,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
* validation_error_resource_class?: scalar|null, // The class used to represent validation errors in the OpenAPI documentation. // Default: null
* },
* maker?: bool|array{
* enabled?: bool, // Default: true
* enabled?: bool, // Default: false
* },
* exception_to_status?: array<string, int>,
* formats?: array<string, array{ // Default: {"jsonld":{"mime_types":["application/ld+json"]}}
@ -2634,12 +2607,6 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
* ...<mixed>
* },
* }
* @psalm-type DamaDoctrineTestConfig = array{
* enable_static_connection?: mixed, // Default: true
* enable_static_meta_data_cache?: bool, // Default: true
* enable_static_query_cache?: bool, // Default: true
* connection_keys?: list<mixed>,
* }
* @psalm-type ConfigType = array{
* imports?: ImportsConfig,
* parameters?: ParametersConfig,
@ -2678,10 +2645,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
* doctrine_migrations?: DoctrineMigrationsConfig,
* security?: SecurityConfig,
* twig?: TwigConfig,
* web_profiler?: WebProfilerConfig,
* monolog?: MonologConfig,
* debug?: DebugConfig,
* maker?: MakerConfig,
* webpack_encore?: WebpackEncoreConfig,
* datatables?: DatatablesConfig,
* liip_imagine?: LiipImagineConfig,
@ -2700,7 +2664,6 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
* knpu_oauth2_client?: KnpuOauth2ClientConfig,
* nelmio_cors?: NelmioCorsConfig,
* jbtronics_settings?: JbtronicsSettingsConfig,
* jbtronics_translation_editor?: JbtronicsTranslationEditorConfig,
* api_platform?: ApiPlatformConfig,
* },
* "when@docker"?: array{
@ -2772,13 +2735,10 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
* doctrine_migrations?: DoctrineMigrationsConfig,
* security?: SecurityConfig,
* twig?: TwigConfig,
* web_profiler?: WebProfilerConfig,
* monolog?: MonologConfig,
* debug?: DebugConfig,
* webpack_encore?: WebpackEncoreConfig,
* datatables?: DatatablesConfig,
* liip_imagine?: LiipImagineConfig,
* dama_doctrine_test?: DamaDoctrineTestConfig,
* twig_extra?: TwigExtraConfig,
* gregwar_captcha?: GregwarCaptchaConfig,
* florianv_swap?: FlorianvSwapConfig,

View file

@ -32,6 +32,9 @@ services:
# this creates a service per class whose id is the fully-qualified class name
App\:
resource: '../src/'
exclude:
- '../src/DataFixtures/'
- '../src/Doctrine/Purger/'
# controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class
@ -230,10 +233,6 @@ services:
arguments:
$enforce_index_php: '%env(bool:NO_URL_REWRITE_AVAILABLE)%'
App\Doctrine\Purger\ResetAutoIncrementPurgerFactory:
tags:
- { name: 'doctrine.fixtures.purger_factory', alias: 'reset_autoincrement_purger' }
App\Repository\PartRepository:
arguments:
$translator: '@translator'
@ -277,6 +276,14 @@ services:
when@test:
services:
App\Doctrine\Purger\:
resource: '../src/Doctrine/Purger/'
App\Doctrine\Purger\ResetAutoIncrementPurgerFactory:
tags:
- { name: 'doctrine.fixtures.purger_factory', alias: 'reset_autoincrement_purger' }
# Decorate the doctrine fixtures load command to use our custom purger by default
doctrine.fixtures_load_command.custom:
decorates: doctrine.fixtures_load_command
@ -285,3 +292,8 @@ when@test:
- '@doctrine.fixtures.loader'
- '@doctrine'
- { default: '@App\Doctrine\Purger\DoNotUsePurgerFactory' }
when@dev:
services:
App\DataFixtures\:
resource: '../src/DataFixtures/'