you need to assert that ``$actual[$key]`` is an array before calling the method to avoid a fatal error on the typehint