WeatherApp::current()   A
last analyzed

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
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Shobi\Weatherapp;
4
5
use Shobi\Weatherapp\Http\Client;
6
use Shobi\Weatherapp\Endpoints\Current;
7
8
class WeatherApp 
9
{
10
    /**
11
     * @var Shobi\Weatherapp\Http\Client
0 ignored issues
show
Bug introduced by
The type Shobi\Weatherapp\Shobi\Weatherapp\Http\Client was not found. Did you mean Shobi\Weatherapp\Http\Client? If so, make sure to prefix the type with \.
Loading history...
12
     */
13
    private $client;
14
15
    /**
16
     * WeatherApp constructor.
17
     */
18
    public function __construct(Client $client)
19
    {
20
        $this->client = $client;
0 ignored issues
show
Documentation Bug introduced by
It seems like $client of type Shobi\Weatherapp\Http\Client is incompatible with the declared type Shobi\Weatherapp\Shobi\Weatherapp\Http\Client of property $client.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
21
    }
22
23
    /**
24
     * @param string $location
25
     * @return Weather\Weather
26
     * @throws GuzzleHttp\Exception\ClientException
27
     */
28
    public function current($location = 'london')
29
    {
30
        return (new Current($this->client))->get($location);
31
    }
32
}