Skip to content

Commit

Permalink
phpstan setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sasezaki committed Jun 14, 2020
1 parent cc4c218 commit 6fc71fe
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
/phpcs.xml export-ignore
/phpunit.xml.dist export-ignore
/test/ export-ignore
/phpstan.neon.dist export-ignore
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
/laminas-mkdoc-theme/
/phpunit.xml
/vendor/
/phpstan.neon
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"mikey179/vfsstream": "^1.6.8",
"ocramius/proxy-manager": "^2.1.1",
"phpbench/phpbench": "^0.13.0",
"phpstan/phpstan": "^0.12.28",
"phpunit/phpunit": "^7.5.20"
},
"provide": {
Expand Down
82 changes: 82 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
parameters:
ignoreErrors:
-
message: "#^Return typehint of method Laminas\\\\ServiceManager\\\\AbstractFactory\\\\ReflectionBasedAbstractFactory\\:\\:__invoke\\(\\) has invalid type Laminas\\\\ServiceManager\\\\AbstractFactory\\\\DispatchableInterface\\.$#"
count: 1
path: src/AbstractFactory/ReflectionBasedAbstractFactory.php

-
message: "#^PHPDoc tag @param has invalid value \\(\\$name\\)\\: Unexpected token \"\\$name\", expected type at offset 133$#"
count: 1
path: src/AbstractFactoryInterface.php

-
message: "#^PHPDoc tag @param has invalid value \\(\\$requestedName\\)\\: Unexpected token \"\\$requestedName\", expected type at offset 153$#"
count: 1
path: src/AbstractFactoryInterface.php

-
message: "#^PHPDoc tag @param has invalid value \\(\\$name\\)\\: Unexpected token \"\\$name\", expected type at offset 111$#"
count: 1
path: src/AbstractFactoryInterface.php

-
message: "#^PHPDoc tag @param has invalid value \\(\\$requestedName\\)\\: Unexpected token \"\\$requestedName\", expected type at offset 131$#"
count: 1
path: src/AbstractFactoryInterface.php

-
message: "#^PHPDoc tag @throws with type Laminas\\\\ServiceManager\\\\Exception\\\\ServiceNotCreatedException\\|Laminas\\\\ServiceManager\\\\Exception\\\\ServiceNotFoundException\\|Laminas\\\\ServiceManager\\\\Factory\\\\ContainerException is not subtype of Throwable$#"
count: 1
path: src/Factory/DelegatorFactoryInterface.php

-
message: "#^PHPDoc tag @throws with type Laminas\\\\ServiceManager\\\\Exception\\\\ServiceNotCreatedException\\|Laminas\\\\ServiceManager\\\\Exception\\\\ServiceNotFoundException\\|Laminas\\\\ServiceManager\\\\Factory\\\\ContainerException is not subtype of Throwable$#"
count: 1
path: src/Factory/FactoryInterface.php

-
message: "#^PHPDoc tag @param has invalid value \\(\\$instance\\)\\: Unexpected token \"\\$instance\", expected type at offset 43$#"
count: 1
path: src/InitializerInterface.php

-
message: "#^PHPDoc tag @throws with type Laminas\\\\ServiceManager\\\\ContainerException\\|Laminas\\\\ServiceManager\\\\Exception\\\\InvalidServiceException is not subtype of Throwable$#"
count: 1
path: src/PluginManagerInterface.php

-
message: "#^PHPDoc tag @throws with type Psr\\\\Container\\\\ContainerExceptionInterface is not subtype of Throwable$#"
count: 1
path: src/ServiceLocatorInterface.php

-
message: "#^PHPDoc tag @param has invalid value \\(bool\\)\\: Unexpected token \"\\\\n \", expected variable at offset 89$#"
count: 1
path: src/ServiceManager.php

-
message: "#^Closure invoked with 4 parameters, 0 required\\.$#"
count: 1
path: src/ServiceManager.php

-
message: "#^PHPDoc tag @throws with type Laminas\\\\ServiceManager\\\\Exception\\\\ExceptionInterface is not subtype of Throwable$#"
count: 1
path: src/ServiceManager.php

-
message: "#^PHPDoc tag @param references unknown parameter\\: \\$abstractFactories$#"
count: 1
path: src/ServiceManager.php

-
message: "#^PHPDoc tag @param has invalid value \\(\\$className\\)\\: Unexpected token \"\\$className\", expected type at offset 18$#"
count: 1
path: src/Tool/ConfigDumper.php

-
message: "#^PHPDoc tag @param has invalid value \\(\\$className\\)\\: Unexpected token \"\\$className\", expected type at offset 18$#"
count: 1
path: src/Tool/FactoryCreator.php

7 changes: 7 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
includes:
- phpstan-baseline.neon

parameters:
level: 3
paths:
- src

0 comments on commit 6fc71fe

Please sign in to comment.