From 9f0d421ae8a947f8f4ea827e3a77e7f7b7958ca8 Mon Sep 17 00:00:00 2001 From: Snider Date: Tue, 17 Mar 2026 09:10:30 +0000 Subject: [PATCH] fix(dx): add strict_types to all PHP files and update CLAUDE.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add declare(strict_types=1) to 9 PHP files missing it - Update CLAUDE.md: document composer test/lint scripts - Update CLAUDE.md: fix lthn/php-api → lthn/api package name - Fix PSR-12 compliance (Pint: ordered imports, FQCN extraction) Co-Authored-By: Virgil --- CLAUDE.md | 6 +++--- app/Providers/AppServiceProvider.php | 2 ++ bootstrap/app.php | 14 +++++++++----- bootstrap/providers.php | 5 ++++- config/core.php | 2 ++ database/seeders/DatabaseSeeder.php | 2 ++ public/index.php | 2 ++ routes/api.php | 2 ++ routes/console.php | 2 ++ routes/web.php | 2 ++ 10 files changed, 30 insertions(+), 9 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index a443014..c7c7a3a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -51,14 +51,14 @@ php artisan make:mod Blog --web # Web routes only php artisan make:mod Blog --api # API routes only # Testing -vendor/bin/pest # Run all tests +composer test # Run all tests (Pest) vendor/bin/pest tests/Feature # Run feature tests only vendor/bin/pest --filter="test name" # Run single test by name vendor/bin/pest path/to/TestFile.php # Run single test file # Code quality +composer lint # Fix code style (Pint) vendor/bin/pint --dirty # Format changed files only -vendor/bin/pint # Format all files ``` ## Module Structure @@ -82,7 +82,7 @@ app/Mod/Blog/ |---------|-----------|---------| | `lthn/php` | `Core\` | Framework core, events, module discovery | | `lthn/php-admin` | `Core\Admin\` | Admin panel, Livewire modals | -| `lthn/php-api` | `Core\Api\` | REST API, scopes, rate limiting, webhooks | +| `lthn/api` | `Core\Api\` | REST API, scopes, rate limiting, webhooks | | `lthn/php-mcp` | `Core\Mcp\` | Model Context Protocol for AI agents | ## Testing diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 452e6b6..8325058 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -1,5 +1,7 @@ withProviders([ // Core PHP Framework - \Core\LifecycleEventProvider::class, - \Core\Website\Boot::class, - \Core\Front\Boot::class, - \Core\Mod\Boot::class, + LifecycleEventProvider::class, + Boot::class, + Core\Front\Boot::class, + Core\Mod\Boot::class, ]) ->withRouting( web: __DIR__.'/../routes/web.php', @@ -19,7 +23,7 @@ return Application::configure(basePath: dirname(__DIR__)) health: '/up', ) ->withMiddleware(function (Middleware $middleware) { - \Core\Front\Boot::middleware($middleware); + Core\Front\Boot::middleware($middleware); }) ->withExceptions(function (Exceptions $exceptions) { // diff --git a/bootstrap/providers.php b/bootstrap/providers.php index 38b258d..6752799 100644 --- a/bootstrap/providers.php +++ b/bootstrap/providers.php @@ -1,5 +1,8 @@