I have a class like
class bank
{
public $accounts;
public function __construct()
{
$accounts = new Accounts();
}
public function fun1()
{
///some code
}
}
Inside fun1()
, I dont get the auto complete(in PHPStorm and Eclipse) feature when using
$this->accounts->..any function
But it works fine when, directly using
$accounts->..auto complete works fine here
Can we achieve the same in the first case?
UPDATE: Thanks to Berry Langerak for rightly pointing it out.
Also, is it possible to
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
}
}
Can we override the behavior and show the functions of the new class, the reference is pointing to