PageRenderTime 57ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/phing/types/Parameter.php

https://bitbucket.org/ealexandru/jobeet
PHP | 99 lines | 40 code | 17 blank | 42 comment | 2 complexity | 1314035d853447e0d54585425851be40 MD5 | raw file
Possible License(s): ISC, AGPL-3.0, LGPL-2.1, BSD-3-Clause, LGPL-3.0
  1. <?php
  2. /*
  3. * $Id: Parameter.php 325 2007-12-20 15:44:58Z hans $
  4. *
  5. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  6. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  7. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  9. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  10. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  11. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  12. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  13. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  14. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  15. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  16. *
  17. * This software consists of voluntary contributions made by many individuals
  18. * and is licensed under the LGPL. For more information please see
  19. * <http://phing.info>.
  20. */
  21. include_once 'phing/types/DataType.php';
  22. /*
  23. * A parameter is composed of a name, type and value. Nested
  24. * Parameters are also possible, but the using task/type has
  25. * to support them
  26. *
  27. * @author Manuel Holtgrewe
  28. * @author <a href="mailto:yl@seasonfive.com">Yannick Lecaillez</a>
  29. * @package phing.types
  30. */
  31. class Parameter extends DataType {
  32. /** Parameter name */
  33. protected $name;
  34. /** Paramter type */
  35. protected $type;
  36. /** Parameter value */
  37. protected $value;
  38. /** Nested parameters */
  39. protected $parameters = array();
  40. function setName($name) {
  41. $this->name = (string) $name;
  42. }
  43. function setType($type) {
  44. $this->type = (string) $type;
  45. }
  46. /**
  47. * Sets value to dynamic register slot.
  48. * @param RegisterSlot $value
  49. */
  50. public function setListeningValue(RegisterSlot $value) {
  51. $this->value = $value;
  52. }
  53. function setValue($value) {
  54. $this->value = (string) $value;
  55. }
  56. function getName() {
  57. return $this->name;
  58. }
  59. function getType() {
  60. return $this->type;
  61. }
  62. function getValue() {
  63. if ($this->value instanceof RegisterSlot) {
  64. return $this->value->getValue();
  65. } else {
  66. return $this->value;
  67. }
  68. }
  69. /**
  70. * @return Parameter
  71. */
  72. function createParam() {
  73. $num = array_push($this->parameters, new Parameter());
  74. return $this->parameters[$num-1];
  75. }
  76. /**
  77. * @return array Nested parameters.
  78. */
  79. function getParams() {
  80. return $this->parameters;
  81. }
  82. }