Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
imanghafoori1 authored Aug 29, 2021
1 parent f033f4f commit 06a8ebc
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,34 @@ This will catch all the 3 cases above since the neutral php whitespaces are igno

-------------------

### Keywords:

- '\<white_space\>'
- '\<until\>'
- '\<in_between\>'
- '\<comment\>'
- '\<variable\>' or '\<var\>'
- '\<string\>' or '\<str\>'
- '\<any\>'
#### Placeholders:

Here is a copmerehensive list of placeholders you can use:

- `"<var>"` or `"<variable>"`: for variables like: `$user`
- `"<str>"` or `"<string>"`: for hard coded strings: `'hello'` or "hello"
- `"<class_ref>"`: for class references: `\App\User::where(...` , `User::where`
- `"<full_class_ref>"`: only for full references: `\App\User::`
- `"<until>"`: to capture all the code until you reach a certain character.
- `"<comment>"`: for commands (does not capture doc-blocks)
- `"<doc_block>"`: for doc-blocks
- `"<statement>"`: to capture a whole php statement.
- `"<name:nam1,nam2>"` or `"<name>"`: for method or function names. `->where` or `::where`
- `"<white_space>"`: for whitespace blocks
- `"<bool>"` or `'<boolean>'`: for true or false (acts case-insensetive)
- `"<number>"`: for numeric values
- `"<cast>"`: for type-casts like: `(array) $a;`
- `"<int>"` or `"<integer>"`: for integer values
- `"<visibility>"`: for public, protected, private
- `"<float>"`: for floating point number
- `"<global_func_call:func1,func2>"`: to detect global function calls.
- `"<in_between>"`: to capture code within a pair of `{...}` or `(...)` or `[...]`
- `"<any>"`: captures any token.
- **You can also define your own keywords if needed!**

You just define a class for your new keyword and append the class path to the end of `Finder::$keywords[] = MyKeyword::class` property.
Just like the default keywords.


### Example:
lets say you want to remove the optional comma from arrays:
Expand Down

0 comments on commit 06a8ebc

Please # to comment.