adds logic discussed in #275

expands upon https://github.com/bshaffer/oauth2-server-php/pull/275 as discussed in https://github.com/bshaffer/oauth2-server-php/pull/275#issuecomment-30694555