fix: code quality cleanup — DI, dedup, CSP, reflection, dead code#100
Open
rhoerr wants to merge 4 commits intovpietri:mainfrom
Open
fix: code quality cleanup — DI, dedup, CSP, reflection, dead code#100rhoerr wants to merge 4 commits intovpietri:mainfrom
rhoerr wants to merge 4 commits intovpietri:mainfrom
Conversation
- Replace ObjectManager usage with constructor DI in Toolbar and Panel - Inject SerializerInterface in Helper/Data, fix and→&& operators - Hash session IDs in temp filenames, add cleanup in shutdown path - Fix cache dedup bug ($cacheEvents → $this->cacheEvents) - Migrate static CSP hashes to SecureRenderer nonces - Guard reflection calls with try/catch \ReflectionException - Remove dead Response plugin - Fix Elasticsearch pullData() return type - Scope window.fetch monkey-patch in dumper.phtml Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Without explicit argument override, UrlInterface resolves to Backend\Model\Url in the adminhtml area, breaking frontend URLs generated by Toolbar and Panel blocks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The method indiscriminately deletes temp files older than 20s, which can destroy other sessions' data. It was never called before PR7 added it, and the TODO in cleanOldFiles() itself notes it needs scoping to the current session before use. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Panel gained a UrlInterface $frontUrl constructor parameter when ObjectManager::get() was replaced with proper DI injection. Six subclasses that override the constructor were not updated to accept and forward this parameter, causing DI compilation errors: "Incompatible argument type: Required UrlInterface. Actual: array" Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
ObjectManagerusage with constructor DI in Toolbar and Panel blocksSerializerInterfaceinHelper/Data, fixand→&&operators$cacheEvents→$this->cacheEvents)try/catch \ReflectionExceptionResponsepluginElasticsearch::pullData()return typewindow.fetchmonkey-patch in dumper.phtmlSecurity Findings Addressed
Test plan
🤖 Generated with Claude Code