WsdlToPhp / PackageGenerator

Generates a PHP SDK based on a WSDL, simple and powerful, WSDL to PHP
https://providr.io
MIT License
422 stars 73 forks source link

Suffixes for ServiceType classes #189

Closed 4n70w4 closed 5 years ago

4n70w4 commented 5 years ago

Hi. I generated code, but the service classes and the structure classes have the same names, it very unuseful.

$authenticate = new \Client\ServiceType\Authenticate($options);
/**
 * Sample call for Authenticate operation/method
 */
if ($authenticate->Authenticate(new \Client\StructType\Authenticate()) !== false) {
    print_r($authenticate->getResult());
} else {
    print_r($authenticate->getLastError());
}

it would be more convenient to give classes suffixes: \Client\ServiceType\Authenticate => \Client\ServiceType\AuthenticateService

It is necessary that there be no namespace name collisions. Cannot be imported like this:

use Client\ServiceType\Authenticate;
use Client\StructType\Authenticate;

Manually assign aliases - very lazy.

mikaelcom commented 5 years ago

You can suffix/prefix the generated classes if necessary, see the class naming options