Remove the hierarchy flag from Config Setup

オープン
#619 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
php
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
PHP
スター
43
フォーク
22
平均マージ
54分
マージ済み PR(30日)
57

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

quantum-php/framework のほかの issue

quantum-php/framework の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。