refactor: narrow over-exposed API (L2)
Composer::autoLabel is private (tested through compose()); the DiviComposition getters used only by tests are marked @internal; Limits::snapshotCount is documented as reserved; the ShortformWriter test seam is named $modulesForTests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
@@ -27,14 +27,14 @@ final class ShortformWriter
|
||||
private const COLOR_ERROR = 'Farbe erwartet, z. B. {{color:primary}} oder #1a1a1a';
|
||||
|
||||
/**
|
||||
* @param array<string, array<string, array<string, mixed>>>|null $modules Short form per
|
||||
* type (tests only); null = ShortformMap.
|
||||
* @param array<string, array<string, array<string, mixed>>>|null $modulesForTests Short form
|
||||
* per type, a test seam (trusted wiring only, ledger T2); null = ShortformMap.
|
||||
*/
|
||||
public function __construct(
|
||||
private Placeholders $placeholders,
|
||||
private MediaResolver $media,
|
||||
private ValueCleaner $cleaner,
|
||||
private ?array $modules = null
|
||||
private ?array $modulesForTests = null
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ final class ShortformWriter
|
||||
{
|
||||
// Ruling S35: controls go before placeholder resolution and trim ("{\0{post:title}}").
|
||||
$values = ControlChars::stripDeep($values);
|
||||
$fields = $this->modules === null ? ShortformMap::fields($type) : ($this->modules[$type] ?? []);
|
||||
$fields = $this->modulesForTests === null ? ShortformMap::fields($type) : ($this->modulesForTests[$type] ?? []);
|
||||
$errors = [];
|
||||
foreach ($values as $name => $value) {
|
||||
$name = (string) $name;
|
||||
@@ -78,7 +78,7 @@ final class ShortformWriter
|
||||
*/
|
||||
public function paths(string $type, array $names): array
|
||||
{
|
||||
$fields = $this->modules === null ? ShortformMap::fields($type) : ($this->modules[$type] ?? []);
|
||||
$fields = $this->modulesForTests === null ? ShortformMap::fields($type) : ($this->modulesForTests[$type] ?? []);
|
||||
$paths = [];
|
||||
foreach ($names as $name) {
|
||||
if (isset($fields[$name]['path'])) {
|
||||
|
||||
Reference in New Issue
Block a user