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
Push — v6 ( e25ad0...199e76 )
by Andrey
04:32 queued 12s
created

Breadcrumbs::render()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 1
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace SleepingOwl\Admin\Templates;
4
5
use DaveJamesMiller\Breadcrumbs\BreadcrumbsManager;
6
use DaveJamesMiller\Breadcrumbs\Exceptions\ViewNotSetException;
7
use SleepingOwl\Admin\Contracts\Template\BreadcrumbsInterface as BreadcrumbsContract;
8
9
class Breadcrumbs extends BreadcrumbsManager implements BreadcrumbsContract
10
{
11
    /**
12
     * @param string|null $name
13
     *
14
     * @return string
15
     * @throws ViewNotSetException
16
     * @throws \DaveJamesMiller\Breadcrumbs\Exceptions\InvalidBreadcrumbException
17
     * @throws \DaveJamesMiller\Breadcrumbs\Exceptions\UnnamedRouteException
18
     */
19
    public function renderIfExists($name = null)
20
    {
21
        if (is_null($name)) {
22
            $params = $this->getCurrentRoute();
23
            $name = $params[0];
24
        }
25
26
        if (! $this->exists($name)) {
27
            return '';
28
        }
29
30
        return $this->render($name);
31
    }
32
33
    /**
34
     * @param string $name
35
     * @param array $params
36
     *
37
     * @return string
38
     * @throws ViewNotSetException
39
     * @throws \DaveJamesMiller\Breadcrumbs\Exceptions\InvalidBreadcrumbException
40
     * @throws \DaveJamesMiller\Breadcrumbs\Exceptions\UnnamedRouteException
41
     */
42
    public function renderArray($name, ...$params)
43
    {
44
        return $this->render($name, ...$params);
45
    }
46
47
    /**
48
     * @param string $name
49
     * @param array $params
50
     *
51
     * @return string
52
     * @throws ViewNotSetException
53
     * @throws \DaveJamesMiller\Breadcrumbs\Exceptions\InvalidBreadcrumbException
54
     * @throws \DaveJamesMiller\Breadcrumbs\Exceptions\UnnamedRouteException
55
     */
56
    public function renderIfExistsArray($name, $params = [])
57
    {
58
        if (! $this->exists($name)) {
59
            return '';
60
        }
61
62
        return $this->renderArray($name, $params);
63
    }
64
}
65