composer require --dev savinmikhail/symfony-translatable-exceptions
In your psalm.xml
add the following lines
<plugins>
<pluginClass class="SavinMikhail\TranslatableExceptionsPlugin\Plugin"/>
</plugins>
ERROR: InvalidArgument - src/Service/Extractor/WhlExtractor.php:33:40 - Avoid hardcoding exception messages, use a translation mechanism instead. (see https://psalm.dev/004)
throw new RuntimeException('File upload required.');
To fix this, we need to use
throw new RuntimeException(this->translator->trans('error.file_upload_required'));