Completed
Push — master ( 39c5ff...9d175d )
by Alex
07:50
created

GetMethods   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A companyLookup() 0 6 1
A stockQuote() 0 6 1
A interactiveChart() 0 10 1
1
<?php
2
3
namespace App\InteractionMethodsMOD;
4
5
use GuzzleHttp\Client;
6
7
class GetMethods
8
{
9
10
    public function companyLookup(Client $client, $to_search)
11
    {
12
        $response = $client->get("http://dev.markitondemand.com/MODApis/Api/v2/Lookup?input=".$to_search);
13
14
        return $response;
15
    }
16
17
    public function stockQuote(Client $client, $company_symbol)
18
    {
19
        $response = $client->get("http://dev.markitondemand.com/MODApis/Api/v2/Quote?symbol=".$company_symbol);
20
21
        return $response;
22
    }
23
24
    public function interactiveChart (Client $client, $company_symbol)
25
    {
26
        $request_params="%7B%22Normalized%22%3Afalse%2C%22NumberOfDays%22%3A730%2C%22DataPeriod%22%3A%22Month%22%2C%22Elements%22%3A%5B%7B%22Symbol%22%3A%22".$company_symbol."%22%2C%22Type%22%3A%22price%22%2C%22Params%22%3A%5B%22c%22%5D%7D%5D%7D";
27
28
        $response = $client->get("http://dev.markitondemand.com/MODApis/Api/v2/InteractiveChart/json?parameters=".$request_params);
29
30
        $response =json_decode($response->getBody());
31
32
        return $response;
33
    }
34
35
}