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

Php upgrade #3540

Merged
merged 6 commits into from
Jul 21, 2023
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.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
43 changes: 33 additions & 10 deletions .github/workflows/push.yml
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
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
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
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