diff --git a/configs/yaf_config_simple.c b/configs/yaf_config_simple.c index 1a3f73e2..4ede4c1e 100644 --- a/configs/yaf_config_simple.c +++ b/configs/yaf_config_simple.c @@ -101,6 +101,14 @@ PHP_METHOD(yaf_config_simple, set) { } /* }}} */ +/** {{{ proto public Yaf_Config_Simple::__set($name, $value) +*/ +PHP_METHOD(yaf_config_simple, __set) { + PHP_MN(yaf_config_simple_set)(INTERNAL_FUNCTION_PARAM_PASSTHRU); + RETURN_NULL(); +} +/* }}} */ + /** {{{ proto public Yaf_Config_Simple::readonly(void) */ PHP_METHOD(yaf_config_simple, readonly) { @@ -145,7 +153,7 @@ zend_function_entry yaf_config_simple_methods[] = { PHP_ME(yaf_config_simple, set, arginfo_class_Yaf_Config_Simple_set, ZEND_ACC_PUBLIC) PHP_ME(yaf_config_simple, readonly, arginfo_class_Yaf_Config_Simple_readonly, ZEND_ACC_PUBLIC) PHP_ME(yaf_config_simple, offsetUnset, arginfo_class_Yaf_Config_Simple_offsetUnSet, ZEND_ACC_PUBLIC) - PHP_MALIAS(yaf_config_simple, __set, set, arginfo_class_Yaf_Config_Simple___set, ZEND_ACC_PUBLIC) + PHP_ME(yaf_config_simple, __set, arginfo_class_Yaf_Config_Simple___set, ZEND_ACC_PUBLIC) PHP_MALIAS(yaf_config_simple, offsetSet, set, arginfo_class_Yaf_Config_Simple_offsetSet, ZEND_ACC_PUBLIC) {NULL, NULL, NULL} }; diff --git a/views/yaf_view_simple.c b/views/yaf_view_simple.c index d80e4f5f..8555c45d 100755 --- a/views/yaf_view_simple.c +++ b/views/yaf_view_simple.c @@ -505,6 +505,19 @@ PHP_METHOD(yaf_view_simple, assign) { } /* }}} */ +/** {{{ proto public Yaf_View_Simple::__set(mixed $value, mixed $value) +*/ +PHP_METHOD(yaf_view_simple, __set) { + yaf_view_object *view = Z_YAFVIEWOBJ_P(getThis()); + zval *value; + zend_string *name; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz", &name, &value) == FAILURE) { + return; + } + yaf_view_simple_assign_single(view, name, value); +} +/* }}} */ + /** {{{ proto public Yaf_View_Simple::assignRef(mixed $value, mixed &$value) */ PHP_METHOD(yaf_view_simple, assignRef) { @@ -647,8 +660,8 @@ zend_function_entry yaf_view_simple_methods[] = { PHP_ME(yaf_view_simple, setScriptPath, arginfo_class_Yaf_View_Simple_setScriptPath, ZEND_ACC_PUBLIC) PHP_ME(yaf_view_simple, getScriptPath, arginfo_class_Yaf_View_Simple_getScriptPath, ZEND_ACC_PUBLIC) PHP_ME(yaf_view_simple, __isset, arginfo_class_Yaf_View_Simple___isset, ZEND_ACC_PUBLIC) + PHP_ME(yaf_view_simple, __set, arginfo_class_Yaf_View_Simple___set, ZEND_ACC_PUBLIC) PHP_MALIAS(yaf_view_simple, __get, get, arginfo_class_Yaf_View_Simple___get, ZEND_ACC_PUBLIC) - PHP_MALIAS(yaf_view_simple, __set, assign, arginfo_class_Yaf_View_Simple___set, ZEND_ACC_PUBLIC) {NULL, NULL, NULL} }; /* }}} */ diff --git a/yaf_config.c b/yaf_config.c index f30aeb25..e1206e51 100644 --- a/yaf_config.c +++ b/yaf_config.c @@ -342,10 +342,8 @@ PHP_METHOD(yaf_config, next) { if (conf->config) { zend_hash_move_forward(conf->config); - RETURN_TRUE; } - - RETURN_FALSE; + return; } /* }}} */ diff --git a/yaf_controller.stub.php b/yaf_controller.stub.php index 85c49e2a..499810c8 100644 --- a/yaf_controller.stub.php +++ b/yaf_controller.stub.php @@ -6,13 +6,13 @@ abstract class Yaf_Controller_Abstract { /* constants */ /* properties */ - protected array $actions = NULL; - protected string $_module = NULL; - protected string $_name = NULL; - protected object $_request = NULL; - protected object $_response = NULL; - protected array $_invoke_args = NULL; - protected object $_view = NULL; + protected ?array $actions = NULL; + protected ?string $_module = NULL; + protected ?string $_name = NULL; + protected ?object $_request = NULL; + protected ?object $_response = NULL; + protected ?array $_invoke_args = NULL; + protected ?object $_view = NULL; /* methods */ @@ -38,7 +38,7 @@ final public function getView():?object; /** * @return Yaf_View_Interface|NULL */ - final public function initView(array $options = NULL):?object; + final public function initView(?array $options = NULL):?object; final public function setViewpath(string $view_directory):?bool; @@ -64,9 +64,9 @@ final public function getInvokeArg(string $name):?string; final public function getName():?string; - final protected function render(string $tpl, array $parameters = NULL):string|null|bool; + final protected function render(string $tpl, ?array $parameters = NULL):string|null|bool; - final protected function display(string $tpl, array $parameters = NULL):?bool; + final protected function display(string $tpl, ?array $parameters = NULL):?bool; } abstract class Yaf_Action_Abstract extends Yaf_Controller_Abstract { diff --git a/yaf_controller_arginfo.h b/yaf_controller_arginfo.h index 6ffc2da7..4e95beb0 100644 --- a/yaf_controller_arginfo.h +++ b/yaf_controller_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: c265ad91ca592d72f56f0603c262bcb90f0a1737 */ + * Stub hash: f6b3c770dde0187a7432deb7b9291bec34347c5b */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Yaf_Controller_Abstract___construct, 0, 0, 0) ZEND_END_ARG_INFO() @@ -15,7 +15,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_Yaf_Controller_Abstract_getView arginfo_class_Yaf_Controller_Abstract_getRequest ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Yaf_Controller_Abstract_initView, 0, 0, IS_OBJECT, 1) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "NULL") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "NULL") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Yaf_Controller_Abstract_setViewpath, 0, 1, _IS_BOOL, 1) @@ -46,12 +46,12 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Yaf_Controller_Abstract_render, 0, 1, MAY_BE_STRING|MAY_BE_NULL|MAY_BE_BOOL) ZEND_ARG_TYPE_INFO(0, tpl, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, parameters, IS_ARRAY, 0, "NULL") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, parameters, IS_ARRAY, 1, "NULL") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Yaf_Controller_Abstract_display, 0, 1, _IS_BOOL, 1) ZEND_ARG_TYPE_INFO(0, tpl, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, parameters, IS_ARRAY, 0, "NULL") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, parameters, IS_ARRAY, 1, "NULL") ZEND_END_ARG_INFO() #define arginfo_class_Yaf_Action_Abstract_execute arginfo_class_Yaf_Controller_Abstract___construct @@ -59,3 +59,4 @@ ZEND_END_ARG_INFO() #define arginfo_class_Yaf_Action_Abstract_getController arginfo_class_Yaf_Controller_Abstract_getRequest #define arginfo_class_Yaf_Action_Abstract_getControllerName arginfo_class_Yaf_Controller_Abstract_getModuleName + diff --git a/yaf_controller_legacy_arginfo.h b/yaf_controller_legacy_arginfo.h index 08edaf31..71a7778d 100644 --- a/yaf_controller_legacy_arginfo.h +++ b/yaf_controller_legacy_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: c265ad91ca592d72f56f0603c262bcb90f0a1737 */ + * Stub hash: f6b3c770dde0187a7432deb7b9291bec34347c5b */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Yaf_Controller_Abstract___construct, 0, 0, 0) ZEND_END_ARG_INFO() @@ -53,3 +53,4 @@ ZEND_END_ARG_INFO() #define arginfo_class_Yaf_Action_Abstract_getController arginfo_class_Yaf_Controller_Abstract___construct #define arginfo_class_Yaf_Action_Abstract_getControllerName arginfo_class_Yaf_Controller_Abstract___construct + diff --git a/yaf_session.stub.php b/yaf_session.stub.php index bc505f34..f7149d1b 100644 --- a/yaf_session.stub.php +++ b/yaf_session.stub.php @@ -5,8 +5,8 @@ final class Yaf_Session implements \Iterator, \Traversable, \ArrayAccess, \Count /* constants */ /* properties */ - static protected object $_instance = NULL; - protected array $_session = NULL; + static protected ?object $_instance = NULL; + protected ?array $_session = NULL; protected bool $_started = false; /* methods */ @@ -22,7 +22,7 @@ public static function getInstance():?object; */ public function start():object; - public function get(string $name = NULL):mixed; + public function get(?string $name = NULL):mixed; public function has(string $name):?bool; diff --git a/yaf_session_arginfo.h b/yaf_session_arginfo.h index eec3287c..a886e79e 100644 --- a/yaf_session_arginfo.h +++ b/yaf_session_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 61ccfe989e1c36218cc63866db9e781a671efd6e */ + * Stub hash: f10baf628eb99eafbf7d0d0baef833070aa0d3ba */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Yaf_Session___construct, 0, 0, 0) ZEND_END_ARG_INFO() @@ -11,7 +11,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Yaf_Session_start, 0, 0, I ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Yaf_Session_get, 0, 0, IS_MIXED, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 0, "NULL") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "NULL") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Yaf_Session_has, 0, 1, _IS_BOOL, 1) @@ -78,3 +78,4 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Yaf_Session___unset, 0, 1, IS_VOID, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() + diff --git a/yaf_session_legacy_arginfo.h b/yaf_session_legacy_arginfo.h index 188493e8..b1173151 100644 --- a/yaf_session_legacy_arginfo.h +++ b/yaf_session_legacy_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 61ccfe989e1c36218cc63866db9e781a671efd6e */ + * Stub hash: f10baf628eb99eafbf7d0d0baef833070aa0d3ba */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Yaf_Session___construct, 0, 0, 0) ZEND_END_ARG_INFO() @@ -52,3 +52,4 @@ ZEND_END_ARG_INFO() #define arginfo_class_Yaf_Session___set arginfo_class_Yaf_Session_set #define arginfo_class_Yaf_Session___unset arginfo_class_Yaf_Session_has + diff --git a/yaf_view.stub.php b/yaf_view.stub.php index f4872b6e..50c5a6f7 100644 --- a/yaf_view.stub.php +++ b/yaf_view.stub.php @@ -12,12 +12,12 @@ public function assign(string $name, mixed $value = NULL); /** * @return string|bool */ - public function render(string $tpl, array $tpl_vars = NULL); + public function render(string $tpl, ?array $tpl_vars = NULL); /** * @return Yaf_View_Interface|bool */ - public function display(string $tpl, array $tpl_vars = NULL); + public function display(string $tpl, ?array $tpl_vars = NULL); /** * @return bool @@ -39,11 +39,11 @@ final class Yaf_View_Simple implements Yaf_View_Interface { protected ?array $_options = NULL; /* methods */ - public function __construct(string $tempalte_dir, array $options = NULL) {} + public function __construct(string $tempalte_dir, ?array $options = NULL) {} public function __isset(string $name):bool {} - public function get(string $name = NULL):mixed {} + public function get(string $name):mixed {} /** * @return Yaf_View_Simple|NULL|FALSE @@ -59,12 +59,12 @@ public function display(string $tpl, ?array $tpl_vars = NULL):?bool {} /** * @return Yaf_View_Simple|NULL */ - public function assignRef(string $name = NULL, mixed &$value):?object {} + public function assignRef(?string $name = NULL, mixed &$value):?object {} /** * @return Yaf_View_Simple|NULL */ - public function clear(string $name = NULL):?object {} + public function clear(?string $name = NULL):?object {} /** * @return Yaf_View_Simple|NULL|FALSE @@ -74,7 +74,7 @@ public function setScriptPath(string $template_dir):object|null|bool {} public function getScriptPath():?string {} /** @implementation-alias Yaf_View_Simple::get */ - public function __get(string $name = NULL):mixed {} + public function __get(string $name):mixed {} /** @implementation-alias Yaf_View_Simple::assign */ public function __set(string $name, mixed $value):void {} diff --git a/yaf_view_arginfo.h b/yaf_view_arginfo.h index 566aa140..a782e21d 100644 --- a/yaf_view_arginfo.h +++ b/yaf_view_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 5d45d131328e5f80f5df131f65cd8018d12574b8 */ + * Stub hash: 45071bca670049bd8ac3f1a2ea5611c022466ade */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Yaf_View_Interface_assign, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) @@ -8,7 +8,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Yaf_View_Interface_render, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, tpl, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, tpl_vars, IS_ARRAY, 0, "NULL") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, tpl_vars, IS_ARRAY, 1, "NULL") ZEND_END_ARG_INFO() #define arginfo_class_Yaf_View_Interface_display arginfo_class_Yaf_View_Interface_render @@ -22,15 +22,15 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Yaf_View_Simple___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, tempalte_dir, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "NULL") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "NULL") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Yaf_View_Simple___isset, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Yaf_View_Simple_get, 0, 0, IS_MIXED, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 0, "NULL") +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Yaf_View_Simple_get, 0, 1, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Yaf_View_Simple_assign, 0, 0, MAY_BE_OBJECT|MAY_BE_NULL|MAY_BE_FALSE) @@ -54,12 +54,12 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Yaf_View_Simple_display, 0 ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Yaf_View_Simple_assignRef, 0, 2, IS_OBJECT, 1) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 0, "NULL") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "NULL") ZEND_ARG_TYPE_INFO(1, value, IS_MIXED, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Yaf_View_Simple_clear, 0, 0, IS_OBJECT, 1) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 0, "NULL") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "NULL") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Yaf_View_Simple_setScriptPath, 0, 1, MAY_BE_OBJECT|MAY_BE_NULL|MAY_BE_BOOL) @@ -75,3 +75,4 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Yaf_View_Simple___set, 0, ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) ZEND_END_ARG_INFO() + diff --git a/yaf_view_legacy_arginfo.h b/yaf_view_legacy_arginfo.h index 50599adc..6878e4f3 100644 --- a/yaf_view_legacy_arginfo.h +++ b/yaf_view_legacy_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 5d45d131328e5f80f5df131f65cd8018d12574b8 */ + * Stub hash: 45071bca670049bd8ac3f1a2ea5611c022466ade */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Yaf_View_Interface_assign, 0, 0, 1) ZEND_ARG_INFO(0, name) @@ -29,9 +29,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Yaf_View_Simple___isset, 0, 0, 1) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Yaf_View_Simple_get, 0, 0, 0) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO() +#define arginfo_class_Yaf_View_Simple_get arginfo_class_Yaf_View_Simple___isset ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Yaf_View_Simple_assign, 0, 0, 0) ZEND_ARG_INFO(0, name) @@ -52,15 +50,18 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Yaf_View_Simple_assignRef, 0, 0, 2) ZEND_ARG_INFO(1, value) ZEND_END_ARG_INFO() -#define arginfo_class_Yaf_View_Simple_clear arginfo_class_Yaf_View_Simple_get +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Yaf_View_Simple_clear, 0, 0, 0) + ZEND_ARG_INFO(0, name) +ZEND_END_ARG_INFO() #define arginfo_class_Yaf_View_Simple_setScriptPath arginfo_class_Yaf_View_Interface_setScriptPath #define arginfo_class_Yaf_View_Simple_getScriptPath arginfo_class_Yaf_View_Interface_getScriptPath -#define arginfo_class_Yaf_View_Simple___get arginfo_class_Yaf_View_Simple_get +#define arginfo_class_Yaf_View_Simple___get arginfo_class_Yaf_View_Simple___isset ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Yaf_View_Simple___set, 0, 0, 2) ZEND_ARG_INFO(0, name) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() +