Assert\AssertionChain::__call PHP Method

__call() public method

Call assertion on the current value in the chain.
public __call ( string $methodName, array $args ) : AssertionChain
$methodName string
$args array
return AssertionChain
    public function __call($methodName, $args)
    {
        if ($this->alwaysValid === true) {
            return $this;
        }
        if (!method_exists($this->assertionClassName, $methodName)) {
            throw new \RuntimeException("Assertion '" . $methodName . "' does not exist.");
        }
        $reflClass = new ReflectionClass($this->assertionClassName);
        $method = $reflClass->getMethod($methodName);
        array_unshift($args, $this->value);
        $params = $method->getParameters();
        foreach ($params as $idx => $param) {
            if (isset($args[$idx])) {
                continue;
            }
            if ($param->getName() == 'message') {
                $args[$idx] = $this->defaultMessage;
            }
            if ($param->getName() == 'propertyPath') {
                $args[$idx] = $this->defaultPropertyPath;
            }
        }
        if ($this->all) {
            $methodName = 'all' . $methodName;
        }
        call_user_func_array(array($this->assertionClassName, $methodName), $args);
        return $this;
    }