|
@@ -237,7 +237,7 @@ class Foo
|
|
|
$commentIndex = $tokens->getNextNonWhitespace($prevIndex);
|
|
|
$commentToken = $tokens[$commentIndex];
|
|
|
|
|
|
- if (!$commentToken->isGivenKind(T_COMMENT) || 0 === strpos($commentToken->getContent(), '/*')) {
|
|
|
+ if (!$commentToken->isGivenKind(T_COMMENT) || str_starts_with($commentToken->getContent(), '/*')) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
@@ -599,7 +599,7 @@ class Foo
|
|
|
if (
|
|
|
!$isAnonymousClass
|
|
|
&& $tokens[$closingParenthesisIndex - 1]->isWhitespace()
|
|
|
- && false !== strpos($tokens[$closingParenthesisIndex - 1]->getContent(), "\n")
|
|
|
+ && str_contains($tokens[$closingParenthesisIndex - 1]->getContent(), "\n")
|
|
|
) {
|
|
|
if (!$tokens[$startBraceIndex - 2]->isComment()) {
|
|
|
$tokens->ensureWhitespaceAtIndex($startBraceIndex - 1, 1, ' ');
|
|
@@ -888,8 +888,8 @@ class Foo
|
|
|
$previousToken->isWhitespace()
|
|
|
&& 1 === Preg::match('/\R$/', $previousToken->getContent())
|
|
|
&& (
|
|
|
- (0 === strpos($nextTokenContent, '//'.$this->whitespacesConfig->getIndent()) || '//' === $nextTokenContent)
|
|
|
- || (0 === strpos($nextTokenContent, '#'.$this->whitespacesConfig->getIndent()) || '#' === $nextTokenContent)
|
|
|
+ (str_starts_with($nextTokenContent, '//'.$this->whitespacesConfig->getIndent()) || '//' === $nextTokenContent)
|
|
|
+ || (str_starts_with($nextTokenContent, '#'.$this->whitespacesConfig->getIndent()) || '#' === $nextTokenContent)
|
|
|
)
|
|
|
) {
|
|
|
return;
|
|
@@ -911,7 +911,7 @@ class Foo
|
|
|
private function isMultilined(Tokens $tokens, int $startParenthesisIndex, int $endParenthesisIndex): bool
|
|
|
{
|
|
|
for ($i = $startParenthesisIndex; $i < $endParenthesisIndex; ++$i) {
|
|
|
- if (false !== strpos($tokens[$i]->getContent(), "\n")) {
|
|
|
+ if (str_contains($tokens[$i]->getContent(), "\n")) {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
@@ -933,7 +933,7 @@ class Foo
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- if (0 === strpos($tokens[$index]->getContent(), '/*')) {
|
|
|
+ if (str_starts_with($tokens[$index]->getContent(), '/*')) {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -979,7 +979,7 @@ class Foo
|
|
|
if (null === $siblingIndex) {
|
|
|
return null;
|
|
|
}
|
|
|
- } while (0 === strpos($tokens[$siblingIndex]->getContent(), '/*'));
|
|
|
+ } while (str_starts_with($tokens[$siblingIndex]->getContent(), '/*'));
|
|
|
|
|
|
$newLines = 0;
|
|
|
for ($i = min($siblingIndex, $index) + 1, $max = max($siblingIndex, $index); $i < $max; ++$i) {
|