find() публичный Метод

public find ( integer $id ) : MessagePack\TypeTransformer\TypeTransformer | null
$id integer
Результат MessagePack\TypeTransformer\TypeTransformer | null
Пример #1
0
 public function testAddRemoveFind()
 {
     $id = 5;
     $transformer = $this->getTransformerMock($id);
     $this->coll->add($transformer);
     $this->assertSame($transformer, $this->coll->find($id));
     $this->coll->remove($id);
     $this->assertNull($this->coll->find($id));
 }
Пример #2
0
 private function unpackExt($length)
 {
     if (!isset($this->buffer[$this->offset + $length - 1])) {
         throw new InsufficientDataException($length, \strlen($this->buffer) - $this->offset);
     }
     $type = $this->unpackInt8();
     if ($this->transformers && ($transformer = $this->transformers->find($type))) {
         return $transformer->reverseTransform($this->unpack());
     }
     $data = \substr($this->buffer, $this->offset, $length);
     $this->offset += $length;
     return new Ext($type, $data);
 }