Issues (5)

src/BaseClass.php (4 issues)

1
<?php
2
3
namespace shweshi\LaravelUnsplashWrapper;
4
5
use GuzzleHttp\Client;
6
7
class BaseClass
8
{
9
    /**
10
     * Base url of unsplash api.
11
     *
12
     * @var string
13
     */
14
    private $baseUrl = 'https://api.unsplash.com/';
15
16
    /**
17
     * Response from unsplash api.
18
     */
19
    private $response;
0 ignored issues
show
The private property $response is not used, and could be removed.
Loading history...
20
21
    /**
22
     * Calls unsplash api.
23
     *
24
     * @param string $url
25
     * @param array  $params
26
     *
27
     * @return mix
0 ignored issues
show
The type shweshi\LaravelUnsplashWrapper\mix was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
28
     */
29
    protected function call($url, $params)
30
    {
31
        $client = new Client([
32
            'base_uri' => $this->baseUrl,
33
        ]);
34
        $response = $client->request('GET', $url, [
35
            'headers' => [
36
                'Authorization'  => 'Client-ID '.config('unsplash.ApplicationID'),
0 ignored issues
show
The function config was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

36
                'Authorization'  => 'Client-ID './** @scrutinizer ignore-call */ config('unsplash.ApplicationID'),
Loading history...
37
            ],
38
            'form_params' => $params,
39
            'query'       => $params,
40
        ]);
41
42
        return $response->getBody();
0 ignored issues
show
Bug Best Practice introduced by
The expression return $response->getBody() returns the type Psr\Http\Message\StreamInterface which is incompatible with the documented return type shweshi\LaravelUnsplashWrapper\mix.
Loading history...
43
    }
44
}
45