本文整理汇总了PHP中PhpCsFixer\Tokenizer\Tokens::isTokenKindFound方法的典型用法代码示例。如果您正苦于以下问题:PHP Tokens::isTokenKindFound方法的具体用法?PHP Tokens::isTokenKindFound怎么用?PHP Tokens::isTokenKindFound使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhpCsFixer\Tokenizer\Tokens
的用法示例。
在下文中一共展示了Tokens::isTokenKindFound方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isCandidate
/**
* {@inheritdoc}
*/
public function isCandidate(Tokens $tokens)
{
// handle `T_ELSE T_WHITESPACE T_IF` treated as single `T_ELSEIF` by HHVM
// see https://github.com/facebook/hhvm/issues/4796
if (defined('HHVM_VERSION') && $tokens->isTokenKindFound(T_ELSEIF)) {
return true;
}
return $tokens->isAllTokenKindsFound(array(T_IF, T_ELSE));
}
示例2: isCandidate
/**
* {@inheritdoc}
*/
public function isCandidate(Tokens $tokens)
{
return $tokens->isTokenKindFound(T_OBJECT_OPERATOR);
}
示例3: isCandidate
/**
* {@inheritdoc}
*/
public function isCandidate(Tokens $tokens)
{
return $tokens->isTokenKindFound(CT::T_ARRAY_SQUARE_BRACE_OPEN);
}
示例4: isCandidate
/**
* {@inheritdoc}
*/
public function isCandidate(Tokens $tokens)
{
return $tokens->isTokenKindFound(T_OPEN_TAG_WITH_ECHO) || defined('HHVM_VERSION') && $tokens->isTokenKindFound(T_ECHO);
}
示例5: isCandidate
/**
* {@inheritdoc}
*/
public function isCandidate(Tokens $tokens)
{
return $tokens->isTokenKindFound(T_START_HEREDOC);
}
示例6: isCandidate
/**
* {@inheritdoc}
*/
public function isCandidate(Tokens $tokens)
{
return $tokens->isTokenKindFound(CT_ARRAY_INDEX_CURLY_BRACE_OPEN);
}
示例7: isCandidate
/**
* {@inheritdoc}
*/
public function isCandidate(Tokens $tokens)
{
return $tokens->isTokenKindFound(T_DOC_COMMENT);
}
示例8: isCandidate
/**
* {@inheritdoc}
*/
public function isCandidate(Tokens $tokens)
{
return $tokens->isTokenKindFound(T_IS_NOT_EQUAL);
}
示例9: isCandidate
/**
* {@inheritdoc}
*/
public function isCandidate(Tokens $tokens)
{
return $tokens->isTokenKindFound(CT::T_CLASS_CONSTANT);
}
示例10: isCandidate
/**
* {@inheritdoc}
*/
public function isCandidate(Tokens $tokens)
{
return $tokens->isTokenKindFound(T_OPEN_TAG_WITH_ECHO);
}
示例11: assertTokens
private function assertTokens(Tokens $expectedTokens, Tokens $inputTokens)
{
foreach ($expectedTokens as $index => $expectedToken) {
$inputToken = $inputTokens[$index];
$this->assertTrue($expectedToken->equals($inputToken), sprintf('The token at index %d must be %s, got %s', $index, $expectedToken->toJson(), $inputToken->toJson()));
}
$this->assertSame($expectedTokens->count(), $inputTokens->count(), 'The collection must have the same length than the expected one.');
$foundTokenKinds = array_keys(AccessibleObject::create($expectedTokens)->foundTokenKinds);
foreach ($foundTokenKinds as $tokenKind) {
$this->assertTrue($inputTokens->isTokenKindFound($tokenKind), sprintf('The token kind %s must be found in fixed tokens collection.', $tokenKind));
}
}
示例12: isCandidate
/**
* {@inheritdoc}
*/
public function isCandidate(Tokens $tokens)
{
return $tokens->isTokenKindFound(T_DOUBLE_ARROW);
}
示例13: isCandidate
/**
* {@inheritdoc}
*/
public function isCandidate(Tokens $tokens)
{
return $tokens->isTokenKindFound($this->candidateTokenType);
}
示例14: isCandidate
/**
* {@inheritdoc}
*/
public function isCandidate(Tokens $tokens)
{
return PHP_VERSION_ID >= 70000 && $tokens->isTokenKindFound(CT::T_TYPE_COLON);
}
示例15: isCandidate
/**
* {@inheritdoc}
*/
public function isCandidate(Tokens $tokens)
{
return $tokens->isTokenKindFound(T_ARRAY);
}