[5.0] Changed type hint to a contract

Was originally part of #6648