Variable.php 798 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. /**
  28. * @param string $name
  29. */
  30. public function __construct($name)
  31. {
  32. $this->name = $name;
  33. }
  34. /**
  35. * Converts the object to a string.
  36. *
  37. * @return string
  38. */
  39. public function __toString()
  40. {
  41. return $this->name;
  42. }
  43. }