Last active
August 9, 2020 16:34
-
-
Save msacar/d53363f112dae94e0da1ca634ea65a0d 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 | |
//Gsm.php ye ekliyoruz | |
/** | |
* Managar olan Gsm sınıfında, | |
* Erişilmeye çalışan static method yoksa; | |
* Gsm sınıfı kendini instance eder ve kendinden bu method çağr | |
* | |
* @param $method | |
* @param $args | |
* @return mixed | |
*/ | |
public static function __callStatic($method, $args) | |
{ | |
self::bootIfNotBooted(); | |
return self::$instance->$method(...$args); | |
} | |
/** | |
* Managar olan ve instance edilmiş Gsm sınıfında, | |
* Erişilmeye çalışan method yoksa; | |
* Driver alınır ve driver üzerinden method çalıştırılır | |
* | |
* @param $method | |
* @param $args | |
* @return mixed | |
*/ | |
public function __call($method, $args) | |
{ | |
return $this->_driver()->$method(...$args); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment