Completed
Push — master ( f77348...ad6f80 )
by Sergey
03:41
created

PinterestBot::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 1
nc 1
nop 0
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\Response;
8
use seregazhuk\PinterestBot\Api\CurlAdapter;
9
use seregazhuk\PinterestBot\Api\ProvidersContainer;
10
11
class PinterestBot
12
{
13
    /**
14
     * Initializes Bot instance and all
15
     * its dependencies
16
     *
17
     * @param string|null $userAgent
18
     *
19
     * @return Bot
20
     */
21
    public static function create($userAgent = null)
22
    {
23
        $request = new Request(new CurlAdapter(), $userAgent);
24
        $response = new Response();
25
        $providersContainer = new ProvidersContainer($request, $response);
26
27
        return new Bot($providersContainer);
28
    }
29
30
    private function __construct()
31
    {
32
    }
33
34
    private function __clone()
35
    {
36
    }
37
}