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. */ class PHP_Token_INTERFACE extends PHP_TokenWithScopeAndVisibility { /** * @var array */ protected $interfaces; /** * @return string */ public function getName() { return (string) $this->tokenStream[$this->id + 2]; } /** * @return bool */ public function hasParent() { return $this->tokenStream[$this->id + 4] instanceof PHP_Token_EXTENDS; } /** * @return array */ public function getPackage() { $result = [ 'namespace' => '', 'fullPackage' => '', 'category' => '', 'package' => '', 'subpackage' => '', ]; $docComment = $this->getDocblock(); $className = $this->getName(); for ($i = $this->id; $i; --$i) { if ($this->tokenStream[$i] instanceof PHP_Token_NAMESPACE) { $result['namespace'] = $this->tokenStream[$i]->getName(); break; } } if ($docComment === null) { return $result; } if (\preg_match('/@category[\s]+([\.\w]+)/', $docComment, $matches)) { $result['category'] = $matches[1]; } if (\preg_match('/@package[\s]+([\.\w]+)/', $docComment, $matches)) { $result['package'] = $matches[1]; $result['fullPackage'] = $matches[1]; } if (\preg_match('/@subpackage[\s]+([\.\w]+)/', $docComment, $matches)) { $result['subpackage'] = $matches[1]; $result['fullPackage'] .= '.' . $matches[1]; } if (empty($result['fullPackage'])) { $result['fullPackage'] = $this->arrayToName( \explode('_', \str_replace('\\', '_', $className)), '.' ); } return $result; } /** * @return bool|string */ public function getParent() { if (!$this->hasParent()) { return false; } $i = $this->id + 6; $tokens = $this->tokenStream->tokens(); $className = (string) $tokens[$i]; while (isset($tokens[$i + 1]) && !$tokens[$i + 1] instanceof PHP_Token_WHITESPACE) { $className .= (string) $tokens[++$i]; } return $className; } /** * @return bool */ public function hasInterfaces() { return (isset($this->tokenStream[$this->id + 4]) && $this->tokenStream[$this->id + 4] instanceof PHP_Token_IMPLEMENTS) || (isset($this->tokenStream[$this->id + 8]) && $this->tokenStream[$this->id + 8] instanceof PHP_Token_IMPLEMENTS); } /** * @return array|bool */ public function getInterfaces() { if ($this->interfaces !== null) { return $this->interfaces; } if (!$this->hasInterfaces()) { return $this->interfaces = false; } if ($this->tokenStream[$this->id + 4] instanceof PHP_Token_IMPLEMENTS) { $i = $this->id + 3; } else { $i = $this->id + 7; } $tokens = $this->tokenStream->tokens(); while (!$tokens[$i + 1] instanceof PHP_Token_OPEN_CURLY) { $i++; if ($tokens[$i] instanceof PHP_Token_STRING) { $this->interfaces[] = (string) $tokens[$i]; } } return $this->interfaces; } /** * @param string $join * * @return string */ protected function arrayToName(array $parts, $join = '\\') { $result = ''; if (\count($parts) > 1) { \array_pop($parts); $result = \implode($join, $parts); } return $result; } }
[+]
..
[-] 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]