You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this particular instance method was called after Instantiating an object from child class. Child class extends parent class but error was still thrown.
Parent
abstract class Duhh
{
public function something(){
Definition of Function in parent
}
}
Child
class DuhhChild extends Duhh
{
}
Use of Method In Some Controller that throws PHP Stan Error - Call to an undefined method object::something();
use DuhhChild;
class SomeController extends random
{
$something = new DuhhChild;
$something->something()
}
inorder to work around this error simple define a docBlock that explains that variable as an Instance of Child Class above the variable that you are using to Instantiate the object. Example;
use DuhhChild;
class SomeController extends random
{
/** @var DuhhChild $something */
$something = new DuhhChild;
$something->something()
}
The text was updated successfully, but these errors were encountered:
In this particular instance method was called after Instantiating an object from child class. Child class extends parent class but error was still thrown.
Parent
abstract class Duhh
{
public function something(){
Definition of Function in parent
}
}
Child
class DuhhChild extends Duhh
{
}
Use of Method In Some Controller that throws PHP Stan Error - Call to an undefined method object::something();
use DuhhChild;
class SomeController extends random
{
$something = new DuhhChild;
$something->something()
}
inorder to work around this error simple define a docBlock that explains that variable as an Instance of Child Class above the variable that you are using to Instantiate the object. Example;
use DuhhChild;
class SomeController extends random
{
/** @var DuhhChild $something */
$something = new DuhhChild;
$something->something()
}
The text was updated successfully, but these errors were encountered: