This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 154142 - Multiple @return types in phpdoc causes issues with code assist
Summary: Multiple @return types in phpdoc causes issues with code assist
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-29 15:51 UTC by jhartikainen
Modified: 2009-02-19 22:52 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jhartikainen 2008-11-29 15:51:19 UTC
If you have a following phpdoc block in a class method, which is valid phpdoc syntax for multiple return types:

/**
 * @return SomeClass|null
 */

the code-assist feature will not work as expected. Instead of getting assist for SomeClass, it won't display anything 
at all. Modifying the above code to...

/**
 * @return SomeClass
 */

...however will give the correct assist.

Multiple return values are often used to indicate a method returning null on failure (for example in Zend Framework), 
and it is valid phpdoc syntax, so having support for it would be good.
Comment 1 Petr Pisl 2008-12-04 00:33:18 UTC
Radek, now it should be easy to fi. We talked about the merge types. 

Try this code:

<?php
class Pub {
    public $street;
    public $town;
}

/**
 * @return Pub|null
 */
function findPub() {
    return new Pub();
}

$pub = findPub();
$pub->
?>
Comment 2 Petr Pisl 2008-12-05 16:10:39 UTC
I have fix for this. 
Comment 3 Petr Pisl 2008-12-05 16:57:32 UTC
Fixed in the trunk. 
Comment 4 Quality Engineering 2008-12-07 05:26:47 UTC
Integrated into 'main-golden', will be available in build *200812070201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/4f32ffb55962
User: Petr Pisl <ppisl@netbeans.org>
Log: #154142 - Multiple @return types in phpdoc causes issues with code assist