Skip to content

Commit 750b04a

Browse files
committed
Use typed properties in ext/curl
1 parent c4a749c commit 750b04a

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

ext/curl/curl_file.stub.php

+3-6
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@
44

55
class CURLFile
66
{
7-
/** @var string */
8-
public $name = "";
9-
/** @var string */
10-
public $mime = "";
11-
/** @var string */
12-
public $postname = "";
7+
public string $name = "";
8+
public string $mime = "";
9+
public string $postname = "";
1310

1411
public function __construct(string $filename, ?string $mime_type = null, ?string $posted_filename = null) {}
1512

ext/curl/curl_file_arginfo.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: fdeef1c2a9e835b443d6e4cced23656ce21d8a30 */
2+
* Stub hash: 1c292af8bd32226f740bc1df947acbc162d56448 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_CURLFile___construct, 0, 0, 1)
55
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
@@ -64,19 +64,19 @@ static zend_class_entry *register_class_CURLFile(void)
6464
zval property_name_default_value;
6565
ZVAL_EMPTY_STRING(&property_name_default_value);
6666
zend_string *property_name_name = zend_string_init("name", sizeof("name") - 1, 1);
67-
zend_declare_property_ex(class_entry, property_name_name, &property_name_default_value, ZEND_ACC_PUBLIC, NULL);
67+
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));
6868
zend_string_release(property_name_name);
6969

7070
zval property_mime_default_value;
7171
ZVAL_EMPTY_STRING(&property_mime_default_value);
7272
zend_string *property_mime_name = zend_string_init("mime", sizeof("mime") - 1, 1);
73-
zend_declare_property_ex(class_entry, property_mime_name, &property_mime_default_value, ZEND_ACC_PUBLIC, NULL);
73+
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));
7474
zend_string_release(property_mime_name);
7575

7676
zval property_postname_default_value;
7777
ZVAL_EMPTY_STRING(&property_postname_default_value);
7878
zend_string *property_postname_name = zend_string_init("postname", sizeof("postname") - 1, 1);
79-
zend_declare_property_ex(class_entry, property_postname_name, &property_postname_default_value, ZEND_ACC_PUBLIC, NULL);
79+
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));
8080
zend_string_release(property_postname_name);
8181

8282
return class_entry;

0 commit comments

Comments
 (0)