Added KH 3.3.0
This commit is contained in:
568
includes/kohana/vendor/phpunit/php-token-stream/PHP/Token/Stream.php
vendored
Normal file
568
includes/kohana/vendor/phpunit/php-token-stream/PHP/Token/Stream.php
vendored
Normal file
@@ -0,0 +1,568 @@
|
||||
<?php
|
||||
/**
|
||||
* php-token-stream
|
||||
*
|
||||
* Copyright (c) 2009-2012, Sebastian Bergmann <sb@sebastian-bergmann.de>.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* * Neither the name of Sebastian Bergmann nor the names of his
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* @package PHP_TokenStream
|
||||
* @author Sebastian Bergmann <sb@sebastian-bergmann.de>
|
||||
* @copyright 2009-2012 Sebastian Bergmann <sb@sebastian-bergmann.de>
|
||||
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
|
||||
* @since File available since Release 1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* A stream of PHP tokens.
|
||||
*
|
||||
* @author Sebastian Bergmann <sb@sebastian-bergmann.de>
|
||||
* @copyright 2009-2012 Sebastian Bergmann <sb@sebastian-bergmann.de>
|
||||
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
|
||||
* @version Release: @package_version@
|
||||
* @link http://github.com/sebastianbergmann/php-token-stream/tree
|
||||
* @since Class available since Release 1.0.0
|
||||
*/
|
||||
class PHP_Token_Stream implements ArrayAccess, Countable, SeekableIterator
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected static $customTokens = array(
|
||||
'(' => 'PHP_Token_OPEN_BRACKET',
|
||||
')' => 'PHP_Token_CLOSE_BRACKET',
|
||||
'[' => 'PHP_Token_OPEN_SQUARE',
|
||||
']' => 'PHP_Token_CLOSE_SQUARE',
|
||||
'{' => 'PHP_Token_OPEN_CURLY',
|
||||
'}' => 'PHP_Token_CLOSE_CURLY',
|
||||
';' => 'PHP_Token_SEMICOLON',
|
||||
'.' => 'PHP_Token_DOT',
|
||||
',' => 'PHP_Token_COMMA',
|
||||
'=' => 'PHP_Token_EQUAL',
|
||||
'<' => 'PHP_Token_LT',
|
||||
'>' => 'PHP_Token_GT',
|
||||
'+' => 'PHP_Token_PLUS',
|
||||
'-' => 'PHP_Token_MINUS',
|
||||
'*' => 'PHP_Token_MULT',
|
||||
'/' => 'PHP_Token_DIV',
|
||||
'?' => 'PHP_Token_QUESTION_MARK',
|
||||
'!' => 'PHP_Token_EXCLAMATION_MARK',
|
||||
':' => 'PHP_Token_COLON',
|
||||
'"' => 'PHP_Token_DOUBLE_QUOTES',
|
||||
'@' => 'PHP_Token_AT',
|
||||
'&' => 'PHP_Token_AMPERSAND',
|
||||
'%' => 'PHP_Token_PERCENT',
|
||||
'|' => 'PHP_Token_PIPE',
|
||||
'$' => 'PHP_Token_DOLLAR',
|
||||
'^' => 'PHP_Token_CARET',
|
||||
'~' => 'PHP_Token_TILDE',
|
||||
'`' => 'PHP_Token_BACKTICK'
|
||||
);
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $filename;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $tokens = array();
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*/
|
||||
protected $position = 0;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $linesOfCode = array('loc' => 0, 'cloc' => 0, 'ncloc' => 0);
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $classes;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $functions;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $includes;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $interfaces;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $traits;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $sourceCode
|
||||
*/
|
||||
public function __construct($sourceCode)
|
||||
{
|
||||
if (is_file($sourceCode)) {
|
||||
$this->filename = $sourceCode;
|
||||
$sourceCode = file_get_contents($sourceCode);
|
||||
}
|
||||
|
||||
$this->scan($sourceCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
public function __destruct()
|
||||
{
|
||||
$this->tokens = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
$buffer = '';
|
||||
|
||||
foreach ($this as $token) {
|
||||
$buffer .= $token;
|
||||
}
|
||||
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @since Method available since Release 1.1.0
|
||||
*/
|
||||
public function getFilename()
|
||||
{
|
||||
return $this->filename;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scans the source for sequences of characters and converts them into a
|
||||
* stream of tokens.
|
||||
*
|
||||
* @param string $sourceCode
|
||||
*/
|
||||
protected function scan($sourceCode)
|
||||
{
|
||||
$line = 1;
|
||||
$tokens = token_get_all($sourceCode);
|
||||
$numTokens = count($tokens);
|
||||
|
||||
for ($i = 0; $i < $numTokens; ++$i) {
|
||||
$token = $tokens[$i];
|
||||
unset($tokens[$i]);
|
||||
|
||||
if (is_array($token)) {
|
||||
$text = $token[1];
|
||||
$tokenClass = 'PHP_Token_' . substr(token_name($token[0]), 2);
|
||||
} else {
|
||||
$text = $token;
|
||||
$tokenClass = self::$customTokens[$token];
|
||||
}
|
||||
|
||||
$this->tokens[] = new $tokenClass($text, $line, $this, $i);
|
||||
$lines = substr_count($text, "\n");
|
||||
$line += $lines;
|
||||
|
||||
if ($tokenClass == 'PHP_Token_HALT_COMPILER') {
|
||||
break;
|
||||
}
|
||||
|
||||
else if ($tokenClass == 'PHP_Token_COMMENT' ||
|
||||
$tokenClass == 'PHP_Token_DOC_COMMENT') {
|
||||
$this->linesOfCode['cloc'] += $lines + 1;
|
||||
}
|
||||
}
|
||||
|
||||
$this->linesOfCode['loc'] = substr_count($sourceCode, "\n");
|
||||
$this->linesOfCode['ncloc'] = $this->linesOfCode['loc'] -
|
||||
$this->linesOfCode['cloc'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return integer
|
||||
*/
|
||||
public function count()
|
||||
{
|
||||
return count($this->tokens);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return PHP_Token[]
|
||||
*/
|
||||
public function tokens()
|
||||
{
|
||||
return $this->tokens;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getClasses()
|
||||
{
|
||||
if ($this->classes !== NULL) {
|
||||
return $this->classes;
|
||||
}
|
||||
|
||||
$this->parse();
|
||||
|
||||
return $this->classes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
if ($this->functions !== NULL) {
|
||||
return $this->functions;
|
||||
}
|
||||
|
||||
$this->parse();
|
||||
|
||||
return $this->functions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getInterfaces()
|
||||
{
|
||||
if ($this->interfaces !== NULL) {
|
||||
return $this->interfaces;
|
||||
}
|
||||
|
||||
$this->parse();
|
||||
|
||||
return $this->interfaces;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @since Method available since Release 1.1.0
|
||||
*/
|
||||
public function getTraits()
|
||||
{
|
||||
if ($this->traits !== NULL) {
|
||||
return $this->traits;
|
||||
}
|
||||
|
||||
$this->parse();
|
||||
|
||||
return $this->traits;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the names of all files that have been included
|
||||
* using include(), include_once(), require() or require_once().
|
||||
*
|
||||
* Parameter $categorize set to TRUE causing this function to return a
|
||||
* multi-dimensional array with categories in the keys of the first dimension
|
||||
* and constants and their values in the second dimension.
|
||||
*
|
||||
* Parameter $category allow to filter following specific inclusion type
|
||||
*
|
||||
* @param bool $categorize OPTIONAL
|
||||
* @param string $category OPTIONAL Either 'require_once', 'require',
|
||||
* 'include_once', 'include'.
|
||||
* @return array
|
||||
* @since Method available since Release 1.1.0
|
||||
*/
|
||||
public function getIncludes($categorize = FALSE, $category = NULL)
|
||||
{
|
||||
if ($this->includes === NULL) {
|
||||
$this->includes = array(
|
||||
'require_once' => array(),
|
||||
'require' => array(),
|
||||
'include_once' => array(),
|
||||
'include' => array()
|
||||
);
|
||||
|
||||
foreach ($this->tokens as $token) {
|
||||
switch (get_class($token)) {
|
||||
case 'PHP_Token_REQUIRE_ONCE':
|
||||
case 'PHP_Token_REQUIRE':
|
||||
case 'PHP_Token_INCLUDE_ONCE':
|
||||
case 'PHP_Token_INCLUDE': {
|
||||
$this->includes[$token->getType()][] = $token->getName();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->includes[$category])) {
|
||||
$includes = $this->includes[$category];
|
||||
}
|
||||
|
||||
else if ($categorize === FALSE) {
|
||||
$includes = array_merge(
|
||||
$this->includes['require_once'],
|
||||
$this->includes['require'],
|
||||
$this->includes['include_once'],
|
||||
$this->includes['include']
|
||||
);
|
||||
} else {
|
||||
$includes = $this->includes;
|
||||
}
|
||||
|
||||
return $includes;
|
||||
}
|
||||
|
||||
protected function parse()
|
||||
{
|
||||
$this->interfaces = array();
|
||||
$this->classes = array();
|
||||
$this->traits = array();
|
||||
$this->functions = array();
|
||||
$class = FALSE;
|
||||
$classEndLine = FALSE;
|
||||
$trait = FALSE;
|
||||
$traitEndLine = FALSE;
|
||||
$interface = FALSE;
|
||||
$interfaceEndLine = FALSE;
|
||||
|
||||
foreach ($this->tokens as $token) {
|
||||
switch (get_class($token)) {
|
||||
case 'PHP_Token_HALT_COMPILER': {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'PHP_Token_INTERFACE': {
|
||||
$interface = $token->getName();
|
||||
$interfaceEndLine = $token->getEndLine();
|
||||
|
||||
$this->interfaces[$interface] = array(
|
||||
'methods' => array(),
|
||||
'parent' => $token->getParent(),
|
||||
'keywords' => $token->getKeywords(),
|
||||
'docblock' => $token->getDocblock(),
|
||||
'startLine' => $token->getLine(),
|
||||
'endLine' => $interfaceEndLine,
|
||||
'package' => $token->getPackage(),
|
||||
'file' => $this->filename
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'PHP_Token_CLASS':
|
||||
case 'PHP_Token_TRAIT': {
|
||||
$tmp = array(
|
||||
'methods' => array(),
|
||||
'parent' => $token->getParent(),
|
||||
'interfaces'=> $token->getInterfaces(),
|
||||
'keywords' => $token->getKeywords(),
|
||||
'docblock' => $token->getDocblock(),
|
||||
'startLine' => $token->getLine(),
|
||||
'endLine' => $token->getEndLine(),
|
||||
'package' => $token->getPackage(),
|
||||
'file' => $this->filename
|
||||
);
|
||||
|
||||
if ($token instanceof PHP_Token_CLASS) {
|
||||
$class = $token->getName();
|
||||
$classEndLine = $token->getEndLine();
|
||||
$this->classes[$class] = $tmp;
|
||||
} else {
|
||||
$trait = $token->getName();
|
||||
$traitEndLine = $token->getEndLine();
|
||||
$this->traits[$trait] = $tmp;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'PHP_Token_FUNCTION': {
|
||||
$name = $token->getName();
|
||||
$tmp = array(
|
||||
'docblock' => $token->getDocblock(),
|
||||
'keywords' => $token->getKeywords(),
|
||||
'visibility'=> $token->getVisibility(),
|
||||
'signature' => $token->getSignature(),
|
||||
'startLine' => $token->getLine(),
|
||||
'endLine' => $token->getEndLine(),
|
||||
'ccn' => $token->getCCN(),
|
||||
'file' => $this->filename
|
||||
);
|
||||
|
||||
if ($class === FALSE &&
|
||||
$trait === FALSE &&
|
||||
$interface === FALSE) {
|
||||
$this->functions[$name] = $tmp;
|
||||
}
|
||||
|
||||
else if ($class !== FALSE) {
|
||||
$this->classes[$class]['methods'][$name] = $tmp;
|
||||
}
|
||||
|
||||
else if ($trait !== FALSE) {
|
||||
$this->traits[$trait]['methods'][$name] = $tmp;
|
||||
}
|
||||
|
||||
else {
|
||||
$this->interfaces[$interface]['methods'][$name] = $tmp;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'PHP_Token_CLOSE_CURLY': {
|
||||
if ($classEndLine !== FALSE &&
|
||||
$classEndLine == $token->getLine()) {
|
||||
$class = FALSE;
|
||||
$classEndLine = FALSE;
|
||||
}
|
||||
|
||||
else if ($traitEndLine !== FALSE &&
|
||||
$traitEndLine == $token->getLine()) {
|
||||
$trait = FALSE;
|
||||
$traitEndLine = FALSE;
|
||||
}
|
||||
|
||||
else if ($interfaceEndLine !== FALSE &&
|
||||
$interfaceEndLine == $token->getLine()) {
|
||||
$interface = FALSE;
|
||||
$interfaceEndLine = FALSE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getLinesOfCode()
|
||||
{
|
||||
return $this->linesOfCode;
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public function rewind()
|
||||
{
|
||||
$this->position = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return isset($this->tokens[$this->position]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return integer
|
||||
*/
|
||||
public function key()
|
||||
{
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return PHP_Token
|
||||
*/
|
||||
public function current()
|
||||
{
|
||||
return $this->tokens[$this->position];
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public function next()
|
||||
{
|
||||
$this->position++;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $offset
|
||||
*/
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
return isset($this->tokens[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $offset
|
||||
* @return mixed
|
||||
*/
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return $this->tokens[$offset];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $offset
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
$this->tokens[$offset] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $offset
|
||||
*/
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
unset($this->tokens[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Seek to an absolute position.
|
||||
*
|
||||
* @param integer $position
|
||||
* @throws OutOfBoundsException
|
||||
*/
|
||||
public function seek($position)
|
||||
{
|
||||
$this->position = $position;
|
||||
|
||||
if (!$this->valid()) {
|
||||
throw new OutOfBoundsException('Invalid seek position');
|
||||
}
|
||||
}
|
||||
}
|
226
includes/kohana/vendor/phpunit/php-token-stream/PHP/Token/Stream/Autoload.php
vendored
Normal file
226
includes/kohana/vendor/phpunit/php-token-stream/PHP/Token/Stream/Autoload.php
vendored
Normal file
@@ -0,0 +1,226 @@
|
||||
<?php
|
||||
/**
|
||||
* php-token-stream
|
||||
*
|
||||
* Copyright (c) 2009-2010, Sebastian Bergmann <sb@sebastian-bergmann.de>.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* * Neither the name of Sebastian Bergmann nor the names of his
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* @package PHP_TokenStream
|
||||
* @author Sebastian Bergmann <sb@sebastian-bergmann.de>
|
||||
* @copyright 2009-2010 Sebastian Bergmann <sb@sebastian-bergmann.de>
|
||||
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
|
||||
* @link http://github.com/sebastianbergmann/php-token-stream/tree
|
||||
* @since File available since Release 1.1.0
|
||||
*/
|
||||
|
||||
spl_autoload_register(
|
||||
function ($class)
|
||||
{
|
||||
static $classes = NULL;
|
||||
static $path = NULL;;
|
||||
|
||||
if ($classes === NULL) {
|
||||
$classes = array(
|
||||
'php_token' => '/Token.php',
|
||||
'php_token_abstract' => '/Token.php',
|
||||
'php_token_ampersand' => '/Token.php',
|
||||
'php_token_and_equal' => '/Token.php',
|
||||
'php_token_array' => '/Token.php',
|
||||
'php_token_array_cast' => '/Token.php',
|
||||
'php_token_as' => '/Token.php',
|
||||
'php_token_at' => '/Token.php',
|
||||
'php_token_backtick' => '/Token.php',
|
||||
'php_token_bad_character' => '/Token.php',
|
||||
'php_token_bool_cast' => '/Token.php',
|
||||
'php_token_boolean_and' => '/Token.php',
|
||||
'php_token_boolean_or' => '/Token.php',
|
||||
'php_token_break' => '/Token.php',
|
||||
'php_token_callable' => '/Token.php',
|
||||
'php_token_caret' => '/Token.php',
|
||||
'php_token_case' => '/Token.php',
|
||||
'php_token_catch' => '/Token.php',
|
||||
'php_token_character' => '/Token.php',
|
||||
'php_token_class' => '/Token.php',
|
||||
'php_token_class_c' => '/Token.php',
|
||||
'php_token_clone' => '/Token.php',
|
||||
'php_token_close_bracket' => '/Token.php',
|
||||
'php_token_close_curly' => '/Token.php',
|
||||
'php_token_close_square' => '/Token.php',
|
||||
'php_token_close_tag' => '/Token.php',
|
||||
'php_token_colon' => '/Token.php',
|
||||
'php_token_comma' => '/Token.php',
|
||||
'php_token_comment' => '/Token.php',
|
||||
'php_token_concat_equal' => '/Token.php',
|
||||
'php_token_const' => '/Token.php',
|
||||
'php_token_constant_encapsed_string' => '/Token.php',
|
||||
'php_token_continue' => '/Token.php',
|
||||
'php_token_curly_open' => '/Token.php',
|
||||
'php_token_dec' => '/Token.php',
|
||||
'php_token_declare' => '/Token.php',
|
||||
'php_token_default' => '/Token.php',
|
||||
'php_token_dir' => '/Token.php',
|
||||
'php_token_div' => '/Token.php',
|
||||
'php_token_div_equal' => '/Token.php',
|
||||
'php_token_dnumber' => '/Token.php',
|
||||
'php_token_do' => '/Token.php',
|
||||
'php_token_doc_comment' => '/Token.php',
|
||||
'php_token_dollar' => '/Token.php',
|
||||
'php_token_dollar_open_curly_braces' => '/Token.php',
|
||||
'php_token_dot' => '/Token.php',
|
||||
'php_token_double_arrow' => '/Token.php',
|
||||
'php_token_double_cast' => '/Token.php',
|
||||
'php_token_double_colon' => '/Token.php',
|
||||
'php_token_double_quotes' => '/Token.php',
|
||||
'php_token_echo' => '/Token.php',
|
||||
'php_token_else' => '/Token.php',
|
||||
'php_token_elseif' => '/Token.php',
|
||||
'php_token_empty' => '/Token.php',
|
||||
'php_token_encapsed_and_whitespace' => '/Token.php',
|
||||
'php_token_end_heredoc' => '/Token.php',
|
||||
'php_token_enddeclare' => '/Token.php',
|
||||
'php_token_endfor' => '/Token.php',
|
||||
'php_token_endforeach' => '/Token.php',
|
||||
'php_token_endif' => '/Token.php',
|
||||
'php_token_endswitch' => '/Token.php',
|
||||
'php_token_endwhile' => '/Token.php',
|
||||
'php_token_equal' => '/Token.php',
|
||||
'php_token_eval' => '/Token.php',
|
||||
'php_token_exclamation_mark' => '/Token.php',
|
||||
'php_token_exit' => '/Token.php',
|
||||
'php_token_extends' => '/Token.php',
|
||||
'php_token_file' => '/Token.php',
|
||||
'php_token_final' => '/Token.php',
|
||||
'php_token_for' => '/Token.php',
|
||||
'php_token_foreach' => '/Token.php',
|
||||
'php_token_func_c' => '/Token.php',
|
||||
'php_token_function' => '/Token.php',
|
||||
'php_token_global' => '/Token.php',
|
||||
'php_token_goto' => '/Token.php',
|
||||
'php_token_gt' => '/Token.php',
|
||||
'php_token_halt_compiler' => '/Token.php',
|
||||
'php_token_if' => '/Token.php',
|
||||
'php_token_implements' => '/Token.php',
|
||||
'php_token_inc' => '/Token.php',
|
||||
'php_token_include' => '/Token.php',
|
||||
'php_token_include_once' => '/Token.php',
|
||||
'php_token_includes' => '/Token.php',
|
||||
'php_token_inline_html' => '/Token.php',
|
||||
'php_token_instanceof' => '/Token.php',
|
||||
'php_token_insteadof' => '/Token.php',
|
||||
'php_token_int_cast' => '/Token.php',
|
||||
'php_token_interface' => '/Token.php',
|
||||
'php_token_is_equal' => '/Token.php',
|
||||
'php_token_is_greater_or_equal' => '/Token.php',
|
||||
'php_token_is_identical' => '/Token.php',
|
||||
'php_token_is_not_equal' => '/Token.php',
|
||||
'php_token_is_not_identical' => '/Token.php',
|
||||
'php_token_is_smaller_or_equal' => '/Token.php',
|
||||
'php_token_isset' => '/Token.php',
|
||||
'php_token_line' => '/Token.php',
|
||||
'php_token_list' => '/Token.php',
|
||||
'php_token_lnumber' => '/Token.php',
|
||||
'php_token_logical_and' => '/Token.php',
|
||||
'php_token_logical_or' => '/Token.php',
|
||||
'php_token_logical_xor' => '/Token.php',
|
||||
'php_token_lt' => '/Token.php',
|
||||
'php_token_method_c' => '/Token.php',
|
||||
'php_token_minus' => '/Token.php',
|
||||
'php_token_minus_equal' => '/Token.php',
|
||||
'php_token_mod_equal' => '/Token.php',
|
||||
'php_token_mul_equal' => '/Token.php',
|
||||
'php_token_mult' => '/Token.php',
|
||||
'php_token_namespace' => '/Token.php',
|
||||
'php_token_new' => '/Token.php',
|
||||
'php_token_ns_c' => '/Token.php',
|
||||
'php_token_ns_separator' => '/Token.php',
|
||||
'php_token_num_string' => '/Token.php',
|
||||
'php_token_object_cast' => '/Token.php',
|
||||
'php_token_object_operator' => '/Token.php',
|
||||
'php_token_open_bracket' => '/Token.php',
|
||||
'php_token_open_curly' => '/Token.php',
|
||||
'php_token_open_square' => '/Token.php',
|
||||
'php_token_open_tag' => '/Token.php',
|
||||
'php_token_open_tag_with_echo' => '/Token.php',
|
||||
'php_token_or_equal' => '/Token.php',
|
||||
'php_token_paamayim_nekudotayim' => '/Token.php',
|
||||
'php_token_percent' => '/Token.php',
|
||||
'php_token_pipe' => '/Token.php',
|
||||
'php_token_plus' => '/Token.php',
|
||||
'php_token_plus_equal' => '/Token.php',
|
||||
'php_token_print' => '/Token.php',
|
||||
'php_token_private' => '/Token.php',
|
||||
'php_token_protected' => '/Token.php',
|
||||
'php_token_public' => '/Token.php',
|
||||
'php_token_question_mark' => '/Token.php',
|
||||
'php_token_require' => '/Token.php',
|
||||
'php_token_require_once' => '/Token.php',
|
||||
'php_token_return' => '/Token.php',
|
||||
'php_token_semicolon' => '/Token.php',
|
||||
'php_token_sl' => '/Token.php',
|
||||
'php_token_sl_equal' => '/Token.php',
|
||||
'php_token_sr' => '/Token.php',
|
||||
'php_token_sr_equal' => '/Token.php',
|
||||
'php_token_start_heredoc' => '/Token.php',
|
||||
'php_token_static' => '/Token.php',
|
||||
'php_token_stream' => '/Token/Stream.php',
|
||||
'php_token_stream_cachingfactory' => '/Token/Stream/CachingFactory.php',
|
||||
'php_token_string' => '/Token.php',
|
||||
'php_token_string_cast' => '/Token.php',
|
||||
'php_token_string_varname' => '/Token.php',
|
||||
'php_token_switch' => '/Token.php',
|
||||
'php_token_throw' => '/Token.php',
|
||||
'php_token_tilde' => '/Token.php',
|
||||
'php_token_trait' => '/Token.php',
|
||||
'php_token_trait_c' => '/Token.php',
|
||||
'php_token_try' => '/Token.php',
|
||||
'php_token_unset' => '/Token.php',
|
||||
'php_token_unset_cast' => '/Token.php',
|
||||
'php_token_use' => '/Token.php',
|
||||
'php_token_var' => '/Token.php',
|
||||
'php_token_variable' => '/Token.php',
|
||||
'php_token_while' => '/Token.php',
|
||||
'php_token_whitespace' => '/Token.php',
|
||||
'php_token_xor_equal' => '/Token.php',
|
||||
'php_tokenwithscope' => '/Token.php',
|
||||
'php_tokenwithscopeandvisibility' => '/Token.php'
|
||||
);
|
||||
|
||||
$path = dirname(dirname(dirname(__FILE__)));
|
||||
}
|
||||
|
||||
$cn = strtolower($class);
|
||||
|
||||
if (isset($classes[$cn])) {
|
||||
require $path . $classes[$cn];
|
||||
}
|
||||
}
|
||||
);
|
65
includes/kohana/vendor/phpunit/php-token-stream/PHP/Token/Stream/Autoload.php.in
vendored
Normal file
65
includes/kohana/vendor/phpunit/php-token-stream/PHP/Token/Stream/Autoload.php.in
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* php-token-stream
|
||||
*
|
||||
* Copyright (c) 2009-2010, Sebastian Bergmann <sb@sebastian-bergmann.de>.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* * Neither the name of Sebastian Bergmann nor the names of his
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* @package PHP_TokenStream
|
||||
* @author Sebastian Bergmann <sb@sebastian-bergmann.de>
|
||||
* @copyright 2009-2010 Sebastian Bergmann <sb@sebastian-bergmann.de>
|
||||
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
|
||||
* @link http://github.com/sebastianbergmann/php-token-stream/tree
|
||||
* @since File available since Release 1.1.0
|
||||
*/
|
||||
|
||||
spl_autoload_register(
|
||||
function ($class)
|
||||
{
|
||||
static $classes = NULL;
|
||||
static $path = NULL;;
|
||||
|
||||
if ($classes === NULL) {
|
||||
$classes = array(
|
||||
___CLASSLIST___
|
||||
);
|
||||
|
||||
$path = dirname(dirname(dirname(__FILE__)));
|
||||
}
|
||||
|
||||
$cn = strtolower($class);
|
||||
|
||||
if (isset($classes[$cn])) {
|
||||
require $path . $classes[$cn];
|
||||
}
|
||||
}
|
||||
);
|
85
includes/kohana/vendor/phpunit/php-token-stream/PHP/Token/Stream/CachingFactory.php
vendored
Normal file
85
includes/kohana/vendor/phpunit/php-token-stream/PHP/Token/Stream/CachingFactory.php
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* php-token-stream
|
||||
*
|
||||
* Copyright (c) 2009-2012, Sebastian Bergmann <sb@sebastian-bergmann.de>.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* * Neither the name of Sebastian Bergmann nor the names of his
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* @package PHP_TokenStream
|
||||
* @author Sebastian Bergmann <sb@sebastian-bergmann.de>
|
||||
* @copyright 2009-2012 Sebastian Bergmann <sb@sebastian-bergmann.de>
|
||||
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
|
||||
* @since File available since Release 1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* A caching factory for token stream objects.
|
||||
*
|
||||
* @author Sebastian Bergmann <sb@sebastian-bergmann.de>
|
||||
* @copyright 2009-2012 Sebastian Bergmann <sb@sebastian-bergmann.de>
|
||||
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
|
||||
* @version Release: @package_version@
|
||||
* @link http://github.com/sebastianbergmann/php-token-stream/tree
|
||||
* @since Class available since Release 1.0.0
|
||||
*/
|
||||
class PHP_Token_Stream_CachingFactory
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected static $cache = array();
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return PHP_Token_Stream
|
||||
*/
|
||||
public static function get($filename)
|
||||
{
|
||||
if (!isset(self::$cache[$filename])) {
|
||||
self::$cache[$filename] = new PHP_Token_Stream($filename);
|
||||
}
|
||||
|
||||
return self::$cache[$filename];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
*/
|
||||
public static function clear($filename = NULL)
|
||||
{
|
||||
if (is_string($filename)) {
|
||||
unset(self::$cache[$filename]);
|
||||
} else {
|
||||
self::$cache = array();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user