limit = (int)$limit; $this->window = +$window; if ( $this->window <= 0 ) { throw new WRStatsError( 'Condition window must be positive' ); } } /** * Get the condition as a number of events per second * * @return float|int */ public function perSecond() { return $this->limit / $this->window; } }