當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Extension\ExtensionFieldMap類代碼示例

本文整理匯總了PHP中Protobuf\Extension\ExtensionFieldMap的典型用法代碼示例。如果您正苦於以下問題:PHP ExtensionFieldMap類的具體用法?PHP ExtensionFieldMap怎麽用?PHP ExtensionFieldMap使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ExtensionFieldMap類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testInvalidArgumentExceptionExtendee

 /**
  * @expectedException InvalidArgumentException
  * @expectedExceptionMessage Invalid extendee, ProtobufTest\Protos\Extension\Animal is expected but ProtobufTest\Protos\Extension\Cat given
  */
 public function testInvalidArgumentExceptionExtendee()
 {
     $animal = new Cat();
     $extensions = new ExtensionFieldMap(Animal::CLASS);
     $extension = new ExtensionField(Cat::CLASS, 'animal', 200, function () {
     }, function () {
     }, function () {
     });
     $extensions->put($extension, $animal);
 }
開發者ID:protobuf-php,項目名稱:protobuf,代碼行數:14,代碼來源:ExtensionFieldMapTest.php

示例2: serializedSize

 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->modified_timestamp_ms !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->modified_timestamp_ms);
     }
     if ($this->deleted_item !== null) {
         $innerSize = $this->deleted_item->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->inventory_item_data !== null) {
         $innerSize = $this->inventory_item_data->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:28,代碼來源:InventoryItem.php

示例3: serializedSize

 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->success !== null) {
         $size += 1;
         $size += 1;
     }
     if ($this->awarded_badges !== null) {
         foreach ($this->awarded_badges as $val) {
             $size += 1;
             $size += $calculator->computeVarintSize($val->value());
         }
     }
     if ($this->awarded_badge_levels !== null) {
         foreach ($this->awarded_badge_levels as $val) {
             $size += 1;
             $size += $calculator->computeVarintSize($val);
         }
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:28,代碼來源:CheckAwardedBadgesResponse.php

示例4: serializedSize

 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->encounter_id !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->spawn_point_id !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->spawn_point_id);
     }
     if ($this->player_latitude !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->player_longitude !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:28,代碼來源:EncounterMessage.php

示例5: serializedSize

 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->max_pokemon !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->max_pokemon);
     }
     if ($this->max_bag_items !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->max_bag_items);
     }
     if ($this->base_pokemon !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->base_pokemon);
     }
     if ($this->base_bag_items !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->base_bag_items);
     }
     if ($this->base_eggs !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->base_eggs);
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:32,代碼來源:InventorySettings.php

示例6: serializedSize

 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->result !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->result->value());
     }
     if ($this->items_awarded !== null) {
         foreach ($this->items_awarded as $val) {
             $innerSize = $val->serializedSize($context);
             $size += 1;
             $size += $innerSize;
             $size += $calculator->computeVarintSize($innerSize);
         }
     }
     if ($this->items_unlocked !== null) {
         foreach ($this->items_unlocked as $val) {
             $size += 1;
             $size += $calculator->computeVarintSize($val->value());
         }
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:30,代碼來源:LevelUpRewardsResponse.php

示例7: serializedSize

 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->result !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->result->value());
     }
     if ($this->currency_type !== null) {
         foreach ($this->currency_type as $val) {
             $size += 1;
             $size += $calculator->computeStringSize($val);
         }
     }
     if ($this->currency_awarded !== null) {
         foreach ($this->currency_awarded as $val) {
             $size += 1;
             $size += $calculator->computeVarintSize($val);
         }
     }
     if ($this->defenders_count !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->defenders_count);
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:32,代碼來源:CollectDailyDefenderBonusResponse.php

示例8: serializedSize

 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->pokemon_data !== null) {
         $innerSize = $this->pokemon_data->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->trainer_public_profile !== null) {
         $innerSize = $this->trainer_public_profile->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->training_pokemon !== null) {
         $innerSize = $this->training_pokemon->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:30,代碼來源:GymMembership.php

示例9: serializedSize

 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->disk_radius_m !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->cylinder_radius_m !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->cylinder_height_m !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->cylinder_ground_m !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->shoulder_mode_scale !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:32,代碼來源:CameraAttributes.php

示例10: serializedSize

 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->name !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->name);
     }
     if ($this->value !== null) {
         foreach ($this->value as $val) {
             $innerSize = $val->serializedSize($context);
             $size += 1;
             $size += $innerSize;
             $size += $calculator->computeVarintSize($innerSize);
         }
     }
     if ($this->options !== null) {
         $innerSize = $this->options->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
開發者ID:protobuf-php,項目名稱:google-protobuf-proto,代碼行數:30,代碼來源:EnumDescriptorProto.php

示例11: serializedSize

 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->equip_badge_cooldown_ms !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->equip_badge_cooldown_ms);
     }
     if ($this->catch_probability_bonus !== null) {
         foreach ($this->catch_probability_bonus as $val) {
             $size += 1;
             $size += 4;
         }
     }
     if ($this->flee_probability_bonus !== null) {
         foreach ($this->flee_probability_bonus as $val) {
             $size += 1;
             $size += 4;
         }
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:28,代碼來源:EquippedBadgeSettings.php

示例12: serializedSize

 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->pokeball_type !== null) {
         $innerSize = 0;
         foreach ($this->pokeball_type as $val) {
             $innerSize += $calculator->computeVarintSize($val->value());
         }
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->capture_probability !== null) {
         $innerSize = 0;
         foreach ($this->capture_probability as $val) {
             $innerSize += 4;
         }
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->reticle_difficulty_scale !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:34,代碼來源:CaptureProbability.php

示例13: serializedSize

 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->gym_state !== null) {
         $innerSize = $this->gym_state->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->name !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->name);
     }
     if ($this->urls !== null) {
         foreach ($this->urls as $val) {
             $size += 1;
             $size += $calculator->computeStringSize($val);
         }
     }
     if ($this->result !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->result->value());
     }
     if ($this->description !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->description);
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:36,代碼來源:GetGymDetailsResponse.php

示例14: serializedSize

 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->platform !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->platform->value());
     }
     if ($this->device_manufacturer !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->device_manufacturer);
     }
     if ($this->device_model !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->device_model);
     }
     if ($this->locale !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->locale);
     }
     if ($this->app_version !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->app_version);
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:32,代碼來源:DownloadRemoteConfigVersionMessage.php

示例15: serializedSize

 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->item_effect !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->item_effect->value());
     }
     if ($this->capture_multi !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->capture_multi_effect !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->item_effect_mod !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:28,代碼來源:PokeballAttributes.php


注:本文中的Protobuf\Extension\ExtensionFieldMap類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。