GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#38)
by Choraimy
08:26
created

UrlShortenerManager   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 5
c 3
b 0
f 0
dl 0
loc 29
ccs 0
cts 7
cp 0
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A client() 0 3 1
A getDefaultDriver() 0 3 1
A createTinyUrlDriver() 0 4 1
1
<?php
2
3
namespace LaraCrafts\UrlShortener;
4
5
use GuzzleHttp\ClientInterface;
6
use Illuminate\Support\Manager;
7
use LaraCrafts\UrlShortener\Contracts\Factory;
8
use LaraCrafts\UrlShortener\Http\TinyUrl;
9
10
/**
11
 * @mixin \LaraCrafts\UrlShortener\Contracts\Client
12
 */
13
class UrlShortenerManager extends Manager implements Factory
14
{
15
    /**
16
     * {@inheritDoc}
17
     */
18
    public function client(string $name = null)
19
    {
20
        return $this->driver($name);
21
    }
22
23
    /**
24
     * Create a new TinyURL driver.
25
     *
26
     * @return \LaraCrafts\UrlShortener\UrlShortener
27
     * @throws \Illuminate\Contracts\Container\BindingResolutionException
28
     */
29
    protected function createTinyUrlDriver()
30
    {
31
        return new UrlShortener(
32
            new TinyUrl($this->app->make(ClientInterface::class))
0 ignored issues
show
Deprecated Code introduced by
The property Illuminate\Support\Manager::$app has been deprecated: Use the $container property instead. ( Ignorable by Annotation )

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

32
            new TinyUrl(/** @scrutinizer ignore-deprecated */ $this->app->make(ClientInterface::class))

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
33
        );
34
    }
35
36
    /**
37
     * {@inheritDoc}
38
     */
39
    public function getDefaultDriver()
40
    {
41
        return $this->app['config']['url-shortener.default'];
0 ignored issues
show
Deprecated Code introduced by
The property Illuminate\Support\Manager::$app has been deprecated: Use the $container property instead. ( Ignorable by Annotation )

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

41
        return /** @scrutinizer ignore-deprecated */ $this->app['config']['url-shortener.default'];

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
42
    }
43
}
44