larastan / larastan

⚗️ Adds code analysis to Laravel improving developer productivity and code quality.
MIT License
5.54k stars 416 forks source link

SOAP-ERROR: Parsing WSDL #276

Closed Nizari closed 5 years ago

Nizari commented 5 years ago

Description

We get the following error

In SoapClient.php line 18:

  SOAP-ERROR: Parsing WSDL: Couldn't load from 'vendor/phpstan/phpstan/bin' : Document is empty  

This might have something to do with the fact that we use this as an facade

Laravel code where the issue was found

This is used as an facade class.

class SoapClient
{
    private $client;

    public function __construct(string $wsdlUrl)
    {
        $this->client = new \SoapClient($wsdlUrl);
    }
}
szepeviktor commented 5 years ago

See https://phpstan.org/r/c226c467-93b9-454f-b8e3-649ee22fd08b

You may not have all the necessary PHP extension. Run php -m

ondrejmirtes commented 5 years ago

I don’t think it’s this problem. The problem is the code is executed with an empty string.

On Thu, 20 Jun 2019 at 14:52, Viktor Szépe notifications@github.com wrote:

Closed #276 https://github.com/nunomaduro/larastan/issues/276.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nunomaduro/larastan/issues/276?email_source=notifications&email_token=AAAZTOEGD2K6WCZBNDAC4EDP3N4PBA5CNFSM4HZSKNLKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOSCW2Y4I#event-2427300977, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAZTOCDYD2AIZRPNSEYKXTP3N4PBANCNFSM4HZSKNLA .

--

Ondřej Mirtes

szepeviktor commented 5 years ago

Really

$ php -d extension=./soap.so -r 'new \SoapClient("");'
PHP Fatal error:  Uncaught SoapFault exception: 
[WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from '/home/viktor' : Document is empty

Sorry for the previous comment.

szepeviktor commented 5 years ago
$ php -d extension=./soap.so -r 'var_dump(new \SoapClient("http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl"));'
object(SoapClient)#1 (2) {
  ["_soap_version"]=>
  int(1)
  ["sdl"]=>
  resource(4) of type (SOAP SDL)
}