Background
In every other programming language I use on a regular basis, it is simple to operate on the return value of a function without declaring
If you just want to return the first item in the array, use the current() function.
return current($foo->getBarArray());
http://php.net/manual/en/function.current.php