Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kukulich committed Jul 8, 2022
1 parent 0e4df34 commit 1cd31e0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
30 changes: 15 additions & 15 deletions SlevomatCodingStandard/Helpers/TokenHelper.php
Expand Up @@ -58,15 +58,15 @@
class TokenHelper
{

/** @var (int|string)[] */
/** @var array<int, (int|string)> */
public static $typeKeywordTokenCodes = [
T_CLASS,
T_TRAIT,
T_INTERFACE,
T_ENUM,
];

/** @var (int|string)[] */
/** @var array<int, (int|string)> */
public static $ineffectiveTokenCodes = [
T_WHITESPACE,
T_COMMENT,
Expand All @@ -84,7 +84,7 @@ class TokenHelper
T_PHPCS_SET,
];

/** @var (int|string)[] */
/** @var array<int, (int|string)> */
public static $inlineCommentTokenCodes = [
T_COMMENT,
T_PHPCS_DISABLE,
Expand All @@ -94,7 +94,7 @@ class TokenHelper
T_PHPCS_SET,
];

/** @var (int|string)[] */
/** @var array<int, (int|string)> */
public static $earlyExitTokenCodes = [
T_RETURN,
T_CONTINUE,
Expand All @@ -103,14 +103,14 @@ class TokenHelper
T_EXIT,
];

/** @var (int|string)[] */
/** @var array<int, (int|string)> */
public static $functionTokenCodes = [
T_FUNCTION,
T_CLOSURE,
T_FN,
];

/** @var (int|string)[] */
/** @var array<int, (int|string)> */
public static $propertyModifiersTokenCodes = [
T_VAR,
T_PUBLIC,
Expand All @@ -121,7 +121,7 @@ class TokenHelper
];

/**
* @param (int|string)|(int|string)[] $types
* @param int|string|array<int|string, int|string> $types
*/
public static function findNext(File $phpcsFile, $types, int $startPointer, ?int $endPointer = null): ?int
{
Expand All @@ -131,7 +131,7 @@ public static function findNext(File $phpcsFile, $types, int $startPointer, ?int
}

/**
* @param (int|string)|(int|string)[] $types
* @param int|string|array<int|string, int|string> $types
* @return int[]
*/
public static function findNextAll(File $phpcsFile, $types, int $startPointer, ?int $endPointer = null): array
Expand All @@ -153,7 +153,7 @@ public static function findNextAll(File $phpcsFile, $types, int $startPointer, ?
}

/**
* @param (int|string)|(int|string)[] $types
* @param int|string|array<int|string, int|string> $types
*/
public static function findNextContent(File $phpcsFile, $types, string $content, int $startPointer, ?int $endPointer = null): ?int
{
Expand All @@ -172,7 +172,7 @@ public static function findNextEffective(File $phpcsFile, int $startPointer, ?in
}

/**
* @param (int|string)|(int|string)[] $types
* @param int|string|array<int|string, int|string> $types
* @param int $startPointer Search starts at this token, inclusive
* @param int|null $endPointer Search ends at this token, exclusive
*/
Expand All @@ -184,7 +184,7 @@ public static function findNextExcluding(File $phpcsFile, $types, int $startPoin
}

/**
* @param (int|string)|(int|string)[] $types
* @param int|string|array<int|string, int|string> $types
*/
public static function findNextLocal(File $phpcsFile, $types, int $startPointer, ?int $endPointer = null): ?int
{
Expand All @@ -203,7 +203,7 @@ public static function findNextAnyToken(File $phpcsFile, int $startPointer, ?int
}

/**
* @param (int|string)|(int|string)[] $types
* @param int|string|array<int|string, int|string> $types
* @param int $startPointer Search starts at this token, inclusive
* @param int|null $endPointer Search ends at this token, exclusive
*/
Expand All @@ -215,7 +215,7 @@ public static function findPrevious(File $phpcsFile, $types, int $startPointer,
}

/**
* @param (int|string)|(int|string)[] $types
* @param int|string|array<int|string, int|string> $types
*/
public static function findPreviousContent(File $phpcsFile, $types, string $content, int $startPointer, ?int $endPointer = null): ?int
{
Expand All @@ -234,7 +234,7 @@ public static function findPreviousEffective(File $phpcsFile, int $startPointer,
}

/**
* @param (int|string)|(int|string)[] $types
* @param int|string|array<int|string, int|string> $types
* @param int $startPointer Search starts at this token, inclusive
* @param int|null $endPointer Search ends at this token, exclusive
*/
Expand All @@ -246,7 +246,7 @@ public static function findPreviousExcluding(File $phpcsFile, $types, int $start
}

/**
* @param (int|string)|(int|string)[] $types
* @param int|string|array<int|string, int|string> $types
*/
public static function findPreviousLocal(File $phpcsFile, $types, int $startPointer, ?int $endPointer = null): ?int
{
Expand Down
Expand Up @@ -102,7 +102,7 @@ abstract protected function getLinesCountAfter(): int;
abstract protected function getLinesCountAfterLast(File $phpcsFile, int $controlStructurePointer, int $controlStructureEndPointer): int;

/**
* @return (int|string)[]
* @return array<int, (int|string)>
*/
public function register(): array
{
Expand Down Expand Up @@ -337,7 +337,7 @@ protected function checkLinesAfter(File $phpcsFile, int $controlStructurePointer
}

/**
* @return (int|string)[]
* @return array<int, (int|string)>
*/
private function getTokensToCheck(): array
{
Expand Down
Expand Up @@ -45,7 +45,7 @@ abstract protected function isCaseSensitive(): bool;
abstract protected function isValidType(ReferencedName $name): bool;

/**
* @return (int|string)[]
* @return array<int, (int|string)>
*/
public function register(): array
{
Expand Down

0 comments on commit 1cd31e0

Please sign in to comment.