From 1c76000e380992e511b16e2a9b8a6422e2947971 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Fri, 21 Jan 2022 16:34:59 +1300 Subject: [PATCH] [php] Add type declarations for optional params too See #2151 --- Source/Modules/php.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Modules/php.cxx b/Source/Modules/php.cxx index 226ca73ad..0437138c3 100644 --- a/Source/Modules/php.cxx +++ b/Source/Modules/php.cxx @@ -747,6 +747,10 @@ public: Printf(arginfo_code, "ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_###, 0, 0, %d)\n", num_required); } + if (Getattr(n, "defaultargs")) { + // Include parameters with default values in the arginfo. + l = Getattr(Getattr(n, "defaultargs"), "parms"); + } int param_count = 0; for (Parm *p = l; p; p = Getattr(p, "tmap:in:next")) { String *tmap_in_numinputs = Getattr(p, "tmap:in:numinputs");