Skip to content

Commit 9dc4a25

Browse files
author
cristian-ungureanu
authored
release: new version
### Improvements - **Enhance code quality**: Elevated the code quality for the recently introduced onboarding feature - **Fine-tune development processes and rectify minor issues**: Integrated the PHPStan tool to fine-tune the development workflow, proactively preventing potential code errors
2 parents 42227ca + 43d1488 commit 9dc4a25

24 files changed

+768
-104
lines changed

.github/workflows/test-php.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,31 @@ jobs:
7676
- name: Run phpunit
7777
run: phpunit
7878

79+
phpstan:
80+
name: PHPStan
81+
runs-on: ubuntu-latest
82+
if: github.event.pull_request.draft == false && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
83+
steps:
84+
- name: Setup PHP version
85+
uses: shivammathur/setup-php@v2
86+
with:
87+
php-version: '7.4'
88+
extensions: simplexml, mysql
89+
- name: Checkout source code
90+
uses: actions/checkout@v2
91+
- name: Get Composer Cache Directory
92+
id: composer-cache
93+
run: |
94+
echo "::set-output name=dir::$(composer config cache-files-dir)"
95+
- name: Setup Composer cache
96+
uses: actions/cache@v1
97+
with:
98+
path: ${{ steps.composer-cache.outputs.dir }}
99+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
100+
restore-keys: |
101+
${{ runner.os }}-composer-
102+
- name: Install composer
103+
run: composer install --prefer-dist --no-progress --no-suggest
104+
- name: PHPStan Static Analysis
105+
run: composer phpstan
106+

composer.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"optimize-autoloader": true,
2626
"platform-check": false,
2727
"platform": {
28-
"php": "5.6"
28+
"php": "7.2"
2929
},
3030
"allow-plugins": {
3131
"dealerdirect/phpcodesniffer-composer-installer": true
@@ -35,11 +35,15 @@
3535
"installer-disable": "true"
3636
},
3737
"require-dev": {
38-
"codeinwp/phpcs-ruleset": "dev-main"
38+
"codeinwp/phpcs-ruleset": "dev-main",
39+
"phpstan/phpstan": "^1.10",
40+
"szepeviktor/phpstan-wordpress": "^1.3",
41+
"php-stubs/wp-cli-stubs": "^2.8"
3942
},
4043
"scripts": {
4144
"format": "phpcbf --standard=phpcs.xml --report-summary --report-source",
42-
"lint": "phpcs --standard=phpcs.xml"
45+
"lint": "phpcs --standard=phpcs.xml",
46+
"phpstan": "phpstan analyse --memory-limit=2G"
4347
},
4448
"support": {
4549
"issues": "https://github.com/Codeinwp/templates-patterns-collection/issues"

0 commit comments

Comments
 (0)