diff options
author | Paul Yang <TeBoring@users.noreply.github.com> | 2017-09-22 14:08:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-22 14:08:01 -0700 |
commit | ae55fd2cc52849004de21a7e26aed7bfe393eaed (patch) | |
tree | fd4abff8b105123876b58748606f40dca16582e0 /php/src/Google/Protobuf/Internal | |
parent | c20440222afe368b2ddb1f842d469fdbe10f5389 (diff) | |
download | protobuf-ae55fd2cc52849004de21a7e26aed7bfe393eaed.tar.gz protobuf-ae55fd2cc52849004de21a7e26aed7bfe393eaed.tar.bz2 protobuf-ae55fd2cc52849004de21a7e26aed7bfe393eaed.zip |
Enforce all error report for php tests. (#3670)
* Enforce all error report for php tests.
* Import vendor/autoload.php in tests/bootstrap_phpunit.php
Diffstat (limited to 'php/src/Google/Protobuf/Internal')
-rw-r--r-- | php/src/Google/Protobuf/Internal/DescriptorPool.php | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/php/src/Google/Protobuf/Internal/DescriptorPool.php b/php/src/Google/Protobuf/Internal/DescriptorPool.php index 65d1a884..304c1615 100644 --- a/php/src/Google/Protobuf/Internal/DescriptorPool.php +++ b/php/src/Google/Protobuf/Internal/DescriptorPool.php @@ -109,18 +109,30 @@ class DescriptorPool public function getDescriptorByClassName($klass) { - return $this->class_to_desc[$klass]; + if (isset($this->class_to_desc[$klass])) { + return $this->class_to_desc[$klass]; + } else { + return null; + } } public function getEnumDescriptorByClassName($klass) { - return $this->class_to_enum_desc[$klass]; + if (isset($this->class_to_enum_desc[$klass])) { + return $this->class_to_enum_desc[$klass]; + } else { + return null; + } } public function getDescriptorByProtoName($proto) { - $klass = $this->proto_to_class[$proto]; - return $this->class_to_desc[$klass]; + if (isset($this->proto_to_class[$proto])) { + $klass = $this->proto_to_class[$proto]; + return $this->class_to_desc[$klass]; + } else { + return null; + } } public function getEnumDescriptorByProtoName($proto) |