22 $this->type = $spec[
'type'] ??
'counter';
24 foreach ( [
'timeStep',
'expiry' ] as $var ) {
25 if ( isset( $spec[$var] ) ) {
26 throw new WRStatsError(
"$var must be in the sequences array" );
29 $seqArrays = $spec[
'sequences'] ?? [];
34 foreach ( $seqArrays as $i => $seqArray ) {
35 if ( !is_array( $seqArray ) ) {
36 throw new WRStatsError(
'sequences must be an array of arrays' );
39 while ( isset(
$sequences[$seqSpec->name] ) ) {
40 $seqSpec->name .=
"s$i";
45 return $a->hardExpiry <=> $b->hardExpiry;