[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-bugs
Subject:    [Bug 305780] New: Add a way to specify type for dynamic values
From:       Andrew Udvare <audvare () gmail ! com>
Date:       2012-08-25 20:22:41
Message-ID: bug-305780-40295 () http ! bugs ! kde ! org/
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=305780

            Bug ID: 305780
          Severity: wishlist
           Version: 4.3.1
          Priority: NOR
          Assignee: kdevelop-bugs@kdevelop.org
           Summary: Add a way to specify type for dynamic values
    Classification: Unclassified
                OS: Linux
          Reporter: audvare@gmail.com
          Hardware: Gentoo Packages
            Status: UNCONFIRMED
         Component: Language Support: PHP
           Product: kdevelop

If a function can return different return values, this is definitely not
guessable by the parser.

<?php
class A {}

/**
 * @return array|integer|A
function a() {
  return new A();
}

$a = a(); // unknown type
?>

Some IDEs have nice things like this:
<?php
// @var A
$a = a();
?>

and subsequently the methods get completed. I am in a project currently that
uses a lot of dynamic return values (the project makes heavy use of Symfony
services). Since we do not want to write @return \Full\Namespace\ClassName just
to get completion and rather want to write @return ClassName (which is part of
the use statement bug I filed).

But even so, because Symfony is done by configuration, again it remains
impossible to guess the type.

<?php
$a = $this->get('myservicename'); // unknown class to the parser, and 99% of
the time the class is also namespaced
?>

If this worked, it would be nice:
<?php
class Controller {
public function B() {
  // @var \FullNamespace\ClassName
  $a = $this->get('myservice');
}
}

So @var would refer strictly to the next upcoming variable. Any forms of
comment syntax would be allowed including /* */, /** */, and //.

Reproducible: Always

Steps to Reproduce:
n/a
Actual Results:  
n/a

-- 
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
KDevelop-bugs mailing list
KDevelop-bugs@kdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-bugs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic