| Total Complexity | 7 |
| Total Lines | 57 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class PinterestBot |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Initializes Bot instance and all its dependencies. |
||
| 15 | * |
||
| 16 | * @return ProvidersContainer |
||
| 17 | */ |
||
| 18 | public static function create() |
||
| 19 | { |
||
| 20 | $request = self::makeRequest(); |
||
| 21 | $response = self::makeResponse(); |
||
| 22 | |||
| 23 | return self::buildProvidersContainer($request, $response); |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @return Request |
||
| 28 | */ |
||
| 29 | protected static function makeRequest() |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @return Response |
||
| 38 | */ |
||
| 39 | protected static function makeResponse() |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @return CurlHttpClient |
||
| 46 | */ |
||
| 47 | protected static function buildHttpClient() |
||
| 48 | { |
||
| 49 | return new CurlHttpClient(new Cookies()); |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @param $request |
||
| 54 | * @param $response |
||
| 55 | * @return ProvidersContainer |
||
| 56 | */ |
||
| 57 | protected static function buildProvidersContainer(Request $request, Response $response) |
||
| 58 | { |
||
| 59 | return new ProvidersContainer($request, $response); |
||
| 60 | } |
||
| 61 | |||
| 62 | private function __construct() |
||
| 64 | } |
||
| 65 | |||
| 66 | private function __clone() |
||
| 67 | { |
||
| 70 |