私は次のようなクラスを持っています
class bank
{
public $accounts;
public function __construct()
{
$accounts = new Accounts();
}
public function fun1()
{
///some code
}
}
内部fun1()
では、使用時にオートコンプリート(PHPStormおよびEclipseで)機能を取得できません
$this->accounts->..any function
しかし、直接使用するとうまく動作します
$accounts->..auto complete works fine here
最初のケースで同じことを達成できますか?
更新:正しく指摘してくれた Berry Langerak に感謝します。
また、可能ですか?
class bank
{
public $accounts;
public function __construct()
{
$this->accounts = new Accounts();
}
public function fun1()
{
///Note changing the reference now
$this->accounts = new OldAccounts();
$this->accounts->..it still shows the functions of Accounts Class, can we override this setting in PHPStorm
}
}
動作をオーバーライドして、新しいクラスの機能を表示できますか。参照は次を指しています