Code Duplication    Length = 10-10 lines in 3 locations

src/Client.php 3 locations

@@ 325-334 (lines=10) @@
322
     * @return Client
323
     * @throws \Akamai\Open\EdgeGrid\Authentication\Exception\ConfigException
324
     */
325
    public static function createInstance($section = 'default', $path = null, array $config = [])
326
    {
327
        $auth = \Akamai\Open\EdgeGrid\Authentication::createInstance($section, $path);
328
329
        if ($host = $auth->getHost()) {
330
            $config['base_uri'] = 'https://' .$host;
331
        }
332
333
        return new static($config, $auth);
334
    }
335
336
    public static function createFromEnv($section = 'default', array $config = [])
337
    {
@@ 336-345 (lines=10) @@
333
        return new static($config, $auth);
334
    }
335
336
    public static function createFromEnv($section = 'default', array $config = [])
337
    {
338
        $auth = \Akamai\Open\EdgeGrid\Authentication::createFromEnv($section);
339
340
        if ($host = $auth->getHost()) {
341
            $config['base_uri'] = 'https://' . $host;
342
        }
343
344
        return new static($config, $auth);
345
    }
346
347
    /**
348
     * Factory method to create a client using credentials from `.edgerc`
@@ 358-367 (lines=10) @@
355
     * @param array $config Options to pass to the constructor/guzzle
356
     * @return \Akamai\Open\EdgeGrid\Client
357
     */
358
    public static function createFromEdgeRcFile($section = 'default', $path = null, array $config = [])
359
    {
360
        $auth = \Akamai\Open\EdgeGrid\Authentication::createFromEdgeRcFile($section, $path);
361
362
        if ($host = $auth->getHost()) {
363
            $config['base_uri'] = 'https://' . $host;
364
        }
365
366
        return new static($config, $auth);
367
    }
368
369
    /**
370
     * Print HTTP requests/responses to STDOUT