Skip to content

Instantly share code, notes, and snippets.

@tadasuke
Created May 29, 2015 08:29
Show Gist options
  • Save tadasuke/ce06db114fa2d92041f4 to your computer and use it in GitHub Desktop.
Save tadasuke/ce06db114fa2d92041f4 to your computer and use it in GitHub Desktop.
Eclipse(PDO)でコード補完させるためのコメントの書き方 ref: http://qiita.com/tadasuke/items/da5551db88594d5e4284
class Hoge {
// 何かしらの処理
}
class Factory {
public static function getHogeInstance() {
return new Hoge();
}
}
$hoge = Factory::getHogeInstance();
class Factory {
/**
* Hogeオブジェクト取得
* @return Hoge
*/
public static function getHogeInstance() {
return new Hoge();
}
}
new $class()
class Factory {
/**
* Hogeオブジェクト取得
* @param string $class
* @return Ambigous
*/
public static function getInstance( $class ) {
return new $class();
}
}
/* @var $hoge Hoge */
$hoge = Factory::getInstance( Hoge::class );
/* @var $hoge Hoge */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment