CommandFailed.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace Illuminate\Redis\Events;
  3. use Throwable;
  4. class CommandFailed
  5. {
  6. /**
  7. * The Redis command that failed.
  8. *
  9. * @var string
  10. */
  11. public $command;
  12. /**
  13. * The array of command parameters.
  14. *
  15. * @var array
  16. */
  17. public $parameters;
  18. /**
  19. * The exception that was thrown.
  20. *
  21. * @var \Throwable
  22. */
  23. public $exception;
  24. /**
  25. * The Redis connection instance.
  26. *
  27. * @var \Illuminate\Redis\Connections\Connection
  28. */
  29. public $connection;
  30. /**
  31. * The Redis connection name.
  32. *
  33. * @var string
  34. */
  35. public $connectionName;
  36. /**
  37. * Create a new event instance.
  38. *
  39. * @param string $command
  40. * @param array $parameters
  41. * @param \Throwable $exception
  42. * @param \Illuminate\Redis\Connections\Connection $connection
  43. */
  44. public function __construct($command, $parameters, Throwable $exception, $connection)
  45. {
  46. $this->command = $command;
  47. $this->parameters = $parameters;
  48. $this->exception = $exception;
  49. $this->connection = $connection;
  50. $this->connectionName = $connection->getName();
  51. }
  52. }