attach() public method

Attach a new enumerator or overwrite an existing one
public attach ( Enum | null | boolean | integer | float | string $enumerator ) : void
$enumerator Enum | null | boolean | integer | float | string
return void
Example #1
0
 /**
  * Checks an ip for part of the tor network
  *
  * @param $ip   string  Ip Address
  * @return EnumSet  contains no elements if the ip is not part of the tor network
  */
 public function torCheckIp($ip)
 {
     $errors = new EnumSet('TuxCoder\\TorInfoBundle\\Enum\\TorIpCheck');
     if (!$this->reverseDomainCheck($ip)) {
         $errors->attach(TorIpCheck::REVERSE_DNS_ERROR);
     }
     if (!$this->ExitAddressCheck($ip)) {
         $errors->attach(TorIpCheck::TOR_EXIT_ADDRESS_LIST);
     }
     return $errors;
 }