private function getErrorOutput(array $problems, Repository $repository) : string
    {
        $err  = count($problems);
        $head = [
            IOUtil::getLineSeparator(80, '-'),
            'CAPTAINHOOK FOUND ' . $err . ' PROBLEM' . ($err === 1 ? '' : 'S') . ' IN YOUR COMMIT MESSAGE',
            IOUtil::getLineSeparator(80, '-')
        ];
        $msg  = OutputUtil::trimEmptyLines($repository->getCommitMsg()->getLines());

        $lines = [IOUtil::getLineSeparator(80, '-')];
        foreach ($problems as $problem) {
            $lines[] = '  ' . $this->formatProblem($problem);
        }

        $lines[] = IOUtil::getLineSeparator(80, '-');

        return implode(PHP_EOL, array_merge($head, $msg, $lines));
    }
private function getErrorOutput(array $problems, Repository $repository) : string
    {
        $err  = count($problems);
        $head = [
            IOUtil::getLineSeparator(80, '-'),
            'CAPTAINHOOK FOUND ' . $err . ' PROBLEM' . ($err === 1 ? '' : 'S') . ' IN YOUR COMMIT MESSAGE',
            IOUtil::getLineSeparator(80, '-')
        ];
        $msg  = OutputUtil::trimEmptyLines($repository->getCommitMsg()->getLines());

        $lines = [IOUtil::getLineSeparator(80, '-')];
        foreach ($problems as $problem) {
            $lines[] = '  ' . $this->formatProblem($problem);
        }

        $lines[] = IOUtil::getLineSeparator(80, '-');

        return implode(PHP_EOL, array_merge($head, $msg, $lines));
    }
private function getErrorOutput ( array $ problems , Repository $ repository ) : string { $ err = count ( $ problems ) ; $ head = [ IOUtil :: getLineSeparator ( 80 , '-' ) , 'CAPTAINHOOK FOUND ' . $ err . ' PROBLEM' . ( $ err === 1 ? '' : 'S' ) . ' IN YOUR COMMIT MESSAGE' , IOUtil :: getLineSeparator ( 80 , '-' ) ] ; $ msg = OutputUtil :: trimEmptyLines ( $ repository -> getCommitMsg ( ) -> getLines ( ) ) ; $ lines = [ IOUtil :: getLineSeparator ( 80 , '-' ) ] ; foreach ( $ problems as $ problem ) { $ lines [ ] = '  ' . $ this -> formatProblem ( $ problem ) ; } $ lines [ ] = IOUtil :: getLineSeparator ( 80 , '-' ) ; return implode ( PHP_EOL , array_merge ( $ head , $ msg , $ lines ) ) ; }
Format the error output

@param  array                             $problems
@param  \SebastianFeldmann\Git\Repository $repository
@return string
Format the error output