private function fixAssert(Tokens $tokens, array $assertIndexes)
{
list($isPositive, $assertCallIndex, , $testDefaultNamespaceTokenIndex, $testIndex, $testOpenIndex, $testCloseIndex, $assertCallCloseIndex) = $assertIndexes;
$content = strtolower($tokens[$testIndex]->getContent());
if (!in_array($content, $this->configuration, true)) {
return $assertCallCloseIndex;
}
if (is_array($this->fixMap[$content])) {
if (false !== $this->fixMap[$content][$isPositive]) {
$tokens[$assertCallIndex]->setContent($this->fixMap[$content][$isPositive]);
$this->removeFunctionCall($tokens, $testDefaultNamespaceTokenIndex, $testIndex, $testOpenIndex, $testCloseIndex);
}
return $assertCallCloseIndex;
}
$type = substr($content, 3);
$tokens[$assertCallIndex]->setContent($isPositive ? 'assertInternalType' : 'assertNotInternalType');
$tokens->overrideAt($testIndex, array(T_CONSTANT_ENCAPSED_STRING, "'" . $type . "'"));
$tokens->overrideAt($testOpenIndex, ',');
$tokens->clearTokenAndMergeSurroundingWhitespace($testCloseIndex);
if (!$tokens[$testOpenIndex + 1]->isWhitespace()) {
$tokens->insertAt($testOpenIndex + 1, new Token(array(T_WHITESPACE, ' ')));
}
if (false !== $testDefaultNamespaceTokenIndex) {
$tokens->clearTokenAndMergeSurroundingWhitespace($testDefaultNamespaceTokenIndex);
}
return $assertCallCloseIndex;
}