Skip to content

Inline @var syntax #73

@kokx

Description

@kokx

Implement inline @var syntax.

Sometimes, you know for a fact that some function returns a certain type. However, type hinting won't work because the function is too generic for that. For example, with the ZF2 ServiceManager:

<?php
use My\Job;

$job = $sm->get(Job::class);
/* @var $job Job */

$job->...

In this case, it would be great to have autocompletion for $job as well. However, padawan.php just marks it as a generic object.

This syntax has been implemented by many IDE's, for example NetBeans.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions