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

cs: enable RequireMultiLineMethodSignature #80

Merged
merged 1 commit into from
Feb 2, 2023
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
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