Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Improve docblock to pick up namespace in Parser as well as class, or at least add it to the docs. #51

Open
NoMan2000 opened this issue Mar 27, 2018 · 1 comment
Labels

Comments

@NoMan2000
Copy link

The docs do not contain any warnings about this problem, which makes it annoying to debug. The error occurs when using anything in a namespace. PHPs typical way of dealing with this is to add the (overused) use statement to the top with the namespace and the class.

However, Zend\Soap\AutoDiscover does not pick up that use statement and instead only uses the classname.

<?php

use myNameSpace\MyClass;

class Foo
{
    /**
     * @var MyClass
     */ 
    public $customer;
}

That fails. When Zend parses it, it will not parse the namespace, just the classname "MyClass", and then fail.

For it to work, it must be done like this:

<?php

class Foo
{
    /**
     * The backspace qualifier is only necessary if this is namespaced.
     * @var \myNameSpace\MyClass
     */ 
    public $customer;
}

A code fix is probably above and beyond, but some docs highlighting that problem would help.

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-soap; a new issue has been opened at laminas/laminas-soap#8.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants