38 $this->extractComments =
false;
48 $this->tokens = array_values(
52 return !is_array($token) || $token[0] !== T_WHITESPACE;
63 $count = count($this->tokens);
64 $bufferFunctions =
array();
69 for ($k = 0; $k < $count; ++$k) {
70 $value = $this->tokens[$k];
72 if (is_string($value)) {
73 if (isset($bufferFunctions[0])) {
76 $bufferFunctions[0]->nextArgument();
79 $functions[] = array_shift($bufferFunctions)->close();
84 $bufferFunctions[0]->stopArgument();
92 case T_CONSTANT_ENCAPSED_STRING:
94 if (isset($bufferFunctions[0])) {
99 if (isset($bufferFunctions[0])) {
100 $bufferFunctions[0]->stopArgument();
103 for ($j = $k + 1; $j < $count; ++$j) {
104 $nextToken = $this->tokens[$j];
105 if (is_array($nextToken) && $nextToken[0] === T_COMMENT) {
108 if ($nextToken ===
'(') {
110 if ($k > 0 && is_array($this->tokens[$k - 1]) && $this->tokens[$k - 1][0] === T_COMMENT) {
116 array_unshift($bufferFunctions, $newFunction);
123 if (isset($bufferFunctions[0])) {
126 $bufferFunctions[0]->addComment(
$comment);
131 if (isset($bufferFunctions[0])) {
132 $bufferFunctions[0]->stopArgument();
144 if ($this->extractComments !==
false) {
145 if ($value[0] ===
'#') {
146 $value = substr($value, 1);
147 } elseif ($value[1] ===
'/') {
148 $value = substr($value, 2);
150 $value = substr($value, 2, -2);
152 $value = trim($value);
153 if ($value !==
'' && ($this->extractComments ===
'' || strpos($value, $this->extractComments) === 0)) {
Function parsed by PhpFunctionsScanner.
__construct($code)
Constructor.
Create styles array
The data for the language used.
disableCommentsExtraction()
Disable comments extraction.
enableCommentsExtraction($tag='')
Enable extracting comments that start with a tag (if $tag is empty all the comments will be extracted...
if(function_exists('posix_getuid') &&posix_getuid()===0) if(!array_key_exists('t', $options)) $tag