PageRenderTime 41ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/zend/Zend/Server/Reflection/ReturnValue.php

https://bitbucket.org/synergylearning/campusconnect
PHP | 110 lines | 35 code | 9 blank | 66 comment | 4 complexity | 8ebc232e74e44a0831b7c0a4c6c51ed5 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, LGPL-3.0, GPL-3.0, LGPL-2.1, Apache-2.0, BSD-3-Clause, AGPL-3.0
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Server
  17. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  18. * @license http://framework.zend.com/license/new-bsd New BSD License
  19. */
  20. /**
  21. * Return value reflection
  22. *
  23. * Stores the return value type and description
  24. *
  25. * @category Zend
  26. * @package Zend_Server
  27. * @subpackage Reflection
  28. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  29. * @license http://framework.zend.com/license/new-bsd New BSD License
  30. * @version $Id$
  31. */
  32. class Zend_Server_Reflection_ReturnValue
  33. {
  34. /**
  35. * Return value type
  36. * @var string
  37. */
  38. protected $_type;
  39. /**
  40. * Return value description
  41. * @var string
  42. */
  43. protected $_description;
  44. /**
  45. * Constructor
  46. *
  47. * @param string $type Return value type
  48. * @param string $description Return value type
  49. */
  50. public function __construct($type = 'mixed', $description = '')
  51. {
  52. $this->setType($type);
  53. $this->setDescription($description);
  54. }
  55. /**
  56. * Retrieve parameter type
  57. *
  58. * @return string
  59. */
  60. public function getType()
  61. {
  62. return $this->_type;
  63. }
  64. /**
  65. * Set parameter type
  66. *
  67. * @param string|null $type
  68. * @return void
  69. */
  70. public function setType($type)
  71. {
  72. if (!is_string($type) && (null !== $type)) {
  73. require_once 'Zend/Server/Reflection/Exception.php';
  74. throw new Zend_Server_Reflection_Exception('Invalid parameter type');
  75. }
  76. $this->_type = $type;
  77. }
  78. /**
  79. * Retrieve parameter description
  80. *
  81. * @return string
  82. */
  83. public function getDescription()
  84. {
  85. return $this->_description;
  86. }
  87. /**
  88. * Set parameter description
  89. *
  90. * @param string|null $description
  91. * @return void
  92. */
  93. public function setDescription($description)
  94. {
  95. if (!is_string($description) && (null !== $description)) {
  96. require_once 'Zend/Server/Reflection/Exception.php';
  97. throw new Zend_Server_Reflection_Exception('Invalid parameter description');
  98. }
  99. $this->_description = $description;
  100. }
  101. }