protected function MapNamingStrategy::flipMapping in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/zendframework/zend-hydrator/src/NamingStrategy/MapNamingStrategy.php \Zend\Hydrator\NamingStrategy\MapNamingStrategy::flipMapping()
Safelly flip mapping array.
Parameters
array $array Array to flip:
Return value
array Flipped array
Throws
1 call to MapNamingStrategy::flipMapping()
- MapNamingStrategy::__construct in vendor/
zendframework/ zend-hydrator/ src/ NamingStrategy/ MapNamingStrategy.php - Initialize.
File
- vendor/
zendframework/ zend-hydrator/ src/ NamingStrategy/ MapNamingStrategy.php, line 49
Class
Namespace
Zend\Hydrator\NamingStrategyCode
protected function flipMapping(array $array) {
array_walk($array, function ($value) {
if (!is_string($value) && !is_int($value)) {
throw new InvalidArgumentException('Mapping array can\'t be flipped because of invalid value');
}
});
return array_flip($array);
}