Hotfix: Livewire-UI-Komponenten im Ordner Ui (wie der Namespace)

Der Ordner hieß im Repository UI, der Namespace App\Livewire\Web\Components\Ui. Auf dem
Mac fällt das nicht auf, auf Linux findet der Autoloader die Klassen nicht: Header,
Footer usw. rendern ohne Klasse (500, Undefined variable $logoPath). Wächtertest prüft
Pfad und Namespace auf gleiche Schreibweise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Adametz 2026-10-09 09:11:39 +00:00
parent cbf04e1f9c
commit a661a68913
7 changed files with 33 additions and 0 deletions

View file

@ -0,0 +1,33 @@
<?php
/**
* Der Live-Server (Linux) unterscheidet Groß- und Kleinschreibung, macOS nicht. Weicht ein
* Ordnername nur in der Schreibweise vom Namespace ab (UI statt Ui), findet der Autoloader die
* Klasse lokal, auf Live aber nicht (09.10.2026: Header ohne Klasse, 500 nach dem Deploy).
*/
it('keeps every class path in the exact case of its namespace', function () {
$root = dirname(__DIR__, 2);
exec('git -C '.escapeshellarg($root).' ls-files app database/seeders database/factories', $files);
$roots = ['app/' => 'App/', 'database/seeders/' => 'Database/Seeders/', 'database/factories/' => 'Database/Factories/'];
$mismatches = [];
foreach ($files as $file) {
if (! str_ends_with($file, '.php') || ! preg_match('/^namespace\s+([^;]+);/m', (string) file_get_contents($root.'/'.$file), $match)) {
continue;
}
foreach ($roots as $path => $namespacePath) {
if (str_starts_with($file, $path)) {
$expected = dirname($namespacePath.substr($file, strlen($path)));
$declared = str_replace('\\', '/', $match[1]);
if ($declared !== $expected && strcasecmp($declared, $expected) === 0) {
$mismatches[] = "{$file} → {$match[1]}";
}
}
}
}
expect($mismatches)->toBe([]);
});