Skip to content

Commit e7f3293

Browse files
committed
Update Slevomat CS
1 parent 2918a7c commit e7f3293

File tree

10 files changed

+14
-63
lines changed

10 files changed

+14
-63
lines changed

.github/workflows/php-package-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
php: [ 7.1, 7.2, 7.3, 7.4, 8.0 ]
12+
php: [ 7.4, 8.0 ]
1313
steps:
1414
- uses: actions/checkout@v2
1515
- uses: shivammathur/setup-php@v2

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ run-tests:
77
./vendor/bin/phpcs --standard=src/PeckaCodingStandardStrict/ruleset.xml tests/Success/
88
./vendor/bin/phpcs --standard=src/PeckaCodingStandard/ruleset.xml tests/Failure/Arrays/TrailingArrayComma.php | tests/errorNumber.sh 1
99
./vendor/bin/phpcs --standard=src/PeckaCodingStandard/ruleset.xml tests/Failure/Classes/ClassConstantVisibility.php | tests/errorNumber.sh 1
10-
./vendor/bin/phpcs --standard=src/PeckaCodingStandard/ruleset.xml tests/Failure/Classes/UnusedPrivateElements.php | tests/errorNumber.sh 2
1110
./vendor/bin/phpcs --standard=src/PeckaCodingStandard/ruleset.xml tests/Failure/Classes/PropertySpacing.php | tests/errorNumber.sh 2
1211
./vendor/bin/phpcs --standard=src/PeckaCodingStandard/ruleset.xml tests/Failure/Classes/MethodSpacingSniff.php | tests/errorNumber.sh 2
1312
./vendor/bin/phpcs --standard=src/PeckaCodingStandard/ruleset.xml tests/Failure/Classes/ClassMemberSpacing.php | tests/errorNumber.sh 1

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "pd/coding-standard",
33
"description": "Coding standard pro PeckaDesign",
44
"require": {
5-
"php": "7.* || 8.*",
5+
"php": "7.4.* || 8.*",
66
"squizlabs/php_codesniffer": "3.*",
7-
"slevomat/coding-standard": "6.4.*",
7+
"slevomat/coding-standard": "7.0.*",
88
"escapestudios/symfony2-coding-standard": "3.*"
99
},
1010
"license": "MIT",

src/PeckaCodingStandard/ruleset.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<rule ref="Generic.Classes.DuplicateClassName"/>
1111
<rule ref="Squiz.Classes.LowercaseClassKeywords"/>
1212
<rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility"/>
13-
<rule ref="SlevomatCodingStandard.Classes.UnusedPrivateElements"/>
1413
<rule ref="SlevomatCodingStandard.Classes.PropertySpacing">
1514
<properties>
1615
<property name="minLinesCountBeforeWithComment" value="1"/>

src/PeckaCodingStandardStrict/ruleset.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators"/>
1212

1313
<!-- TypeHints -->
14-
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"/>
14+
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
15+
<properties>
16+
<property name="declareOnFirstLine" value="1" />
17+
</properties>
18+
</rule>
1519
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint"/>
1620

1721
<!-- Namespaces -->

tests/Failure/Classes/ClassMemberSpacing.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ final class ClassMemberSpacing
44
{
55

66
/**
7-
* @var int
7+
* @var int|string
88
*/
99
private $number;
1010

tests/Failure/Classes/UnusedPrivateElements.php

Lines changed: 0 additions & 19 deletions
This file was deleted.

tests/Success/Classes/ClassMemberSpacing.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
<?php declare(strict_types = 1);
22

3+
namespace PdTests\Success\Classes;
4+
35
final class ClassMemberSpacing
46
{
57

6-
/**
7-
* @var int|string
8-
*/
9-
private $number;
8+
private int $number;
109

1110

1211
public function getNumber(): int

tests/Success/Classes/PropertySpacing.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,8 @@
55
class PropertySpacing
66
{
77

8-
/**
9-
* @var int|string
10-
*/
11-
public $element;
8+
public int $element;
129

13-
/**
14-
* @var int|string
15-
*/
16-
public $element2;
10+
public int|string $element2;
1711

1812
}

tests/Success/Classes/UnusedPrivateElements.php

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)