Skip to content

Commit

Permalink
Small phpdoc improvement (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet authored Jul 27, 2024
1 parent 0a30572 commit aa2743c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

declare(strict_types=1);

use Rector\CodingStyle\Rector\ArrowFunction\StaticArrowFunctionRector;
use Rector\CodingStyle\Rector\Closure\StaticClosureRector;
use Rector\Config\RectorConfig;
use Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector;
use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
Expand All @@ -23,6 +25,8 @@
$rectorConfig->rules([
PrivatizeFinalClassMethodRector::class,
PrivatizeFinalClassPropertyRector::class,
StaticArrowFunctionRector::class,
StaticClosureRector::class,
]);

$rectorConfig->importNames();
Expand Down
2 changes: 1 addition & 1 deletion src/File/FileHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class FileHelper
public static function detectEOL(string $content): string
{
preg_match("/\r\n?|\n/", $content, $matches);
/** @phpstan-var array<non-empty-string> $matches */
/** @phpstan-var list<non-empty-string> $matches */

return $matches[0] ?? \PHP_EOL;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Report/Reporter/TextReporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function display(
}

/**
* @param array<string> $templatesLines
* @param list<string> $templatesLines
*
* @return array<int, string>
*/
Expand All @@ -128,7 +128,7 @@ private function getContext(array $templatesLines, int $line): array
++$lineIndex;
} while ($lineIndex < $max);

return array_map(fn (string $code): string => substr($code, min($indents)), $result);
return array_map(static fn (string $code): string => substr($code, min($indents)), $result);
}

private function formatErrorMessage(Violation $message, bool $debug): string
Expand Down
2 changes: 1 addition & 1 deletion src/Token/Tokenizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private function resetState(Source $source): void
*/
private function getBrackets(): array
{
return array_filter($this->bracketsAndTernary, fn (Token $token): bool => '?' !== $token->getValue());
return array_filter($this->bracketsAndTernary, static fn (Token $token): bool => '?' !== $token->getValue());
}

private function isInTernary(): bool
Expand Down

0 comments on commit aa2743c

Please sign in to comment.