Suggestion.php 1018 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Console\Completion;
  11. /**
  12. * Represents a single suggested value.
  13. *
  14. * @author Wouter de Jong <wouter@wouterj.nl>
  15. */
  16. class Suggestion
  17. {
  18. /**
  19. * @readonly
  20. * @var string
  21. */
  22. private $value;
  23. /**
  24. * @readonly
  25. * @var string
  26. */
  27. private $description = '';
  28. /**
  29. * @param string $value
  30. * @param string $description
  31. */
  32. public function __construct($value, $description = '')
  33. {
  34. $this->value = $value;
  35. $this->description = $description;
  36. }
  37. public function getValue()
  38. {
  39. return $this->value;
  40. }
  41. public function getDescription()
  42. {
  43. return $this->description;
  44. }
  45. public function __toString()
  46. {
  47. return $this->getValue();
  48. }
  49. }