Config.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. namespace Hyperf\Pool\SimplePool;
  12. class Config
  13. {
  14. /**
  15. * @var callable
  16. */
  17. protected $callback;
  18. public function __construct(protected string $name, callable $callback, protected array $option)
  19. {
  20. $this->callback = $callback;
  21. }
  22. public function getName(): string
  23. {
  24. return $this->name;
  25. }
  26. public function setName(string $name): static
  27. {
  28. $this->name = $name;
  29. return $this;
  30. }
  31. public function getCallback(): callable
  32. {
  33. return $this->callback;
  34. }
  35. public function setCallback(callable $callback): static
  36. {
  37. $this->callback = $callback;
  38. return $this;
  39. }
  40. public function getOption(): array
  41. {
  42. return $this->option;
  43. }
  44. public function setOption(array $option): static
  45. {
  46. $this->option = $option;
  47. return $this;
  48. }
  49. }