Returns an instance of sdk.

@return mixed
Returns a new Facebook instance or FALSE if the config was incorrect.

@throws \Drupal\social_api\SocialApiException
966850
public function initSdk() {
    $class_name = '\Facebook\Facebook';

    if (!class_exists($class_name)) {
      throw new SocialApiException(sprintf('The PHP SDK for Facebook could not be found. Class: %s.', $class_name));
    }

    if (!$this->validateConfig($this->settings)) {
      return FALSE;
    }

    $settings = [
      'app_id' => $this->settings->getAppId(),
      'app_secret' => $this->settings->getAppSecret(),
      'default_graph_version' => 'v' . $this->settings->getGraphVersion(),
      'persistent_data_handler' => $this->getDataHandler(),
    ];

    return new $class_name($settings);
  }
28795
public function build(): GetFrameOwnerRequest
	{
		$instance = new GetFrameOwnerRequest();
		if ($this->frameId === null) {
			throw new BuilderException('Property [frameId] is required.');
		}
		$instance->frameId = $this->frameId;
		return $instance;
	}
1067111
public function build(): GetSnapshotRequest
	{
		$instance = new GetSnapshotRequest();
		if ($this->computedStyleWhitelist === null) {
			throw new BuilderException('Property [computedStyleWhitelist] is required.');
		}
		$instance->computedStyleWhitelist = $this->computedStyleWhitelist;
		$instance->includeEventListeners = $this->includeEventListeners;
		$instance->includePaintOrder = $this->includePaintOrder;
		$instance->includeUserAgentShadowTree = $this->includeUserAgentShadowTree;
		return $instance;
	}
894532
public function create() {
		$ssoClient = new \Flowpack\SingleSignOn\Client\Domain\Model\SsoClient();
		if ((string)$this->clientServiceBaseUri === '') {
			throw new Exception('Missing Flowpack.SingleSignOn.Client.client.serviceBaseUri setting', 1351075078);
		}
		$ssoClient->setServiceBaseUri($this->clientServiceBaseUri);
		if ((string)$this->clientPublicKeyFingerprint === '') {
			throw new Exception('Missing Flowpack.SingleSignOn.Client.client.publicKeyFingerprint setting', 1351075159);
		}
		$ssoClient->setPublicKeyFingerprint($this->clientPublicKeyFingerprint);
		return $ssoClient;
	}
1286238
public function getInstance()
    {
        if (!$this->parserInstance) {
            /**
             * Check if Twig_Autoloader class exists
             * otherwise include it.
             */
        
            if (!class_exists('\Twig_Autoloader')) {
                require_once $this->parserDirectory . '/Autoloader.php';
            }

            \Twig_Autoloader::register();
            $loader = new \Twig_Loader_Filesystem($this->getTemplateDirs());
            $this->parserInstance = new \Twig_Environment(
                $loader,
                $this->parserOptions
            );

            foreach ($this->parserExtensions as $ext) {
                $extension = is_object($ext) ? $ext : new $ext;
                $this->parserInstance->addExtension($extension);
            }
        }

        return $this->parserInstance;
    }
693495
public static function getInstance() {

		if( !isset( self::$instance ) ) {

			self::$instance	= new CommentProperties();

			self::$instance->init( CoreGlobal::CONFIG_COMMENT );
		}

		return self::$instance;
	}
676030
public static function newInstance()
    {
        $config = self::create();

        $config->username = 'null';
        $config->password = 'null';
        $config->credentials = ['null', 'null'];
        $config->bindtoInterface = 'null';
        $config->timeout = 5;

        return $config;
    }
45094
public static function getInstance()
    {
        static $_instance;

        if (!$_instance) {
            $_instance = new self(new AnConfig(array('service_container' => AnService::getInstance())));
            AnService::set('plg:contentfilter.chain', $_instance);
            AnService::get('com:plugins.helper')->import('contentfilter');
        }

        return $_instance;
    }
348425
public static function getAccessToken()
    {
        $config = ShopifySDK::$config;

        if(!isset($config['SharedSecret']) || !isset($config['ApiKey'])) {
            throw new SdkException("SharedSecret and ApiKey are required for getting access token. Please check SDK configuration!");
        }

        if(self::verifyShopifyRequest()) {
            $data = array(
                'client_id' => $config['ApiKey'],
                'client_secret' => $config['SharedSecret'],
                'code' => $_GET['code'],
            );

            $response = HttpRequestJson::post($config['AdminUrl'] . 'oauth/access_token', $data);

            return isset($response['access_token']) ? $response['access_token'] : null;
        } else {
            throw new SdkException("This request is not initiated from a valid shopify shop!");
        }
    }
1234041
protected function client()
    {
        $apiKey = $this->config('apiKey');
        if (!$apiKey) {
            return null;
        }

        $endpoint = $this->config('endpoint');
        $defaults = $this->config('defaults');
        if ($defaults === null) {
            $defaults = true;
        }
        $client = Client::make($apiKey, $endpoint, $defaults);

        return $client;
    }
862685
public static function instance() {
		if ( ! isset( self::$instance ) ) {
			self::$instance = new self;
			self::$instance->boot();
			self::$instance->setup_actions();
		}

		return self::$instance;
	}
28757
public static function getInstance()
    {
        if (null === self::$_instance) {
            self::$_instance = new self();
            self::$_instance->provider = Yii::$container->get('motion\i18n\LanguageProviderInterface');
        }

        return self::$_instance;
    }
311226
public function instance()
    {
        if ($this->crudApi->instance === null) {
            $fq = $this->getModel();
            $instance = new $fq();
            $this->crudApi->setInstance($instance);
        }

        return $this->crudApi->instance;
    }
1095419
public function getAwsSdk()
    {
        if (empty($this->_awssdk) || !$this->_awssdk instanceof Aws\Sdk) {
            $this->setAwsSdk();
        }
        return $this->_awssdk;
    }
514480
public static function getInstance(): Request
    {
        if (self::$instance === null) {
            $calledClass    = get_called_class(); //Autorize extends this class
            self::$instance = new $calledClass;
        }

        return self::$instance;
    }
5065
public static function getInstance() {

		if( !isset( self::$instance ) ) {

			self::$instance	= new CoreProperties();

			self::$instance->init( CoreGlobal::CONFIG_CORE );
		}

		return self::$instance;
	}
73303
public static function getInstance() {

		if( !isset( self::$instance ) ) {

			self::$instance	= new TwitterProperties();

			self::$instance->init( SnsConnectGlobal::CONFIG_SNS_TWITTER );
		}

		return self::$instance;
	}