Last active
August 9, 2020 12:33
-
-
Save msacar/e3f2ebfb98937d656a3ba5d2842b5759 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Managar; | |
class Gsm | |
{ | |
protected static $instance = null; | |
public $drivers = []; | |
/** | |
* $instance field'ımıza | |
* sınıf instance edilmemişse | |
* instancelayıp değişkene kaydeder, | |
* sınıf zaten instancelı ise | |
* $instance değişkenini döndürür. | |
* | |
* @return static | |
*/ | |
public static function bootIfNotBooted() | |
{ | |
if (!self::$instance) { | |
return self::$instance = (new static); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment