-
Notifications
You must be signed in to change notification settings - Fork 19
Maintenance release 2.0.1: support PHP 8.1–8.4 and Laravel 10–13 #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
a7201e5
05ebf6b
bcc3d53
b1c32d2
da61e3c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,14 @@ | ||
| # Path-based git attributes | ||
| # https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html | ||
|
|
||
| # Ignore all test and documentation with "export-ignore". | ||
| /.gitattributes export-ignore | ||
| /.gitignore export-ignore | ||
| /.travis.yml export-ignore | ||
| /phpunit.xml.dist export-ignore | ||
| /.scrutinizer.yml export-ignore | ||
| /tests export-ignore | ||
| /docs export-ignore | ||
| /.github export-ignore | ||
| /.editorconfig export-ignore | ||
| # Keep development-only files out of the distributed package. | ||
| /.editorconfig export-ignore | ||
| /.gitattributes export-ignore | ||
| /.github export-ignore | ||
| /.gitignore export-ignore | ||
| /.phpunit-watcher.yml export-ignore | ||
| /CHANGELOG.md export-ignore | ||
| /docs.md export-ignore | ||
| /phpstan.neon export-ignore | ||
| /phpunit.xml export-ignore | ||
| /tests export-ignore |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| version: 2 | ||
|
|
||
| updates: | ||
| - package-ecosystem: composer | ||
| directory: "/" | ||
| schedule: | ||
| interval: monthly | ||
| open-pull-requests-limit: 5 | ||
| labels: | ||
| - dependencies | ||
| # The library itself only requires php-parser. Everything else here is test | ||
| # tooling, and the CI matrix already pins the Laravel versions it exercises. | ||
| ignore: | ||
| - dependency-name: "orchestra/testbench" | ||
| update-types: ["version-update:semver-major"] | ||
|
|
||
| - package-ecosystem: github-actions | ||
| directory: "/" | ||
| schedule: | ||
| interval: monthly | ||
| labels: | ||
| - dependencies |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,105 +1,91 @@ | ||
| name: tests | ||
|
|
||
| on: [push, pull_request] | ||
|
|
||
| env: | ||
| COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --no-suggest --prefer-dist -o -n" | ||
| on: | ||
| push: | ||
| branches: [master] | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| laravel-tests: | ||
| tests: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| php-version: [7.4, 8.0] | ||
| laravel-version: [6, 7, 8] | ||
| os: [ubuntu-latest] | ||
| experimental: [false] | ||
| dependencies: [locked] | ||
| include: | ||
| - php-version: 7.4 | ||
| laravel-version: 8 | ||
| dependencies: highest | ||
| os: ubuntu-latest | ||
| experimental: false | ||
|
|
||
| # - php-version: 7.4 | ||
| # laravel-version: 8 | ||
| # os: windows-latest | ||
| # dependencies: locked | ||
| # experimental: false | ||
|
|
||
| - php-version: 7.4 | ||
| laravel-version: 8 | ||
| os: macos-latest | ||
| dependencies: locked | ||
| experimental: false | ||
|
|
||
| name: PHP ${{ matrix.php-version }} - L${{ matrix.laravel-version }} - ${{ matrix.os }} - ${{ matrix.dependencies }} | ||
| # Laravel 10 (testbench 8) | ||
| - { php: '8.1', laravel: '10.*', testbench: '8.*', os: ubuntu-latest } | ||
| - { php: '8.2', laravel: '10.*', testbench: '8.*', os: ubuntu-latest } | ||
| - { php: '8.3', laravel: '10.*', testbench: '8.*', os: ubuntu-latest } | ||
| # Laravel 11 (testbench 9) | ||
| - { php: '8.2', laravel: '11.*', testbench: '9.*', os: ubuntu-latest } | ||
| - { php: '8.3', laravel: '11.*', testbench: '9.*', os: ubuntu-latest } | ||
| - { php: '8.4', laravel: '11.*', testbench: '9.*', os: ubuntu-latest } | ||
| # Laravel 12 (testbench 10) | ||
| - { php: '8.2', laravel: '12.*', testbench: '10.*', os: ubuntu-latest } | ||
| - { php: '8.3', laravel: '12.*', testbench: '10.*', os: ubuntu-latest } | ||
| - { php: '8.4', laravel: '12.*', testbench: '10.*', os: ubuntu-latest } | ||
| # Keep an eye on the other host we claim to work on | ||
| - { php: '8.4', laravel: '12.*', testbench: '10.*', os: macos-latest } | ||
|
|
||
| name: PHP ${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.os }} | ||
|
|
||
| runs-on: ${{ matrix.os }} | ||
|
|
||
| continue-on-error: ${{ matrix.experimental }} | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v2 | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ matrix.php-version }} | ||
| php-version: ${{ matrix.php }} | ||
| extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd | ||
| coverage: none | ||
| ini-values: "memory_limit=-1" | ||
| tools: composer | ||
| ini-values: memory_limit=-1, error_reporting=E_ALL | ||
| tools: composer:v2 | ||
|
|
||
| - name: Determine composer cache directory | ||
| id: determine-composer-cache-directory | ||
| run: 'echo "::set-output name=directory::$(composer config cache-dir)"' | ||
| id: composer-cache | ||
| run: echo "directory=$(composer config cache-dir)" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Cache dependencies | ||
| uses: actions/cache@v2 | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ${{ steps.determine-composer-cache-directory.outputs.directory }} | ||
| key: dependencies-os-${{ matrix.os }}-php-${{ matrix.php-version }}-laravel-${{ matrix.laravel-version }}-composer-${{ hashFiles('**/composer.lock') }} | ||
| restore-keys: dependencies-os-${{ matrix.os }}-php-${{ matrix.php-version }}-laravel-${{ matrix.laravel-version }}-composer- | ||
|
|
||
| - name: Setup problem matchers for PHP | ||
| run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" | ||
|
|
||
| - name: Setup problem matchers for PHPUnit | ||
| run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | ||
| path: ${{ steps.composer-cache.outputs.directory }} | ||
| key: composer-${{ matrix.os }}-php${{ matrix.php }}-laravel${{ matrix.laravel }}-${{ hashFiles('composer.json') }} | ||
| restore-keys: composer-${{ matrix.os }}-php${{ matrix.php }}-laravel${{ matrix.laravel }}- | ||
|
|
||
| - name: Allow installing EOL Laravel branches | ||
| # Laravel 10 and 11 are past security support, so every release in those | ||
| # branches carries an open advisory and Composer 2.9+ declines to install | ||
| # them at all. This is a compatibility matrix rather than a deployment, | ||
| # and plenty of applications are still on those versions, so we want to | ||
| # know whether Archetype works there. Laravel 12 installs unmodified. | ||
| if: matrix.laravel != '12.*' | ||
| run: composer config policy.advisories.block false | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| composer require --dev --no-update --no-interaction \ | ||
| "laravel/framework:${{ matrix.laravel }}" \ | ||
| "orchestra/testbench:${{ matrix.testbench }}" | ||
| composer update --prefer-dist --no-interaction --no-progress | ||
|
|
||
| - name: Install highest dependencies from composer.json | ||
| if: matrix.dependencies == 'highest' | ||
| uses: nick-invision/retry@v1 | ||
| with: | ||
| timeout_minutes: 5 | ||
| max_attempts: 5 | ||
| command: composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }} | ||
| - name: Run tests | ||
| run: vendor/bin/pest | ||
|
|
||
| - name: Install lowest dependencies from composer.json | ||
| if: matrix.dependencies == 'lowest' | ||
| uses: nick-invision/retry@v1 | ||
| with: | ||
| timeout_minutes: 5 | ||
| max_attempts: 5 | ||
| command: composer install ${{ env.COMPOSER_FLAGS }} --prefer-lowest | ||
| static-analysis: | ||
| name: PHPStan | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install dependencies from composer.lock | ||
| if: matrix.dependencies == 'locked' | ||
| uses: nick-invision/retry@v1 | ||
| - uses: shivammathur/setup-php@v2 | ||
| with: | ||
| timeout_minutes: 5 | ||
| max_attempts: 5 | ||
| command: composer install ${{ env.COMPOSER_FLAGS }} | ||
| php-version: '8.3' | ||
| coverage: none | ||
| tools: composer:v2 | ||
|
|
||
| - name: Select Laravel version | ||
| uses: nick-invision/retry@v1 | ||
| with: | ||
| timeout_minutes: 5 | ||
| max_attempts: 5 | ||
| command: composer require "laravel/framework:${{ matrix.laravel-version }}.*" --no-update | ||
| - run: composer update --prefer-dist --no-interaction --no-progress | ||
|
|
||
| - name: Run tests | ||
| run: vendor/bin/pest --verbose | ||
| - run: vendor/bin/phpstan analyse --no-progress |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,5 +6,6 @@ sketches/ | |
| .vscode/ | ||
| vendor/ | ||
| .phpunit.result.cache | ||
| .phpunit.cache/ | ||
| logs | ||
| composer.lock | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to `ajthinking/archetype` are documented here. | ||
|
|
||
| This project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
|
||
| ## [Unreleased] | ||
|
|
||
| ## [2.0.1] - 2026-08-25 | ||
|
|
||
| Maintenance only. No API changes, and nothing here can break existing usage. | ||
|
|
||
| ### Added | ||
|
|
||
| - Support for PHP 8.2, 8.3 and 8.4, and for Laravel 10, 11 and 12 — now verified | ||
| in CI across ten combinations rather than assumed. | ||
| - A `php` requirement (`>=7.4`) in `composer.json`. The package never declared | ||
| one, so Composer could not warn anybody. | ||
| - `LICENSE.md`. The package has always been MIT; the file was missing. | ||
| - This changelog. | ||
| - `.github/dependabot.yml`, so dependency updates are configured rather than | ||
| running on defaults. | ||
|
|
||
| ### Changed | ||
|
|
||
| - The test suite now runs against a pinned application skeleton in | ||
| `tests/fixtures/laravel` instead of copying one out of `vendor/laravel/laravel` | ||
| at runtime. Laravel 11 removed most of the files the suite relied on | ||
| (`app/Console/Kernel.php`, `app/Exceptions/Handler.php`, `RouteServiceProvider` | ||
| and the middleware), which made the old approach untestable on current Laravel. | ||
| `laravel/laravel` is no longer a dev dependency. | ||
| - CI runs on `actions/checkout@v4` and `actions/cache@v4`, and no longer uses the | ||
| `::set-output` command that GitHub has disabled. | ||
| - `phpunit.xml` migrated to the PHPUnit 10+ schema. | ||
| - `Archetype\Tests\` moved out of the production autoloader into `autoload-dev`. | ||
| - `minimum-stability` is now `stable`. | ||
|
|
||
| ### Fixed | ||
|
|
||
| - Six implicit-nullable parameters that raised deprecation notices on PHP 8.4 | ||
| (`PHPFile::namespace()`, `Namespace_::namespace()`, `FileInput::load()`, | ||
| `InputInterface::load()`, `EndpointProvider::__construct()`, | ||
| `PHPParserPropertyMap::propertyMap()` and `ASTQueryBuilder::traverseIntoClass()`). | ||
| - `getReflection()` now catches `Throwable` rather than `Exception`. A file whose | ||
| parent class or trait cannot be autoloaded raises an `Error`, which previously | ||
| escaped and killed the entire query instead of skipping that one file. This | ||
| affects `LaravelFile::models()`, `controllers()` and `serviceProviders()`. | ||
| - `tests/Pest.php` no longer defines a global `context()` helper. Laravel 11 ships | ||
| its own `context()`, and the collision brought the whole suite down before a | ||
| single test could run. | ||
|
|
||
| ## [2.0.0] - 2024-05-11 | ||
|
|
||
| ### Changed | ||
|
|
||
| - **Breaking:** upgraded to `nikic/php-parser` ^5.0. Thanks to @jasonvarga (#85). | ||
|
|
||
| ## [1.1.5] - 2022-08-24 | ||
|
|
||
| Last release of the 1.x line, which requires `nikic/php-parser` ^4.11. | ||
|
|
||
| 1.x cannot be installed alongside anything that needs php-parser 5 — including | ||
| Pest 3 and newer. If Composer refuses to resolve `ajthinking/archetype`, upgrade | ||
| to 2.x. | ||
|
|
||
| [Unreleased]: https://github.com/ajthinking/archetype/compare/v2.0.1...HEAD | ||
| [2.0.1]: https://github.com/ajthinking/archetype/compare/v2.0.0...v2.0.1 | ||
| [2.0.0]: https://github.com/ajthinking/archetype/compare/v1.1.5...v2.0.0 | ||
| [1.1.5]: https://github.com/ajthinking/archetype/releases/tag/v1.1.5 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # The MIT License (MIT) | ||
|
|
||
| Copyright (c) Anders Jürisoo | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,14 +17,13 @@ | |
| } | ||
| ], | ||
| "require": { | ||
| "php": ">=7.4", | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed, and fixed in bcc3d53 — but set to The upper bound is deliberate. PHP 9 removes dynamic properties, and Checked that 8.1 excludes nobody downstream before picking it: the earliest |
||
| "nikic/php-parser": "^5.0" | ||
| }, | ||
| "require-dev": { | ||
| "laravel/laravel": "^6.0 || ^7.0 || ^8.0 || ^9.0", | ||
| "orchestra/testbench": "^4.0 || ^5.0 || ^6.0", | ||
| "pestphp/pest": "^1.21", | ||
| "phpstan/phpstan": "^1.6", | ||
| "phpunit/phpunit": "^8.0 || ^9.5" | ||
| "orchestra/testbench": "^8.0 || ^9.0 || ^10.0", | ||
| "pestphp/pest": "^2.0 || ^3.0", | ||
| "phpstan/phpstan": "^1.11 || ^2.0" | ||
| }, | ||
| "config": { | ||
| "optimize-autoloader": true, | ||
|
|
@@ -44,15 +43,30 @@ | |
| }, | ||
| "autoload": { | ||
| "psr-4": { | ||
| "Archetype\\": "src/", | ||
| "Archetype\\Tests\\": "tests/" | ||
| } | ||
| "Archetype\\": "src/" | ||
| }, | ||
| "exclude-from-classmap": [ | ||
| "src/snippets/" | ||
| ] | ||
| }, | ||
| "autoload-dev": { | ||
| "psr-4": { | ||
| "Tests\\": "tests/" | ||
| } | ||
| "Archetype\\Tests\\": "tests/", | ||
| "App\\": "tests/fixtures/laravel/app/" | ||
| }, | ||
| "files": [ | ||
| "tests/stubs/laravel-sanctum.php" | ||
| ], | ||
| "exclude-from-classmap": [ | ||
| "tests/fixtures/laravel/database/", | ||
| "tests/fixtures/laravel/public/", | ||
| "tests/stubs/" | ||
| ] | ||
| }, | ||
| "scripts": { | ||
| "test": "pest", | ||
| "analyse": "phpstan analyse" | ||
| }, | ||
| "minimum-stability": "dev", | ||
| "minimum-stability": "stable", | ||
| "prefer-stable": true | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.