diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b0b0a23..6f3fe34 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,12 +14,30 @@ jobs: matrix: php: [8.1, 8.2, 8.3, 8.4] stability: [prefer-lowest, prefer-stable] - laravel: [9.x, 10.x, 11.x, 12.x] + laravel: [9.x, 10.x, 11.x, 12.x, 13.x] exclude: - laravel: 11.x php: 8.1 - laravel: 12.x php: 8.1 + # Laravel 13 requires PHP ^8.3 + - laravel: 13.x + php: 8.1 + - laravel: 13.x + php: 8.2 + include: + # Laravel 13 accepts symfony/console ^7.4 || ^8.0, and symfony/console 8 + # requires PHP >= 8.4.1. So PHP 8.3 can only resolve Symfony 7, and PHP 8.4 + # resolves Symfony 8. Both paths must work; these cells pin that contract so + # a future resolution change cannot silently drop one of them. + - laravel: 13.x + php: 8.3 + stability: prefer-stable + symfony_major: 7 + - laravel: 13.x + php: 8.4 + stability: prefer-stable + symfony_major: 8 name: L${{ matrix.laravel }} - PHP ${{ matrix.php }} - ${{ matrix.stability }} @@ -39,12 +57,26 @@ jobs: composer config -g audit.block-insecure false composer create-project --prefer-dist laravel/laravel=${{ matrix.laravel }} laravel-${{ matrix.laravel }} --no-interaction --no-audit + # Deliberately no -W. If Lucid's Symfony constraint is ever too narrow for the + # host's resolved version, this must fail loudly. With -W, Composer would + # instead silently downgrade the host application's Symfony - which is the + # exact bug this change fixes. - name: Require Lucid run: | cd laravel-${{ matrix.laravel }} composer config repositories.lucid '{"type": "path", "url": "$GITHUB_WORKSPACE", "options": {"symlink": true}}' composer require lucidarch/lucid:@dev --no-audit + - name: Assert resolved Symfony major + if: matrix.symfony_major + run: | + cd laravel-${{ matrix.laravel }} + MAJOR=$(composer show --format=json symfony/console \ + | php -r '$v = json_decode(stream_get_contents(STDIN), true)["versions"][0]; echo explode(".", ltrim($v, "v"))[0];') + echo "resolved symfony/console major: $MAJOR (expected ${{ matrix.symfony_major }})" + [ "$MAJOR" = "${{ matrix.symfony_major }}" ] \ + || { echo "::error::expected Symfony ${{ matrix.symfony_major }}, resolved $MAJOR"; exit 1; } + - name: Run Tests run: | chmod +x $GITHUB_WORKSPACE/bin/test-commands.sh diff --git a/CLAUDE.md b/CLAUDE.md index 8818c60..d95418d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -6,7 +6,7 @@ The `lucidarch/lucid` Composer package — the actual library that implements th **Current version:** 2.0.0 (in progress — see upgrade plan) **Packagist name:** `lucidarch/lucid` -**PHP:** ^8.1 | **Laravel:** 9.x, 10.x, 11.x, 12.x +**PHP:** ^8.1 | **Laravel:** 9.x, 10.x, 11.x, 12.x, 13.x --- @@ -84,7 +84,7 @@ There are no PHPUnit tests in the package source itself — tests are integratio **`bin/test-local.sh`** — run this for local development. Requires a sibling `../Testbench/` directory. ```sh -# Test all versions (9.x 10.x 11.x 12.x) +# Test all versions (9.x 10.x 11.x 12.x 13.x) ./bin/test-local.sh # Test a single version @@ -115,8 +115,12 @@ FRESH=1 ./bin/test-local.sh 11.x ### CI (GitHub Actions) -Matrix: PHP 8.1/8.2/8.3/8.4 × Laravel 9.x/10.x/11.x/12.x × prefer-lowest/prefer-stable. -Exclusions: Laravel 11+ requires PHP 8.2+; Laravel 12+ requires PHP 8.2+. +Matrix: PHP 8.1/8.2/8.3/8.4 × Laravel 9.x/10.x/11.x/12.x/13.x × prefer-lowest/prefer-stable. +Exclusions: Laravel 11+ requires PHP 8.2+; Laravel 12+ requires PHP 8.2+; Laravel 13 requires PHP 8.3+. + +Two `include:` cells pin the Symfony major on Laravel 13 — PHP 8.3 → 7, PHP 8.4 → 8, `prefer-stable` +only — asserted by the "Assert resolved Symfony major" step. `symfony/console` 8 requires PHP >= 8.4.1, +which is what makes that split deterministic. --- @@ -185,7 +189,7 @@ Critical items already addressed (verify before assuming done): - `src/Units/Model.php` — explicit `Illuminate\Database\Eloquent\Model` import - `src/Bus/UnitDispatcher.php` — explicit `Illuminate\Support\Facades\App` import - `bin/test-commands.sh` — Laravel 11 path conditionals -- `.github/workflows/tests.yml` — updated matrix (PHP 8.1–8.4, Laravel 9–12) +- `.github/workflows/tests.yml` — updated matrix (PHP 8.1–8.4, Laravel 9–13) --- diff --git a/bin/test-local.sh b/bin/test-local.sh index f2d988f..0d31f3f 100755 --- a/bin/test-local.sh +++ b/bin/test-local.sh @@ -27,7 +27,7 @@ fi if [[ $# -gt 0 ]]; then VERSIONS=($@) else - VERSIONS=(9.x 10.x 11.x 12.x) + VERSIONS=(9.x 10.x 11.x 12.x 13.x) fi # Safe removal: only removes a direct laravel-* child of TESTBENCH_DIR diff --git a/composer.json b/composer.json index 8551b0a..f75da43 100644 --- a/composer.json +++ b/composer.json @@ -20,10 +20,10 @@ "require": { "php": "^8.1", "ext-dom": "*", - "symfony/console": "^5.4|^6.0|^7.0", - "symfony/filesystem": "^5.4|^6.0|^7.0", - "symfony/finder": "^5.4|^6.0|^7.0", - "symfony/process": "^5.4|^6.0|^7.0" + "symfony/console": "^5.4|^6.0|^7.0|^8.0", + "symfony/filesystem": "^5.4|^6.0|^7.0|^8.0", + "symfony/finder": "^5.4|^6.0|^7.0|^8.0", + "symfony/process": "^5.4|^6.0|^7.0|^8.0" }, "require-dev": { "mockery/mockery": "^1.5" diff --git a/lucid b/lucid index 6192d2e..98bd117 100755 --- a/lucid +++ b/lucid @@ -42,6 +42,6 @@ $commands = [ ]; $app = new Symfony\Component\Console\Application('Lucid', '2.0.0'); -array_walk($commands, [$app, 'add']); +$app->addCommands($commands); $app->run(); diff --git a/src/Console/Command.php b/src/Console/Command.php index 00a3d60..ad83e6a 100644 --- a/src/Console/Command.php +++ b/src/Console/Command.php @@ -24,7 +24,7 @@ trait Command * * @return void */ - protected function configure() + protected function configure(): void { $this ->setName($this->name)