25 $this->type = $spec[
'type'] ??
'counter';
27 foreach ( [
'timeStep',
'expiry' ] as $var ) {
28 if ( isset( $spec[$var] ) ) {
30 ": $var must be specified in the sequences array" );
33 $seqArrays = $spec[
'sequences'] ?? [];
34 if ( !count( $seqArrays ) ) {
38 foreach ( $seqArrays as $i => $seqArray ) {
39 if ( !is_array( $seqArray ) ) {
41 ': sequences is supposed to be an array of arrays' );
44 while ( isset(
$sequences[$seqSpec->name] ) ) {
45 $seqSpec->name .=
"s$i";
50 return $a->hardExpiry <=> $b->hardExpiry;