Skip to content

Commit

Permalink
[automated] Apply Coding Standard (#5806)
Browse files Browse the repository at this point in the history
Co-authored-by: TomasVotruba <924196+TomasVotruba@users.noreply.github.com>
  • Loading branch information
TomasVotruba and TomasVotruba committed Apr 7, 2024
1 parent 467e971 commit 145b616
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
9 changes: 7 additions & 2 deletions composer-dependency-analyser.php
@@ -1,4 +1,6 @@
<?php declare(strict_types = 1);
<?php

declare(strict_types=1);

use ShipMonk\ComposerDependencyAnalyser\Config\Configuration;
use ShipMonk\ComposerDependencyAnalyser\Config\ErrorType;
Expand All @@ -9,7 +11,10 @@
->addPathToScan(__DIR__ . '/build/config', false)
->ignoreErrorsOnPackage('phpunit/phpunit', [ErrorType::DEV_DEPENDENCY_IN_PROD]) // prepared test tooling
->ignoreErrorsOnPackage('react/promise', [ErrorType::UNUSED_DEPENDENCY]) // pinned v2.x version
->ignoreErrorsOnPackage('nette/robot-loader', [ErrorType::DEV_DEPENDENCY_IN_PROD]) // https://github.com/rectorphp/rector-src/pull/5777#discussion_r1541304301
->ignoreErrorsOnPackage(
'nette/robot-loader',
[ErrorType::DEV_DEPENDENCY_IN_PROD]
) // https://github.com/rectorphp/rector-src/pull/5777#discussion_r1541304301
->ignoreErrorsOnPaths([
__DIR__ . '/stubs',
__DIR__ . '/tests',
Expand Down
Expand Up @@ -25,6 +25,9 @@ public function detect(ClassMethod | Param | Property $node): bool
return true;
}

return $this->phpAttributeAnalyzer->hasPhpAttributes($node, ['Symfony\Contracts\Service\Attribute\Required', 'Nette\DI\Attributes\Inject']);
return $this->phpAttributeAnalyzer->hasPhpAttributes(
$node,
['Symfony\Contracts\Service\Attribute\Required', 'Nette\DI\Attributes\Inject']
);
}
}
Expand Up @@ -161,7 +161,10 @@ private function inferParam(
}

/** @var Return_[] $returns */
$returns = $this->betterNodeFinder->findInstancesOfInFunctionLikeScoped($dataProviderClassMethod, Return_::class);
$returns = $this->betterNodeFinder->findInstancesOfInFunctionLikeScoped(
$dataProviderClassMethod,
Return_::class
);
if ($returns !== []) {
return $this->resolveReturnStaticArrayTypeByParameterPosition($returns, $parameterPosition);
}
Expand Down
2 changes: 1 addition & 1 deletion rules/TypeDeclaration/TypeInferer/SilentVoidResolver.php
Expand Up @@ -167,7 +167,7 @@ private function isSwitchWithAlwaysReturnOrExit(Switch_ $switch): bool

$casesWithReturnOrExitCount = $this->resolveReturnOrExitCount($switch);

$cases = array_filter($switch->cases, static fn(Case_ $case): bool => $case->stmts !== []);
$cases = array_filter($switch->cases, static fn (Case_ $case): bool => $case->stmts !== []);

// has same amount of first return or exit nodes as switches
return count($cases) === $casesWithReturnOrExitCount;
Expand Down
4 changes: 1 addition & 3 deletions src/PhpParser/Printer/BetterStandardPrinter.php
Expand Up @@ -476,9 +476,7 @@ protected function pExpr_MethodCall(MethodCall $methodCall): string

return $this->pDereferenceLhs(
$methodCall->var
) . "\n" . $this->resolveIndentSpaces() . '->' . $this->pObjectProperty(
$methodCall->name
)
) . "\n" . $this->resolveIndentSpaces() . '->' . $this->pObjectProperty($methodCall->name)
. '(' . $this->pMaybeMultiline($methodCall->args) . ')';
}

Expand Down

0 comments on commit 145b616

Please sign in to comment.