Skip to content

Commit 64fb2bb

Browse files
authored
Merge pull request #480 from phpDocumentor/drop-php-versions
Upgrade code to php 8.1
2 parents 5112cf3 + 3cf473f commit 64fb2bb

File tree

104 files changed

+898
-1192
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+898
-1192
lines changed

.github/workflows/integrate.yaml

+32-8
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,67 @@ name: "Integrate"
55
on: # yamllint disable-line rule:truthy
66
push:
77
branches:
8-
- "5.x"
8+
- "6.x"
99
pull_request: null
1010
# Allow manually triggering the workflow.
1111
workflow_dispatch: null
1212

1313
jobs:
1414
code-coverage:
1515
name: "Code Coverage"
16-
uses: "phpDocumentor/.github/.github/workflows/[email protected]"
16+
uses: "phpDocumentor/.github/.github/workflows/[email protected]"
17+
with:
18+
php-version: "8.2"
1719

1820
coding-standards:
1921
name: "Coding Standards"
20-
uses: "phpDocumentor/.github/.github/workflows/[email protected]"
22+
runs-on: "ubuntu-22.04"
23+
steps:
24+
- name: "Checkout"
25+
uses: "actions/checkout@v4"
26+
27+
- name: "Install PHP"
28+
uses: "shivammathur/setup-php@v2"
29+
with:
30+
coverage: "none"
31+
php-version: "8.2"
32+
tools: "cs2pr"
33+
34+
- name: "Install dependencies with Composer"
35+
uses: "ramsey/composer-install@v2"
36+
with:
37+
dependency-versions: "locked"
38+
39+
- name: "Run PHP_CodeSniffer"
40+
run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr"
2141

2242
dependency-analysis:
2343
name: "Dependency analysis"
24-
uses: "phpDocumentor/.github/.github/workflows/[email protected]"
44+
uses: "phpDocumentor/.github/.github/workflows/[email protected]"
45+
with:
46+
php-version: "8.2"
2547

2648
lint-root:
2749
name: "Lint root"
28-
uses: "phpDocumentor/.github/.github/workflows/lint.yml@v0.4.0"
50+
uses: "phpDocumentor/.github/.github/workflows/lint.yml@v0.5.0"
2951
with:
52+
php-version: "8.2"
3053
composer-options: "--no-check-publish --ansi"
3154

3255
static-analysis:
3356
name: "Static analysis"
34-
uses: "phpDocumentor/.github/.github/workflows/static-analysis.yml@v0.4.0"
57+
uses: "phpDocumentor/.github/.github/workflows/static-analysis.yml@v0.5.0"
3558
with:
59+
php-version: "8.2"
3660
php-extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, fileinfo, pcntl, posix"
3761

3862
unit-tests:
3963
name: "Unit test"
40-
uses: "phpDocumentor/.github/.github/workflows/continuous-integration.yml@v0.4.0"
64+
uses: "phpDocumentor/.github/.github/workflows/continuous-integration.yml@v0.5.0"
4165

4266
integration-tests:
4367
name: "Integration test"
44-
uses: "phpDocumentor/.github/.github/workflows/continuous-integration.yml@v0.4.0"
68+
uses: "phpDocumentor/.github/.github/workflows/continuous-integration.yml@v0.5.0"
4569
needs: "unit-tests"
4670
with:
4771
test-suite: "integration"

Makefile

+10-10
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,44 @@ help: ## Displays this list of targets with descriptions
44

55
.PHONY: code-style
66
code-style:
7-
docker run -it --rm -v${PWD}:/opt/project -w /opt/project phpdoc/phpcs-ga:latest -d memory_limit=1024M -s
7+
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:8.1-cli vendor/bin/phpcs
88

99
.PHONY: fix-code-style
1010
fix-code-style:
11-
docker run -it --rm -v${PWD}:/opt/project -w /opt/project phpdoc/phpcs-ga:latest phpcbf
11+
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:8.1-cli vendor/bin/phpcbf
1212

1313
.PHONY: static-code-analysis
1414
static-code-analysis: vendor ## Runs a static code analysis with phpstan/phpstan and vimeo/psalm
15-
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:7.4 vendor/bin/phpstan --configuration=phpstan.neon
16-
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:7.4 vendor/bin/psalm
15+
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:8.1-cli vendor/bin/phpstan --configuration=phpstan.neon
16+
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:8.1-cli vendor/bin/psalm
1717

1818
.PHONY: test
1919
test: test-unit test-functional ## Runs all test suites with phpunit/phpunit
20-
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:7.4 vendor/bin/phpunit
20+
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:8.1-cli vendor/bin/phpunit
2121

2222
.PHONY: test-unit
2323
test-unit: ## Runs unit tests with phpunit/phpunit
24-
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:7.4 vendor/bin/phpunit --testsuite=unit
24+
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:8.1-cli vendor/bin/phpunit --testsuite=unit
2525

2626
.PHONY: test-functional
2727
test-functional: ## Runs unit tests with phpunit/phpunit
28-
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:7.4 vendor/bin/phpunit --testsuite=functional
28+
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:8.1-cli vendor/bin/phpunit --testsuite=functional
2929

3030
.PHONY: dependency-analysis
3131
dependency-analysis: vendor ## Runs a dependency analysis with maglnet/composer-require-checker
32-
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:7.4 .phive/composer-require-checker check --config-file=/opt/project/composer-require-checker.json
32+
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:8.1-cli .phive/composer-require-checker check --config-file=/opt/project/composer-require-checker.json
3333

3434
vendor: composer.json composer.lock
3535
composer validate --no-check-publish
3636
composer install --no-interaction --no-progress
3737

3838
.PHONY: benchmark
3939
benchmark:
40-
docker run -it --rm -v${CURDIR}:/opt/project -w /opt/project php:7.4-cli tools/phpbench run
40+
docker run -it --rm -v${CURDIR}:/opt/project -w /opt/project php:8.1-cli tools/phpbench run
4141

4242
.PHONY: rector
4343
rector: ## Refactor code using rector
44-
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:7.4 vendor/bin/rector process
44+
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:8.1-cli vendor/bin/rector process
4545

4646
.PHONY: pre-commit-test
4747
pre-commit-test: fix-code-style test code-style static-code-analysis

composer.json

+9-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
}
2020
},
2121
"require": {
22-
"php": "^7.4|8.0.*|8.1.*|8.2.*|8.3.*",
22+
"php": "8.1.*|8.2.*|8.3.*",
2323
"nikic/php-parser": "~4.14",
2424
"phpdocumentor/reflection-common": "^2.1",
2525
"phpdocumentor/reflection-docblock": "^5",
@@ -28,6 +28,8 @@
2828
"webmozart/assert": "^1.7"
2929
},
3030
"require-dev": {
31+
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
32+
"doctrine/coding-standard": "^12.0",
3133
"mikey179/vfsstream": "~1.2",
3234
"mockery/mockery": "~1.6.0",
3335
"phpspec/prophecy-phpunit": "^2.0",
@@ -37,6 +39,7 @@
3739
"phpstan/phpstan-webmozart-assert": "^1.2",
3840
"phpunit/phpunit": "^9.5",
3941
"rector/rector": "^0.18.0",
42+
"squizlabs/php_codesniffer": "^3.8",
4043
"vimeo/psalm": "^5.0"
4144
},
4245
"config": {
@@ -45,15 +48,17 @@
4548
},
4649
"sort-packages": true,
4750
"platform": {
48-
"php": "7.4.0"
51+
"php": "8.1.0"
4952
},
5053
"allow-plugins": {
51-
"phpstan/extension-installer": true
54+
"phpstan/extension-installer": true,
55+
"dealerdirect/phpcodesniffer-composer-installer": true
5256
}
5357
},
5458
"extra": {
5559
"branch-alias": {
56-
"dev-5.x": "5.3.x-dev"
60+
"dev-5.x": "5.3.x-dev",
61+
"dev-6.x": "6.0.x-dev"
5762
}
5863
}
5964
}

0 commit comments

Comments
 (0)