File tree Expand file tree Collapse file tree 2 files changed +8
-13
lines changed
src/Languages/Php/Patterns Expand file tree Collapse file tree 2 files changed +8
-13
lines changed Original file line number Diff line number Diff line change 1010use Tempest \Highlight \Tokens \TokenTypeEnum ;
1111
1212#[PatternTest(input: 'catch (Foo) {} ' , output: 'Foo ' )]
13+ #[PatternTest(input: 'catch(Foo) {} ' , output: 'Foo ' )]
14+ #[PatternTest(input: 'catch (Foo $foo) {} ' , output: 'Foo ' )]
1315#[PatternTest(input: 'catch (Foo|Bar) {} ' , output: 'Foo|Bar ' )]
14- #[PatternTest(input: 'catch (Foo|Bar $bar) {} ' , output: null )]
16+ #[PatternTest(input: 'catch (Foo|Bar $bar) {} ' , output: ' Foo|Bar ' )]
1517final readonly class CatchTypePattern implements Pattern
1618{
1719 use IsPattern;
1820
1921 public function getPattern (): string
2022 {
21- return 'catch \ ((?<match>[\w\||]+)\ ) ' ;
23+ return 'catch\s*\ ((?<match>[\w\||]+)(\)|\s ) ' ;
2224 }
2325
2426 public function getTokenType (): TokenTypeEnum
Original file line number Diff line number Diff line change 1- ``` ini
2- [PHP]
3-
4- ; zend_extension = xdebug
5- xdebug.mode = profile
6- xdebug.output_dir = /Users/brentroose/Desktop
7- xdebug.profiler_output_name = cachegrind.out.%p
8-
9- ; ;;;;;;;;;;;;;;;;;;
10- ; About php.ini ;
11- ; ;;;;;;;;;;;;;;;;;;
1+ ``` php
2+ try {
3+ } catch (HttpRequestFailed $failure) {
4+ }
125```
You can’t perform that action at this time.
0 commit comments