File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
src/Languages/Php/Patterns
tests/Languages/Php/Patterns Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 1414
1515 public function getPattern (): string
1616 {
17- return '(?<match>\/\/(.)*) ' ;
17+ return '(?<match>(?: \/\/|#[^\[]) (.)*) ' ;
1818 }
1919
2020 public function getTokenType (): TokenTypeEnum
Original file line number Diff line number Diff line change @@ -19,5 +19,23 @@ public function test_pattern()
1919 content: '$bar // foo ' ,
2020 expected: '// foo ' ,
2121 );
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+ );
2240 }
2341}
You can’t perform that action at this time.
0 commit comments