refactor: clean up version handling#6532
Merged
Merged
Conversation
The 'version' key was written to rex_config at the end of setup but never read anywhere. It is a leftover from the 5.x version-diff update detection; 6.x runs updates via idempotent install.php (console migrate) instead.
The 'version' property was only ever set by getVersion() itself as an in-memory cache; nothing else writes it anymore (the persisted core config was just dropped). Composer's InstalledVersions already caches installed.php statically, so the memoization saved nothing. Read directly from InstalledVersions and drop the now-dead 'version' property validation, its getProperty type-map entry and the obsolete taint-escape (the Composer-provided value is not a taint source). For addons this also makes Composer the single source of truth, so a stray 'version' in package.yml can no longer override it.
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.
Was
Räumt das Version-Handling in
CoreundAddonauf.Der erste Commit wirft die write-only
version-Core-Config raus (ein 5.x-Relikt der Versions-Diff-Update-Erkennung; 6.x updatet über idempotenteinstall.php/console migrate).Aufbauend darauf liest der zweite Commit die Version nur noch aus Composer:
version-Property wurde ohnehin nur vongetVersion()selbst als In-Memory-Cache gesetzt — niemand sonst schreibt sie mehr. ComposersInstalledVersionscachedinstalled.phpbereits statisch, die Memoization sparte also nichts.getVersion()liest jetzt direkt ausInstalledVersions.version-Validierungs-caseinCore::setProperty(), denversion-Eintrag in dergetProperty()-Type-Map und den obsoleten@psalm-taint-escape file(der Composer-Wert ist keine Taint-Quelle — percomposer taintverifiziert).version:in derpackage.ymlkann die Composer-Version nicht mehr überschreiben.Alle Checks grün (PHPUnit, PHPStan, Psalm, Taint, CS).