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

PinterestBot   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 0
cbo 5
dl 0
loc 27
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 8 1
A __construct() 0 3 1
A __clone() 0 3 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\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
}