Skip to content

Commit

Permalink
make phpstan warn about misused functions/statements (#2886)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmachughes authored Jan 6, 2025
1 parent c197be8 commit d0b61f3
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 1 deletion.
1 change: 1 addition & 0 deletions sourcecode/hub/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"require-dev": {
"barryvdh/laravel-ide-helper": "^3.2.2",
"cache/array-adapter": "^1.2",
"ekino/phpstan-banned-code": "^3.0",
"fakerphp/faker": "^1.24.1",
"larastan/larastan": "^3",
"laravel/dusk": "^8.2.12",
Expand Down
68 changes: 67 additions & 1 deletion sourcecode/hub/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions sourcecode/hub/phpstan.dist.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
includes:
- vendor/ekino/phpstan-banned-code/extension.neon
- vendor/larastan/larastan/extension.neon
- phpstan-baseline.neon

Expand All @@ -17,3 +18,21 @@ parameters:
checkModelProperties: true

treatPhpDocTypesAsCertain: false

banned_code:
nodes:
-
type: Expr_FuncCall
functions:
- dd
- dump
- phpinfo
- print_r
- printf
- var_dump
- { type: Expr_ShellExec, functions: null }
- { type: Stmt_Echo, functions: null }
- { type: Stmt_Exit, functions: null }
- { type: Stmt_Print, functions: null }

use_from_tests: true

0 comments on commit d0b61f3

Please sign in to comment.