Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dc77e2c

Browse files
authored
chore: improve codebase (#42)
* refactor: add phpcsfixer and basic config psr12 * refactor: add phpcsfixer and basic config psr12 * remove hook simply/core/build * remove depreccated code * feat: add phpstan level 1 * phpstan level 2 * phpstan level 5 * phpstan level 6 * delete unuse commands configuration file
1 parent 1eba744 commit dc77e2c

84 files changed

Lines changed: 2213 additions & 922 deletions

File tree

Some content is hidden

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

.github/workflows/unit-test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,6 @@ jobs:
4242

4343
- name: Run test suite
4444
run: composer run-script test
45+
46+
- name: Run phpstan
47+
run: composer run-script phpstan

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
vendor
22
/cache
33
.phpunit.result.cache
4+
.php-cs-fixer.cache

composer.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,18 @@
1010
"symfony/config": "^6.4",
1111
"symfony/finder": "^6.4",
1212
"symfony/yaml": "^6.4",
13-
"symfony/proxy-manager-bridge": "^6.4",
1413
"twig/twig": "^3.8"
1514
},
1615
"require-dev": {
1716
"brain/monkey": "~2.6",
1817
"phpunit/phpunit": "~9.5",
1918
"yoast/phpunit-polyfills": "^2.0",
2019
"symfony/console": "6.4.4",
21-
"symfony/var-dumper": "^7.0"
20+
"symfony/var-dumper": "^7.0",
21+
"friendsofphp/php-cs-fixer": "^3.51",
22+
"phpstan/phpstan": "^1.10",
23+
"szepeviktor/phpstan-wordpress": "^1.3",
24+
"php-stubs/wp-cli-stubs": "^2.10"
2225
},
2326
"autoload": {
2427
"psr-4": {
@@ -50,6 +53,16 @@
5053
"coverage-html": [
5154
"Composer\\Config::disableProcessTimeout",
5255
"phpunit --coverage-html /var/www/wordpress/build/coverage"
56+
],
57+
58+
"php-cs-check": "php-cs-fixer fix src --dry-run --diff",
59+
"php-cs-fix": "php-cs-fixer fix src",
60+
"php-cs-fix-test": "php-cs-fixer fix tests",
61+
"phpstan": "phpstan analyse -c phpstan.neon --memory-limit=1G",
62+
"quality": [
63+
"@php-cs-fix",
64+
"@php-cs-fix-test",
65+
"@phpstan"
5366
]
5467
}
5568
}

0 commit comments

Comments
 (0)