From 9f0d421ae8a947f8f4ea827e3a77e7f7b7958ca8 Mon Sep 17 00:00:00 2001 From: Snider Date: Tue, 17 Mar 2026 09:10:30 +0000 Subject: [PATCH 1/2] 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 @@ 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 @@ Date: Fri, 1 May 2026 06:55:39 +0100 Subject: [PATCH 2/2] chore(php): add CorePHP shape skeleton files (Phase 1, Mantis #1265) Added: pint.json phpstan.neon --- phpstan.neon | 7 +++++++ pint.json | 8 ++++++++ 2 files changed, 15 insertions(+) create mode 100644 phpstan.neon create mode 100644 pint.json diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..4ab91b3 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,7 @@ +parameters: + level: 5 + paths: + - app + excludePaths: + - vendor + - tests diff --git a/pint.json b/pint.json new file mode 100644 index 0000000..078e2f2 --- /dev/null +++ b/pint.json @@ -0,0 +1,8 @@ +{ + "preset": "psr12", + "rules": { + "declare_strict_types": true, + "ordered_imports": true, + "no_unused_imports": true + } +}