src/ can be override in module for example class /src/Adapter/PDF/OrderInvoicePdfGenerator.php:
file1: /modules/someModule/src/OrderInvoicePdfGenerator.php
-- copy of file OrderInvoicePdfGenerator.php and changed namespace to PrestaShop\Module\someModule\Controller;
file2: /modules/someModul/config/services.yml:
services:
_defaults:
public: true
prestashop.adapter.pdf.order_invoice_pdf_generator:
class: PrestaShop\Module\someModule\Controller\OrderInvoicePdfGenerator
arguments:
- '@translator'
file3: /modules/someModul/composer.json
"autoload": {
"psr-4": {
"PrestaShop\\Module\\someModule\\": "src/"
},
...