can we simplify this part a bit? Also some small styling fixes:
~~~~
throw new Kohana_Exception('Parameter for Arr::count() must be array or object of type Countable, :type given', array(
    ':type' => (is_object($array)) ? get_class($array) : gettype($array),
))
~~~~