diff --git a/app/DataTables/WorklistDataTable.php b/app/DataTables/WorklistDataTable.php index 5f5f77a..c000859 100644 --- a/app/DataTables/WorklistDataTable.php +++ b/app/DataTables/WorklistDataTable.php @@ -34,10 +34,10 @@ public function dataTable(QueryBuilder $query): EloquentDataTable return ''; } - return ''.$study->readingPhysician->display_name; + return '' . $study->readingPhysician->display_name; }) ->editColumn('images', function (Study $study) { - return $study->numInstances().''.human_filesize($study->disk_size).''; + return $study->numInstances() . '' . human_filesize($study->disk_size) . ''; }) ->editColumn('study_date', function (Study $study) { return self::dtFormat($study->study_date); @@ -49,9 +49,9 @@ public function dataTable(QueryBuilder $query): EloquentDataTable return self::dtFormat($study->received_at); }) ->editColumn('show_study', function (Study $study) { - $btn = 'Show'; - $btn .= ' Edit'; - $btn .= ' Delete'; + $btn = 'Show'; + $btn .= ' Edit'; + $btn .= ' Delete'; return $btn; }) diff --git a/app/Http/Controllers/HashidActionControllerBase.php b/app/Http/Controllers/HashidActionControllerBase.php index 82c10a3..44cff63 100644 --- a/app/Http/Controllers/HashidActionControllerBase.php +++ b/app/Http/Controllers/HashidActionControllerBase.php @@ -2,10 +2,10 @@ namespace App\Http\Controllers; -use Throwable; - use function Sentry\captureException; +use Throwable; + abstract class HashidActionControllerBase extends Controller { protected ?int $key = null; diff --git a/app/Http/Controllers/HashidControllerBase.php b/app/Http/Controllers/HashidControllerBase.php index 29e5bae..0adecdb 100644 --- a/app/Http/Controllers/HashidControllerBase.php +++ b/app/Http/Controllers/HashidControllerBase.php @@ -2,10 +2,10 @@ namespace App\Http\Controllers; -use Throwable; - use function Sentry\captureException as gobble; +use Throwable; + abstract class HashidControllerBase extends Controller { protected ?int $key = null; diff --git a/app/Http/Controllers/Staff/StudyViewerController.php b/app/Http/Controllers/Staff/StudyViewerController.php index a5e08f8..eacb680 100644 --- a/app/Http/Controllers/Staff/StudyViewerController.php +++ b/app/Http/Controllers/Staff/StudyViewerController.php @@ -14,7 +14,7 @@ private function loadViewer(\Closure $callback) $study = Study::findOrFail($this->key); $url = $callback($study); abort_if(blank($url), 404); - $title = Str::limit($study->patient_name, 20).' | '.config('app.name'); + $title = Str::limit($study->patient_name, 20) . ' | ' . config('app.name'); return view('staff.studies.viewer', compact('url', 'title')); } diff --git a/app/Models/Study.php b/app/Models/Study.php index aee2f78..ae0bbf3 100644 --- a/app/Models/Study.php +++ b/app/Models/Study.php @@ -100,7 +100,7 @@ public function getMetadataLink(): string public function sexAge(): string { $dob = $this->patient_birthdate; - $age = $dob ? (int) Carbon::make($dob)->diffInYears().'Y' : null; + $age = $dob ? (int) Carbon::make($dob)->diffInYears() . 'Y' : null; if (blank($age) && blank($this->patient_sex)) { return '~'; } diff --git a/app/Models/Traits/BitmaskFunctionality.php b/app/Models/Traits/BitmaskFunctionality.php index 652ac14..9588529 100644 --- a/app/Models/Traits/BitmaskFunctionality.php +++ b/app/Models/Traits/BitmaskFunctionality.php @@ -121,6 +121,6 @@ public function toString(): string /** @param Int32BitMask $value */ public static function valueToString(int $value): string { - return '0b'.substr(chunk_split(sprintf('%\'032b', $value), 4, '_'), 0, -1); + return '0b' . substr(chunk_split(sprintf('%\'032b', $value), 4, '_'), 0, -1); } } diff --git a/app/Models/User.php b/app/Models/User.php index 7c2feb8..f57ea82 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -97,7 +97,7 @@ public function scopeActive($query) public function isAdmin(): bool { - return cache()->remember('user.is_admin:'.$this->id, + return cache()->remember('user.is_admin:' . $this->id, 5 * 60, fn () => $this->hasRole(UserRole::Admin) ); @@ -105,7 +105,7 @@ public function isAdmin(): bool public function isTech(): bool { - return cache()->remember('user.is_tech:'.$this->id, + return cache()->remember('user.is_tech:' . $this->id, 5 * 60, fn () => $this->hasRole(UserRole::Technician) ); @@ -113,7 +113,7 @@ public function isTech(): bool public function primaryRole(): string { - return cache()->remember('user.pri_role:'.$this->id, + return cache()->remember('user.pri_role:' . $this->id, 5 * 60, fn () => Str::title($this->roles()->first()->name) ); @@ -136,7 +136,7 @@ public function getLastSeenAttribute(): Carbon public function getFullNameAttribute(): string { - return trim($this->first_name.' '.$this->last_name); + return trim($this->first_name . ' ' . $this->last_name); } public function avatar(bool $gravatar = false): string diff --git a/app/Providers/FortifyServiceProvider.php b/app/Providers/FortifyServiceProvider.php index 2d741e3..44cb4c8 100644 --- a/app/Providers/FortifyServiceProvider.php +++ b/app/Providers/FortifyServiceProvider.php @@ -34,7 +34,7 @@ public function boot(): void Fortify::resetUserPasswordsUsing(ResetUserPassword::class); RateLimiter::for('login', function (Request $request) { - $throttleKey = Str::transliterate(Str::lower($request->input(Fortify::username())).'|'.$request->ip()); + $throttleKey = Str::transliterate(Str::lower($request->input(Fortify::username())) . '|' . $request->ip()); return Limit::perMinute(5)->by($throttleKey); }); diff --git a/app/Services/Pacs/DicomUtils.php b/app/Services/Pacs/DicomUtils.php index 3e97a56..2832ad2 100644 --- a/app/Services/Pacs/DicomUtils.php +++ b/app/Services/Pacs/DicomUtils.php @@ -22,6 +22,6 @@ public static function dateTimeToCarbon(?string $datePart, ?string $timePart, st return null; } - return Carbon::createFromFormat('YmdHis', $datePart.Str::before($timePart, '.'), $timezone); + return Carbon::createFromFormat('YmdHis', $datePart . Str::before($timePart, '.'), $timezone); } } diff --git a/app/Services/Pacs/OrthancRestClient.php b/app/Services/Pacs/OrthancRestClient.php index 91b9ec0..90d5478 100644 --- a/app/Services/Pacs/OrthancRestClient.php +++ b/app/Services/Pacs/OrthancRestClient.php @@ -15,7 +15,7 @@ public function getClient(): Client public function getStudyStatistics(string $study_id): array { - $response = $this->getClient()->get('/studies/'.$study_id.'/statistics'); + $response = $this->getClient()->get('/studies/' . $study_id . '/statistics'); return json_decode($response->getBody()->getContents(), true); } @@ -29,14 +29,14 @@ public function getServerStatistics(): array public function getStudySeries(string $study_id): array { - $response = $this->getClient()->get('/studies/'.$study_id.'/series?expand'); + $response = $this->getClient()->get('/studies/' . $study_id . '/series?expand'); return json_decode($response->getBody()->getContents(), true); } public function getStudyInstances(string $study_id): array { - $response = $this->getClient()->get('/studies/'.$study_id.'/instances?expand'); + $response = $this->getClient()->get('/studies/' . $study_id . '/instances?expand'); return json_decode($response->getBody()->getContents(), true); } @@ -46,7 +46,7 @@ public function getStudyDetails(string $study_id): array $query = [ 'requested-tags' => implode(';', array_column(DicomTags::cases(), 'value')), ]; - $response = $this->getClient()->get('/studies/'.$study_id.'?'.http_build_query($query)); + $response = $this->getClient()->get('/studies/' . $study_id . '?' . http_build_query($query)); return json_decode($response->getBody()->getContents(), true); } @@ -57,7 +57,7 @@ public function getStudies(): array 'expand' => '1', 'requested-tags' => implode(';', array_column(DicomTags::cases(), 'value')), ]; - $url = '/studies?'.http_build_query($query); + $url = '/studies?' . http_build_query($query); $response = $this->getClient()->get($url); return json_decode($response->getBody()->getContents(), true); diff --git a/app/Services/Pacs/PacsUrlGen.php b/app/Services/Pacs/PacsUrlGen.php index fbc7dd7..74ad6cc 100644 --- a/app/Services/Pacs/PacsUrlGen.php +++ b/app/Services/Pacs/PacsUrlGen.php @@ -48,7 +48,7 @@ public static function ohifSegmentation(string $study_uid): string public static function archive(string $study_uid): string { $url = Uri::of(config('pacs.api.endpoint')) - ->withPath('/studies/'.$study_uid.'/archive'); + ->withPath('/studies/' . $study_uid . '/archive'); return (string) $url; } diff --git a/app/Services/ThemeHelper.php b/app/Services/ThemeHelper.php index fa04413..ef48735 100644 --- a/app/Services/ThemeHelper.php +++ b/app/Services/ThemeHelper.php @@ -219,7 +219,7 @@ public static function updatePageConfig($pageConfigs): void if (isset($pageConfigs)) { if (count($pageConfigs) > 0) { foreach ($pageConfigs as $config => $val) { - Config::set('custom.'.$demo.'.'.$config, $val); + Config::set('custom.' . $demo . '.' . $config, $val); } } } diff --git a/bootstrap/app.php b/bootstrap/app.php index 820152a..cb8c306 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -7,9 +7,9 @@ return Application::configure(basePath: dirname(__DIR__)) ->withRouting( - web: __DIR__.'/../routes/web.php', - api: __DIR__.'/../routes/api.php', - commands: __DIR__.'/../routes/console.php', + web: __DIR__ . '/../routes/web.php', + api: __DIR__ . '/../routes/api.php', + commands: __DIR__ . '/../routes/console.php', health: '/up', ) ->withMiddleware(function (Middleware $middleware) { diff --git a/composer.json b/composer.json index 3bc0676..fd17c2c 100644 --- a/composer.json +++ b/composer.json @@ -91,6 +91,7 @@ "fix": "php-cs-fixer fix", "dev": [ "Composer\\Config::disableProcessTimeout", + "sail up -d", "npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite" ] }, diff --git a/config/cache.php b/config/cache.php index 925f7d2..2dbc452 100644 --- a/config/cache.php +++ b/config/cache.php @@ -103,6 +103,6 @@ | */ - 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'), + 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache_'), ]; diff --git a/config/database.php b/config/database.php index 125949e..25e064c 100644 --- a/config/database.php +++ b/config/database.php @@ -147,7 +147,7 @@ 'options' => [ 'cluster' => env('REDIS_CLUSTER', 'redis'), - 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), + 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'), ], 'default' => [ diff --git a/config/filesystems.php b/config/filesystems.php index b564035..cf2c5c8 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -40,7 +40,7 @@ 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), - 'url' => env('APP_URL').'/storage', + 'url' => env('APP_URL') . '/storage', 'visibility' => 'public', 'throw' => false, ], diff --git a/config/logging.php b/config/logging.php index 8d94292..54bb171 100644 --- a/config/logging.php +++ b/config/logging.php @@ -89,7 +89,7 @@ 'handler_with' => [ 'host' => env('PAPERTRAIL_URL'), 'port' => env('PAPERTRAIL_PORT'), - 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'), + 'connectionString' => 'tls://' . env('PAPERTRAIL_URL') . ':' . env('PAPERTRAIL_PORT'), ], 'processors' => [PsrLogMessageProcessor::class], ], diff --git a/config/session.php b/config/session.php index f0b6541..4683a9b 100644 --- a/config/session.php +++ b/config/session.php @@ -129,7 +129,7 @@ 'cookie' => env( 'SESSION_COOKIE', - Str::slug(env('APP_NAME', 'laravel'), '_').'_session' + Str::slug(env('APP_NAME', 'laravel'), '_') . '_session' ), /* diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index c085b9a..494bb5f 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -70,7 +70,7 @@ public function withPersonalTeam(?callable $callback = null): static return $this->has( Team::factory() ->state(fn (array $attributes, User $user) => [ - 'name' => $user->name.'\'s Team', + 'name' => $user->name . '\'s Team', 'user_id' => $user->id, 'personal_team' => true, ]) diff --git a/pint.json b/pint.json index e69de29..7eb5048 100644 --- a/pint.json +++ b/pint.json @@ -0,0 +1,11 @@ +{ + "preset": "laravel", + "rules": { + "concat_space": { + "spacing": "one" + }, + "ordered_imports": { + "sort_algorithm": "alpha" + } + } +} diff --git a/public/index.php b/public/index.php index 947d989..74a0960 100644 --- a/public/index.php +++ b/public/index.php @@ -5,13 +5,13 @@ define('LARAVEL_START', microtime(true)); // Determine if the application is in maintenance mode... -if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) { +if (file_exists($maintenance = __DIR__ . '/../storage/framework/maintenance.php')) { require $maintenance; } // Register the Composer autoloader... -require __DIR__.'/../vendor/autoload.php'; +require __DIR__ . '/../vendor/autoload.php'; // Bootstrap Laravel and handle the request... -(require_once __DIR__.'/../bootstrap/app.php') +(require_once __DIR__ . '/../bootstrap/app.php') ->handleRequest(Request::capture()); diff --git a/resources/views/staff/worklist/table.blade.php b/resources/views/staff/worklist/table.blade.php index 7bc493b..5304faf 100644 --- a/resources/views/staff/worklist/table.blade.php +++ b/resources/views/staff/worklist/table.blade.php @@ -27,11 +27,11 @@ @endsection @section('vendor-script') - + @vite([ - 'resources/assets/vendor/libs/datatables-bs5/datatables-bootstrap5.js', + 'resources/assets/vendor/libs/jquery/jquery.js', + 'resources/assets/vendor/libs/datatables-bs5/datatables-bootstrap5.js', ]) @endsection @@ -72,42 +72,4 @@ - - @endsection diff --git a/tests/Feature/EmailVerificationTest.php b/tests/Feature/EmailVerificationTest.php index 79351c7..cc921c9 100644 --- a/tests/Feature/EmailVerificationTest.php +++ b/tests/Feature/EmailVerificationTest.php @@ -36,7 +36,7 @@ Event::assertDispatched(Verified::class); expect($user->fresh()->hasVerifiedEmail())->toBeTrue(); - $response->assertRedirect(route('dashboard', absolute: false).'?verified=1'); + $response->assertRedirect(route('dashboard', absolute: false) . '?verified=1'); })->skip(function () { return ! Features::enabled(Features::emailVerification()); }, 'Email verification not enabled.'); diff --git a/tests/Feature/PasswordResetTest.php b/tests/Feature/PasswordResetTest.php index fd1cb4c..7dfa35f 100644 --- a/tests/Feature/PasswordResetTest.php +++ b/tests/Feature/PasswordResetTest.php @@ -37,7 +37,7 @@ ]); Notification::assertSentTo($user, ResetPassword::class, function (object $notification) { - $response = $this->get('/reset-password/'.$notification->token); + $response = $this->get('/reset-password/' . $notification->token); $response->assertStatus(200);