Skip to content

Commit

Permalink
Merge pull request #184 from olivernybroe/batch-mode
Browse files Browse the repository at this point in the history
fix: fix information inspections running in batch mode
  • Loading branch information
olivernybroe authored Oct 9, 2024
2 parents b6a2b1d + 7f74f3b commit a98863f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class ArrayMapToCollectionInspection : PhpInspection() {
override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor {
return object : PhpElementVisitor() {
override fun visitPhpFunctionCall(reference: FunctionReference) {
if (!isOnTheFly) return

if (!reference.isGlobalFunctionCallWithName("array_map")) {
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class ForeachToCollectionInspection : PhpInspection() {
override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor {
return object : PhpElementVisitor() {
override fun visitPhpForeach(foreach: ForeachStatement) {
if (!isOnTheFly) return

holder.registerProblem(
foreach,
MyBundle.message("foreachToCollectionDescription"),
Expand Down

0 comments on commit a98863f

Please sign in to comment.