Use array_map() instead of walk.

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>