Skip to content

Commit a22211e

Browse files
committed
Fix after review
1 parent ca06320 commit a22211e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Zend/zend_inheritance.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,8 @@ static inheritance_status zend_perform_intersection_covariant_class_type_check(
407407
bool have_unresolved = false;
408408
zend_type *single_type;
409409

410-
/* Traverse the list of child types and check if it is either a subtype
411-
* of one of the parent types OR is not in the parent type list */
410+
/* Traverse the list of child types and check that at least one is
411+
* a subtype of the parent type being checked */
412412
ZEND_TYPE_FOREACH(fe_type, single_type) {
413413
zend_class_entry *fe_ce;
414414
zend_string *fe_class_name = NULL;
@@ -427,7 +427,7 @@ static inheritance_status zend_perform_intersection_covariant_class_type_check(
427427
fe_ce = ZEND_TYPE_CE(*single_type);
428428
} else {
429429
/* standard type */
430-
ZEND_ASSERT(0 && "This shouldn't happen yet");
430+
ZEND_UNREACHABLE();
431431
continue;
432432
}
433433

@@ -542,7 +542,7 @@ static inheritance_status zend_is_single_type_subtype_intersection(
542542
proto_ce = ZEND_TYPE_CE(*single_type);
543543
} else {
544544
/* standard type cannot be part a subtype of an intersection type */
545-
ZEND_ASSERT(0 && "This shouldn't happen yet");
545+
ZEND_UNREACHABLE();
546546
continue;
547547
}
548548

@@ -612,7 +612,7 @@ static inheritance_status zend_perform_covariant_type_check(
612612
bool all_success = true;
613613

614614
/* If the child type is an intersection type then we need to loop over
615-
* the parents firstFor intersection types loop over the parent types first
615+
* the parents first. For intersection types, loop over the parent types first
616616
* as the child can add types, however none of them can be a supertype of
617617
* a parent type. */
618618
if (ZEND_TYPE_IS_INTERSECTION(fe_type)) {
@@ -629,7 +629,7 @@ static inheritance_status zend_perform_covariant_type_check(
629629
proto_class_name = proto_ce->name;
630630
} else {
631631
/* standard type */
632-
ZEND_ASSERT(0 && "This shouldn't happen yet");
632+
ZEND_UNREACHABLE();
633633
continue;
634634
}
635635

@@ -698,7 +698,7 @@ static inheritance_status zend_perform_covariant_type_check(
698698
proto_class_name = proto_ce->name;
699699
} else {
700700
/* standard type */
701-
ZEND_ASSERT(0 && "This shouldn't happen yet");
701+
ZEND_UNREACHABLE();
702702
continue;
703703
}
704704

ext/reflection/php_reflection.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,7 @@ static void reflection_parameter_factory(zend_function *fptr, zval *closure_obje
13201320
}
13211321
/* }}} */
13221322

1323-
typedef enum reflection_type_kind {
1323+
typedef enum {
13241324
NAMED_TYPE = 0,
13251325
UNION_TYPE = 1,
13261326
INTERSECTION_TYPE = 2

0 commit comments

Comments
 (0)