/**
  * Returns single instance of the class
  *
  * @return \YITH_WCStripe
  * @since 1.0.0
  */
 public static function get_instance()
 {
     if (is_null(self::$instance)) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Example #2
0
 /**
  * Unique access to instance of YITH_WCStripe class
  *
  * @return \YITH_WCStripe|YITH_WCStripe_Premium
  * @since 1.0.0
  */
 function YITH_WCStripe()
 {
     // Load required classes and functions
     require_once YITH_WCSTRIPE_INC . 'class-yith-stripe.php';
     if (defined('YITH_WCSTRIPE_PREMIUM') && file_exists(YITH_WCSTRIPE_INC . 'class-yith-stripe-premium.php')) {
         require_once YITH_WCSTRIPE_INC . 'class-yith-stripe-premium.php';
         return YITH_WCStripe_Premium::get_instance();
     }
     return YITH_WCStripe::get_instance();
 }