Skip to content

Commit

Permalink
Merge pull request SnapInteractive#8 from rhowardiv/nonl
Browse files Browse the repository at this point in the history
Remove line breaks from error/warning messages
  • Loading branch information
rhowardiv committed Feb 15, 2013
2 parents a6aee2d + bad5553 commit 28594da
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions CodeSniffer/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,11 @@ public function addError($error, $stackPtr, $code='', $data=array(), $severity=0
if (empty($data) === true) {
$message = $error;
} else {
$message = vsprintf($error, $data);
$message = str_replace(
array("\r", "\n"),
array('\r', '\n'),
vsprintf($error, $data)
);
}

if (isset($this->_errors[$lineNum]) === false) {
Expand Down Expand Up @@ -927,7 +931,11 @@ public function addWarning($warning, $stackPtr, $code='', $data=array(), $severi
if (empty($data) === true) {
$message = $warning;
} else {
$message = vsprintf($warning, $data);
$message = str_replace(
array("\r", "\n"),
array('\r', '\n'),
vsprintf($warning, $data)
);
}

if (isset($this->_warnings[$lineNum]) === false) {
Expand Down

0 comments on commit 28594da

Please sign in to comment.