/** * @param float $cost * @param Attendee $attendee * * @return number */ protected function getStudentDiscount($cost, Attendee $attendee) { if ($attendee->isStudentRegistration()) { return $cost * $attendee->getEvent()->getRegistrationInfo()->getStudentDiscount() / 100; } }