Validate multiple groups sequentially in Symfony

Code
<?php

use Symfony\Component\Validator\ValidatorBuilder;
use 
Symfony\Component\Validator\Constraints as C;

$constraints = [
    new 
C\Type(['groups' => ['step1'], 'type' => ArrayObject::class]),
    new 
C\Count(['groups' => ['step2'], 'min' => 1]),
];

$groupSequence = new C\GroupSequence(['step1''step2']);

$validator = (new ValidatorBuilder())
    ->
enableAnnotationMapping()
    ->
getValidator();

dump(
    
// if group "step1" fails, group "step2" won't be checked
    
$validator->validate('foo'$constraints$groupSequence),
    
$validator->validate(new ArrayObject(), $constraints$groupSequence)
);
Result
^ Symfony\Component\Validator\ConstraintViolationList {#1409
-violations: array:1 [
0 => Symfony\Component\Validator\ConstraintViolation {#1414
-message: "This value should be of type ArrayObject."
-messageTemplate: "This value should be of type {{ type }}."
-parameters: array:2 [
"{{ value }}" => ""foo""
"{{ type }}" => "ArrayObject"
]
-plural: null
-root: "foo"
-propertyPath: ""
-invalidValue: "foo"
-constraint: Symfony\Component\Validator\Constraints\Type {#1390
+payload: null
+message: "This value should be of type {{ type }}."
+type: "ArrayObject"
+"groups": array:1 [
0 => "step1"
]
}
-code: "ba785a8c-82cb-4283-967c-3cf342181b40"
-cause: null
}
]
}

^ Symfony\Component\Validator\ConstraintViolationList {#1415
-violations: array:1 [
0 => Symfony\Component\Validator\ConstraintViolation {#1418
-message: "This collection should contain 1 element or more."
-messageTemplate: "This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more."
-parameters: array:2 [
"{{ count }}" => "0"
"{{ limit }}" => "1"
]
-plural: 1
-root: ArrayObject {#1393
-storage: []
flag::STD_PROP_LIST: false
flag::ARRAY_AS_PROPS: false
iteratorClass: "ArrayIterator"
}
-propertyPath: ""
-invalidValue: ArrayObject {#1393}
-constraint: Symfony\Component\Validator\Constraints\Count {#1391
+payload: null
+minMessage: "This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more."
+maxMessage: "This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less."
+exactMessage: "This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements."
+divisibleByMessage: "The number of elements in this collection should be a multiple of {{ compared_value }}."
+min: 1
+max: null
+divisibleBy: null
+"groups": array:1 [
0 => "step2"
]
}
-code: "bef8e338-6ae5-4caf-b8e2-50e7b0579e69"
-cause: null
}
]
}
Used Versions
PHP 8.2, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8