Variable.php 823 B

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