- if (null !== $values && !is_array($values)) {
- if (!$values instanceof \Traversable || !$values instanceof \Countable) {
- throw new InvalidArgumentException('Autocompleter values can be either an array, `null` or an object implementing both `Countable` and `Traversable` interfaces.');
- }
+ if (null !== $values && !\is_array($values) && !$values instanceof \Traversable) {
+ throw new InvalidArgumentException('Autocompleter values can be either an array, `null` or a `Traversable` object.');