/** * @param \DateTime $date * @param ActivityDayCollection $collection * @return integer */ private function calculateTotalCountByCollection(\DateTime $date, $collection) { $return = 0; $subjectCollection = $collection->getByDate($date); if (!is_null($subjectCollection)) { $return = $subjectCollection->totalCount(); } return $return; }