-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
wontfixThis will not be worked onThis will not be worked on
Description
responsive-iframe-googlemap/responsive-iframe-googlemap.php
Lines 48 to 58 in 84b4419
| /** | |
| * Return a list of constants. | |
| * | |
| * @return array Constant list | |
| * @throws ReflectionException | |
| */ | |
| static function getConstants() { | |
| $oClass = new ReflectionClass( __CLASS__ ); | |
| return $oClass->getConstants(); | |
| } |
プロダクトのコードでリフレクションは使用しないほうが良いかと。
理由として、
- 普通に配列を作る場合と比べて、 15倍 以上遅くなる
@throwsにあるとおり、例外が発生する可能性を無駄に増やす- 71〜77、86〜92行目でこんだけ列挙してるなら115行目で同じように全て列挙しても変わらんよね
※私の経験上、リフレクションは基本的にデバッグやテスト用と割り切ったほうが良いかと思います。
Metadata
Metadata
Assignees
Labels
wontfixThis will not be worked onThis will not be worked on