Example #1
0
File: Ip.php Project: fatalaa/seeme
 /**
  * Sets an IP
  *
  * @param string $ip
  */
 public function set($ip)
 {
     if (is_long($ip)) {
         $ip = long2ip($ip);
     }
     Assertion::ip($ip);
     $this->callMethod('setip', compact('ip'));
     return true;
 }
Example #2
0
 /**
  * Sends a message
  *
  * @param integer             $number
  * @param string              $message
  * @param string|null         $sender
  * @param integer|string|null $reference
  * @param array|string|null   $callbackParams
  * @param string|null         $callback
  *
  * @return Receipt
  */
 public function send($number, $message, $sender = null, $reference = null, $callbackParams = null, $callback = null)
 {
     Assertion::integerish($number);
     Assert\that($message)->notEmpty()->string();
     Assertion::nullOrString($sender);
     Assertion::nullOrStringOrInteger($reference);
     Assertion::nullOrAllInRangeOrAll($callbackParams, 1, 10);
     Assertion::nullOrUrl($callback);
     $result = $this->call(compact('number', 'message', 'sender', 'reference', 'callbackParams', 'callback'));
     return Receipt::create($result);
 }
Example #3
0
 /**
  * Creates a new Receipt from an array
  *
  * @param array $array
  *
  * @return self
  */
 public static function create(array $array)
 {
     Assertion::choicesIsset($array, ['price', 'charset', 'split', 'length']);
     return new self($array['price'], $array['charset'], $array['split'], $array['length']);
 }
Example #4
0
 /**
  * Creates a new Balance from an array
  *
  * @param array $array
  *
  * @return self
  */
 public static function create(array $array)
 {
     Assertion::choicesIsset($array, ['balance', 'currency', 'balance-currency', 'custom-services', 'monthlySpentBalance']);
     return new self($array['balance'], $array['currency'], $array['balance-currency'], $array['custom-services'], $array['monthlySpentBalance']);
 }