Page MenuHomeWickedGov Phorge

MinimumEvaluations.php
No OneTemporary

Size
907 B
Referenced Files
None
Subscribers
None

MinimumEvaluations.php

<?php
namespace Eris\Listener;
use Eris\Listener;
use Eris\Listener\EmptyListener;
use OutOfBoundsException;
use Exception;
class MinimumEvaluations extends EmptyListener implements Listener
{
private $threshold;
/**
* @param float $threshold from 0.0 to 1.0
*/
public static function ratio($threshold)
{
return new self($threshold);
}
private function __construct($threshold)
{
$this->threshold = $threshold;
}
public function endPropertyVerification($ordinaryEvaluations, $iterations, Exception $exception = null)
{
if ($exception) {
return;
}
$evaluationRatio = $ordinaryEvaluations / $iterations;
if ($evaluationRatio < $this->threshold) {
throw new OutOfBoundsException("Evaluation ratio {$evaluationRatio} is under the threshold {$this->threshold}");
}
}
}

File Metadata

Mime Type
text/x-php
Expires
Oct 4 2026, 02:25 (5 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
87/4f/0eafa3eb9824ac3bcf36dcb838cc
Default Alt Text
MinimumEvaluations.php (907 B)

Event Timeline