src/Datagrid.php
public function setData($data)
    {
        if (null !== $this->data) {
            throw new BadMethodCallException('Datagrid::setData() can only be called once.');
        }

        if (!is_array($data) && !$data instanceof \Traversable) {
            throw new UnexpectedTypeException($data, ['array', 'Traversable']);
        }

        $this->data = $data;

        return $this;
    }
public function setData($data)
    {
        if (null !== $this->data) {
            throw new BadMethodCallException('Datagrid::setData() can only be called once.');
        }

        if (!is_array($data) && !$data instanceof \Traversable) {
            throw new UnexpectedTypeException($data, ['array', 'Traversable']);
        }

        $this->data = $data;

        return $this;
    }
{@inheritdoc}