Skip to content

Commit

Permalink
Merge pull request #185 from olivernybroe/closure
Browse files Browse the repository at this point in the history
fix: Change closure to arrow to information level
  • Loading branch information
olivernybroe authored Oct 9, 2024
2 parents c9425ce + 75b6ff6 commit b6a2b1d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class ClosureToArrowFunctionInspection : PhpInspection() {
override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor {
return object : PhpElementVisitor() {
override fun visitPhpFunction(closure: Function) {
if (!isOnTheFly) return

// Check that the PHP version supports arrow functions
if (!PhpLanguageFeature.ARROW_FUNCTION_SYNTAX.isSupported(closure.project)) {
return
Expand Down Expand Up @@ -74,7 +76,7 @@ class ClosureToArrowFunctionInspection : PhpInspection() {
holder.registerProblem(
closure,
MyBundle.message("closureToArrowFunctionDescription"),
ProblemHighlightType.WEAK_WARNING,
ProblemHighlightType.INFORMATION,
ClosureToArrowFunctionQuickFix()
)
}
Expand Down

0 comments on commit b6a2b1d

Please sign in to comment.