Skip to content
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

Raise minimal PHP version to 8.1 #102

Merged
merged 1 commit into from
Feb 18, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ 80, 81, 82 ]
php: [ 81, 82, 83 ]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/composer-require-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
['8.0', '8.1', '8.2']
['8.1', '8.2', '8.3']
4 changes: 2 additions & 2 deletions .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
matrix:
os: ['ubuntu-latest']
php: ['8.0', '8.1', '8.2']
php: ['8.3']

services:
rabbitmq:
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:

- name: Run infection
run: |
vendor/bin/roave-infection-static-analysis-plugin -j2 --ignore-msi-with-no-mutations --only-covered
vendor/bin/roave-infection-static-analysis-plugin --threads=2 --ignore-msi-with-no-mutations --only-covered
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
RABBITMQ_HOST: 127.0.0.1
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/rector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ name: rector
jobs:
rector:
uses: yiisoft/actions/.github/workflows/rector.yml@master
secrets:
token: ${{ secrets.YIISOFT_GITHUB_TOKEN }}
with:
os: >-
['ubuntu-latest']
php: >-
['8.0']
['8.3']
2 changes: 1 addition & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
['8.0', '8.1', '8.2']
['8.1', '8.2', '8.3']
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ coverage: ## Run code coverage. Params: {{ v=8.1 }}. Default latest PHP 8.1
make down

static-analyze: ## Run code static analyze. Params: {{ v=8.1 }}. Default latest PHP 8.1
docker-compose -f tests/docker-compose.yml run php$(v) vendor/bin/psalm --config=psalm.xml --shepherd --stats --php-version=8.0
docker-compose -f tests/docker-compose.yml run php$(v) vendor/bin/psalm --config=psalm.xml --shepherd --stats --php-version=8.1
make down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ AMQP adapter based on [php-amqplib](https://github.com/php-amqplib/php-amqplib)

## Requirements

- PHP 8.0 or higher.
- PHP 8.1 or higher.

## Installation

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^8.0",
"php": "^8.1",
"ext-json": "*",
"ext-sockets": "*",
"php-amqplib/php-amqplib": "^3.1.0",
Expand All @@ -33,12 +33,12 @@
"require-dev": {
"maglnet/composer-require-checker": "^4.4",
"phpunit/phpunit": "^9.5",
"rector/rector": "^0.19.0",
"rector/rector": "^1.0",
"roave/infection-static-analysis-plugin": "^1.16",
"spatie/phpunit-watcher": "^1.23",
"symfony/console": "^6.0",
"symfony/process": "^6.0",
"vimeo/psalm": "^4.30|^5.8",
"vimeo/psalm": "^5.22",
"yiisoft/test-support": "^3.0"
},
"autoload": {
Expand Down
16 changes: 8 additions & 8 deletions docs/en/internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,27 @@ Also, if you are using Docker, then you have access to a set of prepared command
The code is statically analyzed with [Psalm](https://psalm.dev). To run static analysis:

```bash
# {{ v }} = 80, 81, 82
make static-analyze v=80
# {{ v }} = 81, 82, 83
make static-analyze v=81
```

### Unit tests

```bash
# {{ v }} = 80, 81, 82
make test v=80
# {{ v }} = 81, 82, 83
make test v=81
```

### Mutation tests

```bash
# {{ v }} = 80, 81, 82
make mutation-test v=80
# {{ v }} = 81, 82, 83
make mutation-test v=83
```

### Code coverage

```bash
# {{ v }} = 80, 81, 82
make coverage v=80
# {{ v }} = 81, 82, 83
make coverage v=81
```
10 changes: 9 additions & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@

use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
Expand All @@ -18,10 +22,14 @@

// define sets of rules
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_80,
LevelSetList::UP_TO_PHP_81,
]);

$rectorConfig->skip([
ClosureToArrowFunctionRector::class,
JsonThrowOnErrorRector::class,
ReadOnlyPropertyRector::class,
NullToStrictStringFuncCallArgRector::class,
ReturnNeverTypeRector::class,
]);
};
12 changes: 6 additions & 6 deletions tests/docker-compose.development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ x-php: &php
PHP_IDE_CONFIG: serverName=yii-queue-amqp

services:
php80:
<<: *php
volumes:
- ..:/app
- ./runtime/.composer80:/root/.composer

php81:
<<: *php
volumes:
Expand All @@ -24,6 +18,12 @@ services:
- ..:/app
- ./runtime/.composer82:/root/.composer

php83:
<<: *php
volumes:
- ..:/app
- ./runtime/.composer83:/root/.composer

rabbitmq:
image: rabbitmq:3-management-alpine
ports:
Expand Down
6 changes: 3 additions & 3 deletions tests/docker-compose.linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ x-php: &php
- host.docker.internal:${DOCKER_HOST_IP:-172.17.0.1}

services:
php80:
<<: *php

php81:
<<: *php

php82:
<<: *php

php83:
<<: *php
18 changes: 9 additions & 9 deletions tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@ x-php: &php
condition: service_healthy

services:
php80:
<<: *php
container_name: yii-queue-amqp-php80
build:
context: ..
dockerfile: tests/docker/php/Dockerfile
args:
PHP_VERSION: '8.0'

php81:
<<: *php
container_name: yii-queue-amqp-php81
Expand All @@ -43,6 +34,15 @@ services:
args:
PHP_VERSION: '8.2'

php83:
<<: *php
container_name: yii-queue-amqp-php83
build:
context: ..
dockerfile: tests/docker/php/Dockerfile
args:
PHP_VERSION: '8.3'

rabbitmq:
image: rabbitmq:3-alpine
healthcheck:
Expand Down
Loading