1

I have a method generating an array of SomeObject[].

/**
 * @return SomeObject[]
 */
private function thatMethod()
{
    ...
    return [$someObject, $someOtherObject, $yetAnotherObject]
}

Yet when I read the object via list

list($someObject, $someOtherObject, $yetAnotherObject) = $this->thatMethod();

I lose typehint for those objects. I have to typehint them explicitly via @var SomeObject $someObject. I rather not do it this way.

Is there a way to get typehints working when using list in PhpStorm9?

1 Answer 1

2

PhpStorm cannot do such thing at the moment.

There is a the ticket to look after. Star/vote/comment to get notified on progress.

Sign up to request clarification or add additional context in comments.

1 Comment

Created by Dmitriy Zavalkin 24 Sep 2013 12:32

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.