The expression $this->pagerfanta->getCurrentPageResults(); of type array|Traversable adds the type Traversable to the return on line 71 which is incompatible with the return type declared by the interface FOS\ElasticaBundle\Provi...::getCurrentPageResults of type array.