From d77f33c9d359fe48f928a1846b4813fd9c6c8180 Mon Sep 17 00:00:00 2001 From: Steve Guns Date: Fri, 22 Jun 2018 10:11:28 +0200 Subject: [PATCH] Don't touch the classmap if it's associative --- src/Artisaninweb/SoapWrapper/Service.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Artisaninweb/SoapWrapper/Service.php b/src/Artisaninweb/SoapWrapper/Service.php index 33fa959..b7d1fd1 100644 --- a/src/Artisaninweb/SoapWrapper/Service.php +++ b/src/Artisaninweb/SoapWrapper/Service.php @@ -173,12 +173,17 @@ public function classMap(array $classmap) * * @return array */ - public function getClassmap() + public function getClassMap() { $classmap = $this->classmap; $classes = [] ; if (!empty($classmap)) { + if (array_keys($classmap) !== range(0, \count($classmap))) { + // If this is an associative array, don't touch it + return $classmap; + } + foreach ($classmap as $class) { // Can't use end because of strict mode :( $name = current(array_slice(explode('\\', $class), -1, 1, true)); @@ -214,7 +219,7 @@ public function getOptions() $options = [ 'trace' => $this->getTrace(), 'cache_wsdl' => $this->getCache(), - 'classmap' => $this->getClassmap(), + 'classmap' => $this->getClassMap(), ]; if ($this->certificate) {