| 1 | <?php |
||
| 10 | class ValueProxy |
||
| 11 | { |
||
| 12 | /** コールバック関数 */ |
||
| 13 | private $callback; |
||
| 14 | /** コンテキスト */ |
||
| 15 | private $context; |
||
| 16 | /** キャッシュするかどうか */ |
||
| 17 | private $cached; |
||
| 18 | /** コールバックの実行結果 */ |
||
| 19 | private $value; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * コンストラクタ |
||
| 23 | * @param callable $callback コールバック関数 |
||
| 24 | * @param array $context コンテキスト |
||
| 25 | * @param boolean $cached キャッシュするかどうか |
||
| 26 | * @return void |
||
|
|
|||
| 27 | */ |
||
| 28 | public function __construct($callback, $context = [], $cached = true) |
||
| 34 | |||
| 35 | /** |
||
| 36 | * 評価する |
||
| 37 | * @return mixed 実行結果 |
||
| 38 | */ |
||
| 39 | public function fetch() |
||
| 54 | } |
||
| 55 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.