I have this code, which works fine
use path\to\class\exampleClass;
class foo {
public function preparePortalService() {
$this->portalService = new exampleClass(array(), $this->getWsdl('portal'));
$portalservice_header = new \SoapHeader($this->getWsdl('portal'), 'SessionHeader', $header);
// Set the Session Header.
$this->portalService->__setSoapHeaders($portalservice_header);
}
}
in another file (which is being autoloaded successfully
namespace path\to\class\exampleClass;
class exampleClass extends \SoapClient {
public function __construct(array $options = array(), $wsdl = 'wsdl/Interface.xml')
{}
}
However, I get a 'Field portalService not found in class foo' warning in PhpStorm (Note: not in the error logs, the code works fine).
Why is this, and how can I get it to recognise the object properties and methods?
EDIT: expanded, sorry for the formatting.
To clarify, the class methods and properties autocompletes are accessible through $portalService
in PhpStorm if I do this:
$portalService = new exampleClass(array(), $this->getWsdl('portal'));
But if I do this,
$this->portalService = $portalService;
then PhpStorm tells me it can't find it when I try this
$this->portalService->__setSoapHeaders($portalservice_header);