explodeBans() public static method

Explode a banned bit mask into an array of ban constants.
public static explodeBans ( integer $banned ) : array
$banned integer The banned bit mask to explode.
return array Returns an array of the set bits.
 /**
  *
  *
  * @throws Exception
  */
 protected function getData()
 {
     $userID = $this->UserID ?: Gdn::session()->UserID;
     $user = Gdn::userModel()->getID($userID);
     $banned = val('Banned', $user);
     $bits = BanModel::explodeBans($banned);
     $reasons = array();
     foreach ($bits as $bit) {
         if (($bit & $this->ExcludeBans) === 0) {
             $reasons[$bit] = t("BanReason.{$bit}");
         }
     }
     $this->setData('Reasons', $reasons);
     if (!$this->Summary) {
         if ($this->ExcludeBans) {
             $summary = "Also banned for the following:";
         } else {
             $summary = "Banned for the following:";
         }
     }
     $this->setData('Summary', $this->Summary ?: $summary);
     $this->EventArguments['User'] = $user;
     $this->fireEvent('GetData');
 }