Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/ArcanistPhpcsLinter.php
Context not available. | |||||
$matches = array(); | $matches = array(); | ||||
$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; | ||||
Context not available. | |||||
} | } | ||||
protected function getDefaultMessageSeverity($code) { | protected function getDefaultMessageSeverity($code) { | ||||
if (preg_match('/^PHPCS\\.W\\./', $code)) { | if (@preg_match('/^PHPCS\\.W\\./', $code)) { | ||||
return ArcanistLintSeverity::SEVERITY_WARNING; | return ArcanistLintSeverity::SEVERITY_WARNING; | ||||
} else { | } else { | ||||
return ArcanistLintSeverity::SEVERITY_ERROR; | return ArcanistLintSeverity::SEVERITY_ERROR; | ||||
Context not available. | |||||
} | } | ||||
protected function getLintCodeFromLinterConfigurationKey($code) { | protected function getLintCodeFromLinterConfigurationKey($code) { | ||||
if (!preg_match('/^PHPCS\\.(E|W)\\./', $code)) { | if (!@preg_match('/^PHPCS\\.(E|W)\\./', $code)) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
"Invalid severity code '%s', should begin with '%s.'.", | "Invalid severity code '%s', should begin with '%s.'.", | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0