public static function parse_form_values(array $array, $path) { if (strpos($path, '*') !== FALSE) { $paths = self::arr_path($array, $path); if ($paths) { foreach ($paths as $i => $items) { Group_Shipping_Items::set_array_values($array, str_replace('*', $i, $path), $items); } } } else { Group_Shipping_Items::set_array_values($array, $path, self::arr_path($array, $path)); } return $array; }
/** * Tests Arr::path() * * @test * @dataProvider provider_arr_path * @param string $path The path to follow * @param mixed $default The value to return if dnx * @param boolean $expected The expected value * @param string $delimiter The path delimiter */ public function test_arr_path($expected, $array, $path, $default = NULL, $delimiter = NULL) { $this->assertSame($expected, Group_Shipping_Items::arr_path($array, $path, $default, $delimiter)); }