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