ChainedBatchTruthTest.php 687 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace Illuminate\Support\Testing\Fakes;
  3. use Closure;
  4. class ChainedBatchTruthTest
  5. {
  6. /**
  7. * The underlying truth test.
  8. *
  9. * @var \Closure
  10. */
  11. protected $callback;
  12. /**
  13. * Create a new truth test instance.
  14. *
  15. * @param \Closure $callback
  16. * @return void
  17. */
  18. public function __construct(Closure $callback)
  19. {
  20. $this->callback = $callback;
  21. }
  22. /**
  23. * Invoke the truth test with the given pending batch.
  24. *
  25. * @param \Illuminate\Bus\PendingBatch
  26. * @return bool
  27. */
  28. public function __invoke($pendingBatch)
  29. {
  30. return call_user_func($this->callback, $pendingBatch);
  31. }
  32. }