Skip to content

Commit

Permalink
Add a rule to enforce one line only between functions declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
carusogabriel authored and ondrejmirtes committed Apr 29, 2019
1 parent 56faa0c commit 57b8ce3
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 11 deletions.
7 changes: 7 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@
<rule ref="SlevomatCodingStandard.Namespaces.UselessAlias"/>
<rule ref="SlevomatCodingStandard.PHP.UselessSemicolon"/>
<rule ref="SlevomatCodingStandard.PHP.UselessParentheses"/>
<rule ref="Squiz.WhiteSpace.FunctionSpacing">
<properties>
<property name="spacing" value="1" />
<property name="spacingBeforeFirst" value="1"/>
<property name="spacingAfterLast" value="1"/>
</properties>
</rule>
<exclude-pattern>tests/*/data</exclude-pattern>
<exclude-pattern>tests/*/traits</exclude-pattern>
<exclude-pattern>tests/notAutoloaded</exclude-pattern>
Expand Down
1 change: 0 additions & 1 deletion src/Analyser/SpecifiedTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public function intersectWith(SpecifiedTypes $other): self
return new self($sureTypeUnion, $sureNotTypeUnion);
}


public function unionWith(SpecifiedTypes $other): self
{
$sureTypeUnion = $this->sureTypes + $other->sureTypes;
Expand Down
1 change: 0 additions & 1 deletion src/PhpDoc/ResolvedPhpDocBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ public static function createEmpty(): self
return new self([], [], [], [], null, null, false, false, false);
}


/**
* @return array<string|int, \PHPStan\PhpDoc\Tag\VarTag>
*/
Expand Down
1 change: 0 additions & 1 deletion src/Reflection/SignatureMap/ParameterSignature.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public function __construct(
$this->variadic = $variadic;
}


public function getName(): string
{
return $this->name;
Expand Down
2 changes: 0 additions & 2 deletions src/Rules/Operators/InvalidComparisonOperationRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public function __construct(RuleLevelHelper $ruleLevelHelper)
$this->ruleLevelHelper = $ruleLevelHelper;
}


public function getNodeType(): string
{
return Node\Expr\BinaryOp::class;
Expand Down Expand Up @@ -87,7 +86,6 @@ private function isNumberType(Scope $scope, Node\Expr $expr): bool
return !$acceptedType->isSuperTypeOf($type)->no();
}


private function isObjectType(Scope $scope, Node\Expr $expr): bool
{
$acceptedType = new ObjectWithoutClassType();
Expand Down
1 change: 0 additions & 1 deletion tests/PHPStan/Type/CallableTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public function testIsSuperTypeOf(CallableType $type, Type $otherType, TrinaryLo
);
}


public function dataIsSubTypeOf(): array
{
return [
Expand Down
2 changes: 0 additions & 2 deletions tests/PHPStan/Type/Constant/ConstantArrayTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public function dataAccepts(): iterable
];
}


/**
* @dataProvider dataAccepts
* @param ConstantArrayType $type
Expand All @@ -87,7 +86,6 @@ public function testAccepts(ConstantArrayType $type, Type $otherType, TrinaryLog
);
}


public function dataIsSuperTypeOf(): iterable
{
yield [
Expand Down
2 changes: 0 additions & 2 deletions tests/PHPStan/Type/Constant/ConstantIntegerTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public function dataAccepts(): iterable
];
}


/**
* @dataProvider dataAccepts
* @param ConstantIntegerType $type
Expand All @@ -48,7 +47,6 @@ public function testAccepts(ConstantIntegerType $type, Type $otherType, TrinaryL
);
}


public function dataIsSuperTypeOf(): iterable
{
yield [
Expand Down
1 change: 0 additions & 1 deletion tests/PHPStan/Type/IntegerTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public function testAccepts(): void
$this->assertTrue($integerType->accepts(new StringType(), true)->no());
}


public function dataIsSuperTypeOf(): iterable
{
yield [
Expand Down

0 comments on commit 57b8ce3

Please sign in to comment.