From ae55fd2cc52849004de21a7e26aed7bfe393eaed Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Fri, 22 Sep 2017 14:08:01 -0700 Subject: Enforce all error report for php tests. (#3670) * Enforce all error report for php tests. * Import vendor/autoload.php in tests/bootstrap_phpunit.php --- php/src/Google/Protobuf/Internal/DescriptorPool.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'php/src/Google/Protobuf/Internal/DescriptorPool.php') 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) -- cgit v1.2.3