protected function filterReasonPhrase($text)
{
if (!(is_object($text) && method_exists($text, '__toString')) && !is_string($text)) {
throw new InvalidArgumentException('The reason phrase must be a string');
}
$text = trim($text);
if (preg_match(',[\\r\\n],', $text)) {
throw new InvalidArgumentException('The reason phrase can not contain carriage return characters');
}
return $text;
}