Last active
September 10, 2015 18:09
-
-
Save shiwork/38a8b4ddd92d4f1a80cc to your computer and use it in GitHub Desktop.
IntelliJのphp pluginの挙動
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class A | |
{ | |
/** | |
* @return $this | |
*/ | |
public function foo() | |
{ | |
return $this; | |
} | |
} | |
class B extends A | |
{ | |
/** | |
* @return $this | |
*/ | |
public static function bar() | |
{ | |
return (new static()) | |
->foo() | |
->foo() // 'Method '[name]' not found in class' when create instance by static(). | |
->foo(); // this line is no suggest. | |
} | |
/** | |
* @return $this | |
*/ | |
public static function foobar() | |
{ | |
return (new self()) | |
->foo() | |
->foo() // create instance by self() | |
->foo(); | |
} | |
} | |
(new A) | |
->foo() | |
->foo() | |
->foo(); | |
(new B) | |
->foo() | |
->foo() | |
->foo(); | |
(new B) | |
->bar() | |
->foo() // no inspection when to write '@return $this' at phpdoc for B::bar() method. | |
->foo(); | |
(new B) | |
->foobar() | |
->foo() | |
->foo(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
関連ありそうなISSUE
https://youtrack.jetbrains.com/issue/WI-7619
https://youtrack.jetbrains.com/issue/WI-15582
https://youtrack.jetbrains.com/issue/WI-15903