public function get(Number\Integer $field) { if (false == isset($this->_data[$field->toNative()])) { throw new Exceptions\InvalidRowException(); } return $this->_data[$field->toNative()]; }
/** * @param array $claims * @return Jwt */ public function encode($claims) { $builder = clone $this->builder; foreach ($claims as $claim => $value) { $builder->set($claim, $value); } $dateTime = $this->clock->getDateTime(); $time = $dateTime->getTimestamp(); $jwt = $builder->setIssuedAt($time)->setExpiration($time + $this->exp->toNative())->setNotBefore($time + $this->nbf->toNative())->sign($this->signer, $this->key)->getToken(); return $jwt; }
public function testToNative() { $integer = new Integer(5); $this->assertSame(5, $integer->toNative()); }