Remove the hierarchy flag from Config Setup

Offen
#619 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
55/100
Issue-Typ
Refactoring
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
php
Bereich
backend

Rechercherichtung

Start with Quantum\Config\Setup, Config::resolveFilePath(), SetupTest, and advanced-features/configuration.md, then read the linked context in issue #618. Remove the hierarchy parameter and methods, make lookup fall back to shared, and update the tests plus changelog and upgrade guide for the signature change. Done when the acceptance criteria pass, including the shared fallback test and the listed CI checks.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

breaking change config refactoring tech debt

Summary

Remove the hierarchical flag from Quantum\Config\Setup, deprecated in 3.1.2 (#618), and make the shared fallback unconditional.

Why

The flag has no practical use: nothing in src turns it off, and turning it off breaks the loading of the global config in shared/config, which is found only through the fallback. The details are in #618.

Proposed change

  • Remove the $hierarchical parameter from Setup::__construct(), and the setHierarchy() and getHierarchy() methods.
  • In Config::resolveFilePath(), drop the if ($setup->getHierarchy()) check. When the file is not found in the module folder, the lookup always falls back to shared.
  • Remove the three lines about the flag from SetupTest.
  • Docs: remove the sentence in advanced-features/configuration.md that says the shared fallback only triggers when hierarchical is on, and keep the "shared fallback" wording from 3.1.2.

Breaking changes

  • Setup::__construct() takes ($pathPrefix, $fileName, $module, $exceptionMessage) instead of ($pathPrefix, $fileName, $hierarchical, $module, $exceptionMessage). $module and $exceptionMessage move up one position, so a call such as new Setup('config', 'x', true, 'Blog') changes meaning or fails. Callers that pass only the first two arguments are unaffected.
  • setHierarchy() and getHierarchy() are gone.
  • To be listed in the changelog and in the upgrade guide, with a before and after example.

Acceptance criteria

  • the parameter and the two methods are removed, and the fallback is unconditional
  • SetupTest and the other Config tests pass, and a test covers the fallback to shared for a module that has no file of its own
  • composer test, composer cs:check, composer phpstan and composer rector:check pass on every PHP version in the CI matrix
  • the changelog and the upgrade guide describe the signature change
Vorherrschende Sprache
PHP
Sterne
43
Forks
22
Ø Merge
54 Min.
Gemergte PRs (30 T.)
57

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus quantum-php/framework

Alle Issues in quantum-php/framework

Ähnliche Issues

Weitere Issues zu PHP

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.