diff --git a/classes/box.c b/classes/box.c index e1b60d9..1f77c58 100644 --- a/classes/box.c +++ b/classes/box.c @@ -79,7 +79,7 @@ PHP_METHOD(Box, __construct) break; default: - { /* throw */ } + php_ui_exception_ex(InvalidArgumentException, "Invalid value given for '$orientation'"); } } /* }}} */ @@ -185,7 +185,7 @@ PHP_METHOD(Box, setPadded) } /* }}} */ #if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(php_ui_box_is_padded_info, 0, 0, _IS_BOOL, NULL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(php_ui_box_is_padded_info, 0, 0, _IS_BOOL, 0) #else ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(php_ui_box_is_padded_info, 0, 0, _IS_BOOL, NULL, 0) #endif diff --git a/classes/entry.c b/classes/entry.c index ef4443e..655832f 100644 --- a/classes/entry.c +++ b/classes/entry.c @@ -23,6 +23,7 @@ #include #include +#include zend_object_handlers php_ui_entry_handlers; @@ -94,7 +95,7 @@ PHP_METHOD(Entry, __construct) break; default: - /* throw */ + php_ui_exception_ex(InvalidArgumentException, "Invalid value given for '$type'"); return; } diff --git a/classes/font.c b/classes/font.c index 633e676..128def0 100644 --- a/classes/font.c +++ b/classes/font.c @@ -23,6 +23,7 @@ #include #include +#include zend_object_handlers php_ui_font_handlers; @@ -85,7 +86,7 @@ PHP_METHOD(DrawTextFont, __construct) font->f = uiDrawLoadClosestFont(&d->d); if (!font->f) { - /* throw */ + php_ui_exception_ex(InvalidArgumentException, "Invalid font descriptor"); } } /* }}} */ diff --git a/classes/menu.c b/classes/menu.c index 2439e2d..b998bf5 100644 --- a/classes/menu.c +++ b/classes/menu.c @@ -23,6 +23,7 @@ #include #include +#include zend_object_handlers php_ui_menu_handlers; @@ -82,7 +83,7 @@ PHP_METHOD(Menu, append) } if (ZEND_NUM_ARGS() > 1 && !instanceof_function(type, uiItem_ce)) { - /* throw */ + php_ui_exception_ex(InvalidArgumentException, "Invalid value given for '$type'"); return; } @@ -108,7 +109,7 @@ PHP_METHOD(Menu, appendCheck) } if (ZEND_NUM_ARGS() > 1 && !instanceof_function(type, uiItem_ce)) { - /* throw */ + php_ui_exception_ex(InvalidArgumentException, "Invalid value given for '$type'"); return; } @@ -139,7 +140,7 @@ PHP_METHOD(Menu, appendQuit) } if (ZEND_NUM_ARGS() > 1 && !instanceof_function(type, uiItem_ce)) { - /* throw */ + php_ui_exception_ex(InvalidArgumentException, "Invalid value given for '$type'"); return; } @@ -162,7 +163,7 @@ PHP_METHOD(Menu, appendPreferences) } if (ZEND_NUM_ARGS() > 1 && !instanceof_function(type, uiItem_ce)) { - /* throw */ + php_ui_exception_ex(InvalidArgumentException, "Invalid value given for '$type'"); return; } @@ -185,7 +186,7 @@ PHP_METHOD(Menu, appendAbout) } if (ZEND_NUM_ARGS() > 1 && !instanceof_function(type, uiItem_ce)) { - /* throw */ + php_ui_exception_ex(InvalidArgumentException, "Invalid value given for '$type'"); return; } diff --git a/classes/multi.c b/classes/multi.c index 4accfba..ebdf334 100644 --- a/classes/multi.c +++ b/classes/multi.c @@ -23,6 +23,7 @@ #include #include +#include zend_object_handlers php_ui_multi_handlers; @@ -90,7 +91,7 @@ PHP_METHOD(Multi, __construct) break; default: - /* throw */ + php_ui_exception_ex(InvalidArgumentException, "Invalid value given for '$type'"); return; }