With the latter issue, you're running PHP 7.0+ code with a version of PHP that is less than 7.0.
With PHP 7.0 came the support of function type hinting, IE:
public function getIsServerRequest(): bool
This states that the function
getIsServerRequest will return a boolean, either
Make sure that you're running the correct version of PHP.
This may also solve the first issue once you have fixed the latter issue.