Skip to content

Commit

Permalink
Merge pull request #3540 from phpDocumentor/php-upgrade
Browse files Browse the repository at this point in the history
Php upgrade
  • Loading branch information
jaapio committed Jul 21, 2023
2 parents 42cac3b + 39b9549 commit 6abc5ea
Show file tree
Hide file tree
Showing 396 changed files with 2,652 additions and 4,150 deletions.
43 changes: 33 additions & 10 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
php-version: ${{ env.defaultPHPVersion }}
extensions: ${{ env.extensions }}
ini-values: memory_limit=2G, display_errors=On, error_reporting=-1
tools: composer-require-checker:3.8.0
tools: composer-require-checker:4.6.0

- name: Install Composer dependencies & cache dependencies
uses: "ramsey/composer-install@v2"
Expand Down Expand Up @@ -110,18 +110,41 @@ jobs:
- setup
steps:
- uses: actions/checkout@v3
- name: Restore/cache vendor folder

- name: Setup cache environment
id: cache-env
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ env.defaultPHPVersion }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}

- name: Cache extensions
uses: actions/cache@v3
with:
path: vendor
key: all-build-${{ hashFiles('**/composer.lock') }}
restore-keys: |
all-build-${{ hashFiles('**/composer.lock') }}
all-build-
- name: Code style check
uses: phpDocumentor/coding-standard@latest
path: ${{ steps.cache-env.outputs.dir }}
key: ${{ steps.cache-env.outputs.key }}
restore-keys: ${{ steps.cache-env.outputs.key }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: -s
php-version: ${{ env.defaultPHPVersion }}
extensions: ${{ env.extensions }}
ini-values: memory_limit=2G, display_errors=On, error_reporting=-1
tools: cs2pr

- name: Install Composer dependencies & cache dependencies
uses: "ramsey/composer-install@v2"
with:
composer-options: --optimize-autoloader
# Bust the cache at least once a month - output format: YYYY-MM-DD.
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")

- name: Code style check
run: ./bin/phpcs -q --no-colors --report=checkstyle | cs2pr

phpstan:
runs-on: ubuntu-latest
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ bin/*
!bin/phpdoc*
!bin/githubaction*
!bin/console*
!bin/phpcs*
!bin/phpcbf*
!bin/utils/*

# Build folder and vendor folder are generated code; no need to version this
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARGS ?=

.USER = CURRENT_UID=$(shell id -u):$(shell id -g)
.DOCKER_COMPOSE_RUN = ${.USER} docker-compose run --rm
.PHP = docker run -it --rm -v${CURDIR}:/data -w /data php:8.1
.PHP = docker run --user=$(shell id -u):$(shell id -g) -it --rm -v${CURDIR}:/data -w /data php:8.1

.PHONY: help
help:
Expand Down Expand Up @@ -77,11 +77,11 @@ pull-containers:

.PHONY: phpcs
phpcs:
docker run -it --rm -v${CURDIR}:/opt/project -w /opt/project phpdoc/phpcs-ga:latest -s ${ARGS}
${.PHP} ./bin/phpcs -s ${ARGS}

.PHONY: phpcbf
phpcbf:
docker run -it --rm -v${CURDIR}:/opt/project -w /opt/project phpdoc/phpcs-ga:latest phpcbf ${ARGS}
${.PHP} ./bin/phpcbf ${ARGS}

.PHONY: phpstan
phpstan:
Expand Down
128 changes: 0 additions & 128 deletions bin/php-parse

This file was deleted.

11 changes: 0 additions & 11 deletions bin/phpcbf

This file was deleted.

11 changes: 0 additions & 11 deletions bin/phpcs

This file was deleted.

7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,15 @@
},
"minimum-stability": "stable",
"require-dev": {
"doctrine/coding-standard": "^12.0",
"fakerphp/faker": "^1.21",
"mikey179/vfsstream": "^1.2",
"mockery/mockery": "^1.0",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-webmozart-assert": "^1.2",
"psalm/phar": "^4.17"
"psalm/phar": "^4.17",
"rector/rector": "^0.17.6"
},
"config": {
"bin-dir": "bin/",
Expand All @@ -105,7 +107,8 @@
},
"allow-plugins": {
"symfony/flex": true,
"phpstan/extension-installer": true
"phpstan/extension-installer": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"replace": {
Expand Down

0 comments on commit 6abc5ea

Please sign in to comment.