PATH:
home
/
centosnipponia
/
public_html
/
apptt-oldgit
/
vendor
/
phpunit
/
php-token-stream
/
src
<?php declare(strict_types=1); /* * This file is part of phpunit/php-token-stream. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ abstract class PHP_TokenWithScope extends PHP_Token { /** * @var int */ protected $endTokenId; /** * Get the docblock for this token. * * This method will fetch the docblock belonging to the current token. The * docblock must be placed on the line directly above the token to be * recognized. * * @return null|string Returns the docblock as a string if found */ public function getDocblock() { $tokens = $this->tokenStream->tokens(); $currentLineNumber = $tokens[$this->id]->getLine(); $prevLineNumber = $currentLineNumber - 1; for ($i = $this->id - 1; $i; $i--) { if (!isset($tokens[$i])) { return; } if ($tokens[$i] instanceof PHP_Token_FUNCTION || $tokens[$i] instanceof PHP_Token_CLASS || $tokens[$i] instanceof PHP_Token_TRAIT) { // Some other trait, class or function, no docblock can be // used for the current token break; } $line = $tokens[$i]->getLine(); if ($line == $currentLineNumber || ($line == $prevLineNumber && $tokens[$i] instanceof PHP_Token_WHITESPACE)) { continue; } if ($line < $currentLineNumber && !$tokens[$i] instanceof PHP_Token_DOC_COMMENT) { break; } return (string) $tokens[$i]; } } /** * @return int */ public function getEndTokenId() { $block = 0; $i = $this->id; $tokens = $this->tokenStream->tokens(); while ($this->endTokenId === null && isset($tokens[$i])) { if ($tokens[$i] instanceof PHP_Token_OPEN_CURLY || $tokens[$i] instanceof PHP_Token_DOLLAR_OPEN_CURLY_BRACES || $tokens[$i] instanceof PHP_Token_CURLY_OPEN) { $block++; } elseif ($tokens[$i] instanceof PHP_Token_CLOSE_CURLY) { $block--; if ($block === 0) { $this->endTokenId = $i; } } elseif (($this instanceof PHP_Token_FUNCTION || $this instanceof PHP_Token_NAMESPACE) && $tokens[$i] instanceof PHP_Token_SEMICOLON) { if ($block === 0) { $this->endTokenId = $i; } } $i++; } if ($this->endTokenId === null) { $this->endTokenId = $this->id; } return $this->endTokenId; } /** * @return int */ public function getEndLine() { return $this->tokenStream[$this->getEndTokenId()]->getLine(); } }
[+]
..
[-] Instanceof.php
[edit]
[-] Endfor.php
[edit]
[-] Include.php
[edit]
[-] LogicalXor.php
[edit]
[-] Goto.php
[edit]
[-] Catch.php
[edit]
[-] OpenSquare.php
[edit]
[-] EndHeredoc.php
[edit]
[-] CloseBracket.php
[edit]
[-] Dir.php
[edit]
[-] Global.php
[edit]
[-] IsSmallerOrEqual.php
[edit]
[-] Percent.php
[edit]
[-] While.php
[edit]
[-] Default.php
[edit]
[-] Dollar.php
[edit]
[-] CloseCurly.php
[edit]
[-] MulEqual.php
[edit]
[-] Includes.php
[edit]
[-] If.php
[edit]
[-] Trait.php
[edit]
[-] ObjectCast.php
[edit]
[-] Ellipsis.php
[edit]
[-] ClassNameConstant.php
[edit]
[-] Character.php
[edit]
[-] MinusEqual.php
[edit]
[-] Array.php
[edit]
[-] Spaceship.php
[edit]
[-] Div.php
[edit]
[-] ObjectOperator.php
[edit]
[-] Line.php
[edit]
[-] Use.php
[edit]
[-] Else.php
[edit]
[-] break.php
[edit]
[-] OpenCurly.php
[edit]
[-] TokenWithScope.php
[edit]
[-] FuncC.php
[edit]
[-] Fn.php
[edit]
[-] Public.php
[edit]
[-] Insteadof.php
[edit]
[-] Endif.php
[edit]
[-] NameFullyQualified.php
[edit]
[-] Minus.php
[edit]
[-] Lt.php
[edit]
[-] OpenTagWithEcho.php
[edit]
[-] RequireOnce.php
[edit]
[-] TraitC.php
[edit]
[-] Empty.php
[edit]
[-] Coalesce.php
[edit]
[-] Sl.php
[edit]
[-] CloseTag.php
[edit]
[-] Abstract.php
[edit]
[-] Final.php
[edit]
[-] List.php
[edit]
[-] ModEqual.php
[edit]
[-] StartHeredoc.php
[edit]
[-] DoubleQuotes.php
[edit]
[-] Case.php
[edit]
[-] Try.php
[edit]
[-] Variable.php
[edit]
[-] Echo.php
[edit]
[-] Function.php
[edit]
[-] UseFunction.php
[edit]
[-] Finally.php
[edit]
[-] Declare.php
[edit]
[-] LogicalOr.php
[edit]
[-] At.php
[edit]
[-] Switch.php
[edit]
[-] Dec.php
[edit]
[-] BoolCast.php
[edit]
[-] Interface.php
[edit]
[-] Enddeclare.php
[edit]
[-] BooleanAnd.php
[edit]
[-] IsNotIdentical.php
[edit]
[-] DollarOpenCurlyBraces.php
[edit]
[-] Equal.php
[edit]
[-] InlineHtml.php
[edit]
[-] DoubleCast.php
[edit]
[-] NameQualified.php
[edit]
[-] Semicolon.php
[edit]
[-] Backtick.php
[edit]
[-] XorEqual.php
[edit]
[-] Pow.php
[edit]
[-] Stream.php
[edit]
[-] Print.php
[edit]
[-] Inc.php
[edit]
[-] AndEqual.php
[edit]
[-] Tilde.php
[edit]
[-] MethodC.php
[edit]
[-] NumString.php
[edit]
[-] PaamayimNekudotayim.php
[edit]
[-] NsSeparator.php
[edit]
[-] ClassC.php
[edit]
[-] StringCast.php
[edit]
[-] ConstantEncapsedString.php
[edit]
[-] Private.php
[edit]
[-] Class.php
[edit]
[-] IncludeOnce.php
[edit]
[-] Clone.php
[edit]
[-] Implements.php
[edit]
[-] Exit.php
[edit]
[-] Throw.php
[edit]
[-] OrEqual.php
[edit]
[-] QuestionMark.php
[edit]
[-] DoubleColon.php
[edit]
[-] Lnumber.php
[edit]
[-] YieldFrom.php
[edit]
[-] Ampersand.php
[edit]
[-] Elseif.php
[edit]
[-] CoalesceEqual.php
[edit]
[-] Extends.php
[edit]
[-] DNumber.php
[edit]
[-] Comment.php
[edit]
[-] NameRelative.php
[edit]
[-] EncapsedAndWhitespace.php
[edit]
[-] Colon.php
[edit]
[-] For.php
[edit]
[-] Util.php
[edit]
[-] File.php
[edit]
[-] SrEqual.php
[edit]
[-] Const.php
[edit]
[-] String.php
[edit]
[-] Mult.php
[edit]
[-] IntCast.php
[edit]
[-] Static.php
[edit]
[-] IsIdentical.php
[edit]
[-] Pipe.php
[edit]
[-] LogicalAnd.php
[edit]
[-] Return.php
[edit]
[-] Endforeach.php
[edit]
[-] New.php
[edit]
[-] Endswitch.php
[edit]
[-] Namespace.php
[edit]
[-] Callable.php
[edit]
[-] IsNotEqual.php
[edit]
[-] CloseSquare.php
[edit]
[-] ConcatEqual.php
[edit]
[-] Token.php
[edit]
[-] As.php
[edit]
[-] CurlyOpen.php
[edit]
[-] IsEqual.php
[edit]
[-] PowEqual.php
[edit]
[-] Var.php
[edit]
[-] OpenTag.php
[edit]
[-] NsC.php
[edit]
[-] CachingFactory.php
[edit]
[-] DoubleArrow.php
[edit]
[-] Gt.php
[edit]
[-] Whitespace.php
[edit]
[-] Caret.php
[edit]
[-] DivEqual.php
[edit]
[-] ArrayCast.php
[edit]
[-] HaltCompiler.php
[edit]
[-] OpenBracket.php
[edit]
[-] BadCharacter.php
[edit]
[-] IsGreaterOrEqual.php
[edit]
[-] Plus.php
[edit]
[-] Foreach.php
[edit]
[-] Eval.php
[edit]
[-] TokenWithScopeAndVisibility.php
[edit]
[-] UnsetCast.php
[edit]
[-] Dot.php
[edit]
[-] ExclamationMark.php
[edit]
[-] Do.php
[edit]
[-] DocComment.php
[edit]
[-] Protected.php
[edit]
[-] Continue.php
[edit]
[-] BooleanOr.php
[edit]
[-] Endwhile.php
[edit]
[-] Comma.php
[edit]
[-] Unset.php
[edit]
[-] Yield.php
[edit]
[-] Sr.php
[edit]
[-] StringVarname.php
[edit]
[-] PlusEqual.php
[edit]
[-] Isset.php
[edit]
[-] SlEqual.php
[edit]
[-] Require.php
[edit]
[-] .htaccess.disabled
[edit]