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()
7070
7171From now you should be able to use global function `` match($value, $pattern) ``
7272
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+
7385##Example usage
7486
7587### Scalar matching
@@ -130,6 +142,12 @@ match(
130142 'firstName' => 'Michał',
131143 'lastName' => 'Dąbrowski',
132144 'roles' => array('ROLE_USER')
145+ ),
146+ array(
147+ 'id' => 3,
148+ 'firstName' => 'Johnny',
149+ 'lastName' => 'DąbrowsBravoki',
150+ 'roles' => array('ROLE_HANDSOME_GUY')
133151 )
134152 ),
135153 true,
@@ -148,7 +166,8 @@ match(
148166 'firstName' => '@string@',
149167 'lastName' => 'Dąbrowski',
150168 'roles' => '@array@'
151- )
169+ ),
170+ '@...@'
152171 ),
153172 '@boolean@',
154173 '@double@'
You can’t perform that action at this time.
0 commit comments