Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small phpdoc improvement #290

Merged
merged 1 commit into from
Jul 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading