From 7507fa01c22a81858b8df96ee4377251f794e2db Mon Sep 17 00:00:00 2001 From: Pavel Kvach Date: Thu, 11 Jan 2024 10:01:01 +0200 Subject: [PATCH] THRIFT-5753 PHP 8.1 deprecated warning about return type in jsonSerialize functions --- compiler/cpp/src/thrift/generate/t_php_generator.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/cpp/src/thrift/generate/t_php_generator.cc b/compiler/cpp/src/thrift/generate/t_php_generator.cc index 5e02b9b69..837385868 100644 --- a/compiler/cpp/src/thrift/generate/t_php_generator.cc +++ b/compiler/cpp/src/thrift/generate/t_php_generator.cc @@ -1285,6 +1285,7 @@ void t_php_generator::generate_php_struct_required_validator(ostream& out, void t_php_generator::generate_php_struct_json_serialize(ostream& out, t_struct* tstruct, bool is_result) { + indent(out) << "#[\\ReturnTypeWillChange]" << endl; indent(out) << "public function jsonSerialize() {" << endl; indent_up();