joshavg / OmgDb

GNU General Public License v2.0
0 stars 0 forks source link

Use the combination of array_map and array_combine instead of foreach #3

Closed joshavg closed 8 years ago

joshavg commented 9 years ago

See AttributeType:

$choices = [];
foreach(AttributeDataType::getTypes() as $type)
{
    $choices[$type->getName()] = $type->getName();
}

This should be:

$choices = array_map(function($type) {
    return $type->getName();
}, AttributeDataType::getTypes());
$choices = array_combine($choices, $choices);
joshavg commented 8 years ago

most of the code will be rewritten, this issue is deprecated