Skip to content

Commit

Permalink
* require at least PHP 7.4 (#2)
Browse files Browse the repository at this point in the history
* update code tools
  • Loading branch information
rieschl authored Jun 25, 2021
1 parent 9d8d916 commit d679833
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 78 deletions.
31 changes: 15 additions & 16 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Check Build

on: [push, pull_request]
on: [pull_request]

jobs:
build:
Expand All @@ -13,9 +13,6 @@ jobs:
container:
image: eventjet/checks-${{ matrix.php }}:latest

env:
COMPOSER_ARGS: ''

steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -24,27 +21,28 @@ jobs:
run: |
mkdir -p /root/.ssh
ssh-keyscan -t rsa github.com >> /root/.ssh/known_hosts
- name: Ignore Plaform Reqs if on PHP8
if: ${{ matrix.php == '8.0' }}
run: echo "COMPOSER_ARGS=--ignore-platform-reqs" >> $GITHUB_ENV
echo "COMPOSER_CACHE=$(composer config cache-dir)" >> $GITHUB_ENV
- name: Composer Cache
uses: actions/cache@v2
with:
path: $(composer config cache-files-dir)
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
path: |
${{ env.COMPOSER_CACHE }}
vendor
key: ${{ runner.os }}-composer

- name: Install dependencies
run: |
composer install --no-progress --no-suggest --no-interaction ${{ env.COMPOSER_ARGS }} > /dev/null
composer update --no-progress --no-interaction ${{ matrix.composer_args }} > /dev/null
- name: PHPCS
if: matrix.php != '8.0'
run: |
composer cs-check
- name: Static analysis
run: |
composer check-deps
composer cs-check
composer phpstan -- --no-progress
composer psalm
Expand All @@ -59,5 +57,6 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
clover_file: "coverage.xml"
threshold_alert: 90
threshold_warning: 95
comment_context: PHP ${{ matrix.php }}
threshold_alert: 100
threshold_warning: 100
20 changes: 0 additions & 20 deletions .gitlab-ci.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .scrutinizer.yml

This file was deleted.

24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,30 @@ All notable changes to this project will be documented in this file, in reverse

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

## 1.0.0 - TBD

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
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@
"description": "Testing helpers for mezzio projects",
"license": "MIT",
"require": {
"php": "^7.3 || ^8.0",
"php": "^7.4 || ^8.0",
"fig/http-message-util": "^1.1",
"laminas/laminas-config-aggregator": "^1.2",
"laminas/laminas-diactoros": "^2.2",
"laminas/laminas-stratigility": "^3.2",
"mezzio/mezzio": "^3.2",
"mezzio/mezzio-router": "^3.1",
"psr/container": "^1.0",
"psr/container": "^1.0 || ^2.0",
"psr/http-message": "^1.0",
"thecodingmachine/safe": "^1.0"
},
"require-dev": {
"eventjet/coding-standard": "^3.1",
"infection/infection": "^0.20",
"infection/infection": "^0.23.0",
"laminas/laminas-servicemanager": "^3.4",
"maglnet/composer-require-checker": "^2.0",
"maglnet/composer-require-checker": "^3.3",
"mezzio/mezzio-fastroute": "^3.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^0.12.5",
"phpstan/phpstan-phpunit": "^0.12.6",
"phpstan/phpstan-strict-rules": "^0.12.1",
"phpunit/phpunit": "^9.4",
"psalm/plugin-phpunit": "^0.13.0",
"psalm/plugin-phpunit": "^0.16.1",
"thecodingmachine/phpstan-safe-rule": "^1.0",
"vimeo/psalm": "^4.0"
},
Expand Down
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": 86,
"minCoveredMsi": 92
"minMsi": 75,
"minCoveredMsi": 82
}
7 changes: 4 additions & 3 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0"?>
<ruleset>
<rule ref="EventjetStrict">
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint"/>
</rule>
<rule ref="EventjetStrict"/>

<arg name="parallel" value="80"/>

<file>src</file>
<file>tests</file>
</ruleset>
11 changes: 4 additions & 7 deletions src/MezzioTestEnvironment.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@

final class MezzioTestEnvironment
{
/** @var ContainerInterface|null */
private $container;
/** @var Application|null */
private $app;
/** @var string */
private $basePath;
private ?ContainerInterface $container = null;
private ?Application $app = null;
private string $basePath;

public function __construct(?string $basePath = null)
{
Expand Down Expand Up @@ -100,7 +97,7 @@ public function router(): RouterInterface
private function registerErrorListener(): void
{
if (!$this->container()->has(ErrorHandler::class)) {
return;
return; // @codeCoverageIgnore
}
$errorHandler = $this->container()->get(ErrorHandler::class);
$errorHandler->attachListener(
Expand Down
2 changes: 1 addition & 1 deletion src/TestConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
final class TestConfigProvider
{
/**
* @return mixed[]
* @return list<mixed>
*/
public static function load(?string $configDir = null): array
{
Expand Down
3 changes: 1 addition & 2 deletions tests/functional/MezzioTestEnvironmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@

class MezzioTestEnvironmentTest extends TestCase
{
/** @var MezzioTestEnvironment */
private $mezzio;
private MezzioTestEnvironment $mezzio;

protected function setUp(): void
{
Expand Down
3 changes: 1 addition & 2 deletions tests/functional/TestDouble/RequestLoggerCallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@

final class RequestLoggerCallback
{
/** @var ServerRequestInterface|null */
private $request;
private ?ServerRequestInterface $request = null;

public function __invoke(ServerRequestInterface $request): ResponseInterface
{
Expand Down

0 comments on commit d679833

Please sign in to comment.