Skip to content

Commit

Permalink
cs: enable RequireMultiLineMethodSignature (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
janedbal committed Feb 2, 2023
1 parent bae7d58 commit 24142f7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
1 change: 1 addition & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@
<rule ref="SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces"/>
<rule ref="SlevomatCodingStandard.Classes.TraitUseDeclaration" />
<rule ref="SlevomatCodingStandard.Classes.PropertyDeclaration" />
<rule ref="SlevomatCodingStandard.Classes.RequireMultiLineMethodSignature"/>
<rule ref="SlevomatCodingStandard.Classes.TraitUseSpacing" />
<rule ref="SlevomatCodingStandard.Classes.DisallowConstructorPropertyPromotion" />
<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing">
Expand Down
7 changes: 6 additions & 1 deletion src/Rule/EnforceNativeReturnTypehintRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,12 @@ private function getUnionTypehint(Type $type, Scope $scope, bool $typeFromPhpDoc
return implode('|', $typehintParts);
}

private function getIntersectionTypehint(Type $type, Scope $scope, bool $typeFromPhpDoc, bool $alwaysTerminating): ?string
private function getIntersectionTypehint(
Type $type,
Scope $scope,
bool $typeFromPhpDoc,
bool $alwaysTerminating
): ?string
{
if (!$type instanceof IntersectionType) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,12 @@ private function getPhpDocParamType(FunctionLike $node, Scope $scope, string $pa
/**
* @return list<string>
*/
private function comparePhpDocAndNativeType(?Type $phpDocReturnType, ?Type $nativeReturnType, Scope $scope, string $phpDocIdentification): array
private function comparePhpDocAndNativeType(
?Type $phpDocReturnType,
?Type $nativeReturnType,
Scope $scope,
string $phpDocIdentification
): array
{
if ($phpDocReturnType === null || $nativeReturnType === null) {
return [];
Expand Down
14 changes: 12 additions & 2 deletions src/Rule/RequirePreviousExceptionPassRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ public function processNode(Node $node, Scope $scope): array
/**
* @return list<RuleError>
*/
private function processExceptionCreation(bool $strictTypes, ?string $caughtExceptionVariableName, Type $caughtExceptionType, CallLike $node, Scope $scope): array
private function processExceptionCreation(
bool $strictTypes,
?string $caughtExceptionVariableName,
Type $caughtExceptionType,
CallLike $node,
Scope $scope
): array
{
$passed = false;

Expand Down Expand Up @@ -170,7 +176,11 @@ private function getCallLikeParameters(CallLike $node, Scope $scope): array
/**
* @param Name[] $exceptionNames
*/
private function getCaughtExceptionType(array $exceptionNames, Scope $scope, Type $exceptionTypesCaughtInPreviousCatches): Type
private function getCaughtExceptionType(
array $exceptionNames,
Scope $scope,
Type $exceptionTypesCaughtInPreviousCatches
): Type
{
$classes = [];

Expand Down

0 comments on commit 24142f7

Please sign in to comment.