src/AJT/Toggl/TogglClient.php
public static function factory($config = [])
    {

        $clientConfig = self::getClientConfig($config);

        $guzzleClient = new Client($clientConfig);

        if (isset($config['apiVersion']) && $config['apiVersion'] !== 'v8') {
            throw new \Exception('Only v8 is supported at this time');

        }

        $description = self::getAPIDescriptionByJsonFile('services_v8.json');
        $client = new GuzzleClient($guzzleClient, $description);

        return $client;
    }
public static function factory($config = [])
    {

        $clientConfig = self::getClientConfig($config);

        $guzzleClient = new Client($clientConfig);

        if (isset($config['apiVersion']) && $config['apiVersion'] !== 'v8') {
            throw new \Exception('Only v8 is supported at this time');

        }

        $description = self::getAPIDescriptionByJsonFile('services_v8.json');
        $client = new GuzzleClient($guzzleClient, $description);

        return $client;
    }
public static function factory ( $ config = [ ] ) { $ clientConfig = self :: getClientConfig ( $ config ) ; $ guzzleClient = new Client ( $ clientConfig ) ; if ( isset ( $ config [ 'apiVersion' ] ) && $ config [ 'apiVersion' ] !== 'v8' ) { throw new \ Exception ( 'Only v8 is supported at this time' ) ; } $ description = self :: getAPIDescriptionByJsonFile ( 'services_v8.json' ) ; $ client = new GuzzleClient ( $ guzzleClient , $ description ) ; return $ client ; }
Factory method to create a new TogglClient

The following array keys and values are available options:
- username: username or API key
- password: password (if empty, then username is a API key)

See https://www.toggl.com/public/api#api_token for more information on the api token

@param array $config Configuration data
@return TogglClient
@throws \Exception
Factory method to create a new TogglClient