decode() public method

Decode an integer.
public decode ( integer $value ) : integer
$value integer
return integer
コード例 #1
0
ファイル: Rockid.php プロジェクト: alihann/laravel-rockid
 /**
  * Decode the given integer.
  *
  * @param int $value
  *
  * @return int
  */
 public function decode($value)
 {
     return $this->obfuscator->decode($value);
 }
コード例 #2
0
 /**
  * @param int $orderId
  *
  * @throws \Illuminate\Database\Eloquent\ModelNotFoundException
  *
  * @return string
  */
 public function viewAction(int $orderId)
 {
     /** @var Order $order */
     $order = $this->orderResource->with(['orderItems.basketItem.productOption.product', 'address'])->findOrFail($this->optimus->decode($orderId));
     return $this->webUi->view('customer.orders.view', compact('order'));
 }
コード例 #3
0
 /**
  * Update the specified resource in storage.
  *
  * @param Optimus $optimus
  * @param $number
  * @param $notificationId
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function update(Optimus $optimus, $number, $notificationId)
 {
     $notificationId = $optimus->decode($notificationId);
     Notification::findOrFail($notificationId)->update(['received' => 1]);
     return $this->respondNoContent();
 }
コード例 #4
0
 public function testDecodeBadStrings()
 {
     $this->setExpectedException('InvalidArgumentException');
     $optimus = new Optimus(1580030173, 59260789);
     $optimus->decode("foo");
 }