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   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 54
rs 10
c 0
b 0
f 0
wmc 6

3 Methods

Rating   Name   Duplication   Size   Complexity  
A renderIfExists() 0 12 3
A renderIfExistsArray() 0 7 2
A renderArray() 0 3 1
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