Skip to content

Commit 0cf29ab

Browse files
committed
streams: remove param field of php_stream_error_entry
It is always assigned NULL
1 parent 85fc576 commit 0cf29ab

2 files changed

Lines changed: 4 additions & 19 deletions

File tree

main/streams/php_stream_errors.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ typedef struct _php_stream_error_entry {
7373
zend_string *message;
7474
zend_enum_StreamErrorCode code;
7575
char *wrapper_name;
76-
char *param;
7776
char *docref;
7877
int severity;
7978
bool terminating;

main/streams/stream_errors.c

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,8 @@ static void php_stream_error_create_object(zval *zv, php_stream_error_entry *ent
6767
zend_update_property_bool(
6868
php_ce_stream_error, Z_OBJ_P(zv), ZEND_STRL("terminating"), entry->terminating);
6969

70-
if (entry->param) {
71-
zend_update_property_string(
72-
php_ce_stream_error, Z_OBJ_P(zv), ZEND_STRL("param"), entry->param);
73-
} else {
74-
zend_update_property_null(php_ce_stream_error, Z_OBJ_P(zv), ZEND_STRL("param"));
75-
}
70+
/* TODO: Remove property */
71+
zend_update_property_null(php_ce_stream_error, Z_OBJ_P(zv), ZEND_STRL("param"));
7672
}
7773

7874
/* Create array of StreamError objects from error chain */
@@ -213,7 +209,6 @@ static void php_stream_error_entry_free(php_stream_error_entry *entry)
213209
php_stream_error_entry *next = entry->next;
214210
zend_string_release(entry->message);
215211
efree(entry->wrapper_name);
216-
efree(entry->param);
217212
efree(entry->docref);
218213
efree(entry);
219214
entry = next;
@@ -335,7 +330,6 @@ static void php_stream_error_add(zend_enum_StreamErrorCode code, const char *wra
335330
entry->message = message;
336331
entry->code = code;
337332
entry->wrapper_name = wrapper_name ? estrdup(wrapper_name) : NULL;
338-
entry->param = NULL;
339333
entry->docref = docref ? estrdup(docref) : NULL;
340334
entry->severity = severity;
341335
entry->terminating = terminating;
@@ -399,15 +393,9 @@ static void php_stream_report_errors(php_stream_context *context, php_stream_err
399393
{
400394
switch (error_mode) {
401395
case PHP_STREAM_ERROR_MODE_ERROR: {
402-
php_stream_error_entry *entry = op->first_error;
396+
const php_stream_error_entry *entry = op->first_error;
403397
while (entry) {
404-
if (entry->param) {
405-
php_error_docref1(entry->docref, entry->param, entry->severity, "%s",
406-
ZSTR_VAL(entry->message));
407-
} else {
408-
php_error_docref(
409-
entry->docref, entry->severity, "%s", ZSTR_VAL(entry->message));
410-
}
398+
php_error_docref(entry->docref, entry->severity, "%s", ZSTR_VAL(entry->message));
411399
entry = entry->next;
412400
}
413401
break;
@@ -652,7 +640,6 @@ static void php_stream_error_entry_dtor_legacy(void *error)
652640
php_stream_error_entry *entry = *(php_stream_error_entry **) error;
653641
zend_string_release(entry->message);
654642
efree(entry->wrapper_name);
655-
efree(entry->param);
656643
efree(entry->docref);
657644
efree(entry);
658645
}
@@ -671,7 +658,6 @@ static void php_stream_wrapper_log_store_error(zend_string *message, zend_enum_S
671658
entry->message = message;
672659
entry->code = code;
673660
entry->wrapper_name = wrapper_name ? estrdup(wrapper_name) : NULL;
674-
entry->param = NULL;
675661
entry->severity = severity;
676662
entry->terminating = terminating;
677663

0 commit comments

Comments
 (0)