Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't touch the classmap if it's associative #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/Artisaninweb/SoapWrapper/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -214,7 +219,7 @@ public function getOptions()
$options = [
'trace' => $this->getTrace(),
'cache_wsdl' => $this->getCache(),
'classmap' => $this->getClassmap(),
'classmap' => $this->getClassMap(),
];

if ($this->certificate) {
Expand Down