diff --git a/.github/workflows/on_pull_request.yml b/.github/workflows/on_pull_request.yml index acd4281..f01853e 100644 --- a/.github/workflows/on_pull_request.yml +++ b/.github/workflows/on_pull_request.yml @@ -31,6 +31,10 @@ jobs: run: composer validate --strict --no-check-lock - name: Install Composer dependencies (with dev) run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader + - name: Run phpcs + run: composer phpcs + - name: Run phpstan + run: composer phpstan - name: Install Composer dependencies (without dev) run: composer install --no-progress --no-dev --no-suggest --prefer-dist --optimize-autoloader diff --git a/composer.json b/composer.json index 5c0b436..97b0c00 100644 --- a/composer.json +++ b/composer.json @@ -38,10 +38,12 @@ "sort-packages": true }, "require-dev": { + "phpstan/phpstan": "^2.1", "squizlabs/php_codesniffer": "^3.7" }, "scripts": { "phpcs": "phpcs", - "phpcbf": "phpcbf" + "phpcbf": "phpcbf", + "phpstan": "phpstan analyse" } } diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..7495716 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,10 @@ +parameters: + level: 8 + paths: + - src + + # Ignore tests directory for now + excludePaths: + - vendor/* + + reportUnmatchedIgnoredErrors: false diff --git a/src/ToArrayInterface.php b/src/ToArrayInterface.php index ae69005..f9ac03b 100644 --- a/src/ToArrayInterface.php +++ b/src/ToArrayInterface.php @@ -12,7 +12,7 @@ interface ToArrayInterface /** * Converts object to array * - * @return array + * @return array */ public function toArray(): array; }