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

Wizard - Call to a member function setNamespaceName() on bool #258

Closed
DamienDub opened this issue Oct 23, 2019 · 1 comment · Fixed by #259
Closed

Wizard - Call to a member function setNamespaceName() on bool #258

DamienDub opened this issue Oct 23, 2019 · 1 comment · Fixed by #259
Labels
Milestone

Comments

@DamienDub
Copy link

Bug Report

OS: Windows 10
PHP version: 7.3.9
Zend code version: 3.4.0
soap-client version: 1.0.4

Summary

When using the wizard with this WSDL file, I get this exception:

PHP Fatal error:  Uncaught Error: Call to a member function setNamespaceName() on bool in C:\Users\d.dubernet\workspace\soap-client\src\Phpro\SoapClient\CodeGenerator\TypeGenerator.php:43
Stack trace:
#0 C:\Users\d.dubernet\workspace\soap-client\src\Phpro\SoapClient\Console\Command\GenerateTypesCommand.php(199): Phpro\SoapClient\CodeGenerator\TypeGenerator->generate(Object(Zend\Code\Generator\FileGenerator), Object(Phpro\SoapClient\CodeGenerator\Model\Type))
#1 C:\Users\d.dubernet\workspace\soap-client\src\Phpro\SoapClient\Console\Command\GenerateTypesCommand.php(130): Phpro\SoapClient\Console\Command\GenerateTypesCommand->generateType(Object(Zend\Code\Generator\FileGenerator), Object(Phpro\SoapClient\CodeGenerator\TypeGenerator), Object(Phpro\SoapClient\CodeGenerator\Model\Type), Object(SplFileInfo))
#2 C:\Users\d.dubernet\workspace\soap-client\src\Phpro\SoapClient\Console\Command\GenerateTypesCommand.php(88): Phpro\SoapClient\Console\Command\GenerateTypesCommand->handleType(Object(Phpro\SoapClient\CodeGenerator\TypeGenerator in C:\Users\d.dubernet\workspace\soap-client\src\Phpro\SoapClient\CodeGenerator\TypeGenerator.php on line 43

In ClientGenerator and TypeGenerator, if I replace this line:

$class = $file->getClass() ?? new ClassGenerator();

with this line:

$class = new ClassGenerator();

The generation seems to work fine. Did I miss something?

@janvernieuwe
Copy link
Collaborator

Hi @DamienDub ,

Thanks for reporting this, I'm able to reproduce it and working on a fix.
It appears a return type in the docblocks of zend-code is also incorrect.

Will fix this asap (today)

janvernieuwe added a commit to janvernieuwe/soap-client that referenced this issue Oct 25, 2019
@janvernieuwe janvernieuwe added this to the 1.0.5 milestone Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants