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

PHPStan fixes #198

Merged
merged 14 commits into from
Oct 13, 2024
Merged
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ anchors:
default_job_config: &default_job_config
working_directory: /home/circleci/plugin
machine:
image: ubuntu-2004:202201-02
image: default

jobs:
build_package_release:
Expand Down
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ phpunit.xml.dist export-ignore
README.md export-ignore
strauss.phar export-ignore
build export-ignore
tests
tests export-ignore
phpstan-stubs export-ignore

/.circleci export-ignore
/.github export-ignore
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
matrix:
php-versions: ['7.3', '7.4', '7.2']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -24,13 +24,15 @@ jobs:
run: composer validate
- name: Cache dependencies
id: cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-build-${{ matrix.php-versions }}-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-build-${{ matrix.php-versions }}-
- name: Install dependencies
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{secrets.COMPOSER_AUTH}}"} }'
if: steps.cache.outputs.cache-hit != 'true'
# We run `--no-scripts` to avoid using Strauss during unit tests
run: composer install --prefer-dist --no-progress --no-scripts
Expand All @@ -40,5 +42,8 @@ jobs:
- name: Run linter
run: composer run-script linter

- name: Run PHPStan
run: composer run-script analyse

- name: Run test suite
run: composer run-script test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ vendor_prefixed
!vendor_prefixed/.gitkeep
!build/strauss.phar
!build/vendor_prefixed/.gitkeep
phpstan.neon
27 changes: 24 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,40 @@
"GFExcel\\": "src/"
}
},
"repositories": [
{
"type": "vcs",
"url": "[email protected]:gravityforms/gravityforms.git"
},
{
"type": "package",
"package": {
"name": "gravityforms/gravitysurvey",
"version": "dev-master",
"source": {
"type": "git",
"url": "[email protected]:gravityforms/gravityformssurvey.git",
"reference": "HEAD"
}
}
}
],
"autoload-dev": {
"psr-4": {
"GFExcel\\Tests\\": "tests/"
}
},
"require-dev": {
"gravityforms/gravityforms": "dev-master",
"gravityforms/gravitysurvey": "dev-master",
"phpunit/phpunit": "7.5.*",
"10up/wp_mock": "0.4.*",
"szepeviktor/phpstan-wordpress": "^0.6.2",
"phpstan/phpstan-mockery": "^0.12.5",
"szepeviktor/phpstan-wordpress": "^1.0",
"phpstan/phpstan-mockery": "^1.1",
"overtrue/phplint": "^2.1"
},
"scripts": {
"unbuild": "rm -rf build/composer.* build/vendor build/src",
"unbuild": "rm -rf build/composer.* build/vendor*/* build/src",
"build": [
"@unbuild",
"cp composer.json build/composer.json",
Expand All @@ -64,6 +84,7 @@
],
"linter": "vendor/bin/phplint --no-cache",
"test": "vendor/bin/phpunit",
"analyse": "vendor/bin/phpstan",
"post-install-cmd": [
"composer dump-autoload -o"
],
Expand Down
Loading