Skip to content

Instantly share code, notes, and snippets.

@MartyIX
Created May 25, 2014 10:45
Show Gist options
  • Save MartyIX/a9dfe8bcccdef58da746 to your computer and use it in GitHub Desktop.
Save MartyIX/a9dfe8bcccdef58da746 to your computer and use it in GitHub Desktop.
return type hint
<?php
class A {
/**
* @return self
*/
public function someMethod() {
return $this;
}
}
class B extends A {
public function onlyInB() {
}
}
$b = new B();
$b->someMethod()->onlyInB(); // PhpStorm IDE does not know 'onlyInB' method. If I change "self" to "static" / "$this" it works just fine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment