I have two classes that depend on each other.
class ClassA extends SomeClass
{
public function __construct(ClassB $classB) {
$this->classB = $classB;
}
}
class ClassB extends SomeOtherClass
{
public function __construct(ClassA $classA) {
$this->classA = $classA;
}
}
How can I avoid an endless loop as they're constructed?