Because there is no return value typehinting in DataObject::canView, the value returned from that method can be of any type. We must cast to boolean before returning the value to avoid possible errors with non-boolean return types.