import v1.1.0_beta1 | 2009-08-21
This commit is contained in:
184
libs/Zend/CodeGenerator/Php/Member/Abstract.php
Normal file
184
libs/Zend/CodeGenerator/Php/Member/Abstract.php
Normal file
@ -0,0 +1,184 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_CodeGenerator
|
||||
* @subpackage PHP
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_CodeGenerator_Php_Abstract
|
||||
*/
|
||||
require_once 'Zend/CodeGenerator/Php/Abstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_CodeGenerator
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
abstract class Zend_CodeGenerator_Php_Member_Abstract extends Zend_CodeGenerator_Php_Abstract
|
||||
{
|
||||
/**#@+
|
||||
* @param const string
|
||||
*/
|
||||
const VISIBILITY_PUBLIC = 'public';
|
||||
const VISIBILITY_PROTECTED = 'protected';
|
||||
const VISIBILITY_PRIVATE = 'private';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $_isAbstract = false;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $_isStatic = false;
|
||||
|
||||
/**
|
||||
* @var const
|
||||
*/
|
||||
protected $_visibility = self::VISIBILITY_PUBLIC;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_name = null;
|
||||
|
||||
/**
|
||||
* setDocblock() Set the docblock
|
||||
*
|
||||
* @param Zend_CodeGenerator_Php_Docblock|array|string $docblock
|
||||
* @return Zend_CodeGenerator_Php_File
|
||||
*/
|
||||
public function setDocblock($docblock)
|
||||
{
|
||||
if (is_string($docblock)) {
|
||||
$docblock = array('shortDescription' => $docblock);
|
||||
}
|
||||
|
||||
if (is_array($docblock)) {
|
||||
$docblock = new Zend_CodeGenerator_Php_Docblock($docblock);
|
||||
} elseif (!$docblock instanceof Zend_CodeGenerator_Php_Docblock) {
|
||||
require_once 'Zend/CodeGenerator/Php/Exception.php';
|
||||
throw new Zend_CodeGenerator_Php_Exception('setDocblock() is expecting either a string, array or an instance of Zend_CodeGenerator_Php_Docblock');
|
||||
}
|
||||
|
||||
$this->_docblock = $docblock;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* getDocblock()
|
||||
*
|
||||
* @return Zend_CodeGenerator_Php_Docblock
|
||||
*/
|
||||
public function getDocblock()
|
||||
{
|
||||
return $this->_docblock;
|
||||
}
|
||||
|
||||
/**
|
||||
* setAbstract()
|
||||
*
|
||||
* @param bool $isAbstract
|
||||
* @return Zend_CodeGenerator_Php_Member_Abstract
|
||||
*/
|
||||
public function setAbstract($isAbstract)
|
||||
{
|
||||
$this->_isAbstract = ($isAbstract) ? true : false;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* isAbstract()
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isAbstract()
|
||||
{
|
||||
return $this->_isAbstract;
|
||||
}
|
||||
|
||||
/**
|
||||
* setStatic()
|
||||
*
|
||||
* @param bool $isStatic
|
||||
* @return Zend_CodeGenerator_Php_Member_Abstract
|
||||
*/
|
||||
public function setStatic($isStatic)
|
||||
{
|
||||
$this->_isStatic = ($isStatic) ? true : false;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* isStatic()
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isStatic()
|
||||
{
|
||||
return $this->_isStatic;
|
||||
}
|
||||
|
||||
/**
|
||||
* setVisitibility()
|
||||
*
|
||||
* @param const $visibility
|
||||
* @return Zend_CodeGenerator_Php_Member_Abstract
|
||||
*/
|
||||
public function setVisibility($visibility)
|
||||
{
|
||||
$this->_visibility = $visibility;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* getVisibility()
|
||||
*
|
||||
* @return const
|
||||
*/
|
||||
public function getVisibility()
|
||||
{
|
||||
return $this->_visibility;
|
||||
}
|
||||
|
||||
/**
|
||||
* setName()
|
||||
*
|
||||
* @param string $name
|
||||
* @return Zend_CodeGenerator_Php_Member_Abstract
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->_name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* getName()
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->_name;
|
||||
}
|
||||
}
|
55
libs/Zend/CodeGenerator/Php/Member/Container.php
Normal file
55
libs/Zend/CodeGenerator/Php/Member/Container.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_CodeGenerator
|
||||
* @subpackage PHP
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_CodeGenerator
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_CodeGenerator_Php_Member_Container extends ArrayObject
|
||||
{
|
||||
|
||||
/**#@+
|
||||
* @param const string
|
||||
*/
|
||||
const TYPE_PROPERTY = 'property';
|
||||
const TYPE_METHOD = 'method';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* @var const|string
|
||||
*/
|
||||
protected $_type = self::TYPE_PROPERTY;
|
||||
|
||||
/**
|
||||
* __construct()
|
||||
*
|
||||
* @param const|string $type
|
||||
*/
|
||||
public function __construct($type = self::TYPE_PROPERTY)
|
||||
{
|
||||
$this->_type = $type;
|
||||
parent::__construct(array(), self::ARRAY_AS_PROPS);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user