public function mock(...$args): MockInterface
    {
        $id = \array_shift($args);

        if (! $this->has($id)) {
            throw new InvalidArgumentException(\sprintf('Cannot mock a non-existent service: [%s]', $id));
        }

        $mock = 'mock::' . $id;

        if (! isset($this->mockedServices[$mock])) {
            $this->mockedServices[$mock] = \call_user_func_array([Mockery::class, 'mock'], $args);
        }

        return $this->mockedServices[$mock];
    }
public function mock(...$args): MockInterface
    {
        $id = \array_shift($args);

        if (! $this->has($id)) {
            throw new InvalidArgumentException(\sprintf('Cannot mock a non-existent service: [%s]', $id));
        }

        $mock = 'mock::' . $id;

        if (! isset($this->mockedServices[$mock])) {
            $this->mockedServices[$mock] = \call_user_func_array([Mockery::class, 'mock'], $args);
        }

        return $this->mockedServices[$mock];
    }
public function mock ( ... $ args ) : MockInterface { $ id = \ array_shift ( $ args ) ; if ( ! $ this -> has ( $ id ) ) { throw new InvalidArgumentException ( \ sprintf ( 'Cannot mock a non-existent service: [%s]' , $ id ) ) ; } $ mock = 'mock::' . $ id ; if ( ! isset ( $ this -> mockedServices [ $ mock ] ) ) { $ this -> mockedServices [ $ mock ] = \ call_user_func_array ( [ Mockery :: class , 'mock' ] , $ args ) ; } return $ this -> mockedServices [ $ mock ] ; }
Takes an id of the service as the first argument.
Any other arguments are passed to the Mockery factory.

@param array<int, mixed> $args

@throws \Viserio\Component\Contract\Container\Exception\InvalidArgumentException

@return \Mockery\MockInterface
Takes an id of the service as the first argument . Any other arguments are passed to the Mockery factory .