missing spaces around the ternary operator.

and I would always return an array when converting. Use an empty array when the key does not exist (so that it does not exist either in the returned value)