Skip to content

Extending SoapClient erorrs issue #618

@ondraondra81

Description

@ondraondra81

I spend few hours when I try solve this issue but I was not successful.
Im try extend php base class SoapClient:
attempt 1.

class SoapClient extends \SoapClient
{
    
}

result: ...Service\Soap\SoapClient does not have a constructor and must be instantiated without any parameters.

attempt 2.

class SoapClient extends \SoapClient
{

    public function __construct($wsdl, array $options = null)
    {
        parent::__construct($wsdl, $options);
    }
}

result: _Call to an undefined static method SoapClient::_construct().

attempt 3. - desperate idea

class SoapClient extends \SoapClient
{

    /**
     * SoapClient constructor.
     *
     * @param mixed $wsdl
     * @param array|null $options
     */
    public function __construct($wsdl, array $options = null)
    {
        parent::SoapClient($wsdl, $options); // or $this->SoapClient(...)
    }
}

result: _..Service\Soap\SoapClient::_construct() does not call parent constructor from SoapClient.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions