Overview

Namespaces

  • Knot
    • Dict
      • Helpers
    • Exceptions
  • None

Classes

  • Knot\Dict
  • Knot\Dict\AbstractDictBody
  • Knot\Dict\ChildDict
  • Knot\Dict\HelperManager
  • Knot\Dict\Helpers\AbstractPHPArrayHelper
  • Knot\Dict\Helpers\PHPArrayChangerHelper
  • Knot\Dict\Helpers\PHPArrayEqualizerHelper
  • Knot\Dict\Helpers\UnderscoreHelper
  • Knot\Dict\ParentDict

Interfaces

  • Knot\Dict\Helpers\HelperInterface

Traits

  • Knot\Dict\ArrayAccessTrait
  • Knot\Dict\CountableTrait
  • Knot\Dict\IteratorAggregateTrait
  • Knot\Dict\PathOperationsTrait

Exceptions

  • Knot\Exceptions\FunctionExecuteException
  • Knot\Exceptions\WrongArrayPathException
  • Knot\Exceptions\WrongFunctionException

Functions

  • ar
  • arr
  • arrRef
  • is_dict
  • Overview
  • Namespace
  • Class
 1: <?php namespace Knot\Dict\Helpers;
 2: 
 3: use Knot\Dict\AbstractDictBody;
 4: use Knot\Dict\HelperManager;
 5: 
 6: /*
 7:  * This helper method's returns changed data.
 8:  */
 9: 
10: class PHPArrayEqualizerHelper extends AbstractPHPArrayHelper implements HelperInterface {
11: 
12:     public $functions = [
13:         "array_change_key_case",
14:         "array_chunk",
15:         "array_column",
16:         "array_combine",
17:         "array_count_values",
18:         "array_diff_assoc",
19:         "array_diff_key",
20:         "array_diff_uassoc",
21:         "array_diff_ukey",
22:         "array_diff",
23:         "array_fill_keys",
24:         "array_filter",
25:         "array_flip",
26:         "array_intersect_assoc",
27:         "array_intersect_key",
28:         "array_intersect_uassoc",
29:         "array_intersect_ukey",
30:         "array_intersect",
31:         "array_keys",
32:         "array_merge_recursive",
33:         "array_merge",
34:         "array_pad",
35:         "array_replace_recursive",
36:         "array_replace",
37:         "array_reverse",
38:         "array_slice",
39:         "array_udiff_assoc",
40:         "array_udiff_uassoc",
41:         "array_udiff",
42:         "array_uintersect_assoc",
43:         "array_uintersect_uassoc",
44:         "array_uintersect",
45:         "array_unique",
46:         "array_values"
47:     ];
48: 
49: 
50:     public function getName()
51:     {
52:         return "phparrayequalhelper";
53:     }
54: 
55: 
56:     public function addRoutes(HelperManager $helperManager)
57:     {
58:         foreach ($this->functions as $functionName)
59:         {
60:             $route = $this->convertPHPFunctionToRoute($functionName);
61:             $helperManager->addRoute($route, [ __CLASS__, "execute" ]);
62:         }
63:     }
64: 
65: 
66:     public static function execute(AbstractDictBody $knot, $arguments, $methodName)
67:     {
68:         $methodName = self::convertRouteToPHPFunction($methodName);
69:         $data       =& $knot->toArray();
70: 
71:         array_unshift($arguments, $data);
72:         $data = call_user_func_array($methodName, $arguments);
73: 
74:         return $knot;
75:     }
76: }
API documentation generated by ApiGen