File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,18 @@ public function testGetToys()
70
70
71
71
From now you should be able to use global function `` match($value, $pattern) ``
72
72
73
+ ### Available patterns
74
+
75
+ * `` @string@ ``
76
+ * `` @integer@ ``
77
+ * `` @boolean@ ``
78
+ * `` @array@ ``
79
+ * `` @...@ `` - * unbounded array*
80
+ * `` @double@ ``
81
+ * `` @null@ ``
82
+ * `` @*@ `` || `` @wildcard@ ``
83
+ * `` expr(expression) ``
84
+
73
85
##Example usage
74
86
75
87
### Scalar matching
@@ -130,6 +142,12 @@ match(
130
142
'firstName' => 'Michał',
131
143
'lastName' => 'Dąbrowski',
132
144
'roles' => array('ROLE_USER')
145
+ ),
146
+ array(
147
+ 'id' => 3,
148
+ 'firstName' => 'Johnny',
149
+ 'lastName' => 'DąbrowsBravoki',
150
+ 'roles' => array('ROLE_HANDSOME_GUY')
133
151
)
134
152
),
135
153
true,
@@ -148,7 +166,8 @@ match(
148
166
'firstName' => '@string@',
149
167
'lastName' => 'Dąbrowski',
150
168
'roles' => '@array@'
151
- )
169
+ ),
170
+ '@...@'
152
171
),
153
172
'@boolean@',
154
173
'@double@'
You can’t perform that action at this time.
0 commit comments