1 | <?php |
||
10 | class TransformMatcher implements TransformMatcherInterface |
||
11 | { |
||
12 | const ROTATE_PATTERN = "/rotate\s*\(\s*(?<a>[+-]?\d+(?:\.\d+)?)((?:\s{1,}\,?\s*|\,\s*)(?<x>[+-]?\d+(?:\.\d+)?)(?:\s{1,}\,?\s*|\,\s*)(?<y>[+-]?\d+(?:\.\d+)?))?\s*\)/"; |
||
13 | |||
14 | const TRANSLATE_PATTERN = "/translate\s*\(\s*(?<x>[+-]?\d+(?:\.\d+)?)((?:\s{1,}\,?\s*|\,\s*)(?<y>[+-]?\d+(?:\.\d+)?))?\)/"; |
||
15 | |||
16 | const SCALE_PATTERN = "/scale\s*\(\s*(?<x>[+-]?\d+(?:\.\d+)?)((?:\s{1,}\,?\s*|\,\s*)(?<y>[+-]?\d+(?:\.\d+)?))?\)/"; |
||
17 | |||
18 | const SKEWX_PATTERN = "/skewX\s*\(\s*(?<x>[+-]?\d+(?:\.\d+)?)?\)/"; |
||
19 | |||
20 | const SKEWY_PATTERN = "/skewY\s*\(\s*(?<y>[+-]?\d+(?:\.\d+)?)?\)/"; |
||
21 | |||
22 | const MATRIX_PATTERN = "/matrix\s*\(\s*((([+-]?\d+(?:\.\d+)?)(?:\s+,?\s*|,\s*)){5}([+-]?\d+(?:\.\d+)?)\s*)\)/"; |
||
23 | |||
24 | 111 | public function makeSequence($transform) |
|
30 | |||
31 | 7 | public function matchRotate($transform) |
|
35 | |||
36 | 9 | private function matchPattern($pattern, $transform, $named) |
|
46 | |||
47 | 1 | public function matchSkewX($transform) |
|
51 | |||
52 | 1 | public function matchSkewY($transform) |
|
56 | |||
57 | 2 | public function matchScale($transform) |
|
61 | |||
62 | 1 | public function matchTranslate($transform) |
|
66 | |||
67 | 2 | public function matchMatrix($transform) |
|
78 | } |