Skip to content

Commit

Permalink
Update Slevomat CS
Browse files Browse the repository at this point in the history
  • Loading branch information
MilanPala committed Nov 4, 2021
1 parent 2918a7c commit e7f3293
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php-package-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ 7.1, 7.2, 7.3, 7.4, 8.0 ]
php: [ 7.4, 8.0 ]
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ run-tests:
./vendor/bin/phpcs --standard=src/PeckaCodingStandardStrict/ruleset.xml tests/Success/
./vendor/bin/phpcs --standard=src/PeckaCodingStandard/ruleset.xml tests/Failure/Arrays/TrailingArrayComma.php | tests/errorNumber.sh 1
./vendor/bin/phpcs --standard=src/PeckaCodingStandard/ruleset.xml tests/Failure/Classes/ClassConstantVisibility.php | tests/errorNumber.sh 1
./vendor/bin/phpcs --standard=src/PeckaCodingStandard/ruleset.xml tests/Failure/Classes/UnusedPrivateElements.php | tests/errorNumber.sh 2
./vendor/bin/phpcs --standard=src/PeckaCodingStandard/ruleset.xml tests/Failure/Classes/PropertySpacing.php | tests/errorNumber.sh 2
./vendor/bin/phpcs --standard=src/PeckaCodingStandard/ruleset.xml tests/Failure/Classes/MethodSpacingSniff.php | tests/errorNumber.sh 2
./vendor/bin/phpcs --standard=src/PeckaCodingStandard/ruleset.xml tests/Failure/Classes/ClassMemberSpacing.php | tests/errorNumber.sh 1
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "pd/coding-standard",
"description": "Coding standard pro PeckaDesign",
"require": {
"php": "7.* || 8.*",
"php": "7.4.* || 8.*",
"squizlabs/php_codesniffer": "3.*",
"slevomat/coding-standard": "6.4.*",
"slevomat/coding-standard": "7.0.*",
"escapestudios/symfony2-coding-standard": "3.*"
},
"license": "MIT",
Expand Down
1 change: 0 additions & 1 deletion src/PeckaCodingStandard/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<rule ref="Generic.Classes.DuplicateClassName"/>
<rule ref="Squiz.Classes.LowercaseClassKeywords"/>
<rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility"/>
<rule ref="SlevomatCodingStandard.Classes.UnusedPrivateElements"/>
<rule ref="SlevomatCodingStandard.Classes.PropertySpacing">
<properties>
<property name="minLinesCountBeforeWithComment" value="1"/>
Expand Down
6 changes: 5 additions & 1 deletion src/PeckaCodingStandardStrict/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators"/>

<!-- TypeHints -->
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"/>
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property name="declareOnFirstLine" value="1" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint"/>

<!-- Namespaces -->
Expand Down
2 changes: 1 addition & 1 deletion tests/Failure/Classes/ClassMemberSpacing.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ final class ClassMemberSpacing
{

/**
* @var int
* @var int|string
*/
private $number;

Expand Down
19 changes: 0 additions & 19 deletions tests/Failure/Classes/UnusedPrivateElements.php

This file was deleted.

7 changes: 3 additions & 4 deletions tests/Success/Classes/ClassMemberSpacing.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<?php declare(strict_types = 1);

namespace PdTests\Success\Classes;

final class ClassMemberSpacing
{

/**
* @var int|string
*/
private $number;
private int $number;


public function getNumber(): int
Expand Down
10 changes: 2 additions & 8 deletions tests/Success/Classes/PropertySpacing.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,8 @@
class PropertySpacing
{

/**
* @var int|string
*/
public $element;
public int $element;

/**
* @var int|string
*/
public $element2;
public int|string $element2;

}
25 changes: 0 additions & 25 deletions tests/Success/Classes/UnusedPrivateElements.php

This file was deleted.

0 comments on commit e7f3293

Please sign in to comment.