Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/.gitattributes export-ignore
/.github/ export-ignore
/.gitignore export-ignore
/.php-cs-fixer.dist.php export-ignore
/renovate.json export-ignore
/.laminas-ci.json export-ignore
/phpunit.xml.dist export-ignore
/test/ export-ignore
/clover.xml export-ignore
/mago.toml export-ignore

# Force our line endings to be LF, even for Windows
* text eol=lf
Expand Down
31 changes: 0 additions & 31 deletions .github/workflows/continuous-integration.yml

This file was deleted.

70 changes: 70 additions & 0 deletions .github/workflows/mago.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: "Mago Code Quality"

on:
push:
pull_request:

jobs:
mago:
name: "PHP ${{ matrix.php }} | ${{ matrix.dependencies }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.3', '8.4', '8.5']
dependencies: ['lowest', 'locked', 'latest']
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up PHP and Mago
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: mago

# PHPUnit 13 requires PHP 8.4+. On 8.3, install without dev
# dependencies so Mago can still lint production code.
- name: Determine Composer flags
run: |
FLAGS="--no-interaction --no-progress"
if [ "${{ matrix.php }}" = "8.3" ]; then
FLAGS="--no-dev $FLAGS"
fi
echo "COMPOSER_FLAGS=$FLAGS" >> "$GITHUB_ENV"

# Resolve dependencies at the configured strategy level.
# "locked" uses the committed composer.lock as-is.
- name: Install dependencies (lowest)
if: matrix.dependencies == 'lowest'
run: composer update --prefer-lowest $COMPOSER_FLAGS

- name: Install dependencies (locked)
if: matrix.dependencies == 'locked'
run: composer install $COMPOSER_FLAGS

- name: Install dependencies (latest)
if: matrix.dependencies == 'latest'
run: composer update $COMPOSER_FLAGS

# Override the php-version in mago.toml to match the matrix PHP version
# so that syntax-level checks are accurate for each version.
- name: Pin Mago PHP version
run: |
sed -i 's/^php-version = .*/php-version = "${{ matrix.php }}"/' mago.toml

- name: Check formatting
run: mago format --check

- name: Lint
if: success() || failure()
run: mago lint

- name: Analyze
if: (success() || failure()) && matrix.php != '8.3'
run: mago analyze

- name: Test
if: (success() || failure()) && matrix.php != '8.3'
run: ./vendor/bin/phpunit --colors=always
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
/.php-cs-fixer.cache
/.phpunit.cache
/.phpunit.result.cache
/.phpstan-cache
/phpstan.neon
/phpbench.json
/clover.xml
/coveralls-upload.json
/phpunit.xml
/vendor/
/.vscode
/mago-results.txt
*:Zone.Identifier
12 changes: 0 additions & 12 deletions .laminas-ci.json

This file was deleted.

52 changes: 0 additions & 52 deletions .php-cs-fixer.dist.php

This file was deleted.

31 changes: 11 additions & 20 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,20 @@
}
],
"require": {
"php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
"php": "~8.3.0 || ~8.4.0 || ~8.5.0",
"fig/http-message-util": "^1.1",
"laminas/laminas-diactoros": "^3.8",
"laminas/laminas-filter": "3.5.x-dev",
"laminas/laminas-inputfilter": "3.0.x-dev",
"psr/http-message": "^2.0",
"psr/http-server-handler": "^1.0",
"psr/http-server-middleware": "^1.0"
"psr/http-server-middleware": "^1.0",
"webmozart/assert": "^2.4.1"
},
"require-dev": {
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-phpunit": "^2.0",
"phpunit/phpunit": "^13.0.0",
"roave/security-advisories": "dev-master",
"webware/coding-standard": "^0.1.0"
"php-db/phpdb": "^0.6.0",
"phpunit/phpunit": "^11.5.55",
"roave/security-advisories": "dev-master"
},
"autoload": {
"psr-4": {
Expand All @@ -44,22 +46,11 @@
"config": {
"sort-packages": true
},
"scripts": {
"scripts": {
"check-all": [
"@cs-check",
"@sa",
"@test"
],
"cs-check": "vendor/bin/php-cs-fixer check",
"cs-fix": "vendor/bin/php-cs-fixer fix",
"test": "phpunit --colors=always",
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml",
"sa": "vendor/bin/phpstan analyse --memory-limit=256M",
"sa-gen-baseline": "vendor/bin/phpstan analyse --memory-limit=256M --generate-baseline",
"sa-verbose": "vendor/bin/phpstan analyse --memory-limit=256M -vv",
"serve": [
"Composer\\Config::disableProcessTimeout",
"php -S 0.0.0.0:8080 -t public/"
]
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml"
}
}
Loading