Skip to content

Commit

Permalink
Merge pull request #30 from ETSGlobal/upgrade_php
Browse files Browse the repository at this point in the history
bump: EB-0 Prepare php8 sf7
  • Loading branch information
aallier authored Dec 15, 2023
2 parents aa43f48 + bd0927b commit 0f6b842
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 41 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/php.code_quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:

env:
PHP_VERSION: 8.1.7
PHP_VERSION: 8.3.0

jobs:
php_analysis:
Expand All @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
tool: [phpcpd, phpcs, phpmd, phpstan, phpunit]
tool: [phpcs, phpmd, phpstan, phpunit]
steps:
- name: Setup PHP ${{ env.PHP_VERSION }} environment
uses: shivammathur/setup-php@b75c104ca87c371bbc71be81a4e5dd5a5d298241 # renovate: tag=v2.17.1
Expand All @@ -32,6 +32,7 @@ jobs:
uses: php-actions/composer@d936bcb900310224b9089aff3337f2221a8df9a0 # renovate: tag=v6.0.0
with:
php_version: ${{ env.PHP_VERSION }}
args: --ignore-platform-reqs
- name: Run ${{ matrix.tool }}
run: make ${{ matrix.tool }}-ci
- name: Upload ${{ matrix.tool }} reports
Expand All @@ -52,25 +53,20 @@ jobs:
- name: Create build/ directory
run: mkdir -p build

# NOTE: only phpunit, phpcs & phpcpd generate reports
# NOTE: only phpunit, phpcs generate reports
- name: Download phpunit reports
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # renovate: tag=v3.0.0
with:
name: phpunit-reports
path: build/
continue-on-error: true

- name: Download phpcs reports
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # renovate: tag=v3.0.0
with:
name: phpcs-reports
path: build/
continue-on-error: true
- name: Download phpcpd reports
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # renovate: tag=v3.0.0
with:
name: phpcpd-reports
path: build/
continue-on-error: true

- name: Report analisys results
uses: mikepenz/action-junit-report@127c778ac944abc0f48a5103964304bab7eb208b # renovate: tag=v2.9.1
Expand Down
13 changes: 2 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
WORKSPACE ?= $(PWD)
REPORTS_DIR ?= build/reports

audit: phpcpd phpcs phpmd phpstan ## Run static code analysis
audit: phpcs phpmd phpstan ## Run static code analysis
.PHONY: audit

lint: phpcbf ## Run linting (alias to phpcbf)
phpcbf: ## Run PHP Code Beautifier and Fixer
vendor/bin/phpcbf --standard=phpcs.xml --extensions=php --ignore=vendor $(EXTRA_ARGS) .
.PHONY: lint phpcbf

phpcpd: ## Run PHP Copy Paste Detector
vendor/bin/phpcpd --min-lines=20 --exclude=vendor/ $(EXTRA_ARGS) .
phpcpd-ci: prepare-ci ## Run PHP Copy Paste Detector (CI)
@xsltproc --version > /dev/null || sudo apt install xsltproc
@wget -qO junit.xslt https://phpmd.org/junit.xslt
EXTRA_ARGS="--log-pmd=$(REPORTS_DIR)/phpcpd.xml" $(MAKE) phpcpd
xsltproc junit.xslt $(REPORTS_DIR)/phpcpd.xml > $(REPORTS_DIR)/phpcpd.junit.xml
.PHONY: phpcpd phpcpd-ci

phpcs: ## Run PHP_CodeSniffer
vendor/bin/phpcs --standard=phpcs.xml --extensions=php --ignore=vendor $(EXTRA_ARGS) .
phpcs-ci: prepare-ci ## Run PHP_CodeSniffer (CI)
Expand All @@ -26,7 +17,7 @@ phpcs-ci: prepare-ci ## Run PHP_CodeSniffer (CI)

PHPMD_FORMAT ?= text
phpmd: ## Run PHP Mess Detector
vendor/bin/phpmd . $(PHPMD_FORMAT) phpmd.xml --suffixes=php $(EXTRA_ARGS)
vendor/bin/phpmd . $(PHPMD_FORMAT) phpmd.xml --suffixes php $(EXTRA_ARGS)
phpmd-ci: prepare-ci ## Run PHP Mess Detector (CI)
PHPMD_FORMAT="github" $(MAKE) phpmd
.PHONY: phpmd phpmd-ci
Expand Down
31 changes: 10 additions & 21 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,23 @@
"description": "",
"license": "MIT",
"require": {
"php": "^8.1",
"php": "^8.3",
"ext-json": "*",
"monolog/monolog": "^3.0",
"symfony/config": "^6.0",
"symfony/console": "^6.0",
"symfony/dependency-injection": "^6.0",
"symfony/http-kernel": "^6.0",
"symfony/monolog-bundle": "^3.3"
"symfony/config": "^7.0",
"symfony/console": "^7.0",
"symfony/dependency-injection": "^7.0",
"symfony/http-kernel": "^7.0",
"symfony/monolog-bundle": "^3.10"
},
"require-dev": {
"jangregor/phpstan-prophecy": "^1.0",
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^9.5",
"psr/http-message": "^1.0 || ^2.0",
"etsglobal/php-static-analysis": "^2.0",
"slevomat/coding-standard": "^7.0 || ^8.0",
"squizlabs/php_codesniffer": "^3.6",
"symfony/phpunit-bridge": "^6.0",
"symfony/http-client-contracts": "^3.0",
"sebastian/phpcpd": "^6.0",
"phpmd/phpmd": "^2.6"
"etsglobal/php-static-analysis": "^3.0",
"symfony/phpunit-bridge": "^7.0",
"symfony/http-client-contracts": "^3.4"
},
"suggest": {
"csa/guzzle-bundle": "Allow token forwarding through Guzzle HTTP calls",
"symfony/http-client": "Allow token forwarding through Symfony's HttpClient HTTP calls"
},
"minimum-stability": "stable",
"autoload": {
"psr-4": {
"ETSGlobal\\LogBundle\\": "\\"
Expand Down

0 comments on commit 0f6b842

Please sign in to comment.