ClientFactory::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 1 Features 1
Metric Value
c 2
b 1
f 1
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
cc 1
eloc 1
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * This file is part of the bee4/transport package.
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 *
7
 * @copyright Bee4 2015
8
 * @author  Stephane HULARD <[email protected]>
9
 * @package Bee4\Transport
10
 */
11
12
namespace Bee4\Transport;
13
14
/**
15
 * A client builder
16
 * @package Bee4\Transport
17
 */
18
class ClientFactory
19
{
20
    protected function __construct()
21
    {
22
        //Just a factory helper, can't be instantiated
23
    }
24
25
    /**
26
     * Create a new client instance
27
     * @param  string $url The root URL used by the client
28
     * @return ClientInterface The generated instance
29
     */
30
    public static function create($url = '')
31
    {
32
        $instance = new Client($url);
33
        return new MagicHandler($instance);
34
    }
35
}
36