Fix code style
General improvements to ArrayHelper (type hinting, scope, passing by
value)

- Add type hinting to array argument in toObject, toString, getColumn,
  invert, isAssociative, pivot, sortObjects, getValue
- Pass variables by value, not by reference (in methods without side
  effects applied to the arguments. So toInteger is an exception)
- toString's array argument is required, not default null
- Make arrayFromObject private (no use having protected methods in a final
  class)
Replace foreach with array_map in trivial cases