Skip to content

Commit a14c59d

Browse files
committed
sniffer: added own ruleset
1 parent 5b455c0 commit a14c59d

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

preset-sniffer/Nette.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Customisable-Sniff-Properties
55
https://github.com/slevomat/coding-standard
66
-->
7+
<rule ref="../src/NetteCodingStandard/ruleset.xml"/>
78

89
<!-- disallow group use declarations use FooLibrary\Bar\Baz\{ ClassA, ClassB, ClassC, ClassD as Fizbo } -->
910
<rule ref="SlevomatCodingStandard.Namespaces.DisallowGroupUse"/>
@@ -44,12 +45,11 @@ https://github.com/slevomat/coding-standard
4445
<rule ref="SlevomatCodingStandard.Classes.PropertyDeclaration"/>
4546

4647
<!-- This sniff checks that there are two blank lines between functions declarations and single between signatures. -->
47-
<rule ref="../src/Sniffs/FunctionSpacingSniff.php">
48-
<!-- is ignored...
48+
<rule ref="NetteCodingStandard.WhiteSpace.FunctionSpacing">
4949
<properties>
5050
<property name="spacingBeforeFirst" value="0"/>
5151
<property name="spacingAfterLast" value="0"/>
52-
</properties> -->
52+
</properties>
5353
</rule>
5454

5555
<!-- Checks that there's a single space between a typehint and a parameter name and no whitespace between a nullability symbol and a typehint -->

src/Sniffs/FunctionSpacingSniff.php renamed to src/NetteCodingStandard/Sniffs/WhiteSpace/FunctionSpacingSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ class FunctionSpacingSniff implements Sniff
2828
*
2929
* @var integer
3030
*/
31-
public $spacingBeforeFirst = 0;
31+
public $spacingBeforeFirst = 2;
3232

3333
/**
3434
* The number of blank lines after the last function in a class.
3535
*
3636
* @var integer
3737
*/
38-
public $spacingAfterLast = 0;
38+
public $spacingAfterLast = 2;
3939

4040
/**
4141
* Original properties as set in a custom ruleset (if any).

src/NetteCodingStandard/ruleset.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="Nette">
3+
<description>Nette Coding Standard</description>
4+
</ruleset>

0 commit comments

Comments
 (0)