Invokable.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /*
  3. * This file is part of the phpunit-mock-objects package.
  4. *
  5. * (c) Sebastian Bergmann <sebastian@phpunit.de>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace PHPUnit\Framework\MockObject;
  11. /**
  12. * Interface for classes which can be invoked.
  13. *
  14. * The invocation will be taken from a mock object and passed to an object
  15. * of this class.
  16. */
  17. interface Invokable extends Verifiable
  18. {
  19. /**
  20. * Invokes the invocation object $invocation so that it can be checked for
  21. * expectations or matched against stubs.
  22. *
  23. * @param Invocation $invocation The invocation object passed from mock object
  24. *
  25. * @return object
  26. */
  27. public function invoke(Invocation $invocation);
  28. /**
  29. * Checks if the invocation matches.
  30. *
  31. * @param Invocation $invocation The invocation object passed from mock object
  32. *
  33. * @return bool
  34. */
  35. public function matches(Invocation $invocation);
  36. }