Skip to content

Commit 0824c47

Browse files
committed
Fix after review
1 parent f98f402 commit 0824c47

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Zend/zend_inheritance.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,8 @@ static inheritance_status zend_perform_intersection_covariant_class_type_check(
411411
bool have_unresolved = false;
412412
zend_type *single_type;
413413

414-
/* Traverse the list of child types and check if it is either a subtype
415-
* of one of the parent types OR is not in the parent type list */
414+
/* Traverse the list of child types and check that at least one is
415+
* a subtype of the parent type being checked */
416416
ZEND_TYPE_FOREACH(fe_type, single_type) {
417417
zend_class_entry *fe_ce;
418418
zend_string *fe_class_name = NULL;
@@ -431,7 +431,7 @@ static inheritance_status zend_perform_intersection_covariant_class_type_check(
431431
fe_ce = ZEND_TYPE_CE(*single_type);
432432
} else {
433433
/* standard type */
434-
ZEND_ASSERT(0 && "This shouldn't happen yet");
434+
ZEND_UNREACHABLE();
435435
continue;
436436
}
437437

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

@@ -624,7 +624,7 @@ static inheritance_status zend_perform_covariant_type_check(
624624
bool all_success = true;
625625

626626
/* If the child type is an intersection type then we need to loop over
627-
* the parents firstFor intersection types loop over the parent types first
627+
* the parents first. For intersection types, loop over the parent types first
628628
* as the child can add types, however none of them can be a supertype of
629629
* a parent type. */
630630
if (ZEND_TYPE_IS_INTERSECTION(fe_type)) {
@@ -641,7 +641,7 @@ static inheritance_status zend_perform_covariant_type_check(
641641
proto_class_name = proto_ce->name;
642642
} else {
643643
/* standard type */
644-
ZEND_ASSERT(0 && "This shouldn't happen yet");
644+
ZEND_UNREACHABLE();
645645
continue;
646646
}
647647

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)