
"""This module exports the Phpcs plugin class."""

from SublimeLinter.lint import Linter


class Phpcs(Linter):
    """Provides an interface to phpcs."""

    syntax = ('php', 'html', 'html 5')
    regex = (
        r'.*line="(?P<line>\d+)" '
        r'column="(?P<col>\d+)" '
        r'severity="(?:(?P<error>error)|(?P<warning>warning))" '
        r'message="(?P<message>.*)" source'
    )
    executable = 'phpcs'
    defaults = {
        '--standard=': 'PSR2',
    }
    inline_overrides = ('standard')
    tempfile_suffix = 'php'

    def cmd(self):
        """Read cmd from inline settings."""
        settings = Linter.get_view_settings(self)

        if 'cmd' in settings:
            command = [settings.get('cmd')]
        else:
            command = [self.executable_path]

        command.append('--report=checkstyle')

        return command


"""This module exports the Phpcs plugin class."""

from SublimeLinter.lint import Linter


class Phpcs(Linter):
    """Provides an interface to phpcs."""

    syntax = ('php', 'html', 'html 5')
    regex = (
        r'.*line="(?P<line>\d+)" '
        r'column="(?P<col>\d+)" '
        r'severity="(?:(?P<error>error)|(?P<warning>warning))" '
        r'message="(?P<message>.*)" source'
    )
    defaults = {
        '--standard=': 'PSR2',
    }
    inline_overrides = ('standard')
    tempfile_suffix = 'php'

    def cmd(self):
        """Read cmd from inline settings."""
        settings = Linter.get_view_settings(self)

        if 'cmd' in settings:
            command = [settings.get('cmd')]
        else:
            command = ['phpcs']

        command.append('--report=checkstyle')

        return command

Remove the executable property to allow override.
Remove the executable property to allow override.

This problem was discussed here : SublimeLinter/SublimeLinter#455

If the `executable` property is defined, the plugin require the host system to have a global `phpcs` binary. If I haven't that binary installed (eg. I use composer to install inside my project folder) and I use the `*.sublime-project` file to configure my linter, the phpcs linter is never executed.

```
{
    "folders":
    [
        {
            "path": "."
        }
    ],
    "SublimeLinter": {
        "linters": {
            "phpcs": {
                "standard": "${folder}/phpcs.xml",
                "cmd": "${folder}/vendor/bin/phpcs"
            }
        }
    }
}
```

With that update suggested by @kaste the global binary is returned only if the configuration doesn't defined a specific one.
  
  """This module exports the Phpcs plugin class."""
  
  from SublimeLinter.lint import Linter
  
  
  class Phpcs(Linter):
      """Provides an interface to phpcs."""
  
      syntax = ('php', 'html', 'html 5')
      regex = (
          r'.*line="(?P<line>\d+)" '
          r'column="(?P<col>\d+)" '
          r'severity="(?:(?P<error>error)|(?P<warning>warning))" '
          r'message="(?P<message>.*)" source'
      )
-     executable = 'phpcs'
      defaults = {
          '--standard=': 'PSR2',
      }
      inline_overrides = ('standard')
      tempfile_suffix = 'php'
  
      def cmd(self):
          """Read cmd from inline settings."""
          settings = Linter.get_view_settings(self)
  
          if 'cmd' in settings:
              command = [settings.get('cmd')]
          else:
-             command = [self.executable_path]
+             command = ['phpcs']
  
          command.append('--report=checkstyle')
  
          return command
  
Remove the executable property to allow override.
## Code Before:

"""This module exports the Phpcs plugin class."""

from SublimeLinter.lint import Linter


class Phpcs(Linter):
    """Provides an interface to phpcs."""

    syntax = ('php', 'html', 'html 5')
    regex = (
        r'.*line="(?P<line>\d+)" '
        r'column="(?P<col>\d+)" '
        r'severity="(?:(?P<error>error)|(?P<warning>warning))" '
        r'message="(?P<message>.*)" source'
    )
    executable = 'phpcs'
    defaults = {
        '--standard=': 'PSR2',
    }
    inline_overrides = ('standard')
    tempfile_suffix = 'php'

    def cmd(self):
        """Read cmd from inline settings."""
        settings = Linter.get_view_settings(self)

        if 'cmd' in settings:
            command = [settings.get('cmd')]
        else:
            command = [self.executable_path]

        command.append('--report=checkstyle')

        return command

## Instruction:
Remove the executable property to allow override.
## Code After:

"""This module exports the Phpcs plugin class."""

from SublimeLinter.lint import Linter


class Phpcs(Linter):
    """Provides an interface to phpcs."""

    syntax = ('php', 'html', 'html 5')
    regex = (
        r'.*line="(?P<line>\d+)" '
        r'column="(?P<col>\d+)" '
        r'severity="(?:(?P<error>error)|(?P<warning>warning))" '
        r'message="(?P<message>.*)" source'
    )
    defaults = {
        '--standard=': 'PSR2',
    }
    inline_overrides = ('standard')
    tempfile_suffix = 'php'

    def cmd(self):
        """Read cmd from inline settings."""
        settings = Linter.get_view_settings(self)

        if 'cmd' in settings:
            command = [settings.get('cmd')]
        else:
            command = ['phpcs']

        command.append('--report=checkstyle')

        return command
