generator/src/Method.php
private function removeString(string $string, string $search): string
    {
        $search = str_replace(' ', '\s+', $search);
        $result = preg_replace('/[\s\,]*'.$search.'/m', '', $string);
        if ($result === null) {
            throw new \RuntimeException('An error occurred while calling preg_replace');
        }
        return $result;
    }
private function removeString(string $string, string $search): string
    {
        $search = str_replace(' ', '\s+', $search);
        $result = preg_replace('/[\s\,]*'.$search.'/m', '', $string);
        if ($result === null) {
            throw new \RuntimeException('An error occurred while calling preg_replace');
        }
        return $result;
    }
private function removeString ( string $ string , string $ search ) : string { $ search = str_replace ( ' ' , '\s+' , $ search ) ; $ result = preg_replace ( '/[\s\,]*' . $ search . '/m' , '' , $ string ) ; if ( $ result === null ) { throw new \ RuntimeException ( 'An error occurred while calling preg_replace' ) ; } return $ result ; }
Removes a string, even if the string is split on multiple lines.
@param string $string
@param string $search
@return string
Removes a string even if the string is split on multiple lines .