Skip to content

Commit

Permalink
Refresh Package (#10)
Browse files Browse the repository at this point in the history
* Require PHP 8.2
* upgrade code quality tools
* remove thecodingmachine/safe
* switch from PHPCS to PHP-CS-Fixer and fix CS issues
* use setup-php in GitHub CI
* allow laminas/laminas-diactoros ^3

fixes #9
  • Loading branch information
rieschl authored Jan 11, 2025
1 parent 3692363 commit 4e4cb96
Show file tree
Hide file tree
Showing 17 changed files with 128 additions and 207 deletions.
38 changes: 23 additions & 15 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,30 @@ jobs:

strategy:
matrix:
php: ["7.4", "8.0", "8.1"]
php: ["8.2", "8.3"]
composer_args:
- '--prefer-lowest'
- ''

runs-on: ubuntu-latest
container:
image: eventjet/checks-${{ matrix.php }}:latest

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: pcov
tools: composer:v2

- name: Prepare environment
run: |
mkdir -p /root/.ssh
ssh-keyscan -t rsa github.com >> /root/.ssh/known_hosts
echo "COMPOSER_CACHE=$(composer config cache-dir)" >> $GITHUB_ENV
- name: Composer Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
${{ env.COMPOSER_CACHE }}
Expand All @@ -38,23 +41,28 @@ jobs:
run: |
composer update --no-progress --no-interaction ${{ matrix.composer_args }} > /dev/null
- name: Static analysis
run: |
composer check-deps
composer cs-check
composer phpstan -- --no-progress
composer psalm
- name: Check Dependencies
run: composer check-deps

- name: Check Code Style
run: PHP_CS_FIXER_IGNORE_ENV=1 composer cs-check

- name: PHPStan
run: composer phpstan -- --no-progress

- name: Psalm
run: composer psalm

- name: Tests
run: |
vendor/bin/phpunit --coverage-clover=coverage.xml --stop-on-failure
composer run --timeout=0 infection
- name: Save Infection result
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: infection-log-${{ matrix.php }}.txt
name: infection-log-${{ matrix.php }}-${{ matrix.composer_args }}.txt
path: infection-log.txt

- name: Monitor coverage
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/vendor/
/composer.lock
/infection-log.txt
/.php-cs-fixer.cache
/vendor/
.phpunit.result.cache
7 changes: 7 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

declare(strict_types=1);

use Eventjet\CodingStandard\PhpCsFixer\Config;

return Config::strict();
117 changes: 1 addition & 116 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,118 +1,3 @@
# Changelog

All notable changes to this project will be documented in this file, in reverse chronological order by release.

File automatically generated with [phly/keep-a-changelog](https://github.com/phly/keep-a-changelog)

## 1.1.2 - 2022-02-25

### Added

- [#6](https://github.com/trinet-at/mezzio-test/pull/6) allows using v2 of thecodingmachine/safe

### Changed

- Nothing.

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- Nothing.

## 1.1.1 - 2021-10-15

### Added

- [#5](https://github.com/trinet-at/mezzio-test/pull/5) adds support for PATCH and PUT verbs in requests

### Changed

- Nothing.

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- Nothing.

## 1.1.0 - 2021-09-29

### Added

- [#3](https://github.com/trinet-at/mezzio-test/pull/3) adds the possibility to pass additional headers to dispatch
methods

### Changed

- Nothing.

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- Nothing.

## 1.0.0 - 2021-06-25

There are no BC breaks from the previous version. This package was already used enough to tag it as stable 🙂

### Added

- Nothing.

### Changed

- [#2](https://github.com/trinet-at/mezzio-test/pull/2) changed minimum PHP version to 7.4

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- Nothing.

## 0.3.1 - 2020-12-08

### Added

- [#1](https://github.com/trinet-at/mezzio-test/pull/1) adds support for PHP 8

### Changed

- Nothing.

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- Nothing.
All release info can be found in the [GitHub releases tab](https://github.com/trinet-at/mezzio-test/releases).
55 changes: 27 additions & 28 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,30 @@
"license": "MIT",
"type": "library",
"require": {
"php": "^7.4 || ^8.0",
"php": "^8.2",
"fig/http-message-util": "^1.1",
"laminas/laminas-config-aggregator": "^1.2",
"laminas/laminas-diactoros": "^2.2",
"laminas/laminas-diactoros": "^2.2 || ^3.5",
"laminas/laminas-stratigility": "^3.2",
"mezzio/mezzio": "^3.2",
"mezzio/mezzio-router": "^3.1",
"psr/container": "^1.0 || ^2.0",
"psr/http-message": "^1.0",
"thecodingmachine/safe": "^1.0 || ^2.0"
"psr/http-message": "^1.0 || ^2.0"
},
"require-dev": {
"bnf/phpstan-psr-container": "^1.0",
"eventjet/coding-standard": "^3.1",
"infection/infection": "^0.26.0",
"laminas/laminas-servicemanager": "^3.4",
"maglnet/composer-require-checker": "^3.3 || ^4.0",
"mezzio/mezzio-fastroute": "^3.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^1.4",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-strict-rules": "^1.0",
"phpunit/phpunit": "^9.5",
"psalm/plugin-phpunit": "^0.16.1",
"thecodingmachine/phpstan-safe-rule": "^1.0",
"vimeo/psalm": "^4.0"
"bnf/phpstan-psr-container": "^1.1",
"eventjet/coding-standard": "^3.18",
"infection/infection": "^0.27.11",
"laminas/laminas-servicemanager": "^4.0",
"maglnet/composer-require-checker": "^4.14",
"mezzio/mezzio-fastroute": "^3.12",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0",
"phpunit/phpunit": "^10.5",
"psalm/plugin-phpunit": "^0.19",
"vimeo/psalm": "^5.26"
},
"minimum-stability": "stable",
"autoload": {
Expand All @@ -46,9 +44,9 @@
"config": {
"allow-plugins": {
"composer/package-versions-deprecated": true,
"phpstan/extension-installer": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"infection/extension-installer": true
"infection/extension-installer": true,
"phpstan/extension-installer": true
},
"sort-packages": true
},
Expand All @@ -61,13 +59,14 @@
"@phpunit",
"@infection"
],
"check-deps": "vendor/bin/composer-require-checker",
"cs-check": "vendor/bin/phpcs --config-set php_version 70423",
"cs-fix": "vendor/bin/phpcbf",
"infection": "vendor/bin/infection --threads=4",
"infection-xdebug": "@composer run --timeout=0 infection -- --initial-tests-php-options='-d zend_extension=xdebug.so'",
"phpstan": "vendor/bin/phpstan analyse",
"phpunit": "vendor/bin/phpunit",
"psalm": "vendor/bin/psalm"
"check-deps": "composer-require-checker",
"cs-check": "php-cs-fixer fix --dry-run",
"cs-fix": "php-cs-fixer fix",
"infection": "infection -jmax",
"infection-diff": "infection -jmax --git-diff-lines --min-msi=100 --min-covered-msi=100 --ignore-msi-with-no-mutations",
"infection-xdebug": "infection --initial-tests-php-options='-d zend_extension=xdebug.so'",
"phpstan": "phpstan analyze",
"phpunit": "phpunit",
"psalm": "psalm"
}
}
4 changes: 2 additions & 2 deletions infection.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"logs": {
"text": "infection-log.txt"
},
"minMsi": 75,
"minCoveredMsi": 82
"minMsi": 68,
"minCoveredMsi": 80
}
5 changes: 2 additions & 3 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
bootstrap="vendor/autoload.php"
beStrictAboutChangesToGlobalState="true"
beStrictAboutOutputDuringTests="true"
verbose="true"
>
<testsuites>
<testsuite name="Trinet\MezzioTest\Unit">
Expand All @@ -14,9 +13,9 @@
<directory>tests/functional</directory>
</testsuite>
</testsuites>
<coverage>
<source>
<include>
<directory>src</directory>
</include>
</coverage>
</source>
</phpunit>
7 changes: 5 additions & 2 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<?xml version="1.0"?>
<psalm
strictBinaryOperands="true"
errorLevel="2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
strictBinaryOperands="true"
errorLevel="2"
findUnusedBaselineEntry="true"
findUnusedCode="true"
findUnusedPsalmSuppress="true"
>
<projectFiles>
<directory name="src"/>
Expand Down
Loading

0 comments on commit 4e4cb96

Please sign in to comment.