Skip to content

Commit

Permalink
qa: add phpstan + baseline (temporarily)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukadschaak committed Nov 3, 2023
1 parent 82dc2a1 commit bcf1327
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ jobs:
- name: Check CS-Fixer
run: composer cs:check

# - name: Check PHPStan
# run: composer phpstan
- name: Check PHPStan
run: composer phpstan
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
"doctrine/orm": "^2.7",
"ergebnis/composer-normalize": "^2.6.1",
"friendsofphp/php-cs-fixer": "^3.0",
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.8",
"phpstan/phpstan-phpunit": "^1.1",
"phpstan/phpstan-symfony": "^1.2",
"phpunit/phpunit": "^9.3",
"vimeo/psalm": "^4.3"
},
Expand Down
56 changes: 56 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#2 \\$registry of class Neusta\\\\Pimcore\\\\TestingFramework\\\\Database\\\\PimcoreDatabaseResetter constructor expects Doctrine\\\\Persistence\\\\ManagerRegistry, object given\\.$#"
count: 1
path: src/Database/DatabaseResetter.php

-
message: "#^Method Neusta\\\\Pimcore\\\\TestingFramework\\\\Database\\\\PimcoreInstaller\\:\\:getDataFiles\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/Database/PimcoreInstaller.php

-
message: "#^Method Neusta\\\\Pimcore\\\\TestingFramework\\\\Database\\\\PimcoreInstaller\\:\\:getDataFiles\\(\\) should return array but returns array\\<int, string\\>\\|false\\.$#"
count: 1
path: src/Database/PimcoreInstaller.php

-
message: "#^PHPDoc tag @throws with type Doctrine\\\\DBAL\\\\DBALException is not subtype of Throwable$#"
count: 1
path: src/Database/PimcoreInstaller.php

-
message: "#^Parameter \\#1 \\$sql of method Doctrine\\\\DBAL\\\\Connection\\:\\:exec\\(\\) expects string, string\\|false given\\.$#"
count: 1
path: src/Database/PimcoreInstaller.php

-
message: "#^Parameter \\#2 \\$string of function explode expects string, string\\|false given\\.$#"
count: 1
path: src/Database/PimcoreInstaller.php

-
message: "#^Property Neusta\\\\Pimcore\\\\TestingFramework\\\\Database\\\\PimcoreInstaller\\:\\:\\$dumpLocation \\(string\\|null\\) does not accept string\\|false\\.$#"
count: 1
path: src/Database/PimcoreInstaller.php

-
message: "#^Method Neusta\\\\Pimcore\\\\TestingFramework\\\\Database\\\\RunCommand\\:\\:__invoke\\(\\) has parameter \\$parameters with no value type specified in iterable type array\\.$#"
count: 1
path: src/Database/RunCommand.php

-
message: "#^Method Pimcore\\\\Kernel\\:\\:configureContainer\\(\\) invoked with 1 parameter, 3 required\\.$#"
count: 1
path: src/Kernel/TestKernel.php

-
message: "#^Parameter \\#1 \\$bundle of method Pimcore\\\\HttpKernel\\\\BundleCollection\\\\BundleCollection\\:\\:addBundle\\(\\) expects string\\|Symfony\\\\Component\\\\HttpKernel\\\\Bundle\\\\BundleInterface, Pimcore\\\\Bundle\\\\AdminBundle\\\\PimcoreAdminBundle given\\.$#"
count: 1
path: src/Kernel/TestKernel.php

-
message: "#^Parameter \\#1 \\$name of static method Neusta\\\\Pimcore\\\\TestingFramework\\\\Pimcore\\\\BootstrapPimcore\\:\\:setEnv\\(\\) expects string, int\\|string given\\.$#"
count: 1
path: src/Pimcore/BootstrapPimcore.php
14 changes: 14 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
includes:
- phpstan-baseline.neon

parameters:

level: 8

paths:
- src

bootstrapFiles:
- vendor/pimcore/pimcore/stubs/dynamic-constants.php

checkGenericClassInNonGenericObjectType: false

0 comments on commit bcf1327

Please sign in to comment.