Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8506927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:43:34+00:00 2026-06-11T02:43:34+00:00

In phpDoc-generated documentation I can cause phpDoc to generate a link to a custom

  • 0

In phpDoc-generated documentation I can cause phpDoc to generate a link to a custom type definition for a given param using

@param CustomType $variablename

and that works great. However, the code I’m currently documenting requires CustomType[] parameters, i.e. an array of said CustomType. I want the documentation to be clear that an array is required, but when I use

@param CustomType[] $variablename

phpDoc no longer recognizes the type, and thus can’t link to it’s definition. This is pretty important in this case – I’m documenting an API that has some fairly complex types that need to be provided.

I’ve tried several different syntaxes for this and all either treat the entries as separate variable types or break type recognition in the documentation.

Barring this I’ll just note it in the parameter note, but it seems more clear to show the array-ness of the parameter in the type.

EDIT

With phpDocumentor 2 (which merged with DocBlox) the

@param CustomType[] $paramName

syntax works, and as noted in @Styx’s answer PhpStorm supports type-hinting with that syntax.

Accepted answer updated appropriately.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T02:43:36+00:00Added an answer on June 11, 2026 at 2:43 am

    New version of PHP doc support /** @var sometype[] */ syntax. Even more complicated: /** @var (sometype|othertype)[] */. http://www.phpdoc.org/docs/latest/guides/types.html#arrays
    PHPStorm also support this syntax.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can you solve the following error messages given by PHPdoc? I run madedoc.sh
How can I mark up constants using PHPDoc? What @-tag should I use? I've
Using Netbeans Generate PHPDoc, I'm able to generate the structure.xml for my project, but
I tried using PHPDoc for the first time today and quickly ran into a
in windows (using apache as server), my file path directory will be C:\xampp\htdocs\mysvn\PhpDocumentor\phpdoc.php. But
I am using PHPDoc and JSDoc for my source code. I know that there
Is there a way to insert PHPDoc in VIM using a command or key
I wonder how I can make PHPDoc-comments visible in Eclipse on a project-wide basis.
I have multiple inheritance like this one: Can I extend a class using more
When using phpdoc on a function I have an argument that always contains an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.