Skip to content

Commit fc1f7c0

Browse files
authored
Merge pull request #802 from PHPCSStandards/feature/pear-squiz-inlinecomments-add-tests-with-emoji-hash-comments
PEAR/Squiz/InlineComment: document handling of emoji hash comments
2 parents 2cbfb36 + fdedc77 commit fc1f7c0

File tree

6 files changed

+12
-0
lines changed

6 files changed

+12
-0
lines changed

src/Standards/PEAR/Tests/Commenting/InlineCommentUnitTest.inc

+2
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ function test()
2727
### use the code from the regex
2828
### over hre
2929
### ok?
30+
31+
#️⃣ Apparently the emoji keycap number sign (hash) also works and turns this into a comment.

src/Standards/PEAR/Tests/Commenting/InlineCommentUnitTest.inc.fixed

+2
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ function test()
2727
// use the code from the regex
2828
// over hre
2929
// ok?
30+
31+
// ️⃣ Apparently the emoji keycap number sign (hash) also works and turns this into a comment.

src/Standards/PEAR/Tests/Commenting/InlineCommentUnitTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function getErrorList()
3737
27 => 1,
3838
28 => 1,
3939
29 => 1,
40+
31 => 1,
4041
];
4142

4243
}//end getErrorList()

src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc

+3
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ readonly class MyClass
186186
readonly $property = 10;
187187
}
188188

189+
#️⃣ Apparently the emoji keycap number sign (hash) also works and turns this into a comment.
190+
echo 'hello!';
191+
189192
/*
190193
* N.B.: The below test line must be the last test in the file.
191194
* Testing that a new line after an inline comment when it's the last non-whitespace

src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc.fixed

+3
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ readonly class MyClass
179179
readonly $property = 10;
180180
}
181181

182+
// ️⃣ Apparently the emoji keycap number sign (hash) also works and turns this into a comment.
183+
echo 'hello!';
184+
182185
/*
183186
* N.B.: The below test line must be the last test in the file.
184187
* Testing that a new line after an inline comment when it's the last non-whitespace

src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public function getErrorList($testFile='')
5252
126 => 2,
5353
130 => 2,
5454
149 => 1,
55+
189 => 1,
5556
];
5657

5758
return $errors;

0 commit comments

Comments
 (0)