Skip to content

Commit

Permalink
feat: add phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim committed Oct 4, 2024
1 parent a4c7ffe commit 13ffdb2
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/php.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,19 @@ jobs:

- name: PHP CS Fixer
run: vendor/bin/php-cs-fixer fix --dry-run --diff
phpstan:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'

- name: Composer install
run: composer install

- name: PHPStan
run: vendor/bin/phpstan analyse
4 changes: 4 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
parameters:
level: max
paths:
- src
5 changes: 5 additions & 0 deletions src/Rule/InternalFunctionCallRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
use PHPStan\Rules\Rule;
use Shopware\PhpStan\Helper\NamespaceChecker;

/**
* @implements Rule<FuncCall>
*
* @internal
*/
class InternalFunctionCallRule implements Rule
{
private ReflectionProvider $reflectionProvider;
Expand Down
6 changes: 6 additions & 0 deletions src/Rule/InternalMethodCallRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
namespace Shopware\PhpStan\Rule;

use PhpParser\Node;
use PhpParser\Node\Expr\FuncCall;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Identifier;
use PHPStan\Analyser\Scope;
Expand All @@ -16,6 +17,11 @@
use PHPStan\Type\TypeUtils;
use Shopware\PhpStan\Helper\NamespaceChecker;

/**
* @implements Rule<MethodCall>
*
* @internal
*/
class InternalMethodCallRule implements Rule
{
public function __construct(private readonly ReflectionProvider $reflectionProvider) {}
Expand Down

0 comments on commit 13ffdb2

Please sign in to comment.