Skip to content

Commit

Permalink
apply rule
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus committed Jan 4, 2024
1 parent fffb7c1 commit 0ecc031
Show file tree
Hide file tree
Showing 35 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion src/Cache/FileCacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function __construct(
FileHandlerInterface $handler,
SignatureInterface $signature,
bool $isDryRun = false,
?DirectoryInterface $cacheDirectory = null
?DirectoryInterface $cacheDirectory = null,
) {
$this->handler = $handler;
$this->signature = $signature;
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Command/SelfUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ final class SelfUpdateCommand extends Command
public function __construct(
NewVersionCheckerInterface $versionChecker,
ToolInfoInterface $toolInfo,
PharCheckerInterface $pharChecker
PharCheckerInterface $pharChecker,
) {
parent::__construct();

Expand Down
2 changes: 1 addition & 1 deletion src/Console/ConfigurationResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public function __construct(
ConfigInterface $config,
array $options,
string $cwd,
ToolInfoInterface $toolInfo
ToolInfoInterface $toolInfo,
) {
$this->defaultConfig = $config;
$this->cwd = $cwd;
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Output/OutputContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class OutputContext
public function __construct(
?OutputInterface $output,
int $terminalWidth,
int $filesCount
int $filesCount,
) {
$this->output = $output;
$this->terminalWidth = $terminalWidth;
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Report/FixReport/ReportSummary.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function __construct(
int $memory,
bool $addAppliedFixers,
bool $isDryRun,
bool $isDecoratedOutput
bool $isDecoratedOutput,
) {
$this->changed = $changed;
$this->filesCount = $filesCount;
Expand Down
4 changes: 2 additions & 2 deletions src/Fixer/AbstractPhpUnitFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ final protected function ensureIsDockBlockWithAnnotation(
Tokens $tokens,
int $index,
string $annotation,
array $preventingAnnotations
array $preventingAnnotations,
): void {
$docBlockIndex = $this->getDocBlockIndex($tokens, $index);

Expand Down Expand Up @@ -121,7 +121,7 @@ private function updateDocBlockIfNeeded(
Tokens $tokens,
int $docBlockIndex,
string $annotation,
array $preventingAnnotations
array $preventingAnnotations,
): void {
$doc = new DocBlock($tokens[$docBlockIndex]->getContent());
foreach ($preventingAnnotations as $preventingAnnotation) {
Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/AbstractShortOperatorFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private function shortenOperation(
int $equalsIndex,
int $operatorIndex,
array $assignRange,
array $operatorRange
array $operatorRange,
): void {
$tokens[$equalsIndex] = $this->getReplacementToken($tokens[$operatorIndex]);
$tokens->clearTokenAndMergeSurroundingWhitespace($operatorIndex);
Expand Down
6 changes: 3 additions & 3 deletions src/Fixer/Alias/SetTypeToCastFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ private function removeSettypeCall(
int $firstArgumentStart,
int $commaIndex,
int $secondArgumentStart,
int $closeParenthesisIndex
int $closeParenthesisIndex,
): void {
$tokens->clearTokenAndMergeSurroundingWhitespace($closeParenthesisIndex);
$prevIndex = $tokens->getPrevMeaningfulToken($closeParenthesisIndex);
Expand All @@ -201,7 +201,7 @@ private function fixSettypeCall(
Tokens $tokens,
int $functionNameIndex,
Token $argumentToken,
Token $castToken
Token $castToken,
): void {
$tokens->insertAt(
$functionNameIndex,
Expand All @@ -222,7 +222,7 @@ private function fixSettypeCall(
private function fixSettypeNullCall(
Tokens $tokens,
int $functionNameIndex,
Token $argumentToken
Token $argumentToken,
): void {
$tokens->insertAt(
$functionNameIndex,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ private function removeUselessParenthesisPair(
int $afterCloseIndex,
int $openIndex,
int $closeIndex,
?string $configType
?string $configType,
): void {
$statements = $this->configuration['statements'];

Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/ControlStructure/YodaStyleFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ private function fixTokensCompare(
int $endLeft,
int $compareOperatorIndex,
int $startRight,
int $endRight
int $endRight,
): int {
$type = $tokens[$compareOperatorIndex]->getId();
$content = $tokens[$compareOperatorIndex]->getContent();
Expand Down
4 changes: 2 additions & 2 deletions src/Fixer/LanguageConstruct/FunctionToConstantFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ private function fixFunctionCallToConstant(Tokens $tokens, int $index, int $brac
private function getReplaceCandidate(
Tokens $tokens,
FunctionsAnalyzer $functionAnalyzer,
int $index
int $index,
): ?array {
if (!$tokens[$index]->isGivenKind(T_STRING)) {
return null;
Expand Down Expand Up @@ -225,7 +225,7 @@ private function getReplaceCandidate(
private function fixGetClassCall(
Tokens $tokens,
FunctionsAnalyzer $functionAnalyzer,
int $index
int $index,
): ?array {
if (!isset($this->functionsFixMap['get_class']) && !isset($this->functionsFixMap['get_class_this'])) {
return null;
Expand Down
4 changes: 2 additions & 2 deletions src/Fixer/Operator/NoUselessConcatOperatorFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ private function mergeConstantEscapedStringOperands(
Tokens $tokens,
array $firstOperand,
int $concatOperatorIndex,
array $secondOperand
array $secondOperand,
): void {
$quote = self::STR_DOUBLE_QUOTE === $firstOperand['type'] || self::STR_DOUBLE_QUOTE === $secondOperand['type'] ? '"' : "'";
$firstOperandTokenContent = $tokens[$firstOperand['start']]->getContent();
Expand Down Expand Up @@ -264,7 +264,7 @@ private function mergeConstantEscapedStringVarOperands(
Tokens $tokens,
array $firstOperand,
int $concatOperatorIndex,
array $secondOperand
array $secondOperand,
): void {
// build uo the new content
$newContent = '';
Expand Down
6 changes: 3 additions & 3 deletions src/Fixer/Phpdoc/NoSuperfluousPhpdocTagsFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ private function fixFunctionDocComment(
array $element,
?string $namespace,
?string $currentSymbol,
array $shortNames
array $shortNames,
): string {
$docBlock = new DocBlock($content);

Expand Down Expand Up @@ -366,7 +366,7 @@ private function fixPropertyDocComment(
array $element,
?string $namespace,
?string $currentSymbol,
array $shortNames
array $shortNames,
): string {
if (\count($element['types']) > 0) {
$propertyTypeInfo = $this->parseTypeHint($tokens, array_key_first($element['types']));
Expand Down Expand Up @@ -511,7 +511,7 @@ private function annotationIsSuperfluous(
array $info,
?string $namespace,
?string $currentSymbol,
array $symbolShortNames
array $symbolShortNames,
): bool {
if ('param' === $annotation->getTag()->getName()) {
$regex = '{\*\h*@param(?:\h+'.TypeExpression::REGEX_TYPES.')?(?!\S)(?:\h+(?:\&\h*)?(?:\.{3}\h*)?\$\S+)?(?:\h+(?<description>(?!\*+\/)\S+))?}s';
Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/ReturnNotation/ReturnAssignmentFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ private function simplifyReturnStatement(
int $assignVarIndex,
int $assignVarOperatorIndex,
int $returnIndex,
int $returnVarEndIndex
int $returnVarEndIndex,
): int {
$inserted = 0;
$originalIndent = $tokens[$assignVarIndex - 1]->isWhitespace()
Expand Down
2 changes: 1 addition & 1 deletion src/FixerConfiguration/FixerOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function __construct(
$default = null,
?array $allowedTypes = null,
?array $allowedValues = null,
?\Closure $normalizer = null
?\Closure $normalizer = null,
) {
if ($isRequired && null !== $default) {
throw new \LogicException('Required options cannot have a default value.');
Expand Down
2 changes: 1 addition & 1 deletion src/FixerDefinition/FileSpecificCodeSample.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class FileSpecificCodeSample implements FileSpecificCodeSampleInterface
public function __construct(
string $code,
\SplFileInfo $splFileInfo,
?array $configuration = null
?array $configuration = null,
) {
$this->codeSample = new CodeSample($code, $configuration);
$this->splFileInfo = $splFileInfo;
Expand Down
2 changes: 1 addition & 1 deletion src/FixerDefinition/FixerDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct(
string $summary,
array $codeSamples,
?string $description = null,
?string $riskyDescription = null
?string $riskyDescription = null,
) {
$this->summary = $summary;
$this->codeSamples = $codeSamples;
Expand Down
2 changes: 1 addition & 1 deletion src/FixerDefinition/VersionSpecificCodeSample.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ final class VersionSpecificCodeSample implements VersionSpecificCodeSampleInterf
public function __construct(
string $code,
VersionSpecificationInterface $versionSpecification,
?array $configuration = null
?array $configuration = null,
) {
$this->codeSample = new CodeSample($code, $configuration);
$this->versionSpecification = $versionSpecification;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner/FileFilterIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ final class FileFilterIterator extends \FilterIterator
public function __construct(
\Traversable $iterator,
?EventDispatcherInterface $eventDispatcher,
CacheManagerInterface $cacheManager
CacheManagerInterface $cacheManager,
) {
if (!$iterator instanceof \Iterator) {
$iterator = new \IteratorIterator($iterator);
Expand Down
2 changes: 1 addition & 1 deletion src/Runner/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function __construct(
bool $isDryRun,
CacheManagerInterface $cacheManager,
?DirectoryInterface $directory = null,
bool $stopOnViolation = false
bool $stopOnViolation = false,
) {
$this->finder = $finder;
$this->fixers = $fixers;
Expand Down
2 changes: 1 addition & 1 deletion tests/AbstractFunctionReferenceFixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function testAbstractFunctionReferenceFixer(
string $source,
string $functionNameToSearch,
int $start = 0,
?int $end = null
?int $end = null,
): void {
$fixer = $this->createAbstractFunctionReferenceFixerDouble();

Expand Down
2 changes: 1 addition & 1 deletion tests/AbstractProxyFixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private function createFixerDouble(
bool $isCandidate,
bool $isRisky = false,
bool $supports = false,
int $priority = 999
int $priority = 999,
): FixerInterface {
return new class($isCandidate, $isRisky, $supports, $priority) implements FixerInterface {
private bool $isCandidate;
Expand Down
2 changes: 1 addition & 1 deletion tests/Console/Command/DescribeCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ private static function createFixerWithSamplesDouble(array $samples): FixerInter
* @param list<CodeSampleInterface> $samples
*/
public function __construct(
array $samples
array $samples,
) {
parent::__construct();
$this->samples = $samples;
Expand Down
8 changes: 4 additions & 4 deletions tests/Console/Command/SelfUpdateCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function testExecute(
array $input,
bool $decorated,
string $expectedFileContents,
string $expectedDisplay
string $expectedDisplay,
): void {
$versionChecker = $this->createNewVersionCheckerDouble($latestVersion, $latestMinorVersion);

Expand Down Expand Up @@ -260,7 +260,7 @@ public function testExecuteWhenNotAbleToGetLatestVersions(
bool $latestMajorVersionSuccess,
bool $latestMinorVersionSuccess,
array $input,
bool $decorated
bool $decorated,
): void {
$versionChecker = $this->createNewVersionCheckerDouble(
self::getNewMajorReleaseVersion(),
Expand Down Expand Up @@ -467,7 +467,7 @@ private function createNewVersionCheckerDouble(
string $latestVersion = Application::VERSION,
?string $latestMinorVersion = Application::VERSION,
bool $latestMajorVersionSuccess = true,
bool $latestMinorVersionSuccess = true
bool $latestMinorVersionSuccess = true,
): NewVersionCheckerInterface {
return new class($latestVersion, $latestMinorVersion, $latestMajorVersionSuccess, $latestMinorVersionSuccess) implements NewVersionCheckerInterface {
private string $latestVersion;
Expand All @@ -479,7 +479,7 @@ public function __construct(
string $latestVersion,
?string $latestMinorVersion,
bool $latestMajorVersionSuccess = true,
bool $latestMinorVersionSuccess = true
bool $latestMinorVersionSuccess = true,
) {
$this->latestVersion = $latestVersion;
$this->latestMinorVersion = $latestMinorVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ final class ProgressOutputFactoryTest extends TestCase
public function testValidProcessOutputIsCreated(
string $outputType,
OutputContext $context,
string $expectedOutputClass
string $expectedOutputClass,
): void {
self::assertInstanceOf($expectedOutputClass, (new ProgressOutputFactory())->create($outputType, $context));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static function provideConfigureRejectsInvalidConfigurationElementCases()
public function testConfigureIncludeSets(
array $include,
?string $expectedExceptionClass = null,
?string $expectedExceptionMessage = null
?string $expectedExceptionMessage = null,
): void {
if (null !== $expectedExceptionClass) {
$this->expectException($expectedExceptionClass);
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixer/Import/FullyQualifiedStrictTypesFixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function testFix(
string $expected,
?string $input = null,
array $config = [],
?WhitespacesFixerConfig $whitespaceConfig = null
?WhitespacesFixerConfig $whitespaceConfig = null,
): void {
$this->fixer->configure($config);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function testFix(
string $expected,
?string $input = null,
?array $config = [],
?WhitespacesFixerConfig $whitespaces = null
?WhitespacesFixerConfig $whitespaces = null,
): void {
if (null !== $whitespaces) {
$this->fixer->setWhitespacesConfig($whitespaces);
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixer/Phpdoc/PhpdocAlignFixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function testFix(
array $configuration,
string $expected,
?string $input = null,
?WhitespacesFixerConfig $whitespacesFixerConfig = null
?WhitespacesFixerConfig $whitespacesFixerConfig = null,
): void {
$this->fixer->configure($configuration);
if (null !== $whitespacesFixerConfig) {
Expand Down
2 changes: 1 addition & 1 deletion tests/Runner/FileLintingIteratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function check(): void
private function fileLintingIteratorIterationTest(
FileLintingIterator $fileLintingIterator,
\SplFileInfo $file,
LintingResultInterface $lintingResultInterface
LintingResultInterface $lintingResultInterface,
): void {
$iterations = 0;

Expand Down
2 changes: 1 addition & 1 deletion tests/Smoke/CiIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function testIntegration(
array $caseCommands,
array $expectedResult1Lines,
array $expectedResult2Lines,
string $expectedResult3FilesLine
string $expectedResult3FilesLine,
): void {
self::executeScript(array_merge(
[
Expand Down
2 changes: 1 addition & 1 deletion tests/Test/IntegrationCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function __construct(
array $config,
RuleSet $ruleset,
string $expectedCode,
?string $inputCode
?string $inputCode,
) {
$this->fileName = $fileName;
$this->title = $title;
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function expectDeprecation(/* string $message */): void
$this->previouslyDefinedErrorHandler = set_error_handler(
function (
int $code,
string $message
string $message,
) {
if (E_USER_DEPRECATED === $code || E_DEPRECATED === $code) {
$this->actualDeprecations[] = $message;
Expand Down

0 comments on commit 0ecc031

Please sign in to comment.