I think you might write this block like so:
```php
return $this->getSLA()->getGracePeriod() - $dept->getWorkingHoursSince(
    $this->getSLA()->isRevolving() ? $this->ht['lastresponse'] : $this->ht['created']);
```