Skip to content

Commit a5186f7

Browse files
author
Masiukevich Maksim
committed
migrate to php 8
1 parent 3f8c677 commit a5186f7

File tree

11 files changed

+1788
-887
lines changed

11 files changed

+1788
-887
lines changed
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: "Continuous Integration"
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
code-style:
7+
name: Code style
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
13+
- name: Install PHP
14+
uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: 8.0
17+
coverage: none
18+
tools: composer:v2
19+
20+
- name: Install dependencies with composer
21+
run: composer install -ov
22+
23+
- name: Run php-cs-fixer
24+
run: PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run --using-cache=no --verbose
25+
26+
psalm:
27+
name: Psalm
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v2
32+
33+
- name: Install PHP
34+
uses: shivammathur/setup-php@v2
35+
with:
36+
php-version: 8.0
37+
coverage: none
38+
tools: composer:v2
39+
40+
- name: Install dependencies with composer
41+
run: composer install -ov
42+
43+
- name: Run vimeo/psalm
44+
run: ./vendor/bin/psalm --config=psalm.xml --shepherd
45+
46+
phpstan:
47+
name: PHPStan
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v2
52+
53+
- name: Install PHP
54+
uses: shivammathur/setup-php@v2
55+
with:
56+
php-version: 8.0
57+
coverage: none
58+
tools: composer:v2
59+
60+
- name: Install dependencies with composer
61+
run: composer install -ov
62+
63+
- name: Run phpstan/phpstan
64+
run: ./vendor/bin/phpstan analyse src --level 7
65+
66+
phpunit:
67+
name: PHPUnit
68+
69+
runs-on: ubuntu-latest
70+
71+
env:
72+
PHP_EXTENSIONS: dom, json, mbstring, curl, tokenizer
73+
PHP_INI_VALUES: assert.exception=1, zend.assertions=1
74+
75+
steps:
76+
- name: Checkout
77+
uses: actions/checkout@v2
78+
79+
- name: Override PHP ini values for JIT compiler
80+
run: echo "PHP_INI_VALUES::assert.exception=1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=1, opcache.optimization_level=-1, opcache.jit=1255, opcache.jit_buffer_size=32M" >> $GITHUB_ENV
81+
82+
- name: Install PHP with extensions
83+
uses: shivammathur/setup-php@v2
84+
with:
85+
php-version: 8.0
86+
extensions: ${{ env.PHP_EXTENSIONS }}
87+
ini-values: ${{ env.PHP_INI_VALUES }}
88+
tools: composer:v2
89+
90+
- name: Install dependencies
91+
run: composer update --no-ansi --no-interaction --no-progress --prefer-lowest
92+
93+
- name: Run tests with phpunit
94+
run: XDEBUG_MODE=coverage php ./vendor/bin/phpunit --configuration ./phpunit.xml --coverage-clover=coverage.clover
95+
96+
- name: Upload coverage file
97+
uses: actions/upload-artifact@v2
98+
with:
99+
name: phpunit.coverage
100+
path: coverage.clover
101+
102+
upload_coverage:
103+
name: Upload coverage
104+
runs-on: ubuntu-latest
105+
needs: phpunit
106+
steps:
107+
- name: Checkout
108+
uses: actions/checkout@v2
109+
110+
- name: Install PHP
111+
uses: shivammathur/setup-php@v2
112+
with:
113+
php-version: 7.4
114+
coverage: none
115+
tools: composer
116+
117+
- name: Download coverage files
118+
uses: actions/download-artifact@v2
119+
with:
120+
path: reports
121+
122+
- name: Send code coverage report to Scrutinizer
123+
run: |
124+
wget https://scrutinizer-ci.com/ocular.phar
125+
php ocular.phar code-coverage:upload --format=php-clover ./reports/phpunit.coverage/coverage.clover

.scrutinizer.yml

Lines changed: 8 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,21 @@
1+
checks:
2+
php: true
3+
14
filter:
2-
paths: [src/*]
3-
excluded_paths: [tests/*]
5+
paths:
6+
- "src/*"
7+
48
tools:
5-
php_analyzer: true
6-
php_sim: true
7-
php_pdepend: true
8-
sensiolabs_security_checker: true
9-
php_changetracking: true
10-
php_mess_detector:
11-
enabled: true
12-
config:
13-
ruleset: ~
14-
code_size_rules:
15-
cyclomatic_complexity: true
16-
npath_complexity: true
17-
excessive_method_length: true
18-
excessive_class_length: true
19-
excessive_parameter_list: true
20-
excessive_public_count: true
21-
too_many_fields: true
22-
too_many_methods: true
23-
excessive_class_complexity: true
24-
design_rules:
25-
exit_expression: true
26-
eval_expression: true
27-
goto_statement: true
28-
number_of_class_children: true
29-
depth_of_inheritance: true
30-
coupling_between_objects: true
31-
unused_code_rules:
32-
unused_private_field: true
33-
unused_local_variable: true
34-
unused_private_method: true
35-
unused_formal_parameter: true
36-
naming_rules:
37-
short_variable:
38-
minimum: 3
39-
long_variable:
40-
maximum: 20
41-
short_method:
42-
minimum: 3
43-
constructor_conflict: true
44-
constant_naming: true
45-
boolean_method_name: true
46-
controversial_rules:
47-
superglobals: true
48-
camel_case_class_name: true
49-
camel_case_property_name: true
50-
camel_case_method_name: true
51-
camel_case_parameter_name: true
52-
camel_case_variable_name: true
539
external_code_coverage:
5410
timeout: 600
55-
checks:
56-
php:
57-
code_rating: true
5811

5912
build:
6013
nodes:
6114
analysis:
6215
environment:
63-
php:
64-
version: 7.4.5
16+
php: 8.0.0
6517
project_setup:
6618
override: true
6719
tests:
6820
override:
69-
- php-scrutinizer-run --enable-security-analysis
21+
- php-scrutinizer-run --enable-security-analysis

.travis.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
## What is it?
2-
[![Build Status](https://travis-ci.org/php-service-bus/message-serializer.svg?branch=v4.1)](https://travis-ci.org/php-service-bus/message-serializer)
3-
[![Code Coverage](https://scrutinizer-ci.com/g/php-service-bus/message-serializer/badges/coverage.png?b=v4.1)](https://scrutinizer-ci.com/g/php-service-bus/message-serializer/?branch=v4.1)
4-
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/php-service-bus/message-serializer/badges/quality-score.png?b=v4.1)](https://scrutinizer-ci.com/g/php-service-bus/message-serializer/?branch=v4.1)
2+
3+
![Continuous Integration](https://github.com/php-service-bus/message-serializer/workflows/Continuous%20Integration/badge.svg)
4+
[![Shepherd](https://shepherd.dev/github/php-service-bus/message-serializer/coverage.svg)](https://shepherd.dev/github/php-service-bus/message-serializer)
5+
[![Code Coverage](https://scrutinizer-ci.com/g/php-service-bus/message-serializer/badges/coverage.png?b=v4.2)](https://scrutinizer-ci.com/g/php-service-bus/message-serializer/?branch=v4.2)
6+
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/php-service-bus/message-serializer/badges/quality-score.png?b=v4.2)](https://scrutinizer-ci.com/g/php-service-bus/message-serializer/?branch=v4.2)
57

68
This component is part of the [PHP Service Bus](https://github.com/php-service-bus/service-bus). Messages serialization implementation
79

composer.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@
2828
}
2929
},
3030
"require": {
31-
"php": ">=7.4",
31+
"php": ">=8.0",
3232
"ext-json": "*",
3333
"ext-iconv": "*",
34-
"php-service-bus/common": "v4.1.*",
35-
"doctrine/annotations": "v1.10.*",
36-
"phpdocumentor/reflection-docblock": "v5.1.*",
37-
"symfony/property-access": "v5.1.*",
38-
"symfony/property-info": "v5.1.*",
39-
"symfony/serializer": "v5.1.*"
34+
"php-service-bus/common": "v4.2.*",
35+
"doctrine/annotations": "v1.11.*",
36+
"phpdocumentor/reflection-docblock": "v5.2.*",
37+
"symfony/property-access": "v5.2.*",
38+
"symfony/property-info": "v5.2.*",
39+
"symfony/serializer": "v5.2.*"
4040
},
4141
"require-dev": {
42-
"php-service-bus/code-style-config": "v1.2.*",
43-
"phpunit/phpunit": "v9.2.*",
44-
"vimeo/psalm": "v3.13.*",
42+
"php-service-bus/code-style-config": "v1.3.*",
43+
"phpunit/phpunit": "v9.5.*",
44+
"vimeo/psalm": "v4.3.*",
4545
"phpstan/phpstan": "v0.12.*"
4646
},
4747
"prefer-stable": true,
@@ -51,8 +51,8 @@
5151
"phpstan": "./vendor/bin/phpstan analyse src --level 7",
5252
"tests": "./vendor/bin/phpunit --configuration phpunit.xml --verbose",
5353
"coverage": "./vendor/bin/phpunit --configuration phpunit.xml --coverage-html ./coverage --verbose",
54-
"cs-check": "./vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run",
55-
"cs-fix": "./vendor/bin/php-cs-fixer fix --allow-risky=yes",
54+
"cs-check": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run",
55+
"cs-fix": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes",
5656
"pre-commit": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes && ./vendor/bin/psalm --config=psalm.xml && ./vendor/bin/phpstan analyse src --level 7 && ./vendor/bin/phpunit --configuration phpunit.xml --verbose"
5757
},
5858
"config": {

0 commit comments

Comments
 (0)