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 — master ( 414922...a9bc98 )
by butschster
12:35
created

Messages::block()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace SleepingOwl\Admin\Widgets\Messages;
4
5
use AdminTemplate;
6
use SleepingOwl\Admin\Widgets\Widget;
7
8
abstract class Messages extends Widget
9
{
10
    /**
11
     * @var string
12
     */
13
    protected static $sessionName;
14
15
    /**
16
     * @var string
17
     */
18
    protected $messageView;
19
20
    /**
21
     * Get content as a string of HTML.
22
     *
23
     * @return string
24
     */
25
    public function toHtml()
26
    {
27
        return AdminTemplate::view($this->messageView, [
28
            'messages' => $this->getMessage(),
29
        ])->render();
30
    }
31
32
    /**
33
     * @return string|array
34
     */
35
    public function template()
36
    {
37
        return AdminTemplate::getViewPath('_layout.inner');
38
    }
39
40
    /**
41
     * @return string
42
     */
43
    public function block()
44
    {
45
        return 'content.top';
46
    }
47
48
    /**
49
     * @return string
50
     */
51
    public function getMessageView()
52
    {
53
        return $this->messageView;
54
    }
55
56
    /**
57
     * @param string $messageView
58
     */
59
    public function setMessageView($messageView)
60
    {
61
        $this->messageView = $messageView;
62
    }
63
64
    /**
65
     * @return mixed
66
     */
67
    protected function getMessage()
68
    {
69
        return session(static::$sessionName);
70
    }
71
72
    /**
73
     * @param string $text
74
     * @return mixed
75
     */
76
    public static function addMessage($text)
77
    {
78
        return session()->flash(static::$sessionName, $text);
79
    }
80
}
81