Skip to content

Commit d9709df

Browse files
authored
Merge pull request #12 from dAppCore/dev
chore(php): CorePHP shape skeleton (Phase 1, Mantis #1265)
2 parents c9a658f + c907417 commit d9709df

12 files changed

Lines changed: 45 additions & 9 deletions

File tree

CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ php artisan make:mod Blog --web # Web routes only
5151
php artisan make:mod Blog --api # API routes only
5252

5353
# Testing
54-
vendor/bin/pest # Run all tests
54+
composer test # Run all tests (Pest)
5555
vendor/bin/pest tests/Feature # Run feature tests only
5656
vendor/bin/pest --filter="test name" # Run single test by name
5757
vendor/bin/pest path/to/TestFile.php # Run single test file
5858

5959
# Code quality
60+
composer lint # Fix code style (Pint)
6061
vendor/bin/pint --dirty # Format changed files only
61-
vendor/bin/pint # Format all files
6262
```
6363

6464
## Module Structure
@@ -82,7 +82,7 @@ app/Mod/Blog/
8282
|---------|-----------|---------|
8383
| `lthn/php` | `Core\` | Framework core, events, module discovery |
8484
| `lthn/php-admin` | `Core\Admin\` | Admin panel, Livewire modals |
85-
| `lthn/php-api` | `Core\Api\` | REST API, scopes, rate limiting, webhooks |
85+
| `lthn/api` | `Core\Api\` | REST API, scopes, rate limiting, webhooks |
8686
| `lthn/php-mcp` | `Core\Mcp\` | Model Context Protocol for AI agents |
8787

8888
## Testing

app/Providers/AppServiceProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Providers;
46

57
use Illuminate\Support\ServiceProvider;

bootstrap/app.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
<?php
22

3+
declare(strict_types=1);
4+
5+
use Core\LifecycleEventProvider;
6+
use Core\Website\Boot;
37
use Illuminate\Foundation\Application;
48
use Illuminate\Foundation\Configuration\Exceptions;
59
use Illuminate\Foundation\Configuration\Middleware;
610

711
return Application::configure(basePath: dirname(__DIR__))
812
->withProviders([
913
// Core PHP Framework
10-
\Core\LifecycleEventProvider::class,
11-
\Core\Website\Boot::class,
12-
\Core\Front\Boot::class,
13-
\Core\Mod\Boot::class,
14+
LifecycleEventProvider::class,
15+
Boot::class,
16+
Core\Front\Boot::class,
17+
Core\Mod\Boot::class,
1418
])
1519
->withRouting(
1620
web: __DIR__.'/../routes/web.php',
@@ -19,7 +23,7 @@
1923
health: '/up',
2024
)
2125
->withMiddleware(function (Middleware $middleware) {
22-
\Core\Front\Boot::middleware($middleware);
26+
Core\Front\Boot::middleware($middleware);
2327
})
2428
->withExceptions(function (Exceptions $exceptions) {
2529
//

bootstrap/providers.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
22

3+
declare(strict_types=1);
4+
use App\Providers\AppServiceProvider;
5+
36
return [
4-
App\Providers\AppServiceProvider::class,
7+
AppServiceProvider::class,
58
];

config/core.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
return [
46
/*
57
|--------------------------------------------------------------------------

database/seeders/DatabaseSeeder.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Database\Seeders;
46

57
use Illuminate\Database\Seeder;

phpstan.neon

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
parameters:
2+
level: 5
3+
paths:
4+
- app
5+
excludePaths:
6+
- vendor
7+
- tests

pint.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"preset": "psr12",
3+
"rules": {
4+
"declare_strict_types": true,
5+
"ordered_imports": true,
6+
"no_unused_imports": true
7+
}
8+
}

public/index.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Illuminate\Http\Request;
46

57
define('LARAVEL_START', microtime(true));

routes/api.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
// API routes are registered via Core modules

0 commit comments

Comments
 (0)