Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/ArcanistPhpcsLinter.php
| Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | public function getVersion() { | ||||
| $regex = '/^PHP_CodeSniffer version (?P<version>\d+\.\d+\.\d+)\b/'; | $regex = '/^PHP_CodeSniffer version (?P<version>\d+\.\d+\.\d+)\b/'; | ||||
| if (preg_match($regex, $stdout, $matches)) { | if (preg_match($regex, $stdout, $matches)) { | ||||
| return $matches['version']; | return $matches['version']; | ||||
| } else { | } else { | ||||
| return false; | return false; | ||||
| } | } | ||||
| } | } | ||||
| public function supportsReadDataFromStdin() { | |||||
| return true; | |||||
| } | |||||
| protected function parseLinterOutput($path, $err, $stdout, $stderr) { | protected function parseLinterOutput($path, $err, $stdout, $stderr) { | ||||
| // NOTE: Some version of PHPCS after 1.4.6 stopped printing a valid, empty | // NOTE: Some version of PHPCS after 1.4.6 stopped printing a valid, empty | ||||
| // XML document to stdout in the case of no errors. If PHPCS exits with | // XML document to stdout in the case of no errors. If PHPCS exits with | ||||
| // error 0, just ignore output. | // error 0, just ignore output. | ||||
| if (!$err) { | if (!$err) { | ||||
| return array(); | return array(); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines | |||||