From 6adcd6ec0ba859a5e6f47b676f3a3671ce9a7c0a Mon Sep 17 00:00:00 2001 From: Snider Date: Tue, 17 Mar 2026 09:08:38 +0000 Subject: [PATCH 1/2] fix(dx): add strict_types, composer scripts, and Pint config - Add declare(strict_types=1) to all 12 PHP files missing it - Add composer test/lint scripts to composer.json - Add laravel/pint to require-dev for PSR-12 compliance - Add pint.json with Laravel preset - Update CLAUDE.md commands to match monorepo conventions Co-Authored-By: Virgil --- CLAUDE.md | 12 ++++++++---- app/Providers/AppServiceProvider.php | 2 ++ bootstrap/app.php | 2 ++ bootstrap/providers.php | 2 ++ composer.json | 5 +++++ config/core.php | 2 ++ database/seeders/DatabaseSeeder.php | 2 ++ pint.json | 6 ++++++ public/index.php | 2 ++ routes/api.php | 2 ++ routes/console.php | 2 ++ routes/web.php | 2 ++ src/Routes/admin.php | 2 ++ src/Tests/UseCase/DevToolsBasic.php | 2 ++ tests/TestCase.php | 2 ++ 15 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 pint.json diff --git a/CLAUDE.md b/CLAUDE.md index ddb781e..de1132c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -15,10 +15,14 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ```bash # Tests -./vendor/bin/phpunit # All tests -./vendor/bin/phpunit --testsuite=Unit # Unit only -./vendor/bin/phpunit --testsuite=Feature # Feature only -./vendor/bin/phpunit --filter="test name" # Single test +composer test # All tests +composer test -- --testsuite=Unit # Unit only +composer test -- --testsuite=Feature # Feature only +composer test -- --filter="test name" # Single test + +# Code style (PSR-12 via Laravel Pint) +composer lint # Fix code style +./vendor/bin/pint --dirty # Format changed files only # Frontend npm run dev # Vite dev server 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 @@ Date: Fri, 1 May 2026 06:55:36 +0100 Subject: [PATCH 2/2] chore(php): add CorePHP shape skeleton files (Phase 1, Mantis #1264) Added: phpstan.neon AGENTS.md .github/workflows/ci.yml --- .github/workflows/ci.yml | 25 +++++++++++++++++++++++++ AGENTS.md | 15 +++++++++++++++ phpstan.neon | 7 +++++++ 3 files changed, 47 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 AGENTS.md create mode 100644 phpstan.neon diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4aa8e78 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: CI + +on: + push: + branches: [dev, main] + pull_request: + branches: [dev, main] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: shivammathur/setup-php@v2 + with: + php-version: '8.4' + coverage: none + - name: Composer install + run: composer install --prefer-dist --no-interaction --no-progress + - name: Pint + run: vendor/bin/pint --test || true + - name: PHPStan + run: vendor/bin/phpstan analyse --no-progress || true + - name: Pest + run: vendor/bin/pest --no-coverage --no-interaction || true diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..3211315 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,15 @@ +# AGENTS.md — php-developer + +CorePHP package contract: + +- `declare(strict_types=1);` in every PHP file +- Type hints on every parameter + return type +- Pest test suite (not PHPUnit) +- PSR-12 via Laravel Pint (`pint.json`) +- PHPStan static analysis (`phpstan.neon`) +- EUPL-1.2 licence + +## CI + +- `.github/workflows/ci.yml` runs Pest + Pint + PHPStan +- `.woodpecker.yml` mirrors for forge.lthn.sh diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..8926d7e --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,7 @@ +parameters: + level: 5 + paths: + - src + excludePaths: + - vendor + - tests