Variable.php 715 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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\DependencyInjection;
  11. /**
  12. * Represents a variable.
  13. *
  14. * $var = new Variable('a');
  15. *
  16. * will be dumped as
  17. *
  18. * $a
  19. *
  20. * by the PHP dumper.
  21. *
  22. * @author Johannes M. Schmitt <schmittjoh@gmail.com>
  23. */
  24. class Variable
  25. {
  26. private $name;
  27. public function __construct(string $name)
  28. {
  29. $this->name = $name;
  30. }
  31. /**
  32. * @return string
  33. */
  34. public function __toString()
  35. {
  36. return $this->name;
  37. }
  38. }