Skip to content

Commit

Permalink
Try make phpstan work
Browse files Browse the repository at this point in the history
  • Loading branch information
AydinHassan committed Jan 17, 2024
1 parent b69b32e commit 0cee804
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
39 changes: 23 additions & 16 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,38 @@ on:
workflow_dispatch:
schedule:
- cron: '0 3 * * *'

env:
SHOPWARE_TOOL_CACHE_PHPSTAN: ${{ github.workspace }}/var/phpstan
jobs:
cs:
if: github.event_name != 'schedule'
uses: shopware/github-actions/.github/workflows/cs-fixer.yml@main
phpstan:
uses: shopware/github-actions/.github/workflows/phpstan.yml@main
uses: shopware/github-actions/.github/workflows/phpstan.yml@phpstan-deps
with:
extensionName: SwagPayPal
shopwareVersion: trunk
dependencies: |-
[
{"name": "SwagCmsExtensions", "repo": "https://shopware:$CMS_TOKEN@gitlab.shopware.com/shopware/6/services/cms-extensions.git"}
]
secrets:
env: CMS_TOKEN=${{ secrets.GITLAB_TOKEN }}
phpunit:
runs-on: ubuntu-latest
steps:
- name: Setup Shopware
uses: FriendsOfShopware/setup-shopware@main
with:
shopware-version: trunk
php-version: 8.2
php-extensions: pcov
- name: Clone Extension
uses: actions/checkout@v4
with:
path: custom/plugins/SwagPayPal
- name: Run PHPUnit
working-directory: custom/plugins/SwagPayPal
run: ${{ github.workspace }}/vendor/bin/phpunit --coverage-clover clover.xml
uses: shopware/github-actions/.github/workflows/phpunit.yml@phpstan-deps
with:
uploadCoverage: true
extensionName: SwagPayPal
shopwareVersion: ${{ matrix.shopware-version }}
dependencies: |-
[
{"name": "SwagCmsExtensions", "repo": "https://shopware:$CMS_TOKEN@gitlab.shopware.com/shopware/6/services/cms-extensions.git"}
]
secrets:
env: CMS_TOKEN=${{ secrets.GITLAB_TOKEN }}
codecovToken: ${{ secrets.CODECOV_TOKEN }}




Expand Down
17 changes: 5 additions & 12 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
includes:
- %ShopwareRoot%/vendor/phpstan/phpstan/conf/bleedingEdge.neon
- ../../../vendor/phpstan/phpstan/conf/bleedingEdge.neon
- ../../../src/Core/DevOps/StaticAnalyze/PHPStan/extension.neon
- ../../../src/Core/DevOps/StaticAnalyze/PHPStan/rules.neon

parameters:
phpVersion: 80100
Expand All @@ -15,11 +17,10 @@ parameters:
excludePaths:
- src/Resources
- src/DevOps/Rector

symfony:
constant_hassers: false
# the placeholder "%ShopwareHashedCacheDir%" will be replaced on execution by bin/phpstan-config-generator.php script
container_xml_path: '../../..%ShopwareHashedCacheDir%/%ShopwareKernelClass%DevDebugContainer.xml'
containerXmlPath: '../../../var/cache/phpstan_dev/Shopware_Core_DevOps_StaticAnalyze_StaticAnalyzeKernelPhpstan_devDebugContainer.xml'
consoleApplicationLoader: ../../../src/Core/DevOps/StaticAnalyze/console-application.php

ignoreErrors:
# We won't type all arrays/iterables for now
Expand All @@ -45,11 +46,3 @@ parameters:
path: tests/Webhook/Registration/WebhookSystemConfigControllerTest.php
count: 11

bootstrapFiles:
- bin/static-analyze-autoloader.php

rules:
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\Internal\InternalClassRule
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\Internal\InternalClassRule
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\Internal\InternalMethodRule
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\PackageAnnotationRule
2 changes: 1 addition & 1 deletion tests/TestBootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
->setProjectDir($_SERVER['PROJECT_ROOT'] ?? dirname(__DIR__, 4))
->setLoadEnvFile(true)
->setForceInstallPlugins(true)
//->addActivePlugins('SwagCmsExtensions')
->addActivePlugins('SwagCmsExtensions')
->addCallingPlugin()
->bootstrap()
->getClassLoader();

0 comments on commit 0cee804

Please # to comment.