reindex() public static method

Reindexes a list of values.
public static reindex ( array $data, array $map, $keepUnmapped = true ) : array
$data array Data.
$map array An map of correspondances of the form ['currentIndex' => 'newIndex'].
return array $keepUnmapped Whether or not to keep keys that are not remapped.
 /**
  *
  */
 public function testReindex()
 {
     $data = ['foo' => 'bar'];
     $map = ['foo' => 'baz'];
     $expected = ['foo' => 'bar', 'baz' => 'bar'];
     $this->assertEquals($expected, Transform::reindex($data, $map));
     $expected = ['baz' => 'bar'];
     $this->assertEquals($expected, Transform::reindex($data, $map, false));
 }
 /**
  *	{@inheritDoc}
  */
 public function present(Media $Media)
 {
     return $Media->setProperties(Transform::reindex($Media->properties(), $this->_mapping));
 }