Пример #1
0
 public function write(&$object, IProtocolFormatter $writer)
 {
     $referenceCache = $writer->getReferenceCache();
     $refId = $referenceCache->getId($object);
     if (is_string($object)) {
         $writer->writeStringReference($refId);
     } else {
         if (is_array($object)) {
             $writer->writeArrayReference($refId);
         } else {
             $writer->writeObjectReference($refId);
         }
     }
 }