Completed
Pull Request — master (#150)
by Sergey
03:09
created

PinterestBot::getHttpClient()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
3
namespace seregazhuk\PinterestBot\Factories;
4
5
use seregazhuk\PinterestBot\Bot;
6
use seregazhuk\PinterestBot\Api\Request;
7
use seregazhuk\PinterestBot\Api\CurlHttpClient;
8
use seregazhuk\PinterestBot\Api\ProvidersContainer;
9
10
class PinterestBot
11
{
12
    /**
13
     * Initializes Bot instance and all its dependencies.
14
     *
15
     * @return Bot
16
     */
17
    public static function create()
18
    {
19
        $request = new Request(new CurlHttpClient());
20
21
        $providersContainer = new ProvidersContainer($request);
22
23
        return new Bot($providersContainer);
24
    }
25
26
    private function __construct()
27
    {
28
    }
29
30
    private function __clone()
31
    {
32
    }
33
}
34