From cdd7ad020e165fe680703b6d3319b908b682fb7a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 20 Oct 2023 17:12:29 +0300 Subject: jaeger-client -> opentelemetry --- .../Google/Protobuf/Internal/OneofDescriptor.php | 87 ++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/OneofDescriptor.php (limited to 'vendor/google/protobuf/src/Google/Protobuf/Internal/OneofDescriptor.php') diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofDescriptor.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofDescriptor.php new file mode 100644 index 000000000..432368571 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofDescriptor.php @@ -0,0 +1,87 @@ +public_desc = new \Google\Protobuf\OneofDescriptor($this); + } + + public function setName($name) + { + $this->name = $name; + } + + public function getName() + { + return $this->name; + } + + public function addField(FieldDescriptor $field) + { + $this->fields[] = $field; + } + + public function getFields() + { + return $this->fields; + } + + public function isSynthetic() + { + return !is_null($this->fields) && count($this->fields) === 1 + && $this->fields[0]->getProto3Optional(); + } + + public static function buildFromProto($oneof_proto, $desc, $index) + { + $oneof = new OneofDescriptor(); + $oneof->setName($oneof_proto->getName()); + foreach ($desc->getField() as $field) { + /** @var FieldDescriptor $field */ + if ($field->getOneofIndex() == $index) { + $oneof->addField($field); + $field->setContainingOneof($oneof); + } + } + return $oneof; + } +} -- cgit v1.2.3