File tree 2 files changed +19
-1
lines changed
src/Languages/Php/Patterns
tests/Languages/Php/Patterns
2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 14
14
15
15
public function getPattern (): string
16
16
{
17
- return '(?<match>\/\/(.)*) ' ;
17
+ return '(?<match>(?: \/\/|#[^\[]) (.)*) ' ;
18
18
}
19
19
20
20
public function getTokenType (): TokenTypeEnum
Original file line number Diff line number Diff line change @@ -19,5 +19,23 @@ public function test_pattern()
19
19
content: '$bar // foo ' ,
20
20
expected: '// foo ' ,
21
21
);
22
+
23
+ $ this ->assertMatches (
24
+ pattern: new SinglelineCommentPattern (),
25
+ content: '$bar # foo ' ,
26
+ expected: '# foo ' ,
27
+ );
28
+
29
+ $ this ->assertMatches (
30
+ pattern: new SinglelineCommentPattern (),
31
+ content: '$bar #[IncompleteAttribute ' ,
32
+ expected: null ,
33
+ );
34
+
35
+ $ this ->assertMatches (
36
+ pattern: new SinglelineCommentPattern (),
37
+ content: '$bar #[Attribute] ' ,
38
+ expected: null ,
39
+ );
22
40
}
23
41
}
You can’t perform that action at this time.
0 commit comments