Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions coder_sniffer/Drupal/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@

<!-- SlevomatCodingStandard sniffs -->
<rule ref="SlevomatCodingStandard.Classes.BackedEnumTypeSpacing"/>
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenComments">
<properties>
<property name="forbiddenCommentPatterns" type="array">
<!-- Catch comments ending in 2 dots, bot leave comments ending in 3
dots alone. -->
<element value="/(?&lt;!\.)\.\.(?!\.)$/"/>
</property>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator"/>
<rule ref="SlevomatCodingStandard.PHP.ShortList"/>
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
Expand Down
3 changes: 2 additions & 1 deletion tests/Drupal/bad/BadUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,8 @@ protected function getErrorList(string $testFile): array
849 => 2,
860 => 2,
867 => 1,
871 => 2,
872 => 1,
876 => 2,
];
}//end switch

Expand Down
5 changes: 5 additions & 0 deletions tests/Drupal/bad/bad.php
Original file line number Diff line number Diff line change
Expand Up @@ -868,4 +868,9 @@ function test30(TestType $a = NULL) {
echo "Hello";
}

/**
* Comments are not allowed to end in 2 dots..
*/
function test31() {}

?>
5 changes: 5 additions & 0 deletions tests/Drupal/bad/bad.php.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -921,3 +921,8 @@ function test29(
function test30(?TestType $a = NULL) {
echo "Hello";
}

/**
* Comments are not allowed to end in 2 dots.
*/
function test31() {}
5 changes: 5 additions & 0 deletions tests/Drupal/good/good.php
Original file line number Diff line number Diff line change
Expand Up @@ -2060,3 +2060,8 @@ public function applies(RouteMatchInterface $route_match /* , CacheableMetadata
function pdo_weird_return_type($param) {
return pdo();
}

/**
* Comments are allowed to end in 3 dots...
*/
function comment_test_dots() {}