$URL needs to be replaced and the Deprecation::notice() should be outside the callback so it's only called once. If those does go into 3.1, I'd prefer passing in a code string to be deprecated then.