[spatch] fix space issues with xhp

Test Plan: unit tests included

Reviewers: amenghra

CC: jcreed, bryano

Differential Revision: https://phabricator.fb.com/D1091786

Task ID: 3360024