BaseService.php 408 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace App\Services;
  3. class BaseService
  4. {
  5. protected static $instance;
  6. protected function __construct()
  7. {
  8. }
  9. public static function getInstance()
  10. {
  11. if (static::$instance instanceof static) {
  12. return self::$instance;
  13. }
  14. static::$instance = new static();
  15. return self::$instance;
  16. }
  17. protected function __clone()
  18. {
  19. }
  20. }