From a80117a4eea4f468433f4e0c5e5a46475570db41 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 27 Nov 2014 17:42:14 +0100 Subject: [PATCH] #1188 - removing unused variable assignments --- lib/Doctrine/ORM/Tools/Pagination/Paginator.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/Doctrine/ORM/Tools/Pagination/Paginator.php b/lib/Doctrine/ORM/Tools/Pagination/Paginator.php index dc4801a46..056520260 100755 --- a/lib/Doctrine/ORM/Tools/Pagination/Paginator.php +++ b/lib/Doctrine/ORM/Tools/Pagination/Paginator.php @@ -118,12 +118,8 @@ class Paginator implements \Countable, \IteratorAggregate public function count() { if ($this->count === null) { - $countQuery = $this->getCountQuery(); - try { - $data = $countQuery->getScalarResult(); - $data = array_map('current', $data); - $this->count = array_sum($data); + $this->count = array_sum(array_map('current', $this->getCountQuery()->getScalarResult())); } catch(NoResultException $e) { $this->count = 0; }