import v2.0.0.0_RC3 | 2012-07-01

https://github.com/lucanos/CommunityID -> http://www.itadmins.net/archives/357
This commit is contained in:
2019-07-17 22:31:04 +02:00
parent 38c146901c
commit 2f397f01f7
2677 changed files with 296182 additions and 45159 deletions

View File

@ -17,7 +17,7 @@
* @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: Property.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Property.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -36,14 +36,14 @@ require_once 'Zend/CodeGenerator/Php/Property/DefaultValue.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
*/
class Zend_CodeGenerator_Php_Property extends Zend_CodeGenerator_Php_Member_Abstract
class Zend_CodeGenerator_Php_Property extends Zend_CodeGenerator_Php_Member_Abstract
{
/**
* @var bool
*/
protected $_isConst = null;
/**
* @var string
*/
@ -58,21 +58,21 @@ class Zend_CodeGenerator_Php_Property extends Zend_CodeGenerator_Php_Member_Abst
public static function fromReflection(Zend_Reflection_Property $reflectionProperty)
{
$property = new self();
$property->setName($reflectionProperty->getName());
$allDefaultProperties = $reflectionProperty->getDeclaringClass()->getDefaultProperties();
$property->setDefaultValue($allDefaultProperties[$reflectionProperty->getName()]);
if ($reflectionProperty->getDocComment() != '') {
$property->setDocblock(Zend_CodeGenerator_Php_Docblock::fromReflection($reflectionProperty->getDocComment()));
}
if ($reflectionProperty->isStatic()) {
$property->setStatic(true);
}
if ($reflectionProperty->isPrivate()) {
$property->setVisibility(self::VISIBILITY_PRIVATE);
} elseif ($reflectionProperty->isProtected()) {
@ -80,12 +80,12 @@ class Zend_CodeGenerator_Php_Property extends Zend_CodeGenerator_Php_Member_Abst
} else {
$property->setVisibility(self::VISIBILITY_PUBLIC);
}
$property->setSourceDirty(false);
return $property;
}
/**
* setConst()
*
@ -97,7 +97,7 @@ class Zend_CodeGenerator_Php_Property extends Zend_CodeGenerator_Php_Member_Abst
$this->_isConst = $const;
return $this;
}
/**
* isConst()
*
@ -117,16 +117,16 @@ class Zend_CodeGenerator_Php_Property extends Zend_CodeGenerator_Php_Member_Abst
public function setDefaultValue($defaultValue)
{
// if it looks like
if (is_array($defaultValue)
if (is_array($defaultValue)
&& array_key_exists('value', $defaultValue)
&& array_key_exists('type', $defaultValue)) {
$defaultValue = new Zend_CodeGenerator_Php_Property_DefaultValue($defaultValue);
}
if (!($defaultValue instanceof Zend_CodeGenerator_Php_Property_DefaultValue)) {
$defaultValue = new Zend_CodeGenerator_Php_Property_DefaultValue(array('value' => $defaultValue));
}
$this->_defaultValue = $defaultValue;
return $this;
}
@ -140,7 +140,7 @@ class Zend_CodeGenerator_Php_Property extends Zend_CodeGenerator_Php_Member_Abst
{
return $this->_defaultValue;
}
/**
* generate()
*
@ -150,30 +150,30 @@ class Zend_CodeGenerator_Php_Property extends Zend_CodeGenerator_Php_Member_Abst
{
$name = $this->getName();
$defaultValue = $this->getDefaultValue();
$output = '';
if (($docblock = $this->getDocblock()) !== null) {
$docblock->setIndentation(' ');
$output .= $docblock->generate();
}
if ($this->isConst()) {
if ($defaultValue != null && !$defaultValue->isValidConstantType()) {
require_once 'Zend/CodeGenerator/Php/Exception.php';
throw new Zend_CodeGenerator_Php_Exception('The property ' . $this->_name . ' is said to be '
. 'constant but does not have a valid constant value.');
}
$output .= $this->_indentation . 'const ' . $name . ' = '
$output .= $this->_indentation . 'const ' . $name . ' = '
. (($defaultValue !== null) ? $defaultValue->generate() : 'null;');
} else {
$output .= $this->_indentation
. $this->getVisibility()
. (($this->isStatic()) ? ' static' : '')
. $this->getVisibility()
. (($this->isStatic()) ? ' static' : '')
. ' $' . $name . ' = '
. (($defaultValue !== null) ? $defaultValue->generate() : 'null;');
}
return $output;
return $output;
}
}