Skip to content

Commit

Permalink
Drop support for PHP < 7.4, PHPUnit < 8 (#160)
Browse files Browse the repository at this point in the history
* Drop support for PHP < 7.4, PHPUnit < 8
* Install rector and change language version
* update reverse regex
* update suggests
  • Loading branch information
ilario-pierbattista authored Apr 21, 2023
1 parent d7ae884 commit e9a2e62
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 14 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: [7.1, 7.4, 8.0]
php: [7.4, 8.0]
dependencies:
- "lowest"
- "highest"
Expand All @@ -35,11 +35,10 @@ jobs:
strategy:
matrix:
include:
- { phpunit: 9, php: 8.2 }
- { phpunit: 9, php: 8.1 }
- { phpunit: 9, php: 8.0 }
- { phpunit: 8, php: 7.4 }
- { phpunit: 7, php: 7.3 }
- { phpunit: 6, php: 7.1 }
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ docs/_build
docker-compose.override.yml
.psalm-cache/
.idea
.php-cs-fixer.cache
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The project follows [semantic versioning](http://semver.org/). `BC` stands for a change that impacts `Backward Compatibility`.

## [Unreleased]
### Added
* `ilario-pierbattista/reverse-regex` as substitute peer dependency of `icomefromthenet/reverse-regex`.
* Support for PHP 8.2
### Removed
* Support for PHP < 7.4
* Support for PHPUnit < 8

## [0.13.0] - 2021-12-17
### Added
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ run-php-7.4:
.PHONY: run-php-8.1
run-php-8.1:
docker-compose run php-8.1 sh

.PHONY: run-php-8.2
run-php-8.2:
docker-compose run php-8.2 sh
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ In property-based testing, several properties that the System Under Test must re

## Compatibility

- PHP 7.1, 7.2, 7.3, 7.4, 8.0, 8.1
- PHPUnit 6.x, 7.x, 8.x, 9.x
- PHP 7.4, 8.0, 8.1, 8.2
- PHPUnit 8.x, 9.x

## Installation

Expand Down
20 changes: 12 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,22 @@
],
"license": "MIT",
"require": {
"php": ">=7.1"
"php": ">=7.4"
},
"require-dev": {
"phpunit/phpunit": ">=7",
"sebastian/comparator": ">=1.2.4",
"friendsofphp/php-cs-fixer": "^2.0",
"ilario-pierbattista/reverse-regex": "v0.0.6.3",
"phpstan/phpstan": "^1.2",
"psalm/phar": "^5.4"
"phpunit/phpunit": "^8 || ^9",
"sebastian/comparator": ">=2.1.3",
"friendsofphp/php-cs-fixer": "^3.0",
"ilario-pierbattista/reverse-regex": "^0.3.1",
"phpstan/phpstan": "^1.10",
"psalm/phar": "^5.4",
"rector/rector": "^0.15"
},
"suggest":
{
"phpunit/phpunit": "Standard way to run generated test cases",
"icomefromthenet/reverse-regex": "v0.0.6.3 for the regex() Generator",
"ilario-pierbattista/reverse-regex": "v0.0.6.3 for the regex() Generator"
"ilario-pierbattista/reverse-regex": "0.3.1 for the regex() Generator (alternative to icomefromthenet/reverse-regex) "
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -63,6 +64,9 @@
],
"phpstan-baseline": [
"vendor/bin/phpstan analyse -c phpstan.neon --generate-baseline"
],
"rector": [
"vendor/bin/rector"
]
}
}
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,12 @@ services:
- .:/usr/src/eris
user: 1000:1000
working_dir: /usr/src/eris
php-8.2:
build:
context: .docker
args:
BASE_IMAGE: php:8.2-cli-alpine3.16
volumes:
- .:/usr/src/eris
user: 1000:1000
working_dir: /usr/src/eris
22 changes: 22 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

declare(strict_types=1);

use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__ . '/src'
]);

// register a single rule
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
$rectorConfig->import(LevelSetList::UP_TO_PHP_74);

// define sets of rules
// $rectorConfig->sets([
// LevelSetList::UP_TO_PHP_74
// ]);
};
2 changes: 1 addition & 1 deletion test/Generator/BindGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ protected function setUp(): void
public function testGeneratesAGeneratedValueObject(): void
{
$generator = new BindGenerator(
// TODO: order of parameters should be consistent with map, or not?
// TODO: order of parameters should be consistent with map, or not?
ConstantGenerator::box(4),
function ($n) {
return new ChooseGenerator($n, $n + 10);
Expand Down

0 comments on commit e9a2e62

Please sign in to comment.