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

Error while creating soap-client.php with wizard #204

Closed
KevinArtus opened this issue Nov 30, 2018 · 3 comments
Closed

Error while creating soap-client.php with wizard #204

KevinArtus opened this issue Nov 30, 2018 · 3 comments
Labels

Comments

@KevinArtus
Copy link

KevinArtus commented Nov 30, 2018

Q A
Version 0.7.8

Hi

I'm facing a problem when trying to trying to use the wizard.
I got this error :

PHP Parse error: syntax error, unexpected ']' in /home/CO_LINK/config/soap-client.php on line 24

It seems that the wizard is missing a ) here :

new Rules\AssembleRule(new Assembler\ConstructorAssembler(new Assembler\ConstructorAssemblerOptions())

could be

new Rules\AssembleRule(new Assembler\ConstructorAssembler(new Assembler\ConstructorAssemblerOptions()))

Here is the soap-config.php generated:

<?php

use Phpro\SoapClient\CodeGenerator\Assembler;
use Phpro\SoapClient\CodeGenerator\Rules;
use Phpro\SoapClient\CodeGenerator\Config\Config;

return Config::create()
    ->setWsdl('test.wsdl')
    ->setTypeDestination('src/Type')
    ->setTypeNamespace('App\Type')
    ->setClientDestination('src')
    ->setClientName('ProviderClient')
    ->setClientNamespace('App')
    ->setClassMapDestination('src')
    ->setClassMapName('ProviderClassmap')
    ->setClassMapNamespace('App')
    ->addRule(new Rules\AssembleRule(new Assembler\GetterAssembler(new Assembler\GetterAssemblerOptions())))
    ->addRule(new Rules\AssembleRule(new Assembler\ImmutableSetterAssembler()))
    ->addRule(
        new Rules\TypenameMatchesRule(
            new Rules\MultiRule([
                new Rules\AssembleRule(new Assembler\RequestAssembler()),
                new Rules\AssembleRule(new Assembler\ConstructorAssembler(new Assembler\ConstructorAssemblerOptions()),
            ]),
            '/(?<!Response)$/i'
        )
    )
    ->addRule(
        new Rules\TypenameMatchesRule(
            new Rules\MultiRule([
                new Rules\AssembleRule(new Assembler\ResultAssembler()),
            ]),
            '/Response$/i'
        )
    )
;

Thanks in advance

@janvernieuwe
Copy link
Collaborator

janvernieuwe commented Nov 30, 2018

I already see the issue, will push a fix and tag soon.

@janvernieuwe
Copy link
Collaborator

@KevinArtus a new version with this fix is released.
You can update when packagist fetches it, or use dev-master for now.

Thanks for the report!

@KevinArtus
Copy link
Author

Thanks for your replies. I'll test it asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants