1 | <?php |
||
56 | class RemoveProperty |
||
57 | { |
||
58 | use LookupMethodByType; |
||
59 | |||
60 | /** |
||
61 | * remove data from a container |
||
62 | * |
||
63 | * @param mixed $container |
||
64 | * the container that we want to remove data from |
||
65 | * @param string $property |
||
66 | * the data that we want to remove |
||
67 | * @return void |
||
68 | */ |
||
69 | public function __invoke(&$container, $property) |
||
73 | |||
74 | /** |
||
75 | * remove data from a container |
||
76 | * |
||
77 | * @param mixed $container |
||
78 | * the container that we want to remove data from |
||
79 | * @param string $property |
||
80 | * the data that we want to remove |
||
81 | * @return void |
||
82 | */ |
||
83 | public static function from(&$container, $property) |
||
88 | |||
89 | /** |
||
90 | * called when we're given a container that we cannot do anything with |
||
91 | * |
||
92 | * @return void |
||
93 | */ |
||
94 | public static function nothingMatchesTheInputType($container) |
||
98 | |||
99 | /** |
||
100 | * remove data from a container |
||
101 | * |
||
102 | * @param array|ArrayObject $container |
||
103 | * the container that we want to remove data from |
||
104 | * @param string $property |
||
105 | * the data that we want to remove |
||
106 | * @return void |
||
107 | */ |
||
108 | private static function fromArray(&$container, $property) |
||
114 | |||
115 | /** |
||
116 | * remove data from a container |
||
117 | * |
||
118 | * @param object $container |
||
119 | * the container that we want to remove data from |
||
120 | * @param string $property |
||
121 | * the data that we want to remove |
||
122 | * @return void |
||
123 | */ |
||
124 | private static function fromObject($container, $property) |
||
130 | |||
131 | private static $dispatchTable = [ |
||
132 | 'Array' => 'fromArray', |
||
133 | 'Assignable' => 'fromObject', |
||
134 | 'Indexable' => 'fromArray', |
||
135 | 'Object' => 'fromObject', |
||
136 | ]; |
||
137 | } |