Yalesov\Cron\Service\Registry::getInstance PHP Method

getInstance() public static method

public static getInstance ( )
    public static function getInstance()
    {
        if (!self::$instance instanceof self) {
            self::$instance = new self();
        }
        return self::$instance;
    }

Usage Example

 public function testDestroy()
 {
     $instance1 = Registry::getInstance();
     Registry::destroy();
     $instance2 = Registry::getInstance();
     $this->assertNotSame($instance1, $instance2);
 }