Use typed properties in ext/curl

This commit is contained in:
Máté Kocsis 2021-04-20 00:09:07 +02:00
parent c4a749c932
commit 750b04a6e1
2 changed files with 7 additions and 10 deletions

View file

@ -4,12 +4,9 @@
class CURLFile
{
/** @var string */
public $name = "";
/** @var string */
public $mime = "";
/** @var string */
public $postname = "";
public string $name = "";
public string $mime = "";
public string $postname = "";
public function __construct(string $filename, ?string $mime_type = null, ?string $posted_filename = null) {}

View file

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: fdeef1c2a9e835b443d6e4cced23656ce21d8a30 */
* Stub hash: 1c292af8bd32226f740bc1df947acbc162d56448 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_CURLFile___construct, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
@ -64,19 +64,19 @@ static zend_class_entry *register_class_CURLFile(void)
zval property_name_default_value;
ZVAL_EMPTY_STRING(&property_name_default_value);
zend_string *property_name_name = zend_string_init("name", sizeof("name") - 1, 1);
zend_declare_property_ex(class_entry, property_name_name, &property_name_default_value, ZEND_ACC_PUBLIC, NULL);
zend_declare_typed_property(class_entry, property_name_name, &property_name_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING));
zend_string_release(property_name_name);
zval property_mime_default_value;
ZVAL_EMPTY_STRING(&property_mime_default_value);
zend_string *property_mime_name = zend_string_init("mime", sizeof("mime") - 1, 1);
zend_declare_property_ex(class_entry, property_mime_name, &property_mime_default_value, ZEND_ACC_PUBLIC, NULL);
zend_declare_typed_property(class_entry, property_mime_name, &property_mime_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING));
zend_string_release(property_mime_name);
zval property_postname_default_value;
ZVAL_EMPTY_STRING(&property_postname_default_value);
zend_string *property_postname_name = zend_string_init("postname", sizeof("postname") - 1, 1);
zend_declare_property_ex(class_entry, property_postname_name, &property_postname_default_value, ZEND_ACC_PUBLIC, NULL);
zend_declare_typed_property(class_entry, property_postname_name, &property_postname_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING));
zend_string_release(property_postname_name);
return class_entry;