Neos\Flow\Error\AbstractExceptionHandler::splitExceptionMessage PHP Метод

splitExceptionMessage() защищенный Метод

Splits the given string into subject and body according to following rules: - If the string is empty or does not contain more than one sentence nor line breaks, the subject will be equal to the string and body will be an empty string - Otherwise the subject is everything until the first line break or end of sentence, the body contains the rest
protected splitExceptionMessage ( string $exceptionMessage ) : array
$exceptionMessage string
Результат array in the format array('subject' => '', 'body' => '');
    protected function splitExceptionMessage($exceptionMessage)
    {
        $body = '';
        $pattern = '/
			(?<=                # Begin positive lookbehind.
			  [.!?]\\s           # Either an end of sentence punct,
			| \\n                # or line break
			)
			(?<!                # Begin negative lookbehind.
			  i\\.E\\.\\s          # Skip "i.E."
			)                   # End negative lookbehind.
			/ix';
        $sentences = preg_split($pattern, $exceptionMessage, 2, PREG_SPLIT_NO_EMPTY);
        if (!isset($sentences[1])) {
            $subject = $exceptionMessage;
        } else {
            $subject = trim($sentences[0]);
            $body = trim($sentences[1]);
        }
        return ['subject' => $subject, 'body' => $body];
    }