If you're looking to save space, you could try something like this:

    if ( $description === null ) {
        $description = ArticleMetaDescriptionHelpers::descriptionFromMessage( $wgTitle) ?: ArticleMetaDescriptionHelpers::descriptionFromSnippet( $wgTitle );
    }