for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace AlecRabbit\Spinner\Core\Factory;
use AlecRabbit\Spinner\Core\Contract\Loop\Contract\ILoop;
use AlecRabbit\Spinner\Core\Contract\Loop\Contract\ILoopProbe;
use AlecRabbit\Spinner\Core\Factory\Contract\ILoopProbeFactory;
use AlecRabbit\Spinner\Core\Factory\Contract\ILoopFactory;
final class LoopFactory implements ILoopFactory
{
private static ?ILoop $loop = null;
public function __construct(
protected ILoopProbeFactory $loopProbeFactory,
) {
}
public function getLoop(): ILoop
if (self::$loop === null) {
self::$loop = $this->createLoop();
return self::$loop;
return self::loop
null
AlecRabbit\Spinner\Core\...act\Loop\Contract\ILoop
private function createLoop(): ILoop
return $this->getLoopProbe()->createLoop();
private function getLoopProbe(): ILoopProbe
return $this->loopProbeFactory->getProbe();