Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Strip whitespace (or other characters) from the beginning and end of a string
<?php trim(string $string, string $characters = " \n\r\t\v\x00"): string
<?php }
$itemInfo['end'] = ($hasKey - 1);
$itemInfo['raw'] = \trim(GetTokensAsString::normal($phpcsFile, $itemInfo['start'], $itemInfo['end']));
$itemInfo['clean'] = \trim(GetTokensAsString::compact($phpcsFile, $itemInfo['start'], $itemInfo['end'], true));
$patterns[] = $itemInfo;
}
<?php $itemInfo['end'] = ($hasKey - 1);
$itemInfo['raw'] = \trim(GetTokensAsString::normal($phpcsFile, $itemInfo['start'], $itemInfo['end']));
$itemInfo['clean'] = \trim(GetTokensAsString::compact($phpcsFile, $itemInfo['start'], $itemInfo['end'], true));
$patterns[] = $itemInfo;
}
<?php if ($hasKey !== false) {
$itemInfo['start'] = ($hasKey + 1);
$itemInfo['raw'] = \trim(GetTokensAsString::normal($phpcsFile, $itemInfo['start'], $itemInfo['end']));
$itemInfo['clean'] = \trim(GetTokensAsString::compact($phpcsFile, $itemInfo['start'], $itemInfo['end'], true));
}
<?php $itemInfo['start'] = ($hasKey + 1);
$itemInfo['raw'] = \trim(GetTokensAsString::normal($phpcsFile, $itemInfo['start'], $itemInfo['end']));
$itemInfo['clean'] = \trim(GetTokensAsString::compact($phpcsFile, $itemInfo['start'], $itemInfo['end'], true));
}
$patterns[] = $itemInfo;
<?php $content = Sniff::stripVariables($content);
}
$regex .= \trim($content);
} catch (RuntimeException $e) {
}
<?php $testVersion = Helper::getConfigData('testversion');
}
$testVersion = \trim((string) $testVersion);
if (empty($testVersion) === false && isset($arrTestVersions[$testVersion]) === false) {
<?php $end = $phpcsFile->findNext($find, ($start + 1), null, true, null, true);
$className = $phpcsFile->getTokensAsString($start, ($end - $start));
$className = \trim($className);
return $this->getFQName($phpcsFile, $stackPtr, $className);
}
<?php $start = ($start + 1);
$className = $phpcsFile->getTokensAsString($start, ($stackPtr - $start));
$className = \trim($className);
return $this->getFQName($phpcsFile, $stackPtr, $className);
}
<?php $content = 0.0;
} else {
$content = (float) \trim($intMatch[0]);
}
} else {
if ($intString !== 1 && $floatString !== 1) {
<?php if ($intString !== 1 && $floatString !== 1) {
$content = 0.0;
} else {
$content = ($floatString === 1) ? (float) \trim($floatMatch[0]) : (float) \trim($intMatch[0]);
}
}
<?php }
if ($intString === 1 && \trim($intMatch[0]) === '0'
&& \preg_match('`^\s*(0x[A-Fa-f0-9]+)`', $stringContent, $hexNumberString) === 1
&& $this->supportsBelow('5.6') === true
) {
<?php if (($i + 1) === $length) {
$contents = '';
} else {
$contents = \trim(\substr($contents, ($i + 1)));
}
break;
}
<?php }
$endToken = $phpcsFile->findNext([\T_SEMICOLON, \T_OPEN_CURLY_BRACKET], ($stackPtr + 1), null, false, null, true);
$namespaceName = \trim($phpcsFile->getTokensAsString(($stackPtr + 1), ($endToken - $stackPtr - 1)));
if (empty($namespaceName) === true) {
return;
}
<?php $tokens = $phpcsFile->getTokens();
$openTag = $tokens[$stackPtr];
$content = \trim($openTag['content']);
if ($content === '' || $content === '<?php') {
return;
<?php if ($tokens[$i]['code'] === \T_DOUBLE_QUOTED_STRING) {
$content = $this->stripVariables($content);
}
$content = \trim($content);
if (empty($content) === false) {
$options .= $content;