Issues (5)

src/Utils/DependencyUrl.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Sfneal\Dependencies\Utils;
4
5
class DependencyUrl
6
{
7
    /**
8
     * @var Url
9
     */
10
    private Url $url;
11
12
    /**
13
     * @var Url|null
14
     */
15
    private ?Url $svg;
16
17
    /**
18
     * DependencySvg constructor.
19
     *
20
     * @param  Url  $url
21
     * @param  Url|null  $svg
22
     */
23
    public function __construct(Url $url, ?Url $svg = null)
24
    {
25
        $this->url = $url;
26
        $this->svg = $svg;
27
    }
28
29
    /**
30
     * Retrieve a dependency SVG image.
31
     *
32
     * @return string
33
     */
34
    public function svg(): string
35
    {
36
        return $this->svg->get();
0 ignored issues
show
The method get() does not exist on null. ( Ignorable by Annotation )

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

36
        return $this->svg->/** @scrutinizer ignore-call */ get();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
37
    }
38
39
    /**
40
     * Retrieve the Dependency URL.
41
     *
42
     * @return string
43
     */
44
    public function url(): string
45
    {
46
        return $this->url->get();
47
    }
48
}
49