public function evaluate(Predicate $predicate, string $description = null): bool
    {
        try {
            if ($predicate->test($this->value)) {
                return true;
            }
        } catch (\Exception $e) {
            if (empty($description)) {
                $description = $e->getMessage();
            } else {
                $description .= "\n" . $e->getMessage();
            }
        }

        throw new AssertionFailure(
                $this->describeFailure($predicate, $description)
        );
    }
public function evaluate(Predicate $predicate, string $description = null): bool
    {
        try {
            if ($predicate->test($this->value)) {
                return true;
            }
        } catch (\Exception $e) {
            if (empty($description)) {
                $description = $e->getMessage();
            } else {
                $description .= "\n" . $e->getMessage();
            }
        }

        throw new AssertionFailure(
                $this->describeFailure($predicate, $description)
        );
    }
public function evaluate ( Predicate $ predicate , string $ description = null ) : bool { try { if ( $ predicate -> test ( $ this -> value ) ) { return true ; } } catch ( \ Exception $ e ) { if ( empty ( $ description ) ) { $ description = $ e -> getMessage ( ) ; } else { $ description .= "\n" . $ e -> getMessage ( ) ; } } throw new AssertionFailure ( $ this -> describeFailure ( $ predicate , $ description ) ) ; }
evaluates predicate against value, throwing an AssertionFailure when predicate fails

@param   \bovigo\assert\predicate\Predicate  $predicate    predicate to test given value
@param   string                              $description  optional  additional description for failure message
@return  bool
@throws  \bovigo\assert\AssertionFailure
evaluates predicate against value throwing an AssertionFailure when predicate fails