src/main/php/Verification.php
private function verifyArgs(int $invocation, array $expected): bool
    {
        $received = $this->invocations->argumentsOf($invocation);
        if (count($received) < count($expected)) {
            throw new ArgumentMismatch(sprintf(
                    'Argument count for invocation #%d of %s is too'
                    . ' low: received %d argument(s), expected %d argument(s).',
                    $invocation,
                    $this->invocations->name(),
                    count($received),
                    count($expected)
            ));
        }

        foreach ($expected as $atPosition => $constraint) {
            $this->evaluate(
                    $constraint,
                    $received[$atPosition] ?? null,
                    sprintf(
                            'Parameter %sat position %d for invocation #%d of %s'
                            . ' does not match expected value.',
                            $this->invocations->argumentName($atPosition, ' '),
                            $atPosition,
                            $invocation,
                            $this->invocations->name()
                    )
            );
        }

        return true;
    }
private function verifyArgs(int $invocation, array $expected): bool
    {
        $received = $this->invocations->argumentsOf($invocation);
        if (count($received) < count($expected)) {
            throw new ArgumentMismatch(sprintf(
                    'Argument count for invocation #%d of %s is too'
                    . ' low: received %d argument(s), expected %d argument(s).',
                    $invocation,
                    $this->invocations->name(),
                    count($received),
                    count($expected)
            ));
        }

        foreach ($expected as $atPosition => $constraint) {
            $this->evaluate(
                    $constraint,
                    $received[$atPosition] ?? null,
                    sprintf(
                            'Parameter %sat position %d for invocation #%d of %s'
                            . ' does not match expected value.',
                            $this->invocations->argumentName($atPosition, ' '),
                            $atPosition,
                            $invocation,
                            $this->invocations->name()
                    )
            );
        }

        return true;
    }
private function verifyArgs ( int $ invocation , array $ expected ) : bool { $ received = $ this -> invocations -> argumentsOf ( $ invocation ) ; if ( count ( $ received ) < count ( $ expected ) ) { throw new ArgumentMismatch ( sprintf ( 'Argument count for invocation #%d of %s is too' . ' low: received %d argument(s), expected %d argument(s).' , $ invocation , $ this -> invocations -> name ( ) , count ( $ received ) , count ( $ expected ) ) ) ; } foreach ( $ expected as $ atPosition => $ constraint ) { $ this -> evaluate ( $ constraint , $ received [ $ atPosition ] ?? null , sprintf ( 'Parameter %sat position %d for invocation #%d of %s' . ' does not match expected value.' , $ this -> invocations -> argumentName ( $ atPosition , ' ' ) , $ atPosition , $ invocation , $ this -> invocations -> name ( ) ) ) ; } return true ; }
verifies arguments of given invocation with the expected constraints

If a constraint is not an instance of PHPUnit\Framework\Constraint\Constraint it
will automatically use PHPUnit\Framework\Constraint\IsEqual.

@param   int    $invocation  number of invocation to check
@param   array  $expected    constraints which describe expected parameters
@return  bool
@throws  \bovigo\callmap\ArgumentMismatch
verifies arguments of given invocation with the expected constraints