WsdlToPhp / PackageGenerator

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

Do not generate empty constructor #201

Closed mikaelcom closed 5 years ago

mikaelcom commented 5 years ago

It can heppen that a Struct inherits from another one, in addition, it then does not contain any property as it's the inherited class that contains the properties and so on:

class VehicleInventoryCost extends TableRequest
{
    /**
     * Constructor method for VehicleInventoryCost
     */
    public function __construct()
    {
    }
}
class TableRequest extends AbstractStructBase
{
    /**
     * The Dealer
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \StructType\DealerInfo
     */
    public $Dealer;
    /**
     * Constructor method for TableRequest
     * @uses TableRequest::setDealer()
     * @param \StructType\DealerInfo $dealer
     */
    public function __construct(\StructType\DealerInfo $dealer = null)
    {
        $this
            ->setDealer($dealer);
    }
}

It's annoying as it does not allow to instantiate the child class easily just by passing the constructor parameter as it needs to call the setter afterwards.