InstallThemeCatalog
in package
インストーラーの初期テーマ選択肢のカタログ(W8+外部拡張ポイント)。
現行の install はテーマ選択肢を install.html に静的直書きし、select_theme を
ホワイトリスト検証せず bin/<name>/ パス組立に使うため、任意の bin 名を差し込める。
本カタログは「宣言(key/label/image 等)の集合」から候補一覧とホワイトリストを組み立て、
ビュー描画と選択値検証を一元化する。
宣言の収集元(コア既定テーマ+setup/bin/* の宣言ファイル走査)はファイル I/O のため
呼び出し側(Phase D の収集器)に置き、本クラスは配列 → 値オブジェクトへの純粋変換・整列・
検証のみを担う。プラグインは setup/bin/<name>/ に宣言ファイルを置くだけで候補を追加でき、
DB もコア改修も不要(setup 実行時はプラグインの ServiceProvider/Hook が発火しないため、
駆動源はファイルシステム宣言である必要がある)。
Table of Contents
Properties
- $themes : array<string|int, mixed>
Methods
- __construct() : mixed
- allowedKeys() : array<int, string>
- 選択可能な key(=ホワイトリスト。hidden は含めない)。
- comparisonAttributes() : array<int, string>
- 比較表の属性ラベル一覧(comparisonThemes 横断の和集合を初出順で)。
- comparisonThemes() : array<int, InstallTheme>
- 比較表に載せるテーマ(可視かつ comparison データを持つもの)を返す。
- find() : InstallTheme|null
- fromDeclarations() : self
- 宣言配列(各要素は theme.yaml 由来の連想配列)からカタログを構築する。 `key` または `label` を欠く宣言は候補にしない。
- isAllowed() : bool
- 送信された select_theme 値が選択肢に含まれるか(W8 検証)。
- visibleThemes() : array<int, InstallTheme>
- 表示対象(hidden 以外)を order 昇順・同 order は宣言順で返す。
- normalizeComparison() : array<string, string>
- 宣言の `comparison`(属性ラベル → 値)を array<string, string> に正規化する。
- toTheme() : InstallTheme|null
Properties
$themes read-only
private
array<string|int, mixed>
$themes
Methods
__construct()
public
__construct(array<int, InstallTheme> $themes) : mixed
Parameters
- $themes : array<int, InstallTheme>
allowedKeys()
選択可能な key(=ホワイトリスト。hidden は含めない)。
public
allowedKeys() : array<int, string>
Return values
array<int, string>comparisonAttributes()
比較表の属性ラベル一覧(comparisonThemes 横断の和集合を初出順で)。
public
comparisonAttributes() : array<int, string>
Return values
array<int, string>comparisonThemes()
比較表に載せるテーマ(可視かつ comparison データを持つもの)を返す。
public
comparisonThemes() : array<int, InstallTheme>
Return values
array<int, InstallTheme>find()
public
find(string $key) : InstallTheme|null
Parameters
- $key : string
Return values
InstallTheme|nullfromDeclarations()
宣言配列(各要素は theme.yaml 由来の連想配列)からカタログを構築する。 `key` または `label` を欠く宣言は候補にしない。
public
static fromDeclarations(array<int, array<string, mixed>> $declarations) : self
Parameters
- $declarations : array<int, array<string, mixed>>
Return values
selfisAllowed()
送信された select_theme 値が選択肢に含まれるか(W8 検証)。
public
isAllowed(string $key) : bool
Parameters
- $key : string
Return values
boolvisibleThemes()
表示対象(hidden 以外)を order 昇順・同 order は宣言順で返す。
public
visibleThemes() : array<int, InstallTheme>
Return values
array<int, InstallTheme>normalizeComparison()
宣言の `comparison`(属性ラベル → 値)を array<string, string> に正規化する。
private
static normalizeComparison(mixed $raw) : array<string, string>
Parameters
- $raw : mixed
Return values
array<string, string>toTheme()
private
static toTheme(array<string, mixed> $declaration) : InstallTheme|null
Parameters
- $declaration : array<string, mixed>