Пример #1
0
 /**
  * Constructs an instance of this class.
  *
  * @param Message             $message
  * @param IdentifierGenerator $generator
  */
 public function __construct(Message $message, IdentifierGenerator $generator)
 {
     $this->message = $message;
     if ($this->message->getQosLevel() > 0) {
         $this->identifier = $generator->generatePacketID();
     }
 }
Пример #2
0
 /**
  * Constructs an instance of this class.
  *
  * @param Subscription[]      $subscriptions
  * @param IdentifierGenerator $generator
  */
 public function __construct(array $subscriptions, IdentifierGenerator $generator)
 {
     $this->subscriptions = array_values($subscriptions);
     $this->identifier = $generator->generatePacketID();
 }