ChainedBatchTruthTest.php 682 B

123456789101112131415161718192021222324252627282930313233343536
  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. */
  17. public function __construct(Closure $callback)
  18. {
  19. $this->callback = $callback;
  20. }
  21. /**
  22. * Invoke the truth test with the given pending batch.
  23. *
  24. * @param \Illuminate\Bus\PendingBatch $pendingBatch
  25. * @return bool
  26. */
  27. public function __invoke($pendingBatch)
  28. {
  29. return call_user_func($this->callback, $pendingBatch);
  30. }
  31. }