diff --git a/linter.py b/linter.py index 57d3c94..e5876cb 100644 --- a/linter.py +++ b/linter.py @@ -10,7 +10,15 @@ """This module exports the Phpmd plugin class.""" -from SublimeLinter.lint import highlight, Linter +import SublimeLinter +from SublimeLinter.lint import Linter + +if getattr(SublimeLinter.lint, 'VERSION', 3) > 3: + from SublimeLinter.lint import const + WARNING = const.WARNING +else: + from SublimeLinter.lint import highlight + WARNING = highlight.WARNING class Phpmd(Linter): @@ -23,7 +31,7 @@ class Phpmd(Linter): r'(?P.+):(?P\d+)' r'\s*(?P.+)$' ) - default_type = highlight.WARNING + default_type = WARNING tempfile_suffix = 'php' defaults = { '@rulesets:,': 'cleancode,codesize,controversial,design,naming,unusedcode'