JobName.php 670B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace Illuminate\Queue\Jobs;
  3. use Illuminate\Support\Str;
  4. class JobName
  5. {
  6. /**
  7. * Parse the given job name into a class / method array.
  8. *
  9. * @param string $job
  10. * @return array
  11. */
  12. public static function parse($job)
  13. {
  14. return Str::parseCallback($job, 'fire');
  15. }
  16. /**
  17. * Get the resolved name of the queued job class.
  18. *
  19. * @param string $name
  20. * @param array $payload
  21. * @return string
  22. */
  23. public static function resolve($name, $payload)
  24. {
  25. if (! empty($payload['displayName'])) {
  26. return $payload['displayName'];
  27. }
  28. return $name;
  29. }
  30. }