Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array containing multiple types and array typehint #419

Closed
alurin opened this issue Apr 3, 2012 · 4 comments · Fixed by #486
Closed

Array containing multiple types and array typehint #419

alurin opened this issue Apr 3, 2012 · 4 comments · Fixed by #486
Labels
Milestone

Comments

@alurin
Copy link

alurin commented Apr 3, 2012

In phpDoc 2.0.0a2 use this annotations created error:

/**
 * @param (Object|array)[] $actions Aray of Object or nested arrays
 */
public function addActions(array $actions);

Message:

The type hint of the argument is incorrect for the type definition of the @param tag with argument $actions in addActions()

Excepted result is absence of error messages, as (Object|array)[] is array, only containing multiple types!

@trq
Copy link
Contributor

trq commented Apr 12, 2012

This isn't a bug. Your function clearly accepts only an array.

@mvriel
Copy link
Member

mvriel commented Apr 12, 2012

Actually it is a bug; this is a good example of a more complex type where the type denotes an array containing arrays or classes of type Object (though I assume object is intended here).

@mvriel
Copy link
Member

mvriel commented Jun 6, 2012

Thanks to @joncave this issue is fixed on the develop branch, will be released soon

@mvriel mvriel closed this as completed Jun 6, 2012
@alurin
Copy link
Author

alurin commented Jun 26, 2012

Thanks!

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

Successfully merging a pull request may close this issue.

3 participants