Skip to content

Commit fcdff48

Browse files
committed
Improved UPGRADE.md file
1 parent fce3198 commit fcdff48

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

UPGRADE.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
# 3.x -> 4.0
22

3-
Below you can find list of changes between 3.x and 4.0 versions of PHPMatcher.
4-
5-
### Creating Matcher
3+
Below you can find list of changes between `3.x` and `4.0` versions of PHPMatcher.
64

5+
**Creating Matcher:**
76
```diff
87
-$factory = new MatcherFactory();
9-
-$this->matcher = $factory->createMatcher();
10-
```
11-
12-
```diff
13-
+$this->matcher = new PHPMatcher();
8+
-$matcher = $factory->createMatcher();
9+
+$matcher = new PHPMatcher();
1410
```
1511

16-
### Simple Matching
17-
12+
**Using Matcher**
1813
```diff
1914
-PHPMatcher::match($value, $pattern, $error)
15+
+$matcher = (new PHPMatcher())->match($value, $pattern);;
2016
```
2117

18+
**Accessing last error/backtrace**
2219
```diff
2320
+$matcher = new PHPMatcher();
2421
+$matcher->match($value, $pattern);
2522
+echo $matcher->error();
23+
+echo $matcher->backtrace();
2624
```

0 commit comments

Comments
 (0)