Skip to content

Commit

Permalink
Detect and remove useless semicolon (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
asispts committed Nov 10, 2023
1 parent b04cc67 commit 125dddd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions ptscs/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@

<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators" />
<rule ref="SlevomatCodingStandard.PHP.UselessParentheses" />
<rule ref="SlevomatCodingStandard.PHP.UselessSemicolon" />

<!--++++++++++++++++++++++++++++++++++++
Code analysis
Expand Down
19 changes: 19 additions & 0 deletions tests/Sniffs/Slevomat/PHP/UselessSemicolonTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php declare(strict_types=1);

namespace Ptscs\Tests\Sniffs\Slevomat\PHP;

use Iterator;
use Ptscs\Tests\SniffTestCase;
use Ptscs\Tests\Utils\ErrorData;

final class UselessSemicolonTest extends SniffTestCase
{
public static function provideTestData(): Iterator
{
yield[
[
new ErrorData(1, 'SlevomatCodingStandard.PHP.UselessSemicolon.UselessSemicolon'),
],
];
}
}
1 change: 1 addition & 0 deletions tests/Sniffs/Slevomat/PHP/_data/UselessSemicolon.php.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php declare(strict_types=1);
1 change: 1 addition & 0 deletions tests/Sniffs/Slevomat/PHP/_data/UselessSemicolon.php.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php declare(strict_types=1);;

0 comments on commit 125dddd

Please sign in to comment.