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