1: <?php
2: 3: 4: 5: 6: 7:
8:
9: namespace Knot\Dict\Helpers;
10:
11: abstract class AbstractPHPArrayHelper {
12:
13: protected function convertPHPFunctionToRoute($phpFunctionName)
14: {
15: $route = ltrim($phpFunctionName, "array_");
16:
17: return preg_replace_callback('/\_([a-z])/', function ($matches)
18: {
19: return strtoupper($matches[1]);
20: }, $route);
21: }
22:
23:
24: protected static function convertRouteToPHPFunction($route)
25: {
26: $right_side = preg_replace_callback('/([A-Z])/', function ($matches)
27: {
28: return '_' . strtolower($matches[1]);
29: }, $route);
30:
31: return 'array_' . $right_side;
32: }
33:
34: }