Eris\Generator\SuchThatGenerator::predicate PHP Method

predicate() private method

private predicate ( GeneratedValue $value )
$value GeneratedValue
    private function predicate(GeneratedValue $value)
    {
        if ($this->filter instanceof PHPUnit_Framework_Constraint) {
            try {
                $this->filter->evaluate($value->unbox());
                return true;
            } catch (PHPUnit_Framework_ExpectationFailedException $e) {
                return false;
            }
        }
        if (is_callable($this->filter)) {
            return call_user_func($this->filter, $value->unbox());
        }
        throw new LogicException("Specified filter does not seem to be of the correct type. Please pass a callable or a PHPUnit_Framework_Constraint instead of " . var_export($this->filter, true));
    }