adding zend project folders into old campcaster.
This commit is contained in:
parent
56abfaf28e
commit
7ef0c18b26
4045 changed files with 1054952 additions and 0 deletions
145
library/Zend/Reflection/Docblock/Tag.php
Normal file
145
library/Zend/Reflection/Docblock/Tag.php
Normal file
|
@ -0,0 +1,145 @@
|
|||
<?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_Reflection
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Tag.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/** Zend_Loader */
|
||||
require_once 'Zend/Loader.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Reflection
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Reflection_Docblock_Tag implements Reflector
|
||||
{
|
||||
/**
|
||||
* @var array Array of Class names
|
||||
*/
|
||||
protected static $_tagClasses = array(
|
||||
'param' => 'Zend_Reflection_Docblock_Tag_Param',
|
||||
'return' => 'Zend_Reflection_Docblock_Tag_Return',
|
||||
);
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_name = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_description = null;
|
||||
|
||||
/**
|
||||
* Factory: Create the appropriate annotation tag object
|
||||
*
|
||||
* @param string $tagDocblockLine
|
||||
* @return Zend_Reflection_Docblock_Tag
|
||||
*/
|
||||
public static function factory($tagDocblockLine)
|
||||
{
|
||||
$matches = array();
|
||||
|
||||
if (!preg_match('#^@(\w+)(\s|$)#', $tagDocblockLine, $matches)) {
|
||||
require_once 'Zend/Reflection/Exception.php';
|
||||
throw new Zend_Reflection_Exception('No valid tag name found within provided docblock line.');
|
||||
}
|
||||
|
||||
$tagName = $matches[1];
|
||||
if (array_key_exists($tagName, self::$_tagClasses)) {
|
||||
$tagClass = self::$_tagClasses[$tagName];
|
||||
if (!class_exists($tagClass)) {
|
||||
Zend_Loader::loadClass($tagClass);
|
||||
}
|
||||
return new $tagClass($tagDocblockLine);
|
||||
}
|
||||
return new self($tagDocblockLine);
|
||||
}
|
||||
|
||||
/**
|
||||
* Export reflection
|
||||
*
|
||||
* Required by Reflector
|
||||
*
|
||||
* @todo What should this do?
|
||||
* @return void
|
||||
*/
|
||||
public static function export()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Serialize to string
|
||||
*
|
||||
* Required by Reflector
|
||||
*
|
||||
* @todo What should this do?
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
$str = "Docblock Tag [ * @".$this->_name." ]".PHP_EOL;
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $tagDocblockLine
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($tagDocblockLine)
|
||||
{
|
||||
$matches = array();
|
||||
|
||||
// find the line
|
||||
if (!preg_match('#^@(\w+)(?:\s+([^\s].*)|$)?#', $tagDocblockLine, $matches)) {
|
||||
require_once 'Zend/Reflection/Exception.php';
|
||||
throw new Zend_Reflection_Exception('Provided docblock line does not contain a valid tag');
|
||||
}
|
||||
|
||||
$this->_name = $matches[1];
|
||||
if (isset($matches[2]) && $matches[2]) {
|
||||
$this->_description = $matches[2];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get annotation tag name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get annotation tag description
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->_description;
|
||||
}
|
||||
}
|
93
library/Zend/Reflection/Docblock/Tag/Param.php
Normal file
93
library/Zend/Reflection/Docblock/Tag/Param.php
Normal file
|
@ -0,0 +1,93 @@
|
|||
<?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_Reflection
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Param.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/** Zend_Reflection_Docblock_Tag */
|
||||
require_once 'Zend/Reflection/Docblock/Tag.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Reflection
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Reflection_Docblock_Tag_Param extends Zend_Reflection_Docblock_Tag
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_type = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_variableName = null;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $tagDocblockLine
|
||||
*/
|
||||
public function __construct($tagDocblockLine)
|
||||
{
|
||||
$matches = array();
|
||||
|
||||
if (!preg_match('#^@(\w+)\s+([\w|\\\]+)(?:\s+(\$\S+))?(?:\s+(.*))?#s', $tagDocblockLine, $matches)) {
|
||||
require_once 'Zend/Reflection/Exception.php';
|
||||
throw new Zend_Reflection_Exception('Provided docblock line is does not contain a valid tag');
|
||||
}
|
||||
|
||||
if ($matches[1] != 'param') {
|
||||
require_once 'Zend/Reflection/Exception.php';
|
||||
throw new Zend_Reflection_Exception('Provided docblock line is does not contain a valid @param tag');
|
||||
}
|
||||
|
||||
$this->_name = 'param';
|
||||
$this->_type = $matches[2];
|
||||
|
||||
if (isset($matches[3])) {
|
||||
$this->_variableName = $matches[3];
|
||||
}
|
||||
|
||||
if (isset($matches[4])) {
|
||||
$this->_description = preg_replace('#\s+#', ' ', $matches[4]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get parameter variable type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get parameter name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getVariableName()
|
||||
{
|
||||
return $this->_variableName;
|
||||
}
|
||||
}
|
72
library/Zend/Reflection/Docblock/Tag/Return.php
Normal file
72
library/Zend/Reflection/Docblock/Tag/Return.php
Normal file
|
@ -0,0 +1,72 @@
|
|||
<?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_Reflection
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Return.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/** Zend_Reflection_Docblock_Tag */
|
||||
require_once 'Zend/Reflection/Docblock/Tag.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Reflection
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Reflection_Docblock_Tag_Return extends Zend_Reflection_Docblock_Tag
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_type = null;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $tagDocblockLine
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($tagDocblockLine)
|
||||
{
|
||||
if (!preg_match('#^@(\w+)\s+([\w|\\\]+)(?:\s+(.*))?#', $tagDocblockLine, $matches)) {
|
||||
require_once 'Zend/Reflection/Exception.php';
|
||||
throw new Zend_Reflection_Exception('Provided docblock line is does not contain a valid tag');
|
||||
}
|
||||
|
||||
if ($matches[1] != 'return') {
|
||||
require_once 'Zend/Reflection/Exception.php';
|
||||
throw new Zend_Reflection_Exception('Provided docblock line is does not contain a valid @return tag');
|
||||
}
|
||||
|
||||
$this->_name = 'return';
|
||||
$this->_type = $matches[2];
|
||||
if (isset($matches[3])) {
|
||||
$this->_description = $matches[3];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get return variable type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->_type;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue