You can’t and shouldn’t echo something into a function’s arguments. The single_post_title()
function will echo the title by default. You should either set the second parameter to false, or use another function:
echo getDescription( single_post_title( '', false ) );
WordPress also offers the get_the_title()
function that returns the single post’s title which you can use here.
So, your code should be:
echo getDescription( get_the_title() );