code: private function getMaxPercentForPersonalBonus($levels)
      {
          $result = 0;
          foreach ($levels as $percent) {
              if ($percent > $result) {
                  $result = $percent;
              }
          }
          return $result;
      }
docs: Look up for the level with the max bonus percent.
  
  @param array $levels set of the levels with percents ([$level => $percent])
  @return int