style: apply Laravel Pint formatting across codebase

Auto-formatted by Laravel Pint (default Laravel preset): string
concatenation spacing, anonymous class brace placement, constructor
body shorthand, import ordering, and assertion indentation.
This commit is contained in:
Thorsten Bus 2026-03-02 23:02:03 +01:00
parent 5b35afb31d
commit 04d271f96a
48 changed files with 173 additions and 174 deletions

View file

@ -18,14 +18,14 @@ public function handle(ChurchToolsService $churchToolsService): int
$summary = $churchToolsService->sync(); $summary = $churchToolsService->sync();
$this->info('Daten wurden aktualisiert'); $this->info('Daten wurden aktualisiert');
$this->line('Services: ' . $summary['services_count']); $this->line('Services: '.$summary['services_count']);
$this->line('Songs in Agenda: ' . $summary['songs_count']); $this->line('Songs in Agenda: '.$summary['songs_count']);
$this->line('Gematchte Songs: ' . $summary['matched_songs_count']); $this->line('Gematchte Songs: '.$summary['matched_songs_count']);
$this->line('Nicht gematchte Songs: ' . $summary['unmatched_songs_count']); $this->line('Nicht gematchte Songs: '.$summary['unmatched_songs_count']);
return self::SUCCESS; return self::SUCCESS;
} catch (Throwable $exception) { } catch (Throwable $exception) {
$this->error('Fehler beim Synchronisieren: ' . $exception->getMessage()); $this->error('Fehler beim Synchronisieren: '.$exception->getMessage());
return self::FAILURE; return self::FAILURE;
} }

View file

@ -50,7 +50,7 @@ public static function run(
try { try {
$events = EventRequest::where('from', $fromDate)->get(); $events = EventRequest::where('from', $fromDate)->get();
$songResponse = CTClient::getClient()->get('/api/songs/' . $songId); $songResponse = CTClient::getClient()->get('/api/songs/'.$songId);
$songRaw = CTResponseUtil::dataAsArray($songResponse); $songRaw = CTResponseUtil::dataAsArray($songResponse);
$song = Song::createModelFromData($songRaw); $song = Song::createModelFromData($songRaw);
} catch (Throwable $throwable) { } catch (Throwable $throwable) {

View file

@ -18,6 +18,5 @@ public function __construct(
public int $processedPages = 0, public int $processedPages = 0,
public int $totalPages = 0, public int $totalPages = 0,
public array $convertedFiles = [], public array $convertedFiles = [],
) { ) {}
}
} }

View file

@ -101,7 +101,7 @@ public function update(Request $request, SongArrangement $arrangement): Redirect
$arrangement->arrangementGroups()->insert($rows); $arrangement->arrangementGroups()->insert($rows);
} }
if (!empty($data['group_colors'])) { if (! empty($data['group_colors'])) {
foreach ($data['group_colors'] as $groupId => $color) { foreach ($data['group_colors'] as $groupId => $color) {
$arrangement->song->groups() $arrangement->song->groups()
->whereKey((int) $groupId) ->whereKey((int) $groupId)

View file

@ -27,13 +27,13 @@ public function importPro(Request $request): JsonResponse
} }
try { try {
$service = new ProImportService(); $service = new ProImportService;
$songs = $service->import($file); $songs = $service->import($file);
return response()->json([ return response()->json([
'message' => count($songs) === 1 'message' => count($songs) === 1
? "Song \"{$songs[0]->title}\" erfolgreich importiert." ? "Song \"{$songs[0]->title}\" erfolgreich importiert."
: count($songs) . ' Songs erfolgreich importiert.', : count($songs).' Songs erfolgreich importiert.',
'songs' => collect($songs)->map(fn (Song $song) => [ 'songs' => collect($songs)->map(fn (Song $song) => [
'id' => $song->id, 'id' => $song->id,
'title' => $song->title, 'title' => $song->title,
@ -53,10 +53,10 @@ public function downloadPro(Song $song): BinaryFileResponse
abort(422, 'Song hat keine Gruppen oder Slides zum Exportieren.'); abort(422, 'Song hat keine Gruppen oder Slides zum Exportieren.');
} }
$exportService = new ProExportService(); $exportService = new ProExportService;
$tempPath = $exportService->generateProFile($song); $tempPath = $exportService->generateProFile($song);
$filename = preg_replace('/[^a-zA-Z0-9äöüÄÖÜß\-_ ]/', '', $song->title) . '.pro'; $filename = preg_replace('/[^a-zA-Z0-9äöüÄÖÜß\-_ ]/', '', $song->title).'.pro';
return response()->download($tempPath, $filename)->deleteFileAfterSend(true); return response()->download($tempPath, $filename)->deleteFileAfterSend(true);
} }

View file

@ -12,8 +12,7 @@ class ServiceSongController extends Controller
{ {
public function __construct( public function __construct(
private readonly SongMatchingService $songMatchingService, private readonly SongMatchingService $songMatchingService,
) { ) {}
}
/** /**
* Manuell einen Song aus der DB einem ServiceSong zuordnen. * Manuell einen Song aus der DB einem ServiceSong zuordnen.

View file

@ -13,8 +13,7 @@ class SongController extends Controller
{ {
public function __construct( public function __construct(
private readonly SongService $songService, private readonly SongService $songService,
) { ) {}
}
/** /**
* Alle Songs auflisten (paginiert, durchsuchbar). * Alle Songs auflisten (paginiert, durchsuchbar).

View file

@ -14,7 +14,7 @@ public function sync(ChurchToolsService $service): RedirectResponse
return back()->with('success', 'Daten wurden aktualisiert'); return back()->with('success', 'Daten wurden aktualisiert');
} catch (\Throwable $e) { } catch (\Throwable $e) {
return back()->with('error', 'Sync fehlgeschlagen: ' . $e->getMessage()); return back()->with('error', 'Sync fehlgeschlagen: '.$e->getMessage());
} }
} }
} }

View file

@ -13,8 +13,7 @@ class TranslationController extends Controller
{ {
public function __construct( public function __construct(
private readonly TranslationService $translationService, private readonly TranslationService $translationService,
) { ) {}
}
public function page(Song $song): Response public function page(Song $song): Response
{ {

View file

@ -23,14 +23,13 @@ class ConvertPowerPointJob implements ShouldQueue
public function __construct( public function __construct(
public string $inputPath, public string $inputPath,
public string $jobId, public string $jobId,
) { ) {}
}
public function handle(FileConversionService $conversionService): void public function handle(FileConversionService $conversionService): void
{ {
event(new PowerPointConversionProgress($this->jobId, 'started')); event(new PowerPointConversionProgress($this->jobId, 'started'));
$tempDir = storage_path('app/temp/ppt-' . $this->jobId); $tempDir = storage_path('app/temp/ppt-'.$this->jobId);
if (! is_dir($tempDir) && ! mkdir($tempDir, 0775, true) && ! is_dir($tempDir)) { if (! is_dir($tempDir) && ! mkdir($tempDir, 0775, true) && ! is_dir($tempDir)) {
throw new RuntimeException('Temporaires Verzeichnis konnte nicht erstellt werden.'); throw new RuntimeException('Temporaires Verzeichnis konnte nicht erstellt werden.');
} }
@ -49,10 +48,10 @@ public function handle(FileConversionService $conversionService): void
$process->run(); $process->run();
if (! $process->isSuccessful()) { if (! $process->isSuccessful()) {
throw new RuntimeException('PowerPoint-Konvertierung fehlgeschlagen: ' . $process->getErrorOutput()); throw new RuntimeException('PowerPoint-Konvertierung fehlgeschlagen: '.$process->getErrorOutput());
} }
$pdfPath = $tempDir . DIRECTORY_SEPARATOR . pathinfo($this->inputPath, PATHINFO_FILENAME) . '.pdf'; $pdfPath = $tempDir.DIRECTORY_SEPARATOR.pathinfo($this->inputPath, PATHINFO_FILENAME).'.pdf';
if (! is_file($pdfPath)) { if (! is_file($pdfPath)) {
throw new RuntimeException('PDF wurde von LibreOffice nicht erzeugt.'); throw new RuntimeException('PDF wurde von LibreOffice nicht erzeugt.');
} }
@ -63,7 +62,7 @@ public function handle(FileConversionService $conversionService): void
$convertedFiles = []; $convertedFiles = [];
for ($page = 1; $page <= $pageCount; $page++) { for ($page = 1; $page <= $pageCount; $page++) {
$slidePath = $tempDir . DIRECTORY_SEPARATOR . 'slide-' . $page . '.jpg'; $slidePath = $tempDir.DIRECTORY_SEPARATOR.'slide-'.$page.'.jpg';
$pdf->selectPage($page)->save($slidePath); $pdf->selectPage($page)->save($slidePath);
$convertedFiles[] = $conversionService->convertImage($slidePath); $convertedFiles[] = $conversionService->convertImage($slidePath);
@ -104,7 +103,7 @@ private function cleanup(string $tempDir): void
continue; continue;
} }
$path = $tempDir . DIRECTORY_SEPARATOR . $entry; $path = $tempDir.DIRECTORY_SEPARATOR.$entry;
if (is_file($path)) { if (is_file($path)) {
@unlink($path); @unlink($path);

View file

@ -15,12 +15,11 @@ public function __construct(
public string $songName, public string $songName,
public ?string $ccliId, public ?string $ccliId,
public mixed $service, public mixed $service,
) { ) {}
}
public function build() public function build()
{ {
return $this->subject("Song-Anfrage: {$this->songName} (CCLI: {$this->ccliId})") return $this->subject("Song-Anfrage: {$this->songName} (CCLI: {$this->ccliId})")
->view('emails.missing-song-request'); ->view('emails.missing-song-request');
} }
} }

View file

@ -52,7 +52,7 @@ public function scopeSearch(Builder $query, ?string $search): Builder
return $query; return $query;
} }
$term = '%' . trim($search) . '%'; $term = '%'.trim($search).'%';
return $query->where(function (Builder $builder) use ($term): void { return $query->where(function (Builder $builder) use ($term): void {
$builder $builder

View file

@ -2,11 +2,11 @@
namespace App\Models; namespace App\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Casts\Attribute;
class Song extends Model class Song extends Model
{ {

View file

@ -11,6 +11,7 @@ class User extends Authenticatable
{ {
/** @use HasFactory<\Database\Factories\UserFactory> */ /** @use HasFactory<\Database\Factories\UserFactory> */
use HasFactory; use HasFactory;
use Notifiable; use Notifiable;
/** /**

View file

@ -2,9 +2,9 @@
namespace App\Providers; namespace App\Providers;
use App\Socialite\ChurchToolsProvider;
use Illuminate\Support\Facades\Vite; use Illuminate\Support\Facades\Vite;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
use App\Socialite\ChurchToolsProvider;
use Laravel\Socialite\Facades\Socialite; use Laravel\Socialite\Facades\Socialite;
class AppServiceProvider extends ServiceProvider class AppServiceProvider extends ServiceProvider

View file

@ -3,11 +3,11 @@
namespace App\Services; namespace App\Services;
use App\Models\ApiRequestLog; use App\Models\ApiRequestLog;
use Closure;
use CTApi\CTConfig; use CTApi\CTConfig;
use CTApi\Models\Events\Event\EventAgendaRequest; use CTApi\Models\Events\Event\EventAgendaRequest;
use CTApi\Models\Events\Event\EventRequest; use CTApi\Models\Events\Event\EventRequest;
use CTApi\Models\Events\Song\SongRequest; use CTApi\Models\Events\Song\SongRequest;
use Closure;
use Illuminate\Support\Carbon; use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
@ -24,8 +24,7 @@ public function __construct(
private readonly ?Closure $songFetcher = null, private readonly ?Closure $songFetcher = null,
private readonly ?Closure $agendaFetcher = null, private readonly ?Closure $agendaFetcher = null,
private readonly ?Closure $eventServiceFetcher = null, private readonly ?Closure $eventServiceFetcher = null,
) { ) {}
}
public function sync(): array public function sync(): array
{ {
@ -252,7 +251,7 @@ private function summarizeResponse(mixed $result): ?string
} }
if (is_array($result)) { if (is_array($result)) {
return 'Array mit ' . count($result) . ' Eintraegen'; return 'Array mit '.count($result).' Eintraegen';
} }
if (is_scalar($result)) { if (is_scalar($result)) {
@ -260,7 +259,7 @@ private function summarizeResponse(mixed $result): ?string
} }
if (is_object($result)) { if (is_object($result)) {
return 'Objekt vom Typ ' . $result::class; return 'Objekt vom Typ '.$result::class;
} }
return null; return null;
@ -275,7 +274,7 @@ private function serializeResponseBody(mixed $result): ?string
try { try {
$json = json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR); $json = json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR);
return mb_strlen($json) > 512000 ? mb_substr($json, 0, 512000) . "\n... (abgeschnitten)" : $json; return mb_strlen($json) > 512000 ? mb_substr($json, 0, 512000)."\n... (abgeschnitten)" : $json;
} catch (\JsonException) { } catch (\JsonException) {
return null; return null;
} }
@ -433,7 +432,7 @@ private function extractPersonName(mixed $eventService): ?string
$firstName = method_exists($person, 'getFirstName') ? trim((string) $person->getFirstName()) : ''; $firstName = method_exists($person, 'getFirstName') ? trim((string) $person->getFirstName()) : '';
$lastName = method_exists($person, 'getLastName') ? trim((string) $person->getLastName()) : ''; $lastName = method_exists($person, 'getLastName') ? trim((string) $person->getLastName()) : '';
$fullName = trim($firstName . ' ' . $lastName); $fullName = trim($firstName.' '.$lastName);
return $fullName === '' ? null : $fullName; return $fullName === '' ? null : $fullName;
} }

View file

@ -34,8 +34,8 @@ public function convertImage(UploadedFile|string|SplFileInfo $file): array
$this->assertSize($file, $sourcePath); $this->assertSize($file, $sourcePath);
$filename = Str::uuid()->toString() . '.jpg'; $filename = Str::uuid()->toString().'.jpg';
$relativePath = 'slides/' . $filename; $relativePath = 'slides/'.$filename;
$targetPath = Storage::disk('public')->path($relativePath); $targetPath = Storage::disk('public')->path($relativePath);
Storage::disk('public')->makeDirectory('slides'); Storage::disk('public')->makeDirectory('slides');
$this->ensureDirectory(dirname($targetPath)); $this->ensureDirectory(dirname($targetPath));
@ -85,12 +85,12 @@ public function processZip(UploadedFile|string|SplFileInfo $file): array
$this->assertSize($file, $sourcePath); $this->assertSize($file, $sourcePath);
$zip = new ZipArchive(); $zip = new ZipArchive;
if ($zip->open($sourcePath) !== true) { if ($zip->open($sourcePath) !== true) {
throw new InvalidArgumentException('ZIP-Datei konnte nicht geoeffnet werden.'); throw new InvalidArgumentException('ZIP-Datei konnte nicht geoeffnet werden.');
} }
$extractDir = storage_path('app/temp/zip-' . Str::uuid()->toString()); $extractDir = storage_path('app/temp/zip-'.Str::uuid()->toString());
if (! is_dir($extractDir) && ! mkdir($extractDir, 0775, true) && ! is_dir($extractDir)) { if (! is_dir($extractDir) && ! mkdir($extractDir, 0775, true) && ! is_dir($extractDir)) {
throw new InvalidArgumentException('Temporaires ZIP-Verzeichnis konnte nicht erstellt werden.'); throw new InvalidArgumentException('Temporaires ZIP-Verzeichnis konnte nicht erstellt werden.');
} }
@ -121,11 +121,13 @@ public function processZip(UploadedFile|string|SplFileInfo $file): array
if (in_array($entryExtension, self::IMAGE_EXTENSIONS, true)) { if (in_array($entryExtension, self::IMAGE_EXTENSIONS, true)) {
$results[] = $this->convertImage($entryPath); $results[] = $this->convertImage($entryPath);
continue; continue;
} }
if (in_array($entryExtension, self::POWERPOINT_EXTENSIONS, true)) { if (in_array($entryExtension, self::POWERPOINT_EXTENSIONS, true)) {
$results[] = ['job_id' => $this->convertPowerPoint($entryPath)]; $results[] = ['job_id' => $this->convertPowerPoint($entryPath)];
continue; continue;
} }
@ -147,8 +149,8 @@ public function generateThumbnail(string $path): string
throw new InvalidArgumentException('Datei fuer Thumbnail nicht gefunden.'); throw new InvalidArgumentException('Datei fuer Thumbnail nicht gefunden.');
} }
$filename = pathinfo($absolutePath, PATHINFO_FILENAME) . '.jpg'; $filename = pathinfo($absolutePath, PATHINFO_FILENAME).'.jpg';
$thumbnailRelativePath = 'slides/thumbnails/' . $filename; $thumbnailRelativePath = 'slides/thumbnails/'.$filename;
$thumbnailAbsolutePath = Storage::disk('public')->path($thumbnailRelativePath); $thumbnailAbsolutePath = Storage::disk('public')->path($thumbnailRelativePath);
Storage::disk('public')->makeDirectory('slides/thumbnails'); Storage::disk('public')->makeDirectory('slides/thumbnails');
$this->ensureDirectory(dirname($thumbnailAbsolutePath)); $this->ensureDirectory(dirname($thumbnailAbsolutePath));
@ -240,6 +242,7 @@ private function deleteDirectory(string $directory): void
if ($item->isDir()) { if ($item->isDir()) {
@rmdir($item->getPathname()); @rmdir($item->getPathname());
continue; continue;
} }
@ -265,6 +268,6 @@ private function createImageManager(): mixed
$managerClass = implode('\\', ['Intervention', 'Image', 'ImageManager']); $managerClass = implode('\\', ['Intervention', 'Image', 'ImageManager']);
$driverClass = implode('\\', ['Intervention', 'Image', 'Drivers', 'Gd', 'Driver']); $driverClass = implode('\\', ['Intervention', 'Image', 'Drivers', 'Gd', 'Driver']);
return new $managerClass(new $driverClass()); return new $managerClass(new $driverClass);
} }
} }

View file

@ -6,7 +6,6 @@
use App\Models\SongArrangement; use App\Models\SongArrangement;
use App\Models\SongArrangementGroup; use App\Models\SongArrangementGroup;
use App\Models\SongGroup; use App\Models\SongGroup;
use App\Models\SongSlide;
use Illuminate\Http\UploadedFile; use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use ProPresenter\Parser\ProFileReader; use ProPresenter\Parser\ProFileReader;
@ -34,13 +33,13 @@ public function import(UploadedFile $file): array
/** @return Song[] */ /** @return Song[] */
private function importZip(UploadedFile $file): array private function importZip(UploadedFile $file): array
{ {
$zip = new ZipArchive(); $zip = new ZipArchive;
if ($zip->open($file->getRealPath()) !== true) { if ($zip->open($file->getRealPath()) !== true) {
throw new \RuntimeException('ZIP-Datei konnte nicht geöffnet werden.'); throw new \RuntimeException('ZIP-Datei konnte nicht geöffnet werden.');
} }
$tempDir = sys_get_temp_dir() . '/pro-import-' . uniqid(); $tempDir = sys_get_temp_dir().'/pro-import-'.uniqid();
mkdir($tempDir, 0755, true); mkdir($tempDir, 0755, true);
$songs = []; $songs = [];
@ -49,8 +48,8 @@ private function importZip(UploadedFile $file): array
$zip->extractTo($tempDir); $zip->extractTo($tempDir);
$zip->close(); $zip->close();
$proFiles = glob($tempDir . '/*.pro') ?: []; $proFiles = glob($tempDir.'/*.pro') ?: [];
$proFilesNested = glob($tempDir . '/**/*.pro') ?: []; $proFilesNested = glob($tempDir.'/**/*.pro') ?: [];
$allProFiles = array_unique(array_merge($proFiles, $proFilesNested)); $allProFiles = array_unique(array_merge($proFiles, $proFilesNested));
if (empty($allProFiles)) { if (empty($allProFiles)) {
@ -201,7 +200,7 @@ private function deleteDirectory(string $dir): void
continue; continue;
} }
$path = $dir . '/' . $item; $path = $dir.'/'.$item;
is_dir($path) ? $this->deleteDirectory($path) : unlink($path); is_dir($path) ? $this->deleteDirectory($path) : unlink($path);
} }
rmdir($dir); rmdir($dir);

View file

@ -20,14 +20,14 @@ protected function getBaseUrl(): string
protected function getAuthUrl($state): string protected function getAuthUrl($state): string
{ {
return $this->buildAuthUrlFromBase( return $this->buildAuthUrlFromBase(
$this->getBaseUrl() . '/oauth/authorize', $this->getBaseUrl().'/oauth/authorize',
$state, $state,
); );
} }
protected function getTokenUrl(): string protected function getTokenUrl(): string
{ {
return $this->getBaseUrl() . '/oauth/access_token'; return $this->getBaseUrl().'/oauth/access_token';
} }
/** /**
@ -37,10 +37,10 @@ protected function getTokenUrl(): string
protected function getUserByToken($token): array protected function getUserByToken($token): array
{ {
$response = $this->getHttpClient()->get( $response = $this->getHttpClient()->get(
$this->getBaseUrl() . '/oauth/userinfo', $this->getBaseUrl().'/oauth/userinfo',
[ [
RequestOptions::HEADERS => [ RequestOptions::HEADERS => [
'Authorization' => 'Bearer ' . $token, 'Authorization' => 'Bearer '.$token,
'Accept' => 'application/json', 'Accept' => 'application/json',
], ],
], ],
@ -51,9 +51,9 @@ protected function getUserByToken($token): array
protected function mapUserToObject(array $user): User protected function mapUserToObject(array $user): User
{ {
return (new User())->setRaw($user)->map([ return (new User)->setRaw($user)->map([
'id' => $user['id'] ?? null, 'id' => $user['id'] ?? null,
'name' => $user['displayName'] ?? trim(($user['firstName'] ?? '') . ' ' . ($user['lastName'] ?? '')), 'name' => $user['displayName'] ?? trim(($user['firstName'] ?? '').' '.($user['lastName'] ?? '')),
'email' => $user['email'] ?? null, 'email' => $user['email'] ?? null,
'avatar' => $user['imageUrl'] ?? null, 'avatar' => $user['imageUrl'] ?? null,
]); ]);

View file

@ -1,9 +1,9 @@
<?php <?php
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Application; use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions; use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware; use Illuminate\Foundation\Configuration\Middleware;
use Illuminate\Console\Scheduling\Schedule;
return Application::configure(basePath: dirname(__DIR__)) return Application::configure(basePath: dirname(__DIR__))
->withRouting( ->withRouting(

View file

@ -15,9 +15,9 @@ public function definition(): array
return [ return [
'type' => $this->faker->randomElement(['information', 'moderation', 'sermon']), 'type' => $this->faker->randomElement(['information', 'moderation', 'sermon']),
'service_id' => Service::factory(), 'service_id' => Service::factory(),
'original_filename' => $this->faker->word() . '.jpg', 'original_filename' => $this->faker->word().'.jpg',
'stored_filename' => $this->faker->uuid() . '.jpg', 'stored_filename' => $this->faker->uuid().'.jpg',
'thumbnail_filename' => $this->faker->uuid() . '_thumb.jpg', 'thumbnail_filename' => $this->faker->uuid().'_thumb.jpg',
'expire_date' => $this->faker->optional()->dateTimeBetween('now', '+12 months'), 'expire_date' => $this->faker->optional()->dateTimeBetween('now', '+12 months'),
'uploader_name' => $this->faker->name(), 'uploader_name' => $this->faker->name(),
'uploaded_at' => $this->faker->dateTimeBetween('-1 month', 'now'), 'uploaded_at' => $this->faker->dateTimeBetween('-1 month', 'now'),

View file

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class extends Migration
{
public function up(): void public function up(): void
{ {
Schema::table('users', function (Blueprint $table) { Schema::table('users', function (Blueprint $table) {

View file

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class extends Migration
{
public function up(): void public function up(): void
{ {
Schema::create('services', function (Blueprint $table) { Schema::create('services', function (Blueprint $table) {

View file

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class extends Migration
{
public function up(): void public function up(): void
{ {
Schema::create('songs', function (Blueprint $table) { Schema::create('songs', function (Blueprint $table) {

View file

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class extends Migration
{
public function up(): void public function up(): void
{ {
Schema::create('song_groups', function (Blueprint $table) { Schema::create('song_groups', function (Blueprint $table) {

View file

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class extends Migration
{
public function up(): void public function up(): void
{ {
Schema::create('song_slides', function (Blueprint $table) { Schema::create('song_slides', function (Blueprint $table) {

View file

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class extends Migration
{
public function up(): void public function up(): void
{ {
Schema::create('song_arrangements', function (Blueprint $table) { Schema::create('song_arrangements', function (Blueprint $table) {

View file

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class extends Migration
{
public function up(): void public function up(): void
{ {
Schema::create('song_arrangement_groups', function (Blueprint $table) { Schema::create('song_arrangement_groups', function (Blueprint $table) {

View file

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class extends Migration
{
public function up(): void public function up(): void
{ {
Schema::create('service_songs', function (Blueprint $table) { Schema::create('service_songs', function (Blueprint $table) {

View file

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class extends Migration
{
public function up(): void public function up(): void
{ {
Schema::create('slides', function (Blueprint $table) { Schema::create('slides', function (Blueprint $table) {

View file

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class extends Migration
{
public function up(): void public function up(): void
{ {
Schema::create('cts_sync_log', function (Blueprint $table) { Schema::create('cts_sync_log', function (Blueprint $table) {

View file

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class extends Migration
{
public function up(): void public function up(): void
{ {
Schema::create('api_request_logs', function (Blueprint $table) { Schema::create('api_request_logs', function (Blueprint $table) {

View file

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class extends Migration
{
/** /**
* Run the migrations. * Run the migrations.
*/ */

View file

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class extends Migration
{
public function up(): void public function up(): void
{ {
Schema::table('songs', function (Blueprint $table) { Schema::table('songs', function (Blueprint $table) {

View file

@ -19,7 +19,6 @@
Route::middleware('auth:sanctum')->group(function () { Route::middleware('auth:sanctum')->group(function () {
Route::apiResource('songs', SongController::class)->names('api.songs'); Route::apiResource('songs', SongController::class)->names('api.songs');
Route::post('/service-songs/{serviceSongId}/assign', [ServiceSongController::class, 'assignSong']) Route::post('/service-songs/{serviceSongId}/assign', [ServiceSongController::class, 'assignSong'])
->name('api.service-songs.assign'); ->name('api.service-songs.assign');

View file

@ -50,7 +50,7 @@ public static function run(
try { try {
$events = EventRequest::where('from', $fromDate)->get(); $events = EventRequest::where('from', $fromDate)->get();
$songResponse = CTClient::getClient()->get('/api/songs/' . $songId); $songResponse = CTClient::getClient()->get('/api/songs/'.$songId);
$songRaw = CTResponseUtil::dataAsArray($songResponse); $songRaw = CTResponseUtil::dataAsArray($songResponse);
$song = Song::createModelFromData($songRaw); $song = Song::createModelFromData($songRaw);
} catch (Throwable $throwable) { } catch (Throwable $throwable) {

View file

@ -1,11 +1,11 @@
<?php <?php
use App\Services\ChurchToolsService; use App\Services\ChurchToolsService;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Carbon; use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
beforeEach(function () { beforeEach(function () {
ensureSyncTables(); ensureSyncTables();
@ -132,8 +132,7 @@ public function __construct(
private readonly string $startDate, private readonly string $startDate,
private readonly ?string $note = null, private readonly ?string $note = null,
private readonly array $eventServices = [], private readonly array $eventServices = [],
) { ) {}
}
public function getId(): string public function getId(): string
{ {
@ -166,8 +165,7 @@ final class FakeEventService
public function __construct( public function __construct(
private readonly string $name, private readonly string $name,
private readonly ?FakePerson $person, private readonly ?FakePerson $person,
) { ) {}
}
public function getName(): string public function getName(): string
{ {
@ -185,8 +183,7 @@ final class FakePerson
public function __construct( public function __construct(
private readonly string $firstName, private readonly string $firstName,
private readonly string $lastName, private readonly string $lastName,
) { ) {}
}
public function getFirstName(): string public function getFirstName(): string
{ {
@ -201,9 +198,7 @@ public function getLastName(): string
final class FakeAgenda final class FakeAgenda
{ {
public function __construct(private readonly array $songs) public function __construct(private readonly array $songs) {}
{
}
public function getSongs(): array public function getSongs(): array
{ {
@ -217,8 +212,7 @@ public function __construct(
private readonly int $id, private readonly int $id,
private readonly string $title, private readonly string $title,
private readonly ?string $ccli, private readonly ?string $ccli,
) { ) {}
}
public function getId(): string public function getId(): string
{ {

View file

@ -34,7 +34,7 @@
'type' => 'text', 'type' => 'text',
'cclid' => '7115744', 'cclid' => '7115744',
'lyricParts' => [ 'lyricParts' => [
['key' => 'v1', 'text' => "Du bist hier"], ['key' => 'v1', 'text' => 'Du bist hier'],
], ],
], ],
], ],

View file

@ -41,9 +41,9 @@
$response->assertOk(); $response->assertOk();
$response->assertInertia( $response->assertInertia(
fn ($page) => $page fn ($page) => $page
->component('Services/Edit') ->component('Services/Edit')
->has('informationSlides', 1) ->has('informationSlides', 1)
->where('informationSlides.0.id', $validSlide->id) ->where('informationSlides.0.id', $validSlide->id)
); );
}); });
@ -71,8 +71,8 @@
$response->assertOk(); $response->assertOk();
$response->assertInertia( $response->assertInertia(
fn ($page) => $page fn ($page) => $page
->has('informationSlides', 1) ->has('informationSlides', 1)
->where('informationSlides.0.id', $sameDay->id) ->where('informationSlides.0.id', $sameDay->id)
); );
}); });
@ -101,7 +101,7 @@
$responseA->assertOk(); $responseA->assertOk();
$responseA->assertInertia( $responseA->assertInertia(
fn ($page) => $page fn ($page) => $page
->has('informationSlides', 2) ->has('informationSlides', 2)
); );
// Service B: only slideLate should appear (slideEarly expire_date < 2026-03-20) // Service B: only slideLate should appear (slideEarly expire_date < 2026-03-20)
@ -109,8 +109,8 @@
$responseB->assertOk(); $responseB->assertOk();
$responseB->assertInertia( $responseB->assertInertia(
fn ($page) => $page fn ($page) => $page
->has('informationSlides', 1) ->has('informationSlides', 1)
->where('informationSlides.0.id', $slideLate->id) ->where('informationSlides.0.id', $slideLate->id)
); );
}); });
@ -139,8 +139,8 @@
$response->assertOk(); $response->assertOk();
$response->assertInertia( $response->assertInertia(
fn ($page) => $page fn ($page) => $page
->has('informationSlides', 1) ->has('informationSlides', 1)
->where('informationSlides.0.id', $activeSlide->id) ->where('informationSlides.0.id', $activeSlide->id)
); );
}); });
@ -173,8 +173,8 @@
$response->assertOk(); $response->assertOk();
$response->assertInertia( $response->assertInertia(
fn ($page) => $page fn ($page) => $page
->has('informationSlides', 1) ->has('informationSlides', 1)
->where('informationSlides.0.id', $infoSlide->id) ->where('informationSlides.0.id', $infoSlide->id)
); );
}); });
@ -203,9 +203,9 @@
$response->assertOk(); $response->assertOk();
$response->assertInertia( $response->assertInertia(
fn ($page) => $page fn ($page) => $page
->has('informationSlides', 2) ->has('informationSlides', 2)
->where('informationSlides.0.id', $withoutExpire->id) ->where('informationSlides.0.id', $withoutExpire->id)
->where('informationSlides.1.id', $withExpire->id) ->where('informationSlides.1.id', $withExpire->id)
); );
}); });
@ -233,8 +233,8 @@
$response->assertOk(); $response->assertOk();
$response->assertInertia( $response->assertInertia(
fn ($page) => $page fn ($page) => $page
->has('informationSlides', 1) ->has('informationSlides', 1)
->where('informationSlides.0.id', $visibleSlide->id) ->where('informationSlides.0.id', $visibleSlide->id)
); );
}); });
@ -262,8 +262,8 @@
$response->assertOk(); $response->assertOk();
$response->assertInertia( $response->assertInertia(
fn ($page) => $page fn ($page) => $page
->has('informationSlides', 2) ->has('informationSlides', 2)
->where('informationSlides.0.id', $newer->id) ->where('informationSlides.0.id', $newer->id)
->where('informationSlides.1.id', $older->id) ->where('informationSlides.1.id', $older->id)
); );
}); });

View file

@ -3,7 +3,6 @@
namespace Tests\Feature; namespace Tests\Feature;
use App\Mail\MissingSongRequest; use App\Mail\MissingSongRequest;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
use Tests\TestCase; use Tests\TestCase;
@ -28,7 +27,7 @@ public function test_missing_song_request_mailable_renders_with_german_content()
$serviceDate = '2026-03-08'; $serviceDate = '2026-03-08';
// Create a mock service object // Create a mock service object
$service = new \stdClass(); $service = new \stdClass;
$service->id = $serviceId; $service->id = $serviceId;
$service->title = $serviceTitle; $service->title = $serviceTitle;
$service->date = $serviceDate; $service->date = $serviceDate;
@ -55,7 +54,7 @@ public function test_missing_song_request_mailable_has_correct_subject(): void
$songName = 'Großer Gott'; $songName = 'Großer Gott';
$ccliId = '12345678'; $ccliId = '12345678';
$service = new \stdClass(); $service = new \stdClass;
$service->id = 1; $service->id = 1;
$service->title = 'Sonntagsgottesdienst'; $service->title = 'Sonntagsgottesdienst';
$service->date = '2026-03-08'; $service->date = '2026-03-08';

View file

@ -16,7 +16,7 @@
$response->assertStatus(200); $response->assertStatus(200);
$response->assertInertia( $response->assertInertia(
fn ($page) => $page fn ($page) => $page
->component('Auth/Login') ->component('Auth/Login')
); );
}); });
@ -28,7 +28,7 @@
// This is verified by checking the component renders correctly // This is verified by checking the component renders correctly
$response->assertInertia( $response->assertInertia(
fn ($page) => $page fn ($page) => $page
->component('Auth/Login') ->component('Auth/Login')
); );
}); });
@ -50,7 +50,7 @@
}); });
it('creates a new user from OAuth callback', function () { it('creates a new user from OAuth callback', function () {
$socialiteUser = new SocialiteUser(); $socialiteUser = new SocialiteUser;
$socialiteUser->map([ $socialiteUser->map([
'id' => '42', 'id' => '42',
'name' => 'Max Mustermann', 'name' => 'Max Mustermann',
@ -104,7 +104,7 @@
'churchtools_id' => 42, 'churchtools_id' => 42,
]); ]);
$socialiteUser = new SocialiteUser(); $socialiteUser = new SocialiteUser;
$socialiteUser->map([ $socialiteUser->map([
'id' => '42', 'id' => '42',
'name' => 'Max Mustermann', 'name' => 'Max Mustermann',

View file

@ -12,7 +12,7 @@ final class ProFileImportTest extends TestCase
{ {
use RefreshDatabase; use RefreshDatabase;
private function testProFile(): UploadedFile private function test_pro_file(): UploadedFile
{ {
$sourcePath = base_path('../propresenter-work/ref/Test.pro'); $sourcePath = base_path('../propresenter-work/ref/Test.pro');
@ -24,7 +24,7 @@ public function test_import_pro_datei_erstellt_song_mit_gruppen_und_slides(): vo
$user = User::factory()->create(); $user = User::factory()->create();
$response = $this->actingAs($user)->postJson(route('api.songs.import-pro'), [ $response = $this->actingAs($user)->postJson(route('api.songs.import-pro'), [
'file' => $this->testProFile(), 'file' => $this->test_pro_file(),
]); ]);
$response->assertOk(); $response->assertOk();
@ -43,13 +43,13 @@ public function test_import_pro_ohne_ccli_erstellt_neuen_song(): void
$user = User::factory()->create(); $user = User::factory()->create();
$this->actingAs($user)->postJson(route('api.songs.import-pro'), [ $this->actingAs($user)->postJson(route('api.songs.import-pro'), [
'file' => $this->testProFile(), 'file' => $this->test_pro_file(),
]); ]);
$this->assertSame(1, Song::count()); $this->assertSame(1, Song::count());
$this->actingAs($user)->postJson(route('api.songs.import-pro'), [ $this->actingAs($user)->postJson(route('api.songs.import-pro'), [
'file' => $this->testProFile(), 'file' => $this->test_pro_file(),
]); ]);
$this->assertSame(2, Song::count()); $this->assertSame(2, Song::count());
@ -71,7 +71,7 @@ public function test_import_pro_upsert_mit_ccli_dupliziert_nicht(): void
$this->assertSame(1, Song::count()); $this->assertSame(1, Song::count());
$response = $this->actingAs($user)->postJson(route('api.songs.import-pro'), [ $response = $this->actingAs($user)->postJson(route('api.songs.import-pro'), [
'file' => $this->testProFile(), 'file' => $this->test_pro_file(),
]); ]);
$response->assertOk(); $response->assertOk();
@ -94,7 +94,7 @@ public function test_import_pro_lehnt_ungueltige_datei_ab(): void
public function test_import_pro_erfordert_authentifizierung(): void public function test_import_pro_erfordert_authentifizierung(): void
{ {
$response = $this->postJson(route('api.songs.import-pro'), [ $response = $this->postJson(route('api.songs.import-pro'), [
'file' => $this->testProFile(), 'file' => $this->test_pro_file(),
]); ]);
$response->assertUnauthorized(); $response->assertUnauthorized();
@ -105,7 +105,7 @@ public function test_import_pro_erstellt_arrangement_gruppen(): void
$user = User::factory()->create(); $user = User::factory()->create();
$this->actingAs($user)->postJson(route('api.songs.import-pro'), [ $this->actingAs($user)->postJson(route('api.songs.import-pro'), [
'file' => $this->testProFile(), 'file' => $this->test_pro_file(),
]); ]);
$song = Song::where('title', 'Test')->first(); $song = Song::where('title', 'Test')->first();

View file

@ -15,13 +15,13 @@
$response->assertOk(); $response->assertOk();
$response->assertInertia( $response->assertInertia(
fn ($page) => $page fn ($page) => $page
->has('auth.user') ->has('auth.user')
->where('auth.user.id', $user->id) ->where('auth.user.id', $user->id)
->where('auth.user.name', 'Max Mustermann') ->where('auth.user.name', 'Max Mustermann')
->where('auth.user.email', 'max@example.de') ->where('auth.user.email', 'max@example.de')
->where('auth.user.avatar', 'https://example.de/avatar.jpg') ->where('auth.user.avatar', 'https://example.de/avatar.jpg')
->missing('auth.user.password') ->missing('auth.user.password')
->missing('auth.user.remember_token') ->missing('auth.user.remember_token')
); );
}); });
@ -32,7 +32,7 @@
$response->assertOk(); $response->assertOk();
$response->assertInertia( $response->assertInertia(
fn ($page) => $page fn ($page) => $page
->where('auth.user', null) ->where('auth.user', null)
); );
}); });
@ -46,8 +46,8 @@
$response->assertOk(); $response->assertOk();
$response->assertInertia( $response->assertInertia(
fn ($page) => $page fn ($page) => $page
->has('flash') ->has('flash')
->where('flash.success', 'Erfolgreich gespeichert!') ->where('flash.success', 'Erfolgreich gespeichert!')
); );
}); });
@ -61,8 +61,8 @@
$response->assertOk(); $response->assertOk();
$response->assertInertia( $response->assertInertia(
fn ($page) => $page fn ($page) => $page
->has('flash') ->has('flash')
->where('flash.error', 'Ein Fehler ist aufgetreten.') ->where('flash.error', 'Ein Fehler ist aufgetreten.')
); );
}); });
@ -90,8 +90,8 @@
$response->assertOk(); $response->assertOk();
$response->assertInertia( $response->assertInertia(
fn ($page) => $page fn ($page) => $page
->has('last_synced_at') ->has('last_synced_at')
->where('last_synced_at', $syncTime->toJSON()) ->where('last_synced_at', $syncTime->toJSON())
); );
}); });
@ -103,7 +103,7 @@
$response->assertOk(); $response->assertOk();
$response->assertInertia( $response->assertInertia(
fn ($page) => $page fn ($page) => $page
->where('last_synced_at', null) ->where('last_synced_at', null)
); );
}); });
@ -115,6 +115,6 @@
$response->assertOk(); $response->assertOk();
$response->assertInertia( $response->assertInertia(
fn ($page) => $page fn ($page) => $page
->has('app_name') ->has('app_name')
); );
}); });

View file

@ -115,7 +115,7 @@
// Create a real file with .pptx extension // Create a real file with .pptx extension
$tempPath = tempnam(sys_get_temp_dir(), 'cts-pptx-'); $tempPath = tempnam(sys_get_temp_dir(), 'cts-pptx-');
$pptxPath = $tempPath . '.pptx'; $pptxPath = $tempPath.'.pptx';
file_put_contents($pptxPath, str_repeat('x', 1024)); file_put_contents($pptxPath, str_repeat('x', 1024));
$file = new UploadedFile($pptxPath, 'slides.pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', null, true); $file = new UploadedFile($pptxPath, 'slides.pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', null, true);
@ -136,11 +136,11 @@
test('upload zip processes contained images', function () { test('upload zip processes contained images', function () {
// Create a small zip with a valid image // Create a small zip with a valid image
$tempDir = sys_get_temp_dir() . '/cts-zip-test-' . uniqid(); $tempDir = sys_get_temp_dir().'/cts-zip-test-'.uniqid();
mkdir($tempDir, 0775, true); mkdir($tempDir, 0775, true);
// Create an image inside // Create an image inside
$imgPath = $tempDir . '/slide1.png'; $imgPath = $tempDir.'/slide1.png';
$image = imagecreatetruecolor(200, 150); $image = imagecreatetruecolor(200, 150);
$blue = imagecolorallocate($image, 0, 0, 255); $blue = imagecolorallocate($image, 0, 0, 255);
imagefill($image, 0, 0, $blue); imagefill($image, 0, 0, $blue);
@ -148,8 +148,8 @@
imagedestroy($image); imagedestroy($image);
// Build zip // Build zip
$zipPath = $tempDir . '/slides.zip'; $zipPath = $tempDir.'/slides.zip';
$zip = new ZipArchive(); $zip = new ZipArchive;
$zip->open($zipPath, ZipArchive::CREATE); $zip->open($zipPath, ZipArchive::CREATE);
$zip->addFile($imgPath, 'slide1.png'); $zip->addFile($imgPath, 'slide1.png');
$zip->close(); $zip->close();

View file

@ -1,7 +1,6 @@
<?php <?php
use App\Mail\MissingSongRequest; use App\Mail\MissingSongRequest;
use App\Models\Service;
use App\Models\ServiceSong; use App\Models\ServiceSong;
use App\Models\Song; use App\Models\Song;
use App\Models\SongArrangement; use App\Models\SongArrangement;

View file

@ -55,16 +55,16 @@ public function test_songs_block_shows_unmatched_song_with_matching_options(): v
$response->assertOk(); $response->assertOk();
$response->assertInertia( $response->assertInertia(
fn ($page) => $page fn ($page) => $page
->component('Services/Edit') ->component('Services/Edit')
->has('serviceSongs', 2) ->has('serviceSongs', 2)
->where('serviceSongs.0.cts_song_name', 'First Song') ->where('serviceSongs.0.cts_song_name', 'First Song')
->where('serviceSongs.0.song_id', null) ->where('serviceSongs.0.song_id', null)
->where('serviceSongs.1.cts_song_name', 'Unmatched Song') ->where('serviceSongs.1.cts_song_name', 'Unmatched Song')
->where('serviceSongs.1.song_id', null) ->where('serviceSongs.1.song_id', null)
->has('songsCatalog') ->has('songsCatalog')
->where('songsCatalog', fn ($songsCatalog) => collect($songsCatalog)->contains( ->where('songsCatalog', fn ($songsCatalog) => collect($songsCatalog)->contains(
fn (array $song) => $song['title'] === 'Amazing Grace' && $song['ccli_id'] === '22025' fn (array $song) => $song['title'] === 'Amazing Grace' && $song['ccli_id'] === '22025'
)) ))
); );
} }
@ -128,13 +128,13 @@ public function test_songs_block_provides_matched_song_data_for_arrangement_conf
$response->assertOk(); $response->assertOk();
$response->assertInertia( $response->assertInertia(
fn ($page) => $page fn ($page) => $page
->component('Services/Edit') ->component('Services/Edit')
->where('serviceSongs.0.song_id', $song->id) ->where('serviceSongs.0.song_id', $song->id)
->where('serviceSongs.0.song.has_translation', true) ->where('serviceSongs.0.song.has_translation', true)
->where('serviceSongs.0.song.arrangements.0.name', 'Normal') ->where('serviceSongs.0.song.arrangements.0.name', 'Normal')
->where('serviceSongs.0.song.arrangements.0.groups.0.name', 'Strophe 1') ->where('serviceSongs.0.song.arrangements.0.groups.0.name', 'Strophe 1')
->where('serviceSongs.0.song.groups.0.name', 'Strophe 1') ->where('serviceSongs.0.song.groups.0.name', 'Strophe 1')
->where('serviceSongs.0.song_arrangement_id', $normal->id) ->where('serviceSongs.0.song_arrangement_id', $normal->id)
); );
} }
} }

View file

@ -1,9 +1,8 @@
<?php <?php
use App\Services\ChurchToolsService; use App\Services\ChurchToolsService;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
beforeEach(function () { beforeEach(function () {
ensureSyncControllerTables(); ensureSyncControllerTables();

View file

@ -196,10 +196,10 @@
SongSlide::factory()->create([ SongSlide::factory()->create([
'song_group_id' => $group->id, 'song_group_id' => $group->id,
'order' => 1, 'order' => 1,
'text_content' => "Line 1", 'text_content' => 'Line 1',
]); ]);
$this->service->importTranslation($song, "Zeile 1"); $this->service->importTranslation($song, 'Zeile 1');
$song->refresh(); $song->refresh();
expect($song->has_translation)->toBeTrue(); expect($song->has_translation)->toBeTrue();
@ -229,15 +229,15 @@
$slide1 = SongSlide::factory()->create([ $slide1 = SongSlide::factory()->create([
'song_group_id' => $group->id, 'song_group_id' => $group->id,
'order' => 1, 'order' => 1,
'text_content' => "Original", 'text_content' => 'Original',
'text_content_translated' => "Übersetzt", 'text_content_translated' => 'Übersetzt',
]); ]);
$slide2 = SongSlide::factory()->create([ $slide2 = SongSlide::factory()->create([
'song_group_id' => $group->id, 'song_group_id' => $group->id,
'order' => 2, 'order' => 2,
'text_content' => "Original 2", 'text_content' => 'Original 2',
'text_content_translated' => "Übersetzt 2", 'text_content_translated' => 'Übersetzt 2',
]); ]);
$this->service->removeTranslation($song); $this->service->removeTranslation($song);
@ -350,8 +350,8 @@
SongSlide::factory()->create([ SongSlide::factory()->create([
'song_group_id' => $group->id, 'song_group_id' => $group->id,
'order' => 1, 'order' => 1,
'text_content' => "Original", 'text_content' => 'Original',
'text_content_translated' => "Übersetzt", 'text_content_translated' => 'Übersetzt',
]); ]);
$response = $this->actingAs($this->user) $response = $this->actingAs($this->user)