protected function parseMessages($lines) {
    $messages = array();

    $message = array();
    foreach ($lines as $line) {
      if (empty($line) & !empty($message)) {
        $messages[] = $message;
        $message = array();
        continue;
      }
      $message[] = $line;
    }

    return $messages;
  }
protected function parseMessages($lines) {
    $messages = array();

    $message = array();
    foreach ($lines as $line) {
      if (empty($line) & !empty($message)) {
        $messages[] = $message;
        $message = array();
        continue;
      }
      $message[] = $line;
    }

    return $messages;
  }
protected function parseMessages ( $ lines ) { $ messages = array ( ) ; $ message = array ( ) ; foreach ( $ lines as $ line ) { if ( empty ( $ line ) & ! empty ( $ message ) ) { $ messages [ ] = $ message ; $ message = array ( ) ; continue ; } $ message [ ] = $ line ; } return $ messages ; }
Parse output into separate messages.

@param array $lines Array of CLI output lines.

@return array Array of arrays of message lines.
Parse output into separate messages .