Skip to content

Commit 2f2bad2

Browse files
committed
update functions section with info on definition searching
1 parent e614e87 commit 2f2bad2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,14 @@ foreach($results->results as $result) {
7676
}
7777
```
7878

79-
### Function calls
79+
### Functions
8080

81-
To search for function calls, use the `functions` method before calling `search`.
81+
To search for function calls or definitions, use the `functions` method. Regular expressions can be used by surrounding the name with slashes `/`, i.e. `/test\d+/`.
8282

8383
```php
84+
// this will search for references AND definitions for 'strtolower' and 'myfunc'
8485
$results = $searcher
85-
->functions(['strtolower', 'strtoupper'])
86+
->functions(['strtolower', 'myfunc'])
8687
->search('./file1.php');
8788

8889
foreach($results->results as $result) {

0 commit comments

Comments
 (0)