src/main/php/Verification.php
private function evaluate($constraint, $received, string $description): bool
    {
        if (function_exists('bovigo\assert\assertThat')) {
            return \bovigo\assert\assertThat(
                    $received,
                    $this->predicateFor($constraint),
                    $description
            );
        }

        if (class_exists('\PHPUnit\Framework\Constraint\IsEqual')) {
            return $this->evaluateWithPhpUnit($constraint, $received, $description);
        }

        if (class_exists('\unittest\TestCase')) {
            return $this->evaluateWithXpFrameworkCore($constraint, $received, $description);
        }

        throw new \RuntimeException('Neither bovigo/assert, PHPUnit nor xp-framework/unittest found, can not perform argument verification');
    }
private function evaluate($constraint, $received, string $description): bool
    {
        if (function_exists('bovigo\assert\assertThat')) {
            return \bovigo\assert\assertThat(
                    $received,
                    $this->predicateFor($constraint),
                    $description
            );
        }

        if (class_exists('\PHPUnit\Framework\Constraint\IsEqual')) {
            return $this->evaluateWithPhpUnit($constraint, $received, $description);
        }

        if (class_exists('\unittest\TestCase')) {
            return $this->evaluateWithXpFrameworkCore($constraint, $received, $description);
        }

        throw new \RuntimeException('Neither bovigo/assert, PHPUnit nor xp-framework/unittest found, can not perform argument verification');
    }
private function evaluate ( $ constraint , $ received , string $ description ) : bool { if ( function_exists ( 'bovigo\assert\assertThat' ) ) { return \ bovigo \ assert \ assertThat ( $ received , $ this -> predicateFor ( $ constraint ) , $ description ) ; } if ( class_exists ( '\PHPUnit\Framework\Constraint\IsEqual' ) ) { return $ this -> evaluateWithPhpUnit ( $ constraint , $ received , $ description ) ; } if ( class_exists ( '\unittest\TestCase' ) ) { return $ this -> evaluateWithXpFrameworkCore ( $ constraint , $ received , $ description ) ; } throw new \ RuntimeException ( 'Neither bovigo/assert, PHPUnit nor xp-framework/unittest found, can not perform argument verification' ) ; }
evaluates given constraint given received argument

@param   mixed|\bovigo\assert\predicate\Predicate|\PHPUnit\Framework\Constraint\Constraint  $constraint  constraint for argument
@param   mixed                                                                   $received    actually received argument
@param   string                                                                  $description  description for invocation in case of error
@return  bool
@throws  \RuntimeException  in case neither bovigo/assert, PHPUnit not xp-framework/unittest is present
evaluates given constraint given received argument