General type hint cleanup

* Remove unnecessary `is_object` checks, `instanceof` is enough.
* Add some missing type hints.
* Fix some `Snaks` type hints (not 100% sure about this, please have a look).
* Unify usage of `bool`.
* Add missing newlines at end of file.
You sure this does not cause notices when $object is null or a scalar?