@@ -30,6 +30,12 @@ void GtkLabel_::__construct(Php::Parameters ¶meters)
3030
3131void GtkLabel_::set_text (Php::Parameters ¶meters)
3232{
33+ if (!parameters[0 ].isString ()) {
34+ std::string error_msg = " GtkLabel::set_text: First parameter (text) must be a string, " ;
35+ error_msg += phpgtk_type_to_string (parameters[0 ].type ());
36+ error_msg += " given" ;
37+ throw Php::Exception (error_msg);
38+ }
3339 std::string s_str = parameters[0 ];
3440 gchar *str = (gchar *)s_str.c_str ();
3541
@@ -39,6 +45,12 @@ void GtkLabel_::set_text(Php::Parameters ¶meters)
3945
4046void GtkLabel_::set_markup (Php::Parameters ¶meters)
4147{
48+ if (!parameters[0 ].isString ()) {
49+ std::string error_msg = " GtkLabel::set_markup: First parameter (markup) must be a string, " ;
50+ error_msg += phpgtk_type_to_string (parameters[0 ].type ());
51+ error_msg += " given" ;
52+ throw Php::Exception (error_msg);
53+ }
4254 std::string s_str = parameters[0 ];
4355 gchar *str = (gchar *)s_str.c_str ();
4456
@@ -48,6 +60,12 @@ void GtkLabel_::set_markup(Php::Parameters ¶meters)
4860
4961void GtkLabel_::set_markup_with_mnemonic (Php::Parameters ¶meters)
5062{
63+ if (!parameters[0 ].isString ()) {
64+ std::string error_msg = " GtkLabel::set_markup_with_mnemonic: First parameter (markup) must be a string, " ;
65+ error_msg += phpgtk_type_to_string (parameters[0 ].type ());
66+ error_msg += " given" ;
67+ throw Php::Exception (error_msg);
68+ }
5169 std::string s_str = parameters[0 ];
5270 gchar *str = (gchar *)s_str.c_str ();
5371
@@ -176,6 +194,12 @@ void GtkLabel_::set_selectable(Php::Parameters ¶meters)
176194
177195void GtkLabel_::set_text_with_mnemonic (Php::Parameters ¶meters)
178196{
197+ if (!parameters[0 ].isString ()) {
198+ std::string error_msg = " GtkLabel::set_text_with_mnemonic: First parameter (text) must be a string, " ;
199+ error_msg += phpgtk_type_to_string (parameters[0 ].type ());
200+ error_msg += " given" ;
201+ throw Php::Exception (error_msg);
202+ }
179203 std::string s_str = parameters[0 ];
180204 gchar *str = (gchar *)s_str.c_str ();
181205
0 commit comments