Skip to content

Commit 71c81b1

Browse files
author
Nico
committed
Cleanup
1 parent ce48d1e commit 71c81b1

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ $rule->registerToken(Tokenizer::TOKEN_VARIABLE, ':\w+');
115115
var_dump($rule->isTrue()); // bool(true)
116116
```
117117

118+
Also note that the original tokens will no longer be recognized after overwriting them. Thus, if you want to implement aliases
119+
for custom tokens, you have to group them into one regular expression: `(?:\b(?:is\s+)?greater\s+than\b|>)`
120+
118121
## Error Handling
119122
Both, `$rule->isTrue()` and `$rule->isFalse()` will throw an exception if the syntax is invalid. These calls can either be placed inside a `try` / `catch` block, or it can be checked prior using `$rule->isValid()`.
120123

src/nicoSWD/Rules/Tokenizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @link https://github.com/nicoSWD
66
* @author Nicolas Oelgart <nico@oelgart.com>
77
*/
8-
declare(strict_types = 1);
8+
declare(strict_types=1);
99

1010
namespace nicoSWD\Rules;
1111

0 commit comments

Comments
 (0)