PageRenderTime 43ms CodeModel.GetById 38ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/framework/vendor/zend/Zend/Server/Reflection/ReturnValue.php

http://zoop.googlecode.com/
PHP | 110 lines | 35 code | 9 blank | 66 comment | 4 complexity | c69d0ec9e2de811938079493a8fd0951 MD5 | raw file
  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/**
 22 * Return value reflection
 23 *
 24 * Stores the return value type and description
 25 *
 26 * @category   Zend
 27 * @package    Zend_Server
 28 * @subpackage Reflection
 29 * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
 30 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 31 * @version $Id: ReturnValue.php 20096 2010-01-06 02:05:09Z bkarwin $
 32 */
 33class Zend_Server_Reflection_ReturnValue
 34{
 35    /**
 36     * Return value type
 37     * @var string
 38     */
 39    protected $_type;
 40
 41    /**
 42     * Return value description
 43     * @var string
 44     */
 45    protected $_description;
 46
 47    /**
 48     * Constructor
 49     *
 50     * @param string $type Return value type
 51     * @param string $description Return value type
 52     */
 53    public function __construct($type = 'mixed', $description = '')
 54    {
 55        $this->setType($type);
 56        $this->setDescription($description);
 57    }
 58
 59    /**
 60     * Retrieve parameter type
 61     *
 62     * @return string
 63     */
 64    public function getType()
 65    {
 66        return $this->_type;
 67    }
 68
 69    /**
 70     * Set parameter type
 71     *
 72     * @param string|null $type
 73     * @return void
 74     */
 75    public function setType($type)
 76    {
 77        if (!is_string($type) && (null !== $type)) {
 78            require_once 'Zend/Server/Reflection/Exception.php';
 79            throw new Zend_Server_Reflection_Exception('Invalid parameter type');
 80        }
 81
 82        $this->_type = $type;
 83    }
 84
 85    /**
 86     * Retrieve parameter description
 87     *
 88     * @return string
 89     */
 90    public function getDescription()
 91    {
 92        return $this->_description;
 93    }
 94
 95    /**
 96     * Set parameter description
 97     *
 98     * @param string|null $description
 99     * @return void
100     */
101    public function setDescription($description)
102    {
103        if (!is_string($description) && (null !== $description)) {
104            require_once 'Zend/Server/Reflection/Exception.php';
105            throw new Zend_Server_Reflection_Exception('Invalid parameter description');
106        }
107
108        $this->_description = $description;
109    }
110}