phpdocのthrowsの簡単な使い方
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 | |
/** | |
* このメソッドは適当に作りました | |
* | |
* @param[in] $hoge | |
* @return 対応する配列 | |
* @throws Exception 対応するデータがない場合 | |
*/ | |
public function hoge($hoge = '') { | |
if(! isset($array[$hoge])) { | |
throw new Exception('データがありません。'); | |
} | |
return $array[$hoge]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment