refactor(import): декомпозиция ImportCSV, EventGate и ProductImportService - #499
Open
Ibochkarev wants to merge 10 commits into
Open
refactor(import): декомпозиция ImportCSV, EventGate и ProductImportService#499Ibochkarev wants to merge 10 commits into
Ibochkarev wants to merge 10 commits into
Conversation
Split the 999-line ImportCSV monolith into focused collaborators (reader, row mapper/processor, upserter, options, gallery, events) with a thin facade under 200 LOC. Preserves CSV contract, returnedValues events, and OptionSync path for option.* columns. Refs #344
- Add ImportCsvPathGuard for CSV and gallery path traversal checks - Re-validate CSV path after msOnBeforeImport returnedValues - Remove unused encoding passthroughs from ImportCSV facade - Extend unit tests for path guard, missing column mapping Refs #344
Use print_r(..., true), modX path options instead of MODX_* constants, string select() for xPDO query, modResource return annotation, and widen EventBridge array types for list-shaped gallery payloads. Refs #344
Centralize returnedValues parsing in Utils\EventGate and delegate Utils::invokeEvent through it. Migrate ImportCSV, notifications, ProductDataService and ms3_products; remove ImportCsvEventBridge.
Add EventGate::invokeRaw for direct invokeEvent call sites, extract invokeProductModifier in ProductDataService, migrate ms3_products, and move EventGate tests to PHPUnit under tests/Unit/Utils.
Register ms3_product_import in ServiceRegistry; processors and scheduler task use DI. Utils\ImportCSV remains a deprecated BC wrapper.
Check BC wrapper via file path instead of loading deprecated class.
Align anonymous modX::lexicon overrides with ModxStub signature so integration tests pass on PHP 8.2+ when typed lexicon is present.
Anonymous subclasses must not redeclare parent properties with types when ModxStub uses untyped $services (PHP 8.2 fatal).
Same PHP 8.2 rule as CartFacadeDraftStoreTest: anonymous modX subclasses must assign $services in ctor without retyping.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Описание
ImportCSVнаServices/Product/Import/*.Utils/EventGateдляreturnedValues.ProductImportService, DI-ключms3_product_import;Utils\ImportCSV— deprecated BC-wrapper.Тип изменений
Связанные Issues
Closes #344
Closes #358
Closes #368
Как это было протестировано?
Чеклист
Services/Product/Import/ProductImportServicems3_product_importв ServiceRegistry (override через ms3.services.php)Дополнительные заметки
Utils\ImportCSVсохранён для внешнихnew ImportCSV($modx)до следующего major.