fix(dx): add strict_types to all PHP files and update CLAUDE.md
- 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 <virgil@lethean.io>
This commit is contained in:
parent
b1f3278418
commit
9f0d421ae8
10 changed files with 30 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Core\LifecycleEventProvider;
|
||||
use Core\Website\Boot;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Foundation\Configuration\Exceptions;
|
||||
use Illuminate\Foundation\Configuration\Middleware;
|
||||
|
|
@ -7,10 +11,10 @@ use Illuminate\Foundation\Configuration\Middleware;
|
|||
return Application::configure(basePath: dirname(__DIR__))
|
||||
->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) {
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
use App\Providers\AppServiceProvider;
|
||||
|
||||
return [
|
||||
App\Providers\AppServiceProvider::class,
|
||||
AppServiceProvider::class,
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
define('LARAVEL_START', microtime(true));
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
// API routes are registered via Core modules
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
// Console commands are registered via Core modules
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::get('/', function () {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue