Completed
Push — master ( 301697...4f2aa4 )
by PROSPER
02:55
created

LobController::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use Illuminate\Http\Request;
6
7
use Lob\Lob;
8
use App\Http\Requests;
9
use App\Http\Controllers\Controller;
10
11
class LobController extends Controller
12
{
13
    /**
14
     * LOB API KEY
15
     * @var string
16
     */
17
    protected $apikey;
18
19
    /**
20
     * Instance of Lob
21
     * @var object
22
     */
23
    protected $lob;
24
25
    /**
26
     * Initialize Lob
27
     */
28
    public function __construct()
29
    {
30
        $this->apikey = env('LOB_API_KEY');
31
        $this->lob = new Lob($this->apikey);
32
    }
33
34
    /**
35
     * Get all delivery routes for this zip code
36
     * @param  string $zipcdode
0 ignored issues
show
Documentation introduced by
There is no parameter named $zipcdode. Did you maybe mean $zipcode?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
37
     * @return array
38
     */
39
    private function getRoutes($zipcode)
40
    {
41
        $results = $this->lob->routes()->all(['zip_codes' => $zipcode]);
42
43
        return $results[0]['routes'];
44
    }
45
46
    /**
47
     * Return all data to the Lob API dashboard
48
     * @return mixed
49
     */
50
    public function getPage()
51
    {
52
        $routes = $this->getRoutes('10007');
53
54
        return view('api.lob')->withRoutes($routes);
55
    }
56
}
57