-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test to demonstrate a bug in MemberVarSpacing
- Loading branch information
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Ptscs\Tests\Bugs\Squiz; | ||
|
||
use Iterator; | ||
use Ptscs\Tests\SniffTestCase; | ||
use Ptscs\Tests\Utils\ErrorData; | ||
|
||
final class MemberVarSpacingTest extends SniffTestCase | ||
{ | ||
protected function setUp(): void | ||
{ | ||
$this->appendExclude('Squiz.Classes.ClassFileName'); | ||
} | ||
|
||
public static function provideTestData(): Iterator | ||
{ | ||
yield[ | ||
[ | ||
new ErrorData(5, 'Squiz.WhiteSpace.MemberVarSpacing.AfterComment'), | ||
new ErrorData(16, 'Squiz.WhiteSpace.MemberVarSpacing.Incorrect'), | ||
new ErrorData(28, 'Squiz.WhiteSpace.MemberVarSpacing.Incorrect'), | ||
], | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
final class MemberVar | ||
{ | ||
// phpcs can fix this but not the next one | ||
#[SingleAttribute] | ||
public $property1; | ||
|
||
#[SingleAttribute] | ||
|
||
|
||
|
||
|
||
public $property2; | ||
|
||
#[SingleAttribute] | ||
|
||
|
||
|
||
|
||
|
||
public $property3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
final class MemberVar | ||
{ | ||
// phpcs can fix this but not the next one | ||
|
||
#[SingleAttribute] | ||
|
||
|
||
public $property1; | ||
#[SingleAttribute] | ||
|
||
|
||
|
||
|
||
public $property2; | ||
|
||
|
||
|
||
|
||
|
||
#[SingleAttribute] | ||
|
||
|
||
|
||
|
||
|
||
public $property3; | ||
} |