25 $this->type = $spec[
'type'] ??
'counter';
27 foreach ( [
'timeStep',
'expiry' ] as $var ) {
28 if ( isset( $spec[$var] ) ) {
29 throw new WRStatsError(
"$var must be in the sequences array" );
32 $seqArrays = $spec[
'sequences'] ?? [];
37 foreach ( $seqArrays as $i => $seqArray ) {
38 if ( !is_array( $seqArray ) ) {
39 throw new WRStatsError(
'sequences must be an array of arrays' );
42 while ( isset(
$sequences[$seqSpec->name] ) ) {
43 $seqSpec->name .=
"s$i";
48 return $a->hardExpiry <=> $b->hardExpiry;