WsdlToPhp / PackageGenerator

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

Use statement for InvalidArgumentException is missing when needed in ServiceType class #265

Closed mikaelcom closed 2 years ago

mikaelcom commented 2 years ago

Describe the bug When a ServiceType class has a setSoapHeader method containng the usage of an argument that is part of a restriction, an InvalidArgumentException exception can be thrown but the use statement is missing which would lead to an error if the exception had to be thrown.

        // validation for constraint: enumeration
        if (!\Ews\EnumType\DateTimePrecisionType::valueIsValid($dateTimePrecision)) {
            throw new InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \Ews\EnumType\DateTimePrecisionType', is_array($dateTimePrecision) ? implode(', ', $dateTimePrecision) : var_export($dateTimePrecision, true), implode(', ', \Ews\EnumType\DateTimePrecisionType::getValidValues())), __LINE__);
        }

To Reproduce Generate the package for the Ews365 Soap WS

Expected behavior The use InvalidArgumentEsception must be present at the beginning of the class.