0

I have this collection and would like to annotate the correct PHPDoc for this collection. Would it be Collection<string>?

Illuminate\Support\Collection^ {#525
  #items: array:3 [
    0 => "string_1"
    1 => "string_2"
    2 => "string_3"
  ]
  #escapeWhenCastingToString: false
}
2
  • 1
    You are correct, Collection<string> would be the correct annotation if you are using PHPstorm, you can also use string[], but prefer the first one as the IDE understands it too Commented May 31, 2023 at 13:33
  • 1
    @matiaslauriti Thank you for your comment with the answer! Thanks also for the alternative suggestion string[]. Top! Have a nice day! Commented Jun 1, 2023 at 7:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.